Skip to content

feat: enable conditional breakpoints#1398

Merged
sebthom merged 2 commits intoeclipse-lsp4e:mainfrom
sebthom:issue-1136
Nov 17, 2025
Merged

feat: enable conditional breakpoints#1398
sebthom merged 2 commits intoeclipse-lsp4e:mainfrom
sebthom:issue-1136

Conversation

@sebthom
Copy link
Copy Markdown
Member

@sebthom sebthom commented Nov 14, 2025

This PR contributes a detail pane to the Break Points View allowing to specify condition (with optional TM4E based syntax highlighting), hit condition and breakpoint column.

image

Fixes #1136

// removed legacy reflection-based TM4E viewer creation

private void hookListeners() {
enableConditionButton.addSelectionListener(widgetSelectedAdapter(e -> {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'e' is never used.
}
});

enableHitConditionButton.addSelectionListener(widgetSelectedAdapter(e -> {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'e' is never used.
}
});

columnSpinner.addSelectionListener(widgetSelectedAdapter(e -> {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'e' is never used.
@mickaelistria
Copy link
Copy Markdown
Contributor

Awesome addition!

@sebthom sebthom requested a review from rubenporras November 14, 2025 10:53

@Override
public void display(final IStructuredSelection selection) {
final var selectedBP_ = selectedBP = getSelectedBreakPoint(selection);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about prepending the for this kind of variables instead of appending _? It looks more readable to me.

Suggested change
final var selectedBP_ = selectedBP = getSelectedBreakPoint(selection);
final var theSelectedBP = selectedBP = getSelectedBreakPoint(selection);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also not happy with that. However, I’d like to propose an alternative.
I created a custom CodeQL rule that allows the pattern we currently use to satisfy Eclipse null analysis:

final var varname = this.varname;

At the same time, the rule disallows both shadowing with non-final assignments:

var varname = this.varname;

and assignments of different values:

var varname = this.foobar;
var varname = "somevalue";

This strikes a good balance and avoids the usual confusion that variable shadowing can introduce.

@sebthom sebthom force-pushed the issue-1136 branch 3 times, most recently from 93c0873 to f8a4b2b Compare November 14, 2025 18:27
@sebthom sebthom requested a review from rubenporras November 14, 2025 18:27
@sebthom sebthom merged commit e32b8a6 into eclipse-lsp4e:main Nov 17, 2025
11 checks passed
@sebthom sebthom deleted the issue-1136 branch November 18, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for conditional/inline breakpoints

4 participants