Skip to content

Conversation

olafurpg
Copy link
Contributor

@olafurpg olafurpg commented Jul 19, 2022

Previously, scip-java only linked references for method symbols. This
commit changes the behavior to additionally include fields so that "find
references" for fields shows usages of all implementations of the field
(abstract super field and concrete implementations).

Test plan

See newly added snapshot test that reproduces the issue. However, the snapshot test does not render the new "reference" relationship between the sub-field and super-field (I manually verified the relationship is correct by running scip snapshot locally).

https://sourcegraph.com/github.com/sourcegraph/sbt-sourcegraph@9ad1fc3cd0cd111552f99db1d0d869ecdf82d26d/-/blob/example/i413.scala?L12:25#tab=references

CleanShot 2022-07-19 at 13 05 15

We should consider updating the snapshot format to mirror the new scip cli tool

Previously, scip-java only linked references for method symbols. This
commit changes the behavior to additionally include fields so that "find
references" for fields shows usages of all implementations of the field
(abstract super field and concrete implementations).
@olafurpg olafurpg changed the title Link references for fields, fixes #431 Link references for fields, fixes #413 Jul 19, 2022
Previously, we used the symbol itself, which was not reliable because it
didn't distinguish between fields an objects. This commit changes the
logic to be based on `SymbolInformation.kind` from SemanticDB, that is
a more robust and idiomatic solution. Fixes #414.
@olafurpg olafurpg merged commit 9a98c50 into main Jul 20, 2022
@olafurpg olafurpg deleted the issue-413 branch July 20, 2022 10:27
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.

2 participants