-
Notifications
You must be signed in to change notification settings - Fork 476
Open
Description
I have a module BeltMapX with utility functions for working with Belt.Map.t.
I tried to set up autocomplete for pipe completion in rescript.json like so:
"editor": {
"autocomplete": {
"Belt.Map.t": ["BeltMapX"],
}
}This didn't work so I did some debugging in analysis/src/CompletionBackEnd.ml, and it turned out that mainTypeId is actually Belt_Map.t.
rescript/analysis/src/CompletionBackEnd.ml
Lines 1068 to 1077 in 7b4bc42
| let mainTypeId = TypeUtils.findRootTypeId ~full ~env typ in | |
| let typePath = TypeUtils.pathFromTypeExpr typ in | |
| match mainTypeId with | |
| | None -> | |
| if Debug.verbose () then | |
| Printf.printf | |
| "[pipe_completion] Could not find mainTypeId. Aborting pipe \ | |
| completions.\n"; | |
| [] | |
| | Some mainTypeId -> |
Updating my rescript.json config to use the unaliased type, as below, worked.
"editor": {
"autocomplete": {
"Belt_Map.t": ["BeltMapX"],
}
}Would it be possible to make the completions backend handle type aliases so that "Belt.Map.t": ["BeltMapX"] works?
Metadata
Metadata
Assignees
Labels
No labels