Skip to content

Commit 89d94ea

Browse files
committed
fix: DAP will not remove final breakpoint during a debugging session
Fixes #1316 Signed-off-by: azerr <azerr@redhat.com>
1 parent cc0f4e2 commit 89d94ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/redhat/devtools/lsp4ij/dap/breakpoints/BreakpointHandlerBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void unregisterBreakpoint(@NotNull B breakpoint,
8282
}
8383
breakpoints.remove(breakpoint);
8484
sendBreakpoints(null,
85-
new TemporaryBreakpoint(sourcePosition, false));
85+
breakpoints.isEmpty() ? new TemporaryBreakpoint(sourcePosition, false) : null);
8686
}
8787

8888
@Override
@@ -92,7 +92,8 @@ public void dispose() {
9292

9393
protected CompletableFuture<@Nullable Void> sendBreakpoints(@Nullable IDebugProtocolServer debugProtocolServer,
9494
@Nullable TemporaryBreakpoint temporaryBreakpoint) {
95-
if (debugProtocolServers.isEmpty() || breakpoints.isEmpty()) {
95+
if (debugProtocolServers.isEmpty() || (breakpoints.isEmpty() && temporaryBreakpoint == null)) {
96+
// DAP servers are not started or there are no breakpoints to send
9697
return CompletableFuture.completedFuture(null);
9798
}
9899
return doSendBreakpoints(debugProtocolServer, temporaryBreakpoint);

0 commit comments

Comments
 (0)