@@ -19,6 +19,10 @@ object SourcegraphPlugin extends AutoPlugin {
19
19
" Task to upload the LSIF index to Sourcegraph to enable precise code intelligence."
20
20
)
21
21
val sourcegraphLsif : TaskKey [File ] =
22
+ taskKey[File ](" Alias for the sourcegraphCompile command." )
23
+ val sourcegraphScip : TaskKey [File ] =
24
+ taskKey[File ](" Alias for the sourcegraphCompile command." )
25
+ val sourcegraphCompile : TaskKey [File ] =
22
26
taskKey[File ](
23
27
" Task to generate a single LSIF index for all SemanticDB files in this workspace."
24
28
)
@@ -30,8 +34,8 @@ object SourcegraphPlugin extends AutoPlugin {
30
34
taskKey[File ](
31
35
" Task to generate a single LSIF index for all SemanticDB files in this workspace."
32
36
)
33
- val sourcegraphLsifJavaVersion : SettingKey [String ] =
34
- settingKey[String ](" The version of the `lsif -java` command-line tool." )
37
+ val sourcegraphScipJavaVersion : SettingKey [String ] =
38
+ settingKey[String ](" The version of the `scip -java` command-line tool." )
35
39
val sourcegraphSemanticdbDirectories : TaskKey [List [File ]] =
36
40
taskKey[List [File ]](
37
41
" Task to compile all projects in this build and aggregate all SemanticDB directories."
@@ -79,9 +83,9 @@ object SourcegraphPlugin extends AutoPlugin {
79
83
import autoImport ._
80
84
81
85
override lazy val buildSettings : Seq [Def .Setting [_]] = List (
82
- sourcegraphLsifJavaVersion := {
86
+ sourcegraphScipJavaVersion := {
83
87
scala.util.Properties
84
- .propOrElse(" lsif -java-version" , Versions .semanticdbJavacVersion())
88
+ .propOrElse(" scip -java-version" , Versions .semanticdbJavacVersion())
85
89
},
86
90
sourcegraphTargetRoots := {
87
91
val directories =
@@ -93,7 +97,7 @@ object SourcegraphPlugin extends AutoPlugin {
93
97
if (directoryArguments.isEmpty) {
94
98
throw new TaskException (
95
99
" Can't upload LSIF index to Sourcegraph because there are no SemanticDB directories. " +
96
- " To fix this problem, run the `sourcegraphEnable` command before `sourcegraphLsif ` like this: sbt sourcegraphEnable sourcegraphLsif "
100
+ " To fix this problem, run the `sourcegraphEnable` command before `sourcegraphCompile ` like this: sbt sourcegraphEnable sourcegraphCompile "
97
101
)
98
102
}
99
103
directoryArguments
@@ -110,14 +114,17 @@ object SourcegraphPlugin extends AutoPlugin {
110
114
)
111
115
out
112
116
},
113
- sourcegraphLsif := {
114
- val out = target.in(Sourcegraph ).value / " dump.lsif"
117
+ sourcegraphLsif := sourcegraphCompile.value,
118
+ sourcegraphScip := sourcegraphCompile.value,
119
+ sourcegraphCompile := {
120
+ val out = target.in(Sourcegraph ).value / " index.scip"
115
121
out.getParentFile.mkdirs()
116
122
runProcess(
117
123
sourcegraphCoursierBinary.value ::
118
124
" launch" ::
119
- " --contrib" ::
120
- s " lsif-java: ${sourcegraphLsifJavaVersion.value}" ::
125
+ s " com.sourcegraph:scip-java_2.13: ${sourcegraphScipJavaVersion.value}" ::
126
+ " -M" ::
127
+ " com.sourcegraph.scip_java.ScipJava" ::
121
128
" --" ::
122
129
" index-semanticdb" ::
123
130
s " --output= $out" ::
@@ -134,11 +141,11 @@ object SourcegraphPlugin extends AutoPlugin {
134
141
" in https://github.com/sourcegraph/sbt-sourcegraph/blob/main/README.md"
135
142
)
136
143
}
137
- val in = sourcegraphLsif .value
144
+ val in = sourcegraphCompile .value
138
145
val uploadCommand = List [Option [String ]](
139
146
Some (sourcegraphSrcBinary.value),
140
147
sourcegraphEndpoint.value.map(url => s " --endpoint= $url" ),
141
- Some (" lsif " ),
148
+ Some (" code-intel " ),
142
149
Some (" upload" ),
143
150
Option (System .getenv(" GITHUB_TOKEN" ))
144
151
.map(token => s " --github-token= $token" ),
0 commit comments