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
...g/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
Outdated
Show resolved
Hide resolved
8359e3e to
cc29e4d
Compare
|
Hi @iloveeclipse |
|
Random test failure : #2569 |
9a835ae to
fba9156
Compare
|
Build looks good now. |
|
if there are no more suggestions/review can this be merged ? |
|
@SougandhS this looks odd? vokoscreenNG-2026-03-25_15-01-55.mp4I copy 2 expressions, paste them into one, then when I copy the dialog comes up again. I'm not sure you can do anything about it though, looking at the code. Other than maybe removing the newlines... Also I'm seeing Even when pasting multiple expressions, each expression has |
|
@trancexpress thanks for testing
you mean while splitting ? |
Ah, sorry, I didn't pay attention. It really is
I think so too, but maybe keeping the newlines? I'm not sure about them. |
|
But on a second thought, if user has manually added any '\t' or '\n' that will also be affected.. |
ca8087c to
4972547
Compare
|
I have added an additional check to avoid the issue you shown in the video |
|
I'm still not sure this works as expected: vokoscreenNG-2026-03-26_13-38-39.mp4It looks like the tabs (when not written by the user) are used to separate column values. When not debugging, there is nothing in the value column. Should the copy operation write the data in some special format, that is easier to parse by the paste operation? |
I see, already this is the case when copying and pasting. Unfortunate then, I thought Copy Expressions was some special action. I wouldn't add a preference for this. Is it possible to not paste the last tab and the value after it? Since it comes from the 2nd column of the table. For then new paste action added here. |
|
For pasting into the view, the intent is clear - paste the copied expressions, not thier values. As the value columns are read only. So I'm not sure about a preference... What is your suggestion? If the preference would be for copying only the expressions and not their values, then I'd have to change preferences between "modes" when I want to do specific things - copy the entire row, or copy just the expression. E.g. YourKit has the context menu options to copy the entire row or just the method qualified name. How about this? Copy expression copies just the first column, a new menu entry "Copy row" copies all the column values. We dont have that many elements in the context menu, maybe its OK to add two more instead of one. I can also imagine a preference for different formatting when copying... Formatting that makes it easier to distinguish user input in the clipboard, and so makes it clear where the values for the first column end in the clipboard contents. But I'm not sure how that would work. Other options I can think of, when copying:
|
This sounds good, Already there were some issues while copying from expressions which was fixed (2f0bfea) |
|
@trancexpress, if there are no further concerns apart from the copying from Expresssions issue (which needs be handled in a separate PR), can this be merged? |
|
Seems fine, yes. Can you open the follow-up issue, I assume you mean for the extra menu item (#2299 (comment))? |
|
Test error is: Seems to not be related. |
Raised #2596 |
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