rescript-lang / rescript-lang/rescript
Completions defined in `editor.autocomplete` don't work on type aliases
Nessuno ha ancora preso questa issue.
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 55
Descrizione
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.
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?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Start in analysis/src/CompletionBackEnd.ml at the handling referenced around lines 1068-1077, and compare the configured type name Belt.Map.t with the resolved Belt_Map.t. The work is done when autocomplete configured with the aliased type name produces completions for BeltMapX, while the existing unaliased configuration continues to work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ocaml
- Ambito
- compilers, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 58/100