rescript-lang / rescript-lang/rescript-vscode
LSP autocompletion not offering module type in the same file
Nobody has claimed this yet.
- Dominant language
- ReScript
- Stars
- 354
- Forks
- 63
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 1
Description
There is no autocompletion help by the LSP to help with annotating the module type with a module type being a submodule in the same file. (The LSP helps annotating the module type, when the module type from another file is used.)
module type MT = {
let x: int
}
module M: //<-- Cursor is here, but LSP will not suggest MT
This may not be the most common case, but could add some convenience.
Note: This behavior was first stated in https://github.com/rescript-lang/rescript-vscode/issues/902, but was added as a separate issue for transparency.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported completion gap with the ReScript snippet, placing the cursor after module M: while MT is defined in the same file. Compare this with completion for a module type imported from another file, then trace the LSP completion entry point that handles the two cases. Done means same-file module types are offered as completion suggestions without regressing cross-file suggestions.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100