Skip to content

Commit

Permalink
Merge pull request sbt#7100 from ckipp01/debugProvider
Browse files Browse the repository at this point in the history
fix: ensure sbt server says it's a debugProvider
  • Loading branch information
adpi2 authored Dec 29, 2022
2 parents 4318386 + 4a6832f commit e8c58df
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ object BuildServerProtocol {
CompileProvider(BuildServerConnection.languages),
TestProvider(BuildServerConnection.languages),
RunProvider(BuildServerConnection.languages),
DebugProvider(Vector.empty),
dependencySourcesProvider = true,
resourcesProvider = true,
outputPathsProvider = true,
Expand Down Expand Up @@ -609,7 +610,8 @@ object BuildServerProtocol {
config <- configs
if dep != thisProjectRef || config.name != thisConfig.name
} yield (dep / config / Keys.bspTargetIdentifier)
val capabilities = BuildTargetCapabilities(canCompile = true, canTest = true, canRun = true)
val capabilities =
BuildTargetCapabilities(canCompile = true, canTest = true, canRun = true, canDebug = false)
val tags = BuildTargetTag.fromConfig(configuration.name)
Def.task {
BuildTarget(
Expand Down Expand Up @@ -655,7 +657,12 @@ object BuildServerProtocol {
toSbtTargetIdName(loadedUnit),
projectStandard(loadedUnit.unit.localBase).toURI,
Vector(),
BuildTargetCapabilities(canCompile = false, canTest = false, canRun = false),
BuildTargetCapabilities(
canCompile = false,
canTest = false,
canRun = false,
canDebug = false
),
BuildServerConnection.languages,
Vector(),
"sbt",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion protocol/src/main/contraband/bsp.contra
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type BuildTargetCapabilities {

## This target can be run by the BSP server.
canRun: Boolean!

## This target can be debugged by the BSP server.
canDebug: Boolean!
}

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

# The languages the server supports debugging via method debugSession/start
debugProvider: sbt.internal.bsp.DebugProvider

# The server can provide a list of targets that contain a
# single text document via the method buildTarget/inverseSources
# inverseSourcesProvider: Boolean
Expand Down Expand Up @@ -235,6 +241,10 @@ type RunProvider {
languageIds: [String]
}

type DebugProvider {
languageIds: [String]
}

## Publish Diagnostics
type PublishDiagnosticsParams {
## The document where the diagnostics are published.
Expand Down Expand Up @@ -759,4 +769,4 @@ type JvmRunEnvironmentParams {
type JvmRunEnvironmentResult{
items: [sbt.internal.bsp.JvmEnvironmentItem]!
originId: String
}
}

0 comments on commit e8c58df

Please sign in to comment.