Skip to content

Add support to import recent workspaces from previous installations into launcher dialog - #3995

Open
deepika-u wants to merge 1 commit into
eclipse-platform:masterfrom
deepika-u:import_wksp_list_4_5_2026
Open

deepika-u wants to merge 1 commit into
eclipse-platform:masterfrom
deepika-u:import_wksp_list_4_5_2026

Conversation

@deepika-u

@deepika-u deepika-u commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

This PR lets you import recent workspaces from another Eclipse installation straight from the Choose Workspace launcher dialog.

When you set up a new Eclipse or a milestone build, the recent workspace list starts out empty, and you have to browse to each workspace by hand. This adds an Import... button that reads the workspace list from another installation and copies the entries you pick into the current one.


What it does

  • Manual and one-time. You trigger the import yourself. There is no shared registry and no automatic syncing, so installations that run side by side stay independent.
  • Finds the workspaces for you. You point it at another installation. It reads configuration/.settings/org.eclipse.ui.ide.prefs (falling back to the .metadata location) and understands both the old comma-separated format (protocol 2) and the newline-separated one (protocol 3).
  • Lets you choose. Paths that don't exist, paths that are files, and workspaces you already have are left out. The rest appear in a checkbox list with a filter box, Select All / Deselect All, and a way to browse to a different installation without closing the dialog. Empty, invalid and duplicate cases show a clear message.
  • Saves right away. Imported workspaces are written to the current installation's preferences immediately. The recent workspaces list scrolls, and "Show more..." reveals five more entries at a time.
  • Can be turned off. Set workspaceImportEnabled in the .product file, or pass -Dworkspace.import.enabled=false.
  • Tested. ChooseWorkspaceDialogTests covers both protocol versions, directory validation, the alternative metadata location and error cases.

This change enhances workspace migration usability and improves the overall launcher experience for users moving between Eclipse installations.

Before this pr :
image

After this pr :

  1. When fresh eclipse is installed, the twistee against "Recent Workspaces" will remain closed though empty, when one opens it, it would be like below. Import... is the newly added button ->
image
  1. On clicking Import..., you can browse previous eclipse installation path and browse recently used workspaces in it and import them like this - the desired ones ->
image
  1. When i have already imported some workspaces successfully, i get ->
image
  1. I can still add new workspaces to existing list of "Recent Workspaces" from another installation by clicking Import... again like this ->
image
  1. On saying OK on this window, it returns and merges to the previous list of workspaces already imported ->
image
  1. Select one of the imported workspaces and launch.

How to Test

Standalone Installation Bundle Drop

  1. Download and extract the built test bundle:
    org.eclipse.ui.ide_3.24.0.v20261124-0801.zip

  2. Copy the extracted .jar to <eclipse-install>/plugins/.

  3. Update <eclipse-install>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info by replacing the org.eclipse.ui.ide entry with:

    org.eclipse.ui.ide,3.24.0.v20261124-0801,plugins/org.eclipse.ui.ide_3.24.0.v20261124-0801.jar,4,false
    
    

Note

  • Once done with testing, please revert bundles.info back to restore the original Eclipse installation state.
  • As verified on Windows platform.

How to Disable this Feature

Via eclipse.ini (For Installed / Standalone Eclipse)

  1. Open your target <eclipse-install>/eclipse.ini file in a text editor.
  2. Locate the line with -vmargs.
  3. Add the flag anywhere after -vmargs on its own line:
    -vmargs
    -Dworkspace.import.enabled=false
    
  4. Save the file and launch eclipse.exe.
  5. Result: The Choose Workspace dialog launches without the Import... button:
image

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch 2 times, most recently from 5d4e732 to 56de0b8 Compare May 11, 2026 14:31
@vogella

vogella commented May 11, 2026

Copy link
Copy Markdown
Contributor

What about storing the workspaces in user scope scoped by product / application instead of storing them in configuration scope. This way the workspaces for a product would always be the same which I think is the most common use case.

@github-actions

github-actions Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ± 0     867 suites  ±0   54m 34s ⏱️ - 5m 33s
 8 582 tests +15   8 342 ✅ +15  240 💤 ±0  0 ❌ ±0 
21 618 runs  +45  20 945 ✅ +45  673 💤 ±0  0 ❌ ±0 

Results for commit c53cfe5. ± Comparison against base commit 50268ca.

♻️ This comment has been updated with latest results.

@iloveeclipse

Copy link
Copy Markdown
Member

Interesting idea, but can we please made this feature optional, so the "Import..." is not shown at all (we extend IDEApplication and ChooseWorkspaceDialog) to share as much code as possible with original code and default workspace selection dialog)?

We have Eclipse based application deployed with rpm, so by default installation is read only and all settings are stored on (typically mounted) user home and for a specific application version the path would be something like /home/user/.eclipse/com.verigy.itee.ui.ewcProduct_8_8_2_0__user-bf_20260504_0604_048042b160e2_C_BETA__R__64_user_RHEL9_socbn410__1/

Not only that this path is by default hidden, it is also application version specific, different application versions are installed in parallel and should not share the workspaces used.

"Import..." would casue more troubles in this scenario, so we would want to disable this completely to avoid user errors.

What about storing the workspaces in user scope scoped by product / application instead of storing them in configuration scope.

In our case it would be important to have that "per product / per version" or give a chance to see that the workspace is for a different product version.

Ideally Eclise could automatically detect Eclipse workspaces from "compatible" workspaces. "Compatible" is the key, and it should be possible, similar to org.eclipse.ui.internal.ide.application.IDEApplication.checkValidWorkspace(Shell, URL) to override the "default" strategy.

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 56de0b8 to 979ee98 Compare May 13, 2026 14:07
@deepika-u

Copy link
Copy Markdown
Contributor Author

What about storing the workspaces in user scope scoped by product / application instead of storing them in configuration scope. This way the workspaces for a product would always be the same which I think is the most common use case.

Thanks for the feedback, i am exploring this path. If it can be done in user mode, made it optional.
Does anyone has any other inputs or suggestions further? on this thought - please welcome!

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 979ee98 to cbeb03c Compare May 19, 2026 17:17
@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from cbeb03c to 29c6d94 Compare June 3, 2026 09:44
@vogella

vogella commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

See https://github.com/eclipse-platform/eclipse.platform.ui/pull/3875/changes how to use user scope to save the recent workspaces together with a product / application prefix.

The example is used for the theme but it should be easy to apply the same approach to the workspaces.

@deepika-u

Copy link
Copy Markdown
Contributor Author

See https://github.com/eclipse-platform/eclipse.platform.ui/pull/3875/changes how to use user scope to save the recent workspaces together with a product / application prefix.

The example is used for the theme but it should be easy to apply the same approach to the workspaces.

Thanks aton, i was about to ask for some help in this context. Let me check on that.

@merks

merks commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Why are there 3 commits?

@deepika-u

deepika-u commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Why are there 3 commits?

@merks : Thanks for your interest.
Stages wise i have implemented this feature, so at logical points i had made the commits for my reference. For the pr to be reviewed - only the latest would do(rest can be ignored, sorry if it had caused any confusion). Once all the comments are fixed, i would squash all the commits to 1 i thought so just retained for now. Thanks for your question. Any other inputs on this idea please?

@merks merks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a lot of code...

if (Platform.getInstanceLocation().isSet()) {
store.setValue(RECENT_WORKSPACES, sb.toString());
}
// else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess you will clean this up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will need to investigate on this if configuration scope needs any check here or else can be removed.

protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(1, false));
// FIX ORDER

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this tell me?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry that was a debug message while coding, removed now.

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 29c6d94 to a0e1cf5 Compare June 3, 2026 11:43
@vogella

vogella commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

I assume if you switch to save and load the recent workspaces from User Scope no import is needed.

@deepika-u

Copy link
Copy Markdown
Contributor Author

I assume if you switch to save and load the recent workspaces from User Scope no import is needed.

May be, let me check. Still trying to figure out.

@merks

merks commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

It's quite a bit of extra logic for what to me seems a narrow use case. I think Lar's question kind of hints at the fact that one might share them across all products of the same type. That being said, given I have 50 installations and I never want to share workspaces across them, so I don't actually like that so much. But maybe I'm special. Then again, one can always find workspace without an import dialog too, so I'm a bit ambivalent over all...

@deepika-u

deepika-u commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor Author

I feel UserScope + Product ID is best generic solution like updated in #3878.

Please let me know if we can go with this.

@vogella

vogella commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

I feel UserScope + Product ID is best generic solution like updated in #3878.

Please let me know if we can go with this.

Sounds good to me.

@merks

merks commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

How is RECENT_WORKSPACES value maintained with multiple products are using this? Is there some kind of locking to prevent overwriting the values stored from other instances. Is this value ordered and how do multiple instance working with a single such list impact the order across the instances?

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch 2 times, most recently from 5ce4b33 to 4ece49d Compare June 10, 2026 09:43
@deepika-u

Copy link
Copy Markdown
Contributor Author

How is RECENT_WORKSPACES value maintained with multiple products are using this? Is there some kind of locking to prevent overwriting the values stored from other instances. Is this value ordered and how do multiple instance working with a single such list impact the order across the instances?

Good question.

The proposal is to store RECENT_WORKSPACES in UserScope scoped by product/application ID, so each product maintains its own ordered MRU list.

I am not currently proposing any additional locking. This would follow the same Eclipse preferences infrastructure already used by other UserScope preferences (e.g., the recently added themeid preference), which also relies on the standard preference APIs without custom synchronization.

Since RECENT_WORKSPACES is a UI-driven convenience feature that is updated infrequently, any concurrent updates would only affect the recent-workspace history itself and not workspace data.

@merks

merks commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The theme is changed infrequently and the product-scoped theme is intended to make that even more infrequent.

But the workspace location preference is used by every IDE when it starts. I literally have dozens of installations of the Eclipse IDE for Committers and often have 10 or more different installations of that product open at once. I really don't need and would not like them all to share one unified list because each is augmented with additional tools and are intended to work on specific git repositories. But assuming I'm "special" and that others would want this (and I won't question why), I would still like a clear understanding of how this actually works. Each IDE when it starts moves its workspace to the front? When is that preference saved? When is it loaded and reloaded? When I switch workspaces in an IDE, do I see workspaces from other installations?

I really do wonder what problem we are solving and I'm particularly concerned whether in doing so we create a new and different problem that we didn't have before. Sorry for being a little negative on the topic...

@iloveeclipse

Copy link
Copy Markdown
Member

Yes, it would be great to outline the solution, Ed's questions are all valid.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds “workspace import” capabilities to the Eclipse launcher’s Choose Workspace flow, enabling users to discover and import recent workspaces from a previous Eclipse/application installation via a new import UI.

Changes:

  • Adds a new WorkspaceImportDialog for browsing an installation path, filtering, and selecting workspaces to import.
  • Extends ChooseWorkspaceDialog to always show the “Recent Workspaces” section and to launch the import flow (including deduplication/merge behavior).
  • Introduces new NLS keys for the import UI and related messages.

Reviewed changes

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

File Description
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/WorkspaceImportDialog.java New dialog to browse a previous installation, filter, select all/none, and import detected workspaces.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/ChooseWorkspaceDialog.java Adds Import button and import/merge logic; refreshes Recent Workspaces UI after changes.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties Adds user-facing strings for the import button and the new import dialog.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java Declares new NLS fields corresponding to the added message keys.

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

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 4ece49d to 48fb3d1 Compare July 7, 2026 15:42
@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch 2 times, most recently from 3913a1a to 16e6ae0 Compare August 31, 2026 14:49
@deepika-u

Copy link
Copy Markdown
Contributor Author

To answer on @merks comments, please find my update below

Each IDE when it starts moves its workspace to the front?

Yes - this is existing platform behavior (ChooseWorkspaceData#workspaceSelected), unchanged by this PR. On launch/OK, the selected workspace is moved to the front of the recent list. Our import feature only adds entries into that same list at bottom now; it doesn't alter this ordering behavior.

When is that preference saved?

Two paths: (a) the existing platform flow saves it as part of normal workspace-selection on launch, and (b) this PR explicitly calls writePersistedData() right after setRecentWorkspaces(...) in both the import and remove flows - so newly imported/removed entries are persisted immediately, not deferred until the IDE actually starts.

When is it loaded and reloaded?

Loaded once at dialog startup from the installation's own prefs. Reloaded in-memory within the same session on every refresh (refreshRecentWorkspacesComposite() - after import, remove, or "Show more..."), so the UI always reflects the latest in-memory state. Across a fresh launch, it re-reads from disk.

When I switch workspaces in an IDE, do I see workspaces from other installations?

No, not automatically - recent workspaces are stored per-installation (that install's own configuration/.settings prefs). Other installations' workspaces only appear if explicitly pulled in via this PR's "Import" action - a one-time, on-demand copy, not a live/shared registry across installations.

Present scope :
A user-scope (product/app-ID-prefixed) storage model was discussed as a possible generalization. Given the added complexity (multi-instance concurrent writes, ordering semantics, per-version isolation), we'll scope that out of this PR and propose it as a follow-up at a later stage.

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch 2 times, most recently from af7d20d to a73b352 Compare August 31, 2026 16:54
@iloveeclipse
iloveeclipse requested a balanced review from Copilot August 31, 2026 17:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from a73b352 to 3f1966f Compare November 4, 2026 17:59
@deepika-u deepika-u changed the title Add workspace import support to Eclipse launcher window Add support to import recent workspaces from previous installations into launcher dialog Nov 5, 2026
@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 3f1966f to 811e88a Compare November 5, 2026 06:29
@deepika-u

deepika-u commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you for all the constructive feedback. I have incorporated all suggestions across the review comments in this latest push. Could you please take a fresh look?

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 811e88a to 8648b9b Compare November 10, 2026 04:06
@deepika-u

Copy link
Copy Markdown
Contributor Author

@iloveeclipse @merks @HeikoKlare
By any chance can anyone take a look on this feature please, Since we are in M3 - sorry to push for this again.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved issues can discard existing or newly imported workspace history, abort imports on malformed preferences, and leave keyboard-focused workspace links outside the visible viewport.

4 open issues
15 resolved since last review

Review effort: Balanced

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 8648b9b to ca0dfab Compare November 12, 2026 06:43
@deepika-u

deepika-u commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi all, please take fresh look when you have time. Thank you for the thorough reviews!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active issues allow equivalent workspace paths to be offered and reported as imported despite being discarded, and can leave newly imported workspace rows clipped until the dialog is resized.

2 open issues
4 resolved since last review

Review effort: Balanced

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from ca0dfab to 6bf0b94 Compare November 12, 2026 10:53
@deepika-u

Copy link
Copy Markdown
Contributor Author

Hi, All the comments are fixed now.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Workspace import can miss valid macOS installations or resolve relative paths to the wrong workspace, while font handling and rebuilt-control styling cause readability and display regressions.

5 open issues
2 resolved since last review

Review effort: Balanced

@deepika-u
deepika-u force-pushed the import_wksp_list_4_5_2026 branch from 6bf0b94 to c53cfe5 Compare November 26, 2026 12:13
@deepika-u

Copy link
Copy Markdown
Contributor Author

Hi, Fixed all the recent comments and its ready for review. Please have a fresh look when you get some time.

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