Skip to content

Improve Pasting in Expression's View#2299

Open
SougandhS wants to merge 1 commit intoeclipse-platform:masterfrom
SougandhS:ImprovePaste
Open

Improve Pasting in Expression's View#2299
SougandhS wants to merge 1 commit intoeclipse-platform:masterfrom
SougandhS:ImprovePaste

Conversation

@SougandhS
Copy link
Contributor

@SougandhS SougandhS commented Dec 3, 2025

Previously, when pasting multiple expressions in the Expressions View, Eclipse would combine all lines into a single expression. This made it tedious for users who wanted to copy and paste multiple expressions at once, such as when importing or exporting between workspaces, forcing them to paste each expression individually. Additionally, pasting often required keyboard shortcuts, which could be inconvenient for new users.

With this change, a context menu entry has been added for the Paste action

image

and when pasting multi-line expressions, Eclipse now prompts the user to choose how the clipboard content should be added.

image

Users can select either Single Expression, which combines all lines into one expression (default behaviour) or Multiple Expressions, which creates individual expressions for each line.

The preferred default behavior can be set directly in the prompt dialog, and users can later update this preference via Preferences → Run/Debug → Expressions Paste Behavior.

image

Current

CurrentBehav.mp4

New

AfterIm.mp4

This improvement simplifies copy/paste of multiple expressions, streamlines import/export workflows for Expressions View, and makes the pasting more user-friendly and discoverable.

Export/Import

Import.Export.mp4

@eclipse-platform-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:

debug/org.eclipse.debug.ui/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 61af7fbe6a16860f4c3249a40323b2b69863f705 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Wed, 3 Dec 2025 09:04:35 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index 860867d420..db51858366 100644
--- a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
-Bundle-Version: 3.19.100.qualifier
+Bundle-Version: 3.19.200.qualifier
 Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-- 
2.51.2

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Test Results

 1 980 files  ±0   1 980 suites  ±0   1h 35m 2s ⏱️ + 1m 8s
 4 750 tests ±0   4 726 ✅ ±0   24 💤 ±0  0 ❌ ±0 
14 250 runs  ±0  14 068 ✅ ±0  182 💤 ±0  0 ❌ ±0 

Results for commit cc29e4d. ± Comparison against base commit e33c137.

♻️ This comment has been updated with latest results.

@rdin777
Copy link

rdin777 commented Dec 17, 2025

"It appears this workspace corruption is linked to the metadata migration logic in the new 2025-09 build.

To narrow this down, could the reporter try:

Running Eclipse with the -clean flag to force a plugin registry refresh.

Checking the .metadata/.log file specifically for BundleException or unresolved constraint errors.

If the issue persists, it might be a regression in how the ResourcesPlugin handles legacy workspace preferences from the 4.33 (2025-03) version. Given the missing features reported in #2298, it's possible that some mandatory UI dependencies are simply not being satisfied during the workspace initialization phase."

@SougandhS
Copy link
Contributor Author

Hi @iloveeclipse, could you please check this PR ?

@SougandhS
Copy link
Contributor Author

Hi @iloveeclipse,
Could you please trigger a co-pilot review for this PR ?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the Eclipse Debug Expressions View paste behavior by adding support for multi-line clipboard content and introducing a user preference (with optional prompt) to control whether multi-line pastes create one combined expression or multiple expressions.

Changes:

  • Add multi-line paste handling in the Expressions View, including an optional “remember my choice” dialog.
  • Introduce a new preference (and preference page UI) to control multi-line paste behavior (prompt/single/multiple).
  • Update action/message resources and adjust Expressions view popup menu contribution paths.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
ui/.../views/expression/ExpressionView.java Implements multi-line paste logic, preference lookup, and context menu paste visibility.
ui/.../preferences/IDebugPreferenceConstants.java Adds a new preference key for multi-line paste behavior.
ui/.../preferences/DebugPreferencesMessages.properties Adds preference page label; trims trailing whitespace in an existing string.
ui/.../preferences/DebugPreferencesMessages.java Adds NLS field for the new preference label.
ui/.../preferences/DebugPreferencePage.java Adds radio-group UI to configure multi-line paste behavior.
ui/.../IInternalDebugUIConstants.java Adds string constants representing the paste behavior modes.
ui/.../DebugUIPreferenceInitializer.java Initializes the default value for the new multi-line paste preference.
ui/.../actions/expressions/PasteWatchExpressionsAction.java Adjusts the action label behavior via getText().
ui/.../actions/ActionMessages.properties Adds new strings for paste dialog/buttons and action label; whitespace cleanup.
ui/.../actions/ActionMessages.java Adds NLS fields for the new action/dialog strings.
plugin.xml Changes menubarPath for expression removal actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 1595 to 1609
<action
label="%RemoveAllAction.label"
icon="$nl$/icons/full/elcl16/rem_all_co.svg"
helpContextId="remove_all_expressions_action_context"
class="org.eclipse.debug.internal.ui.actions.expressions.RemoveAllExpressionsAction"
menubarPath="expressionGroup"
menubarPath="expressionRemoveGroup"
id="org.eclipse.debug.ui.debugview.popupMenu.removeAllExpressionsAction">
</action>
<action
label="%RemoveAction.label"
icon="$nl$/icons/full/elcl16/rem_co.svg"
helpContextId="remove_expression_action_context"
class="org.eclipse.debug.internal.ui.actions.expressions.RemoveExpressionAction"
menubarPath="expressionGroup"
menubarPath="expressionRemoveGroup"
id="org.eclipse.debug.ui.debugview.popupMenu.removeExpressionAction">
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

menubarPath was changed to expressionRemoveGroup, but ExpressionView.fillContextMenu only creates separators for IDebugUIConstants.EMPTY_EXPRESSION_GROUP and IDebugUIConstants.EXPRESSION_GROUP. There is no expressionRemoveGroup group being contributed, so these remove actions may no longer appear in the Expressions view popup menu. Either add the corresponding group/separator in the view, or keep the menubarPath aligned with an existing group id.

Copilot uses AI. Check for mistakes.
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 was done for arranging the ordering -> to make paste come after copy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@SougandhS SougandhS force-pushed the ImprovePaste branch 2 times, most recently from fceb0ea to 8359e3e Compare March 12, 2026 14:53
Enhance Expressions View paste functionality with context menu entry,
multi-line paste prompt, and a Run/Debug preference for paste behavior
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.

4 participants