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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

github-actions bot commented Dec 3, 2025

Test Results

    54 files  ±0      54 suites  ±0   35m 59s ⏱️ -36s
 4 547 tests ±0   4 524 ✅ ±0   23 💤 ±0  0 ❌ ±0 
12 237 runs  ±0  12 078 ✅ ±0  159 💤 ±0  0 ❌ ±0 

Results for commit 740eea6. ± Comparison against base commit e85fd97.

♻️ This comment has been updated with latest results.

@rdin777
Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

Hi @iloveeclipse, could you please check this PR ?

@SougandhS
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown

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.

@SougandhS SougandhS force-pushed the ImprovePaste branch 3 times, most recently from 8359e3e to cc29e4d Compare March 12, 2026 16:32
@SougandhS
Copy link
Copy Markdown
Contributor Author

Hi @iloveeclipse
Do you have any further suggestion/reviews on this PR ?

@SougandhS
Copy link
Copy Markdown
Contributor Author

Random test failure : #2569

@SougandhS
Copy link
Copy Markdown
Contributor Author

Build looks good now.

@SougandhS
Copy link
Copy Markdown
Contributor Author

if there are no more suggestions/review can this be merged ?

@trancexpress
Copy link
Copy Markdown
Contributor

trancexpress commented Mar 25, 2026

@SougandhS this looks odd?

vokoscreenNG-2026-03-25_15-01-55.mp4

I 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 \r\t on Linux, which seems odd. Should this change use System.lineSeparator() instead?

Even when pasting multiple expressions, each expression has \r\t following it, which is not there in the expressions view itself.

@SougandhS
Copy link
Copy Markdown
Contributor Author

@trancexpress thanks for testing
By default while copying multiple expressions eclipse will '\t' & '\n'.
test1\t\t\t\t\ntest2\t\t\t\t\n
I think its better to filter these tabs and newlines when user choose paste as single expression

Also I'm seeing \r\t on Linux, which seems odd. Should this change use System.lineSeparator() instead?

you mean while splitting ?

@trancexpress
Copy link
Copy Markdown
Contributor

trancexpress commented Mar 25, 2026

Also I'm seeing \r\t on Linux, which seems odd. Should this change use System.lineSeparator() instead?

you mean while splitting ?

Ah, sorry, I didn't pay attention. It really is \t\t, I thought the code was adding \r\n.

I think its better to filter these tabs and newlines when user choose paste as single expression

I think so too, but maybe keeping the newlines? I'm not sure about them.

@SougandhS
Copy link
Copy Markdown
Contributor Author

But on a second thought, if user has manually added any '\t' or '\n' that will also be affected..

@SougandhS SougandhS force-pushed the ImprovePaste branch 2 times, most recently from ca8087c to 4972547 Compare March 25, 2026 13:52
@SougandhS
Copy link
Copy Markdown
Contributor Author

I have added an additional check to avoid the issue you shown in the video

@trancexpress
Copy link
Copy Markdown
Contributor

I'm still not sure this works as expected:

vokoscreenNG-2026-03-26_13-38-39.mp4

It 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?

@SougandhS
Copy link
Copy Markdown
Contributor Author

SougandhS commented Mar 26, 2026

I'm still not sure this works as expected:

While copying from expression, its value is also copied..

image

Same behavior happens with Copy Variable

Should the copy operation write the data in some special format, that is easier to parse by the paste operation?

Maybe we should provide some UI pref to handle copying Exps & Variables, --> Copy Var/Exp Name & Value or Variable/Exp Name only (Will do this in a diff PR)

@trancexpress
Copy link
Copy Markdown
Contributor

trancexpress commented Mar 26, 2026

While copying from expression, its value is also copied..

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.

@SougandhS
Copy link
Copy Markdown
Contributor Author

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.

it will still cause problem..

eg.
if we enable Actual Type column and do a copy paste then that column value will also be pasted..

image

So I would still suggest some preference UI for copying..

@trancexpress
Copy link
Copy Markdown
Contributor

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:

  • dont add \t if a column is empty
  • copy only the first column if no debug session is running
  • leave as is and expect users to copy when not debugging

@SougandhS
Copy link
Copy Markdown
Contributor Author

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.

In VScode they have these 2 options (I think Intellij have similar too)

image

Maybe similar can be implemented here too..

@SougandhS
Copy link
Copy Markdown
Contributor Author

Other options I can think of, when copying:

  • dont add \t if a column is empty
  • copy only the first column if no debug session is running
  • leave as is and expect users to copy when not debugging

This sounds good, Already there were some issues while copying from expressions which was fixed (2f0bfea)
so will do this too in a different PR 👍

@SougandhS
Copy link
Copy Markdown
Contributor Author

@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?

@trancexpress
Copy link
Copy Markdown
Contributor

Seems fine, yes. Can you open the follow-up issue, I assume you mean for the extra menu item (#2299 (comment))?

@trancexpress trancexpress self-requested a review March 30, 2026 08:13
@trancexpress
Copy link
Copy Markdown
Contributor

trancexpress commented Mar 30, 2026

Test error is:

05:25:22.293 [INFO] infocenter-app 4.40.0-SNAPSHOT ..................... FAILURE [ 15.732 s]
05:25:22.348 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.4.0:war (default-war) on project infocenter-app: Error assembling WAR: Problem creating war: Execution exception: Java heap space -> [Help 1]

Seems to not be related.

@SougandhS
Copy link
Copy Markdown
Contributor Author

Seems fine, yes. Can you open the follow-up issue, I assume you mean for the extra menu item (#2299 (comment))?

Raised #2596

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.

5 participants