rescript-lang / rescript-lang/rescript-vscode

Missing go to module definition in first class modules and functors

Open
#304 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

To reproduce with rescript 9.1.4:

module type Database = {
  let query: string => unit
}

module MakeHandler = (Db: Database) => { // Go to definition here fails, when it clearly compiles 
  let handle = (str1, str2) => {
    Db.query("select * from what")

    Js.log(str1)
    Js.log(str2)
  }
}

module Handler = MakeHandler({
  let query = str => Js.log(str)
})

let handler = (module(DB: Database)) => { // Also fails
  DB.query("asdfasdfads asd fadsf as")
}

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 failures with ReScript 9.1.4 using the first-class module and functor examples in the issue. Trace the go-to-definition handling for Db.query and DB.query; done means both references navigate to the corresponding Database.query definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.