scip-java icon indicating copy to clipboard operation
scip-java copied to clipboard

Partially precise result on a Scala codebase

Open kubukoz opened this issue 3 years ago • 2 comments

Hi! First of all, thanks for building great tools.

I'm trying out a private Sourcegraph instance. Ran an indexing round on a branch and now some of my definition searches look like this:

image

The definition of AccountId in question is in the same sbt module as the code I'm looking at. However, it still shows up as partially precise.

In the Definition view, all results I see are search-based:

image

Could this be a configuration issue (I'm on all the defaults when it comes to generating the index) or is something wrong with scip-java?

kubukoz avatar Aug 16 '22 11:08 kubukoz

Thank you for reporting! I'm able to reproduce. A workaround is to include the argument --output=dump.lsif in the command

scip-java index --output=dump.lsif

We haven't fully reached feature parity when using the new SCIP format when it comes to dealing with situations where multiple symbols are defined in the same file (which happens for case classes). It will be necessary to use --output=dump.lsif for Scala codebases for at least a few more weeks until I can get back to closing the gap between our LSIF and SCIP support.

olafurpg avatar Aug 17 '22 18:08 olafurpg

Thank you for reporting! I'm able to reproduce. A workaround is to include the argument --output=dump.lsif in the command

scip-java index --output=dump.lsif

We haven't fully reached feature parity when using the new SCIP format when it comes to dealing with situations where multiple symbols are defined in the same file (which happens for case classes). It will be necessary to use --output=dump.lsif for Scala codebases for at least a few more weeks until I can get back to closing the gap between our LSIF and SCIP support.

I was just looking at this, and from looking at the code, I don't believe this is supported via scip-java. It doesn't look like it passes the --output to the sbt plugin at all, and index.scip is hardcoded:

https://github.com/sourcegraph/scip-java/blob/5a49a8b4b6b1745abc670f22a07eafd99ab9efb5/scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/SbtBuildTool.scala#L44-L59

Same with the sbt plugin actually:

https://github.com/sourcegraph/sbt-sourcegraph/blob/860f088b2cd041665996f790c6469ac4e6ee8206/src/main/scala/com/sourcegraph/sbtsourcegraph/SourcegraphPlugin.scala#L118-L134

It looks like a workaround would be to use index-semanticdb --output=dump.lsif but that would require semanticDB to already be present.

ckipp01 avatar Aug 24 '22 17:08 ckipp01