-
Notifications
You must be signed in to change notification settings - Fork 29
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
Case Class References Missing Instantiations #403
Comments
It is already a lot better than before, though, thanks! :) |
Thank you for reporting! I am able to reproduce and I opened a PR fixing this issue in #404 Please keep the bug reports coming, I appreciate your patience with all of the different releases. It's tricky to get this right for case classes since they generate so many different kinds of symbols (some which we want to include with "find ref" results while not others) |
Reopening this issue since "Find references" on the case class does not show usages of the synthetic companion object. Here's a minimized test case that reproduces the problem Line 16 in bf4ca0c
To fix this problem, we should add an |
The root cause of this issue is here where we intentionally return scip-java/scip-semanticdb/src/main/java/com/sourcegraph/scip_semanticdb/ScipSemanticdb.java Line 350 in bf4ca0c
I'm wondering if the fix is to remove the scip-java/scip-semanticdb/src/main/java/com/sourcegraph/scip_semanticdb/ScipSemanticdb.java Line 147 in bf4ca0c
|
Another possible fix, which I think might be a better solution, is to add an |
Concretely, the proposal is to update this line here in the snapshots to include Line 13 in 8964623
|
Fixed in #561 Link to reproduce https://sourcegraph.com/github.com/sourcegraph/scip-java/-/blob/tests/minimized-scala/src/main/scala/minimized/Issue403.scala?L3:12-3:20#tab=references Note that the empty line is refers to a zero-length range for a usage of the |
lsif-java
version:0.7.6
Type of code: case classes in Scala
Expected behavior: Case class "Find Reference" should contain instantiations.
Actual behavior: Case class "Find References" does not contain instantiations. You can find other instantiations if you "Find Reference" any one instantiation.
If the companion object is explicitly defined, you can find instantiations there by "Find Reference".
Note that "Go to Definition" from instantiations does go to the case class if the companion object does not exist (otherwise, it would go to the companion object), but the hover references the companion object(???). Ideally, all the synthetic functions should reference the case class (and vice versa) similar to IntelliJ's code reference.
The text was updated successfully, but these errors were encountered: