You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preferably, the type alias would be transparently converted to the type it points to. But I would also be fine with the compiler emitting a warning like Invalid editor.autocomplete value: Belt.Map.t is an alias for type Belt_Map.t and then having to manually update rescript.json with the correct value.
Maybe an alternative way of fixing this could be having the LSP provide type alias information. It would be nice if when I hover over e.g. a Belt.Map.t value in VS Code, in addition to seeing type Belt.Map.t<'key, 'value, 'identity>, I would see something like Alias for type Belt_Map.t and therefore know to use that instead.
This would be particularly helpful for something like Dom.element, where I had to follow the chain of type element = element_like = node_like = eventTarget_like to figure out the correct editor.autocomplete value.
Uh oh!
There was an error while loading. Please reload this page.
I have a module
BeltMapX
with utility functions for working withBelt.Map.t
.I tried to set up autocomplete for pipe completion in
rescript.json
like so:This didn't work so I did some debugging in
analysis/src/CompletionBackEnd.ml
, and it turned out thatmainTypeId
is actuallyBelt_Map.t
.rescript/analysis/src/CompletionBackEnd.ml
Lines 1068 to 1077 in 7b4bc42
Updating my
rescript.json
config to use the unaliased type, as below, worked.Would it be possible to make the completions backend handle type aliases so that
"Belt.Map.t": ["BeltMapX"]
works?The text was updated successfully, but these errors were encountered: