Skip to content

Conversation

@SougandhS
Copy link
Member

@SougandhS SougandhS commented Jun 25, 2025

This pr enables users to select a lambda in a single-line chained lambda expressions to put a lambda entry breakpoint + updated chained lambda breakpoint names in breakpoints view

Fixes : #732

On toggling lambda entry breakpoint on chained lambda exps
image

Debugger will show an UI to select the indented lambda of user's choice

image

User can select the lambda inside the small popup either by double click or click->select via button,

On selecting, breakpoint will be added specific to that lambda

image
LambdaNew.mp4

What it does

How to test

Author checklist

@SougandhS SougandhS force-pushed the lambdaBPPOC branch 2 times, most recently from 205492e to 585495e Compare June 25, 2025 09:02
@SougandhS SougandhS requested a review from iloveeclipse June 25, 2025 09:02
@SougandhS
Copy link
Member Author

@iloveeclipse - Could you please review when you get time ?

@SougandhS SougandhS force-pushed the lambdaBPPOC branch 2 times, most recently from 915c89c to b18cbcf Compare June 26, 2025 06:08
@SougandhS
Copy link
Member Author

random Test failure -> #719

@SougandhS SougandhS force-pushed the lambdaBPPOC branch 4 times, most recently from abeac62 to 698f7ad Compare June 29, 2025 15:15
@SougandhS
Copy link
Member Author

SougandhS commented Jun 29, 2025

@iloveeclipse I have resolved the merge conflicts 👍

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

Few impressions after a quick black box test, without looking into the code.
In general, the idea is useful, but implementation has at least one major bug and also UI needs to be polished.

Take the file below and try that below:

import java.util.Arrays;
import java.util.List;
import java.util.Optional;

public class BreakpointsTest {
	
	public static void main(String[] args) {
		callMe();
	}

	private static void callMe() { 
		BreakpointsTest t = new BreakpointsTest();
		t.lotOfLambdas();
	}
	
	void lotOfLambdas() {
		Optional.of("aa").map(this::a6).filter(x -> x.isBlank()).map(this::a6);

		List<String> list = Arrays.asList("a", "b", "c");
		list.stream().filter(s -> s.length() > 0).map(s -> s.toLowerCase()).filter(x -> x.charAt(0) > 1).map(s -> s.toUpperCase()).filter(k -> k.indexOf(0) < 0).map(s -> s.toLowerCase()).filter(p -> !p.isBlank()).forEach(System.out::println);
		
		list.stream().filter(s -> s.length() > 0).map(s -> s.toLowerCase()).filter(x -> x.charAt(0) > 1).map(s -> s.toUpperCase())
				.filter(k -> k.indexOf(0) < 0).map(s -> s.toLowerCase()).filter(p -> !p.isBlank()).forEach(System.out::println);
		
		list.stream().filter(s -> s.length() > 0).map(s -> s.toLowerCase()).filter(x -> x.charAt(0) > 1)
				.map(s -> s.toUpperCase()).filter(k -> {
					System.out.println(k);
					return k.indexOf(0) < 0;
				}).map(s -> s.toLowerCase()).filter(p -> !p.isBlank()).forEach(t -> {
					if(t.contains("a")) {
						System.out.println(t + "!!!");
					}
				});
	}
	
	String a6(String s) {
		return s;
	}
}

  1. Major bug: "Toggle Breakpoint" works to create breakpoints but is broken for deleting breakpoints, breakpoints can't be removed from editor anymore (only via Breakpoints view). It seem breakpoints can be "toggled" only on lines where lambda breakpoints can be created via "Toggle Lambda Breakpoint" menu.
  2. Bug: if one closes lambda proposal dialog by "cancel", no breakpoint is created but on next double click on same line no lambda proposals dialog is shown and a regular breakpoint is created. Expectation is: on "Cancel" nothing is created and no behavior is changed. After playing with that for some time I was not able to show up lambda selection dialog anymore, independently what I've tried - without any error in the log.
  3. UI problem: the shown list of lambda's is resizable but the content inside is fixed.
  4. UI problem: extra line added for block expressions:
    image

@SougandhS
Copy link
Member Author

Few impressions after a quick black box test, without looking into the code. In general, the idea is useful, but implementation has at least one major bug and also UI needs to be polished.

Thanks for testing, will fix and get back 👍

@SougandhS
Copy link
Member Author

  1. Major bug:

Fixed

  1. no breakpoint is created but on next double click on same line no lambda proposals dialog is shown

Lambda proposal is only shown when user do Right click->Toggle lambda Entry breakpoint . Double click creates Line breakpoint only

After playing with that for some time I was not able to show up lambda selection dialog

Strange. I tried many times and it was working for me, can you try again ? or share the exact same step you tried

3 the shown list of lambda's is resizable but the content inside is fixed.

Fixed

4 extra line added for block expressions:

Handled

@SougandhS SougandhS requested a review from iloveeclipse July 4, 2025 05:16
@SougandhS SougandhS force-pushed the lambdaBPPOC branch 2 times, most recently from aae6f4e to f7cdc9e Compare July 9, 2025 04:21
@SougandhS SougandhS force-pushed the lambdaBPPOC branch 3 times, most recently from 62446fb to fa1c386 Compare August 2, 2025 03:13
@SougandhS
Copy link
Member Author

@iloveeclipse could you please check this again ?

@SougandhS
Copy link
Member Author

Hi @iloveeclipse
Could you please re-review this once you are available ?

@eclipse-jdt-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
org.eclipse.jdt.debug.ui/pom.xml
org.eclipse.jdt.debug/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 4368217a4c474a78286515275a4d78f16ca93887 Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <[email protected]>
Date: Mon, 8 Sep 2025 06:02:35 +0000
Subject: [PATCH] Version bump(s) for 4.38 stream


diff --git a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
index a4f478043..58c8e615c 100644
--- a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.debug.ui; singleton:=true
-Bundle-Version: 3.15.100.qualifier
+Bundle-Version: 3.15.200.qualifier
 Bundle-Activator: org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/org.eclipse.jdt.debug.ui/pom.xml b/org.eclipse.jdt.debug.ui/pom.xml
index 212983904..dcfe6c67b 100644
--- a/org.eclipse.jdt.debug.ui/pom.xml
+++ b/org.eclipse.jdt.debug.ui/pom.xml
@@ -18,7 +18,7 @@
   </parent>
   <groupId>org.eclipse.jdt</groupId>
   <artifactId>org.eclipse.jdt.debug.ui</artifactId>
-  <version>3.15.100-SNAPSHOT</version>
+  <version>3.15.200-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
   <properties>
   	<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
diff --git a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
index 1a6f573b1..39dc0010b 100644
--- a/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.debug/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.debug; singleton:=true
-Bundle-Version: 3.24.0.qualifier
+Bundle-Version: 3.24.100.qualifier
 Bundle-ClassPath: jdimodel.jar
 Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
 Bundle-Vendor: %providerName
-- 
2.51.0

Further information are available in Common Build Issues - Missing version increments.

@SougandhS
Copy link
Member Author

Hi @iloveeclipse
I’ve made some code optimizations and fixed a few UI issues. Could we plan this for M2 or M3?

@iloveeclipse
Copy link
Member

I hope to find time tomorrow

@SougandhS
Copy link
Member Author

What I see is just a dialog that appears somewhere on the screen, independently where I have my cursor. It seem trying to open it time to time on different places, but never places it in a way that one could clearly "link" the dialog to the lambda selected.

I believe once this sync feature is added one could clearly link with selection because the popup will always open few distance below the actual code

@iloveeclipse
Copy link
Member

I believe once this sync feature is added one could clearly link with selection because the popup will always open few distance below the actual code

I've slightly modified the dialog from my patch. Now user can select something in editor. I would prefer to use this dialog, all what is needed now is to set dialog selection on cursor changes, which you seem to done already in private patch. If you could apply this patch to the dialog, we could be all happy I assume.

@SougandhS
Copy link
Member Author

SougandhS commented Oct 23, 2025

I've slightly modified the dialog from my patch. Now user can select something in editor. I would prefer to use this dialog, all what is needed now is to set dialog selection on cursor changes, which you seem to done already in private patch. If you could apply this patch to the dialog, we could be all happy I assume.

Thanks, I have added the sync selection

My.Movie.mp4
image

@SougandhS
Copy link
Member Author

SougandhS commented Oct 23, 2025

This is not correct. My patch keeps lambda positions as they are written. I guess you had troubles to compile the patch properly.

there's something wrong with the comparator

list.stream().map(s -> s.toLowerCase()).filter(s -> s.length() > 0).map(s -> s.toLowerCase()).filter(x -> x.charAt(0) > 1)

positions of 2nd and 3rd are interchanged..

image

Edit : The comparator fails when there are duplicate entries.

@SougandhS
Copy link
Member Author

SougandhS commented Oct 23, 2025

I have fixed with the comparator issue when there are duplicate entries

image

@SougandhS
Copy link
Member Author

If there are no more changes can this be merged ?

@iloveeclipse
Copy link
Member

iloveeclipse commented Oct 24, 2025

I will now fix remaining items, squash everyting and update the PR.

@SougandhS
Copy link
Member Author

I will not fix remaining items, squash everyting and update the PR.

PR updated 👍

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

I did final pass through the changes, see comments.

I will fix all code comments in a dedicated commit to show the differences and then squash all together once again.

Allow users to put a lambda entry breakpoint on a selected lambda if
line contains multiple chained lambda expressions.

Fixes : eclipse-jdt#732

Co-authored-by: Andrey Loskutov <[email protected]>
@iloveeclipse iloveeclipse merged commit 6738a62 into eclipse-jdt:master Oct 24, 2025
13 checks passed
@iloveeclipse
Copy link
Member

iloveeclipse commented Oct 24, 2025

@SougandhS : thanks for the feature. Please provide N&N entry.

PS:
if you have time, would be great have the preference page entry for #798

@SougandhS
Copy link
Member Author

SougandhS commented Oct 25, 2025

Thank you for the cleanup and improvements

if you have time, would be great have the preference page entry for #798

image

Looks like the original author has already implemented it via #81

SougandhS added a commit to SougandhS/www.eclipse.org-eclipse that referenced this pull request Oct 25, 2025
SougandhS added a commit to SougandhS/www.eclipse.org-eclipse that referenced this pull request Oct 26, 2025
SougandhS added a commit to SougandhS/www.eclipse.org-eclipse that referenced this pull request Oct 28, 2025
MohananRahul pushed a commit to eclipse-platform/www.eclipse.org-eclipse that referenced this pull request Oct 28, 2025
@SougandhS SougandhS added enhancement New feature or request noteworthy Noteworthy feature labels Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request noteworthy Noteworthy feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda breakpoints enhancement

3 participants