Skip to content

Issue with references (related #646) #649

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

- Fix issue with completing `foo. x` where `x` should not be part of the completion https://github.com/rescript-lang/rescript-vscode/pull/644

- Fix issue with references to elements defined in an interface file https://github.com/rescript-lang/rescript-vscode/issues/645

- Fix issue where code analysis would not track types in inner modules across implementations and interfaces https://github.com/rescript-association/reanalyze/issues/186

- Fix issue with references to elements defined in an interface file https://github.com/rescript-lang/rescript-vscode/pull/646
Expand Down
8 changes: 5 additions & 3 deletions analysis/src/Commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ let references ~path ~pos ~debug =
| Some loc -> loc
| None -> Uri.toTopLevelLoc uri2
in
Protocol.stringifyLocation
{uri = Uri.toString uri2; range = Utils.cmtLocToRange loc}
:: acc)
if loc.loc_ghost then acc
else
Protocol.stringifyLocation
{uri = Uri.toString uri2; range = Utils.cmtLocToRange loc}
:: acc)
[])
in
print_endline
Expand Down
4 changes: 3 additions & 1 deletion analysis/tests/src/References.res
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ module M: {
let bb = M.aa
let cc = bb
let dd = M.aa
// ^ref
// ^ref

let _ = <ComponentInner/>
2 changes: 2 additions & 0 deletions analysis/tests/src/inner/ComponentInner.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@react.component
let make = () => React.null
2 changes: 2 additions & 0 deletions analysis/tests/src/inner/ComponentInner.resi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@react.component
let make: unit => React.element
2 changes: 2 additions & 0 deletions analysis/tests/src/inner/ReferencesInner.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@react.component
let make = () => <ComponentInner/>
2 changes: 2 additions & 0 deletions analysis/tests/src/inner/ReferencesInner.resi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@react.component
let make: unit => React.element