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 15m 38s ⏱️ - 2m 55s
 8 234 tests ±0   7 985 ✅ ±0  249 💤 ±0  0 ❌ ±0 
23 622 runs  ±0  22 828 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit fc83bc2. ± Comparison against base commit 6d2b614.

♻️ 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 2 times, most recently from 9691ac5 to e2ca711 Compare November 12, 2025 14:44
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
@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

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.

4 participants