Skip to content

Commit 641865e

Browse files
committed
Update lsp4j debug version
1 parent 82f5304 commit 641865e

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

adapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ startScripts {
1515

1616
dependencies {
1717
// The JSON-RPC and Debug Adapter Protocol implementations
18-
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.12.0'
18+
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j.debug:0.15.0'
1919
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
2020
implementation 'org.jetbrains.kotlin:kotlin-reflect'
2121
implementation('kotlin-language-server:shared') {

adapter/src/main/kotlin/org/javacs/ktda/adapter/DAPConverter.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ class DAPConverter(
7474
line = lineConverter.toExternalLine(internalBreakpoint.position.lineNumber)
7575
isVerified = true
7676
}
77+
78+
fun toDAPBreakpoint(internalBreakpoint: InternalExceptionBreakpoint) = DAPBreakpoint().apply {
79+
id = internalBreakpoint.id.toInt()
80+
message = internalBreakpoint.label
81+
isVerified = true
82+
}
7783

7884
fun toInternalStackFrame(frameId: Long) = stackFramePool.getByID(frameId)
7985

adapter/src/main/kotlin/org/javacs/ktda/adapter/KotlinDebugAdapter.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ class KotlinDebugAdapter(
8080
LOG.info("Connected to client")
8181
}
8282

83-
override fun runInTerminal(args: RunInTerminalRequestArguments): CompletableFuture<RunInTerminalResponse> = notImplementedDAPMethod()
84-
8583
override fun configurationDone(args: ConfigurationDoneArguments?): CompletableFuture<Void> {
8684
LOG.trace("Got configurationDone request")
8785
val response = CompletableFuture<Void>()
@@ -276,11 +274,15 @@ class KotlinDebugAdapter(
276274

277275
override fun setFunctionBreakpoints(args: SetFunctionBreakpointsArguments): CompletableFuture<SetFunctionBreakpointsResponse> = notImplementedDAPMethod()
278276

279-
override fun setExceptionBreakpoints(args: SetExceptionBreakpointsArguments) = async.execute {
280-
args.filters
277+
override fun setExceptionBreakpoints(args: SetExceptionBreakpointsArguments) = async.compute {
278+
val internalBreakpoints = args.filters
281279
.map(converter::toInternalExceptionBreakpoint)
282280
.toSet()
283-
.let(context.breakpointManager.exceptionBreakpoints::setAll)
281+
internalBreakpoints.let(context.breakpointManager.exceptionBreakpoints::setAll)
282+
283+
SetExceptionBreakpointsResponse().apply {
284+
breakpoints = internalBreakpoints.map(converter::toDAPBreakpoint).toTypedArray()
285+
}
284286
}
285287

286288
override fun continue_(args: ContinueArguments) = async.compute {

0 commit comments

Comments
 (0)