rescript-lang / rescript-lang/rescript-vscode

LSP autocompletion not offering module type in the same file

Open
#1,011 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.