lahodaj opened a new pull request, #9285:
URL: https://github.com/apache/netbeans/pull/9285
This is something I was looking at long time ago, but was not very happy
about the UI. So I was trying to improve the UI, but I didn't make progress on
that, and this got stashed. So, now I decided to try to recover this, even with
the not-so-nice UI.
I would consider this patch to be a fairly advanced prototype.
Currently, having code like:
```
List.of("a", "b", "c")
.stream()
.map(s -> s).filter(s -> !s.isEmpty())
.forEach(s -> System.err.println(s));
}
```
putting a breakpoint at the line with `map` will mean the debugger will stop
at the line when `map` is called, and then each time any of the lambdas is
called. This is rarely what one wants. It would be better to be able to say
that I want the debugger to stop at e.g. the first lambda.
This is what this PR is trying to do. There's an ability to specify the
breakpoint applies to n-th lambda on the given line. Special values are `-1`,
which means to stop at the line outside of any lambda, and `Integer.MIN_VALUE`,
which means stop each time this line is reached, regardless of any lambdas.
This is the way it works on the backend.
Inside the NetBeans UI, it works like this:
- when a line breakpoint is added on a line with lambdas, it is considered
to be on the line only, and there's a disable lambda breakpoint added for each
lambda automatically. These can then be enabled/disabled independently.
- when the line breakpoint is removed, all the lambda breakpoints are
removed as well.
The ability is also used in the DAP Java server, for use in DAP clients
(e.g. in VS Code). The UI in VS Code is better, but also has some sharp edges.
Inside NB, it can look like this:
<img width="683" height="249" alt="lambda-breakpoints-editor"
src="https://github.com/user-attachments/assets/22850b02-5b07-4aa0-930f-7f6e367a45e4"
/>
<img width="1146" height="328" alt="lambda-breakpoints-view"
src="https://github.com/user-attachments/assets/2773fc6e-4a4c-4f54-9893-06ddbd50b754"
/>
---
**^Add meaningful description above**
<details open>
<summary>Click to collapse/expand PR instructions</summary>
By opening a pull request you confirm that, unless explicitly stated
otherwise, the changes -
- are all your own work, and you have the right to contribute them.
- are contributed solely under the terms and conditions of the Apache
License 2.0 (see section 5 of the license for more information).
Please make sure (eg. `git log`) that all commits have a valid name and
email address for you in the Author field.
If you're a first time contributor, see the Contributing guidelines for more
information.
If you're a committer, please label the PR before pressing "Create pull
request" so that the right test jobs can run.
### PR approval and merge checklist:
1. [ ] Was this PR [correctly
labeled](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=240884239#PRsandYouAreviewerGuide-PRtriggeredCIJobs(conditionalCIpipeline)),
did the right tests run? When did they run?
2. [ ] Is this PR
[squashed](https://cwiki.apache.org/confluence/display/NETBEANS/git%3A+squash+and+merge)?
3. [ ] Are author name / email address correct? Are
[co-authors](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line)
correctly listed? Do the commit messages need updates?
3. [ ] Does the PR title and description still fit after the Nth iteration?
Is the description sufficient to appear in the release notes?
If this PR targets the delivery branch: [don't
merge](https://cwiki.apache.org/confluence/display/NETBEANS/Pull+requests+for+delivery).
([full wiki
article](https://cwiki.apache.org/confluence/display/NETBEANS/PRs+and+You+-+A+reviewer+Guide))
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists