Skip to content

Conversation

@SougandhS
Copy link
Contributor

@SougandhS SougandhS commented Nov 8, 2025

This change prompts the user when attempting to switch to a workspace in Eclipse that is currently locked by another instance, preventing Eclipse from restarting into the locked workspace. Previously, if Eclipse restarted with a locked workspace, the workspace lock prompt would appear, and clicking “OK” would exit the application, requiring the user to reopen Eclipse to select an active workspace. With this update, the user is warned before switching, informed about the lock via a dialog, and prevented from restarting into the locked workspace, improving workflow and avoiding unnecessary restarts.

Before :

before.mp4

After :
(commented out the initial development mode check for this video)

after.mp4

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 12m 24s ⏱️ - 3m 1s
 8 236 tests ±0   7 987 ✅ +1  249 💤 ±0  0 ❌  - 1 
23 628 runs  ±0  22 834 ✅ +1  794 💤 ±0  0 ❌  - 1 

Results for commit ed5958e. ± Comparison against base commit 2d4334f.

♻️ This comment has been updated with latest results.

@SougandhS
Copy link
Contributor Author

Hi @iloveeclipse, could you please check this PR when you get some time ?

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

I can check on Monday. The idea itself is good.

@BeckerWdf
Copy link
Member

would it be possible to bring up the exact same dialog (with the same information) in both situations?

@SougandhS
Copy link
Contributor Author

would it be possible to bring up the exact same dialog (with the same information) in both situations?

Sure 👍

@SougandhS
Copy link
Contributor Author

would it be possible to bring up the exact same dialog (with the same information) in both situations?

Updated as suggested

My.Movie.mp4

@SougandhS SougandhS force-pushed the PromptOnSwitch branch 3 times, most recently from b3e89f9 to a7c8013 Compare November 11, 2025 00:47
@SougandhS SougandhS force-pushed the PromptOnSwitch branch 3 times, most recently from e2ca711 to fc83bc2 Compare November 12, 2025 14:44
@SougandhS
Copy link
Contributor Author

@iloveeclipse Could u please re-check this ?

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

I believe M3 is the bad time for changing workspace locking code. Take time, test the change also please with the workspace selection dialog that is shown on Eclipse startup, and if everything will work, it could land in the next release.

String wsLockedError = lockMessage + System.lineSeparator() + System.lineSeparator()
+ NLS.bind(WorkbenchSWTMessages.IDEApplication_workspaceLockMessage, workspaceLock);

MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
Copy link
Member

Choose a reason for hiding this comment

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

I've already commented before, if the workspace selection dialog is opened, there is NO active workbench window, not a single window is opened!

I would recommend to move all this workspace locking code to extra class and add a bold statement on the class javadoc that it is used in both workbench / window - free and workbench - created use cases.

* @param workspacePath the new workspace location
* @return {@link IApplication#EXIT_OK} or {@link IApplication#EXIT_RELAUNCH}
* @return {@link IApplication#EXIT_OK} or {@link IApplication#EXIT_RELAUNCH} or
* <code>null</code>
Copy link
Member

Choose a reason for hiding this comment

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

While the returning constants is self explanatory, what does "return null" mean for the caller? NO exit? Don't care? Leave me alone with my problems?
Just imagine you would see this javadoc and not see the implementation. What you would think about this API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add few more details then

Prompts user on attempting to switch to a workspace that is currently
locked by another Eclipse instance, a prompt dialog is now shown
informing the user about the lock details and preventing Eclipse from
exiting

sdsd
@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:

bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
bundles/org.eclipse.ui.ide/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 4f32a5b6fd95dc2f7684b0f9a9b9faa18cf4b409 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Tue, 2 Dec 2025 04:47:34 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
index 8ecfefafc5..653acf36f8 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt;singleton:=true
-Bundle-Version: 0.17.1000.qualifier
+Bundle-Version: 0.17.1100.qualifier
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
index 8e8ed96585..52a3fe6de8 100644
--- a/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.ide.application/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.ide.application;singleton:=true
-Bundle-Version: 1.5.900.qualifier
+Bundle-Version: 1.5.1000.qualifier
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.21.0,4.0.0)",
diff --git a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
index c115a47b5f..0d2916a41c 100644
--- a/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.ide; singleton:=true
-Bundle-Version: 3.22.800.qualifier
+Bundle-Version: 3.22.900.qualifier
 Bundle-Activator: org.eclipse.ui.internal.ide.IDEWorkbenchPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %Plugin.providerName
-- 
2.51.2

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

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