sourcegraph / scip-java

SCIP Code Intelligence Protocol generator for Java
https://sourcegraph.github.io/scip-java/
Apache License 2.0
67 stars 28 forks source link

`scip-java index` doesn't work for Scala 3 projects in sbt #478

Open ckipp01 opened 2 years ago

ckipp01 commented 2 years ago

The problem

When running scip-java index on a pure Scala 3 project you won't get any semanticDB produced and therefore no scip file will be produced.

Steps to reproduce

  1. g8 scala/scala3.g8 and accept all the defaults
  2. run scip-java index on the project
  3. See the following output
❯ scip-java index
$ sbt sourcegraphEnable sourcegraphScip
[info] welcome to sbt 1.7.1 (Temurin Java 1.8.0_332)
[info] loading settings for project global-plugins from plugins.sbt ...
[info] loading global plugins from /Users/ckipp/.sbt/1.0/plugins
[info] loading settings for project scala-3-project-template-build from sourcegraph_generated.sbt ...
[info] loading project definition from /Users/ckipp/Documents/scratch-workspace/scala-3-project-template/project
[info] loading settings for project root from build.sbt ...
[info] set current project to Scala 3 Project Template (in build file:/Users/ckipp/Documents/scratch-workspace/scala-3-project-template/)
[info] set current project to Scala 3 Project Template (in build file:/Users/ckipp/Documents/scratch-workspace/scala-3-project-template/)
[info] compiling 1 Scala source to /Users/ckipp/Documents/scratch-workspace/scala-3-project-template/target/scala-3.1.3/classes ...
[info] done compiling
[info] compiling 1 Scala source to /Users/ckipp/Documents/scratch-workspace/scala-3-project-template/target/scala-3.1.3/test-classes ...
[info] done compiling
[error] (ThisBuild / sourcegraphTargetRoots) com.sourcegraph.sbtsourcegraph.SourcegraphPlugin$TaskException: Can't upload LSIF index to Sourcegraph because there are no SemanticDB directories. To fix this problem, run the `sourcegraphEnable` command before `sourcegraphCompile` like this: sbt sourcegraphEnable sourcegraphCompile
[error] Total time: 4 s, completed Aug 9, 2022 1:21:22 PM

Expectation

I'd expect this to work for Scala 3 projects giving me a index.scip file.

Notes

More than likely the fix will need to be in https://github.com/sourcegraph/sbt-sourcegraph since that's what's controlling everything, but since I experienced it using scip-java I'm creating here.

kubukoz commented 1 year ago

I'm getting a similar result in a Scala 2.13.10 project.