Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to search lambda breakpoint for both chained and multiline lambdas #529

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public BreakpointLocationLocator(CompilationUnit compilationUnit, int lineNumber
super(compilationUnit, lineNumber, bindingsResolved, bestMatch);
}

public BreakpointLocationLocator(CompilationUnit compilationUnit, int lineNumber, boolean bindingsResolved,
boolean bestMatch, int offset, int end) {
super(compilationUnit, lineNumber, bindingsResolved, bestMatch, offset, end);
}

@Override
public boolean visit(MethodDeclaration node) {
boolean result = super.visit(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public JavaBreakpointLocation[] getBreakpointLocations(String sourceUri, SourceB
// In future, we could consider supporting to update the breakpoint to a valid
// location.
BreakpointLocationLocator locator = new BreakpointLocationLocator(astUnit,
sourceLine, true, true);
sourceLine, true, true, astUnit.getPosition(sourceLine, 0), 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a limitation of the upstream ValidBreakpointLocationLocator. It requires the selection offset to search for line breakpoints on nested chained or multiline lambdas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

astUnit.accept(locator);
// When the final valid line location is same as the original line, that
// represents it's a valid breakpoint.
Expand Down
Loading