rescript-lang / rescript-lang/rescript-vscode
Make the type hint more completely.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- ReScript
- Sterne
- 354
- Forks
- 63
- Ø Merge
- 11 Std. 29 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Currently, our editor only support a part of type hints for type, see the code below:
module Matrix2D = {
type t = {
row: int,
col: int,
data: Js.TypedArray2.Float32Array.t,
}
let make = (~row: int, ~col: int, ~data: Js.TypedArray2.Float32Array.t): t => {
assert false
}
let zeros = (~row: int, ~col: int): t => {
assert false
}
}
module Matrix2Ds = {
type t = Matrix2D.t
let divide = (m1: t, m2: t): t => {
assert false
}
}
let m = Matrix2D.zeros(~row=3, ~col=3)
I create two modules, Matrix2D and Matrix2Ds, and a value with type Matrix2D.t. When i typing 'm->', i get some type hints of this:
As the image shows, the type hint only contains the functions of module Matrix2D, while, the function divide in module Matrix2Ds can also accept parameter with type Matrix2D.t. It's definitily a much better UE if our editor could support more completely type hints with searching among all functions by the first parameter type, just like the oop function call in Moonbit lang. @bobzhang
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Keine Quelldatei, kein Test und kein Einstiegspunkt ist angegeben. Beginne damit, das Beispiel für Matrix2D und Matrix2Ds im Editor zu reproduzieren und nachzuverfolgen, wie Typhinweise für m-e gesammelt werden. Als erledigt gilt die Aufgabe, wenn Vorschläge auch Funktionen finden, deren erster Parameter den Typ des Werts hat, einschließlich Matrix2Ds.divide, mit Abdeckung für dieses Beispiel.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100