rescript-lang / rescript-lang/rescript
Completions defined in `editor.autocomplete` don't work on type aliases
Personne n'a encore pris cette issue.
- Langage dominant
- OCaml
- Étoiles
- 7.5k
- Forks
- 485
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 55
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.
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?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- ocaml
- Domaine
- compilers, developer-experience
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 58/100