Improve Pasting in Expression's View#2299
Improve Pasting in Expression's View#2299SougandhS wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
|
This pull request changes some projects for the first time in this development cycle. 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 patchFurther information are available in Common Build Issues - Missing version increments. |
3dd8050 to
3bf4bf9
Compare
|
"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." |
3bf4bf9 to
29f3d0d
Compare
|
Hi @iloveeclipse, could you please check this PR ? |
29f3d0d to
6d5d395
Compare
|
Hi @iloveeclipse, |
There was a problem hiding this comment.
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.
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Outdated
Show resolved
Hide resolved
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Show resolved
Hide resolved
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Show resolved
Hide resolved
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Outdated
Show resolved
Hide resolved
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Outdated
Show resolved
Hide resolved
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
Outdated
Show resolved
Hide resolved
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
Outdated
Show resolved
Hide resolved
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
Outdated
Show resolved
Hide resolved
| <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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This was done for arranging the ordering -> to make paste come after copy
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Outdated
Show resolved
Hide resolved
fceb0ea to
8359e3e
Compare
Enhance Expressions View paste functionality with context menu entry, multi-line paste prompt, and a Run/Debug preference for paste behavior

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
and when pasting multi-line expressions, Eclipse now prompts the user to choose how the clipboard content should be added.
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.
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