Skip to content

Missing Scala Precise Code Intelligence when Overriding Fields #413

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
wchau opened this issue Mar 4, 2022 · 3 comments · Fixed by #566
Closed

Missing Scala Precise Code Intelligence when Overriding Fields #413

wchau opened this issue Mar 4, 2022 · 3 comments · Fixed by #566
Assignees

Comments

@wchau
Copy link

wchau commented Mar 4, 2022

lsif-java version: 0.7.7

Type of code: Overriding Fields in Scala

Expected behavior: When clicking on "Find References" on the overridden fields, the abstract field / base field should show up in Precise Code Intelligence. Vice versa.

Actual behavior: It does not show up. Vice versa.

trait A {
  val b: Int
}

class B extends A {
  override val b = 10
}
@olafurpg
Copy link
Member

Thank you for reporting! I'm able to reproduce. I opened #471 that should fix this issue.

Please note that the latest version of scip-java emits SCIP by default instead of LSIF. I recommend using scip index-semanticdb --output=dump.lsif, which emits LSIF directly instead of SCIP because there are still a few features missing in the SCIP->LSIF conversion tool to cover custom navigation features we implemented for Scala specifically, see sourcegraph/scip#52

@olafurpg
Copy link
Member

@wchau I just released scip-java v0.8.2 that includes the fix for this issue. Please note the comment above about using the --output=dump.lsif option to emit LSIF directly.

@olafurpg
Copy link
Member

Reopening this is issue since "Find references" on the A.b field no longer shows usages of B.b with the SCIP format. It works correctly when doing "Find references" on B.b, it shows both usages of A.b and B.b.

The scip-java indexer emits correct SCIP data but the Sourcegraph backend does not include B.b usages for A.b even if B.b has an is_reference relationship with A.b.

This Sourcegraph backend issue is tracked here https://github.com/sourcegraph/sourcegraph/issues/50927 and I will close this issue once the upstream issue is fixed.

@olafurpg olafurpg reopened this Apr 21, 2023
olafurpg added a commit that referenced this issue Apr 27, 2023
Fixes #413. Previously, "find references" and "find implementations"
didn't work as expected with Sourcegraph 5.0 due to
https://github.com/sourcegraph/sourcegraph/issues/50927.

This PR is a workaround until that issue gets fixed so that users can
index with scip-java and get the best possible navigation experience.
olafurpg added a commit that referenced this issue Apr 27, 2023
Fixes #413. Previously, "find references" and "find implementations"
didn't work as expected with Sourcegraph 5.0 due to
https://github.com/sourcegraph/sourcegraph/issues/50927.

This PR is a workaround until that issue gets fixed so that users can
index with scip-java and get the best possible navigation experience.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants