Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with references to elements defined in an interface file #646

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Dec 7, 2022

Fixes #645

References to elements defined in an interface file are not working. E.g.

module M: {
  let aa: int
} = {
  let aa = 10
}

let bb = M.aa
let cc = bb
let dd = M.aa
//          ^ref

The observed issue is that the locations of the references are fine, but the location of the definition in the module type is reported as being a ghost location (line -1).

This PR simply removes the ghost location from the results. Still need to look at why such ghost location is produced (go to definitions goes to the correct location in the module type).

For components, the JSX ppx produces 2 values called make shadowing one another, which triggers the compiler to generate a module constraint with a module type having only one make, and the same issue appears.

This also finds as reference the value defined in the interface.
@cristianoc cristianoc merged commit be24bf4 into master Dec 13, 2022
@cristianoc cristianoc deleted the refs_with_interfaces branch December 13, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All references are not being found for module component
1 participant