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

Disable all conditions in breakpoints #549 #550

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SougandhS
Copy link
Contributor

@SougandhS SougandhS commented Oct 29, 2024

Provides additional right click menu option for removing all the conditions set in breakpoints. Will be useful for clearing all the conditions in breakpoints at once.

Enhancement #549

What it does

Provides additional option to remove all conditions
image

image

How to test

Author checklist

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.

As commented on the ticket, this only adds more complexity to the menu.
I don't see any reason why anyone would need an extra item for removing conditional breakpoints and why it is so important to get it into the menu.

In the opposite, removing al conditional breakpoints is more dangerous as usual ones because often conditions are non trivial and if lost, need much more time to restore compared to simple breakpoints that can be togled by a single click.

So definitely no.

@SougandhS
Copy link
Contributor Author

As commented on the ticket, this only adds more complexity to the menu. I don't see any reason why anyone would need an extra item for removing conditional breakpoints and why it is so important to get it into the menu.

In the opposite, removing al conditional breakpoints is more dangerous as usual ones because often conditions are non trivial and if lost, need much more time to restore compared to simple breakpoints that can be togled by a single click.

So definitely no.

Okay @iloveeclipse will cancel this then. Thank you

@SougandhS SougandhS closed this Oct 29, 2024
@SougandhS
Copy link
Contributor Author

As commented on the ticket, this only adds more complexity to the menu. I don't see any reason why anyone would need an extra item for removing conditional breakpoints and why it is so important to get it into the menu.

In the opposite, removing al conditional breakpoints is more dangerous as usual ones because often conditions are non trivial and if lost, need much more time to restore compared to simple breakpoints that can be togled by a single click.

So definitely no.

@iloveeclipse By the way the conditions are not removed they are only disabled. if user wants that condition again the condition will still be available in the text area so it can enabled by the tick option

@SougandhS
Copy link
Contributor Author

As commented on the ticket, this only adds more complexity to the menu. I don't see any reason why anyone would need an extra item for removing conditional breakpoints and why it is so important to get it into the menu.
In the opposite, removing al conditional breakpoints is more dangerous as usual ones because often conditions are non trivial and if lost, need much more time to restore compared to simple breakpoints that can be togled by a single click.
So definitely no.

@iloveeclipse By the way the conditions are not removed they are only disabled. if user wants that condition again the condition will still be available in the text area so it can enabled by the tick option

@iloveeclipse shall I reopen this ?

@iloveeclipse
Copy link
Member

By the way the conditions are not removed they are only disabled.

  • Ticket title is "Option for Remove all conditional"
  • PR says "Clear all conditions in breakpoints"
  • Screenshot says "Remove all conditions"
  • You say "only disabled"

This is extremely confusing.
Please make sure that you properly explain the problem & solution, as all points mean completely different actions!

@SougandhS
Copy link
Contributor Author

By the way the conditions are not removed they are only disabled.

  • Ticket title is "Option for Remove all conditional"
  • PR says "Clear all conditions in breakpoints"
  • Screenshot says "Remove all conditions"
  • You say "only disabled"

This is extremely confusing. Please make sure that you properly explain the problem & solution, as all points mean completely different actions!

Will correct it now.

@SougandhS SougandhS changed the title Clear all conditions in breakpoints #549 Disable all conditions in breakpoints #549 Oct 29, 2024
@SougandhS
Copy link
Contributor Author

By the way the conditions are not removed they are only disabled.

  • Ticket title is "Option for Remove all conditional"
  • PR says "Clear all conditions in breakpoints"
  • Screenshot says "Remove all conditions"
  • You say "only disabled"

This is extremely confusing. Please make sure that you properly explain the problem & solution, as all points mean completely different actions!

Will update the code now.

@SougandhS SougandhS reopened this Oct 29, 2024
@iloveeclipse
Copy link
Member

Will update the code now.

Now you are pushed an older commit? It is not on the master branch head as before.

@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch 2 times, most recently from bacf750 to 394e594 Compare October 29, 2024 08:13
@SougandhS
Copy link
Contributor Author

Will update the code now.

Now you are pushed an older commit? It is not on the master branch head as before.

I have force pushed a new one now.

@iloveeclipse
Copy link
Member

Still not on latest master state

@SougandhS
Copy link
Contributor Author

Still not on latest master state

let me check again

@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch 2 times, most recently from c20f1f4 to 2d7ded5 Compare October 29, 2024 08:35
@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch 2 times, most recently from 75f08dd to afa36d2 Compare October 29, 2024 10:00
@SougandhS
Copy link
Contributor Author

SougandhS commented Oct 29, 2024

Hi @iloveeclipse , had some issues with my git earlier, now its fixed pls check latest commit

org.eclipse.jdt.debug.ui/plugin.properties Outdated Show resolved Hide resolved
org.eclipse.jdt.debug.ui/plugin.xml Outdated Show resolved Hide resolved
org.eclipse.jdt.debug.ui/plugin.xml Outdated Show resolved Hide resolved
org.eclipse.jdt.debug.ui/plugin.xml Outdated Show resolved Hide resolved
org.eclipse.jdt.debug.ui/plugin.xml Outdated Show resolved Hide resolved
for (IBreakpoint breakpoint : DebugPlugin.getDefault().getBreakpointManager().getBreakpoints()) {
if (breakpoint instanceof JavaLineBreakpoint javaBp) {
if (javaBp.isConditionEnabled()) {
javaBp.setConditionEnabled(false);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is the right thing to do. I would expect the breakpoint to be disabled, not the condition on the breakpoint

Copy link
Contributor Author

@SougandhS SougandhS Oct 30, 2024

Choose a reason for hiding this comment

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

Intention of the PR is to provide functionality similar to "Remove All Triggers" in which all triggers in breakpoints will be disabled by preserving the breakpoint enabled/disabled status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so for this all conditional check will be disabled. keeping the condition and enabled/disabled status as it is.

@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch from afa36d2 to 821e5d4 Compare November 7, 2024 09:00
@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch from 821e5d4 to 426110f Compare November 27, 2024 03:54
@eclipse-jdt-bot
Copy link
Contributor

eclipse-jdt-bot commented Nov 27, 2024

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

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 e2a30e58100aaed483f81549fdae4b5583719da4 Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Mon, 2 Dec 2024 02:28:18 +0000
Subject: [PATCH] Version bump(s) for 4.35 stream


diff --git a/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.debug.ui/META-INF/MANIFEST.MF
index e651afa8a..06269ace2 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.13.600.qualifier
+Bundle-Version: 3.13.700.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 dceebf96d..597b96d81 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.13.600-SNAPSHOT</version>
+  <version>3.13.700-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
   <properties>
   	<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
-- 
2.47.0

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

helpContextId="remove_all_breakpoints_action_context"
icon="$nl$/icons/full/elcl16/removeAllConditions.png"
class="org.eclipse.jdt.internal.debug.ui.actions.RemoveAllCondtionalBreakpoints"
menubarPath="breakpointGroupJava"
Copy link
Member

Choose a reason for hiding this comment

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

The right solution would be to add additional separator or group at the platform and contribute new menu to that, so it is not placed in a wrong location. Please try that.

IWorkspaceRunnable runnable = monitor -> {
for (IBreakpoint breakpoint : DebugPlugin.getDefault().getBreakpointManager().getBreakpoints()) {
try {
breakpoint.getMarker().setAttribute(IBreakpoint.ENABLED, breakpoint.isEnabled());
Copy link
Member

Choose a reason for hiding this comment

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

looks like here you change all breakpoints, while above only JavaLimeBreakpoints. This is not OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change it

}

@Override
protected void initialize() {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need listener? Isn't action state updated on every right click?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to check that.

Copy link
Contributor Author

@SougandhS SougandhS Nov 27, 2024

Choose a reason for hiding this comment

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

Listener is required then only it will update, other right click options have the same too.

Provides additional Action in breakpoints actions for disabling all the
conditions set in breakpoints. Will be useful for disabling every
conditions in breakpoints by preserving the conditions in the text
editor.

Enhancement eclipse-jdt#549
@SougandhS SougandhS force-pushed the RemoveAll_Condition_Options branch from 50fdd56 to f2133cf Compare December 2, 2024 02:26
SougandhS added a commit to SougandhS/eclipse.platform that referenced this pull request Dec 2, 2024
This PR provides additional separation and arrangements between
Enable/Disable Actions in breakpoints view. New actions can be
contributed here.

Part of Enhancement #eclipse-jdt/eclipse.jdt.debug#550
jukzi pushed a commit to SougandhS/eclipse.platform that referenced this pull request Dec 4, 2024
This PR provides additional separation and arrangements between
Enable/Disable Actions in breakpoints view. New actions can be
contributed here.

Part of Enhancement #eclipse-jdt/eclipse.jdt.debug#550
SougandhS added a commit to SougandhS/eclipse.platform that referenced this pull request Dec 4, 2024
This PR provides additional separation and arrangements between
Enable/Disable Actions in breakpoints view. New actions can be
contributed here.

Part of Enhancement #eclipse-jdt/eclipse.jdt.debug#550
SougandhS added a commit to SougandhS/eclipse.platform that referenced this pull request Dec 4, 2024
This PR provides additional separation and arrangements between
Enable/Disable Actions in breakpoints view. New actions can be
contributed here.

Part of Enhancement #eclipse-jdt/eclipse.jdt.debug#550
SougandhS added a commit to SougandhS/eclipse.platform that referenced this pull request Dec 9, 2024
This PR provides additional separation and arrangements between
Enable/Disable Actions in breakpoints view. New actions can be
contributed here.

Part of Enhancement #eclipse-jdt/eclipse.jdt.debug#550
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.

3 participants