Skip to content

Commit e8c58df

Browse files
authored
Merge pull request sbt#7100 from ckipp01/debugProvider
fix: ensure sbt server says it's a debugProvider
2 parents 4318386 + 4a6832f commit e8c58df

9 files changed

+113
-20
lines changed

main/src/main/scala/sbt/internal/server/BuildServerProtocol.scala

+9-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ object BuildServerProtocol {
5050
CompileProvider(BuildServerConnection.languages),
5151
TestProvider(BuildServerConnection.languages),
5252
RunProvider(BuildServerConnection.languages),
53+
DebugProvider(Vector.empty),
5354
dependencySourcesProvider = true,
5455
resourcesProvider = true,
5556
outputPathsProvider = true,
@@ -609,7 +610,8 @@ object BuildServerProtocol {
609610
config <- configs
610611
if dep != thisProjectRef || config.name != thisConfig.name
611612
} yield (dep / config / Keys.bspTargetIdentifier)
612-
val capabilities = BuildTargetCapabilities(canCompile = true, canTest = true, canRun = true)
613+
val capabilities =
614+
BuildTargetCapabilities(canCompile = true, canTest = true, canRun = true, canDebug = false)
613615
val tags = BuildTargetTag.fromConfig(configuration.name)
614616
Def.task {
615617
BuildTarget(
@@ -655,7 +657,12 @@ object BuildServerProtocol {
655657
toSbtTargetIdName(loadedUnit),
656658
projectStandard(loadedUnit.unit.localBase).toURI,
657659
Vector(),
658-
BuildTargetCapabilities(canCompile = false, canTest = false, canRun = false),
660+
BuildTargetCapabilities(
661+
canCompile = false,
662+
canTest = false,
663+
canRun = false,
664+
canDebug = false
665+
),
659666
BuildServerConnection.languages,
660667
Vector(),
661668
"sbt",

protocol/src/main/contraband-scala/sbt/internal/bsp/BuildServerCapabilities.scala

+14-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/BuildTargetCapabilities.scala

+12-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/DebugProvider.scala

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/codec/BuildServerCapabilitiesFormats.scala

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/codec/BuildTargetCapabilitiesFormats.scala

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/codec/DebugProviderFormats.scala

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband-scala/sbt/internal/bsp/codec/JsonProtocol.scala

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/main/contraband/bsp.contra

+11-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ type BuildTargetCapabilities {
6161

6262
## This target can be run by the BSP server.
6363
canRun: Boolean!
64+
65+
## This target can be debugged by the BSP server.
66+
canDebug: Boolean!
6467
}
6568

6669
type DebugSessionAddress {
@@ -190,6 +193,9 @@ type BuildServerCapabilities {
190193
# The languages the server supports run via method buildTarget/run
191194
runProvider: sbt.internal.bsp.RunProvider
192195

196+
# The languages the server supports debugging via method debugSession/start
197+
debugProvider: sbt.internal.bsp.DebugProvider
198+
193199
# The server can provide a list of targets that contain a
194200
# single text document via the method buildTarget/inverseSources
195201
# inverseSourcesProvider: Boolean
@@ -235,6 +241,10 @@ type RunProvider {
235241
languageIds: [String]
236242
}
237243

244+
type DebugProvider {
245+
languageIds: [String]
246+
}
247+
238248
## Publish Diagnostics
239249
type PublishDiagnosticsParams {
240250
## The document where the diagnostics are published.
@@ -759,4 +769,4 @@ type JvmRunEnvironmentParams {
759769
type JvmRunEnvironmentResult{
760770
items: [sbt.internal.bsp.JvmEnvironmentItem]!
761771
originId: String
762-
}
772+
}

0 commit comments

Comments
 (0)