Repository navigation
fix: cancel a DAP request with the DAP cancel request, not a $/cancelRequest event - #2122
Merged
lagergren merged 2 commits intoNov 23, 2026
Conversation
…Request event
LSP4J 1.0.0's DebugRemoteEndpoint inherits RemoteEndpoint.sendCancelNotification, so cancelling the
future of a DAP request sends LSP's $/cancelRequest, which goes out as the DAP event
{"type":"event","event":"$/cancelRequest","body":{"id":<seq>}}. DAP has no such event: a request is
cancelled with the cancel request, whose requestId is the seq of the request.
DAPClient now creates its launcher with a DebugLauncher.Builder whose remote endpoint overrides
sendCancelNotification. When the capabilities of the debug adapter have supportsCancelRequest, it sends
the cancel request without keeping it pending, since some debug adapters (CodeLLDB) never answer it,
and drops the answer when one comes. Otherwise it sends nothing. The future ends cancelled locally
either way.
Nothing in LSP4IJ cancels the future of a DAP request yet; redhat-developer#2107 will. The workaround goes once
eclipse-lsp4j/lsp4j#1009 is released.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2122 +/- ##
==========================================
+ Coverage 50.69% 50.72% +0.02%
==========================================
Files 816 817 +1
Lines 33910 33946 +36
Branches 6979 5295 -1684
==========================================
+ Hits 17190 17218 +28
- Misses 14059 14066 +7
- Partials 2661 2662 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
This was referenced Nov 23, 2026
lagergren
added a commit
that referenced
this pull request
Nov 25, 2026
…0.1 (#2255) ## What An audit of the docs against main found wrong information, missing docs for features merged since 0.30.1, broken links and small mistakes. This PR fixes the text. The outdated screenshots are retaken in separate PRs. ## Change ### DAP guides - **DAPSupport.md:** - The `Cancel` request is supported, with `supportsCancelRequest` (#2122). It was marked ❌. - `Terminate Thread` is also in the Frames view. - The Output line links the user guide. - **DAP user guide:** - New section, "Console output": ANSI colours, indented groups, hidden `telemetry` output, and the source link or "Jump to Value Source" after an output. - Jump to Source on a lazy variable whose value has no declaration opens the lazy variable's own declaration. - The Frames view also says "the thread has exited". - CodeLLDB maps Rust files only. - **DAP developer guide:** - The `DAPClient` requests `stepBack`, `reverseContinue`, `locations`, `setExpression` and `terminateThreads`. - The rule that a request naming a frame id or a `variablesReference` goes through `sendInExecutionEpoch`. - The `DAP.Threads.Popup` group with `ThreadsPanel.SELECTED_THREADS`. - Keeping `supportsANSIStyling` when overriding `createInitializeRequestArguments`. - **Debug adapter pages:** - "Log pattern before proceeding", not "processing", in go-delve, julia and vscode-js-debug. - ruby-rdbg: select Attach, since the dialog opens on Launch. - codelldb: the C++ TODO is replaced by how to map C/C++ files. ### Developer guides - **LSPApi.md, fixes:** - The formatting sample compiles: `isExistingFormatterOverrideable` is `public`. The javadoc sample of `LSPFormattingFeature` is fixed too. - The `get*Characters` and `get*Scope` methods return `String` and `FormattingScope`, not `boolean`. - The CodeLens sample compares the command's title, not the `Command`, and has its imports. - There is one Diagnostic section, with `getTooltip`; the duplicate section named `getToolTip`, which is never called. - The DocumentSymbol table: `getIcon` takes the `boolean`. - `isEnabled(VirtualFile)` is `false` until a server with an installer is installed. - `EditorBehaviorFeature` is named correctly, and the Breadcrumbs default is given. - Two stray `=======` merge markers are gone. - **LSPApi.md, additions:** - Sections for the call hierarchy, type hierarchy, on-type formatting and configuration features. - The missing methods of CodeAction, CodeLens, Completion, Progress, DocumentSymbol and References. - When Find Usages merges a language server's reference with a language plugin's. - **DeveloperGuide.md:** - A custom server API is exposed with `getServerInterface()`, not `createLanguageClient`. - The get-server sample had an inverted null check. The Lease sample checks for a null item, casts to the server API and joins the future. - The custom `WorkspaceFolderStrategy` sample implements `getWorkspaceFolders`, so it compiles. - All attributes of the `server` extension point are listed. - `OSProcessStreamConnectionProvider` isn't experimental, starts one process, and logs to the `Logs` tab. - A document matcher that throws counts as no match. - The missing workspace folders image is replaced by an existing screenshot. ### User guides - **UserGuide.md:** - A Getting started section. The empty LSP console's `Getting Started` link opens this page. - The console tree: state badges, the server and instance tooltips, and `[stdio]` or the socket. - Messages that LSP4J can't parse are shown in the traces. - The warning when IntelliJ 2026.3's own LSP client also serves a file. - Find Usages lists a declaration once, and lists once a reference that a language plugin also finds. - **LSPSupport.md:** - Snippet edits of `workspace/applyEdit`. - `workspace/executeCommand` traces name the command. - When Quick Documentation shows a late hover reply. - The completion prefix in a token that spans whitespace. - `callHierarchy/incomingCalls` and `callHierarchy/outgoingCalls`, not `textDocument/...`. - The `LSP Type Definition(s)` and `LSP Declaration(s)` menus. - A reversed link is fixed. - **README:** - "As notification" is the default error reporting. - "In log" writes a warning to `idea.log` and opens no dialog; the screenshot of that dialog is removed. - LSP4IJ instead of LSP4J. - The documentation list names the LSP API, the template page and the DAP pages. ### User-defined language servers and templates - **UserDefinedLanguageServerTemplate.md:** - The npm `exec` example matches the bundled TypeScript installer: it runs in `node_modules`, with a quoted command, and says why (#2084). - A downloaded file is named after the last segment of the URL's path, without its query or fragment. - The `template.json` example gives JavaScript its `*.js` pattern. - The rust-analyzer installer tab is a link, not an inline image. - **UserDefinedLanguageServer.md:** the template list uses the names that `Choose template...` shows (Camel, Dart, EO, Stylelint, Vue), and the Language ID sentence is finished. - **Server pages:** - Ada: the path includes the archive's `integration/` folder. - HTML: the template is development-only. - LemMinX: the installer runs at the first start, not when the server is created. ## Checks - **Samples:** the developer-guide samples, and an override of every method in the new API tables, compile in a throwaway test source. The samples as they are on main fail with 3 errors. - **Links:** all relative links and anchors of the changed pages resolve. - **Open PRs:** the doc changes of #2229, #2230 and #2233 still apply on top of this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Cancelling the future of a DAP request sends
{"type":"event","seq":N,"event":"$/cancelRequest","body":{"id":<seq>}}to the debug adapter. That isn't DAP: DAP cancels a request with thecancelrequest, whoserequestIdis theseqof the request.Cause
LSP4J 1.0.0's
DebugRemoteEndpointdoesn't overrideRemoteEndpoint.sendCancelNotification. SoJsonRpcRequestFuture.cancelsends LSP's$/cancelRequestnotification, andDebugMessageTypeAdapterwrites it as a DAP event. eclipse-lsp4j/lsp4j#1009 fixes this in LSP4J, but isn't released yet (tracked in #2121).Change
DAPClient.createLauncherbuilds its launcher with aDebugLauncher.Builder(the newDAPClientLauncher). ItscreateRemoteEndpointis LSP4J's, except that it makes aDebugRemoteEndpointsubclass.sendCancelNotification:supportsCancelRequest, it sendscancelwithrequestIdset to the request'sseq, with LSP4J'sCancelArguments;cancel, which would leave a pending entry forever;cancel, for whichRemoteEndpointwould log "Unmatched response message".// TODO LSP4J:, to remove once fix: expand selection feature not respecting servertextDocument/selectionRangeresponse #1009 is released. The capability check stays.Behaviour changes
None today: LSP4IJ never cancels the future of a DAP request. #2107 (progress and cancel) will, and this is the launcher change it plans. Every message other than
cancelgoes through the same LSP4J code as before.Test
DAPClientLauncherTestcreates the launcher against a debug adapter on a loopback socket, and reads the raw frames on the adapter's end:supportsCancelRequest, the adapter gets onecancelrequest with the cancelled request'sseq, and then the next request, with no$/cancelRequestevent. The adapter answers thecancel, and LSP4J logs no warning.On
main's launcher, both tests fail: the adapter gets{"type":"event","seq":2,"event":"$/cancelRequest","body":{"id":1}}.The
daptests pass on 2024.2, 2025.3 and IU 2026.3 (346 each), and the full suite passes on 2024.2 (1861 tests, 0 failures, 7 skipped).