Repository navigation
feat: give DAP exception breakpoint filters a condition - #1760
angelozerr merged 1 commit into
Conversation
A debug adapter can let an exception breakpoint filter take a condition (ExceptionBreakpointsFilter.supportsCondition, with conditionDescription saying what it means), such as the exception types to stop at, and receive it in the filter options of setExceptionBreakpoints (supportsExceptionFilterOptions). LSP4IJ only sent the enabled filters' ids. - The Exception Breakpoints panel gains a Condition column, editable for the filters which support a condition; an empty cell shows the condition's description, greyed. A changed condition is sent, as a checked or unchecked filter is. - The conditions are kept by filter id in the DAP server's filter settings, beside the enabled filters. - setExceptionBreakpoints sends an enabled filter which supports a condition and has one in filterOptions, with its condition, when the debug adapter supports filter options; every other filter is sent by its id in filters, as before. - The breakpoint handler keeps each debug adapter's capabilities from initialize(). The user guide describes the column. Tests: DAPExceptionFilterConditionsTest. Against a debug adapter with filter options, an enabled filter with a condition is sent in filterOptions (trimmed), while conditions on a filter which doesn't support them, or on a disabled filter, are not sent; a debug adapter without filter options gets the enabled filters' ids only. Conditions are read back by a later handler of the same debug adapter and removed by an empty one, and survive XML serialization of the filter settings. With the handler change reverted, the first test fails: "uncaught" is sent without its condition.
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 2 minutes. View limit details
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1760 +/- ##
==========================================
+ Coverage 32.28% 32.46% +0.17%
==========================================
Files 753 753
Lines 28015 28064 +49
Branches 5598 4270 -1328
==========================================
+ Hits 9044 9110 +66
+ Misses 17344 17322 -22
- Partials 1627 1632 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks @lagergren ! |
A debug adapter can let an exception breakpoint filter take a condition, such as the exception types to stop at:
ExceptionBreakpointsFilter.supportsCondition, withconditionDescriptionsaying what the condition means, and the condition sent in the filter options ofsetExceptionBreakpointswhen the adapter hassupportsExceptionFilterOptions. LSP4IJ sends only the enabled filters' ids, so such a condition cannot be given, and exception breakpoints by type are unavailable in IntelliJ while VS Code offers them.The fix
FilterItemSettings), beside the enabled filters.setExceptionBreakpointssends an enabled filter that supports a condition and has one infilterOptions, with its condition, when the debug adapter supports filter options. Every other filter is sent by its id infilters, as before.initialize(), to know whether it supports filter options.Test
New
DAPExceptionFilterConditionsTest, with the real breakpoint handler and panel as inDAPBreakpointHandlerBaseTest:filterOptions, trimmed. Conditions on a filter that doesn't support them, or on a disabled filter, are not sent.Without the handler change, the first test fails:
uncaughtis sent without its condition.Native check, in IntelliJ IDEA 2026.2.3 with the Ecstasy language server's debug adapter, which supports a condition on both its exception filters: exception classes separated by commas. A program first throws and catches an
IllegalState, then throws anIllegalArgument. Stopped before the first throw, All Exceptions is given the conditionIllegalArgumentin the new column, and Uncaught Exceptions is unchecked. With a plugin built from this branch, the caughtIllegalStatedoesn't stop the program, which stops where theIllegalArgumentis thrown. With one built frommain, which sends no condition, the same setup stops at the caughtIllegalState../gradlew check: 745 tests, 3 skipped. 7 tests fail on my macOS machine, onmainwithout this change as well:LSPIJUtils_applyWorkspaceEdit_{Go,TypeScript,Scala,Zig}TestandCommandExecutorTest. Each reportsFile accessed outside allowed rootsfor a temporary file: the file is reached as/private/var/folders/…/T/…, while the allowed root is/var/folders/…/T/, and/varis a symlink to/private/varon macOS. They are unrelated to this change.