Skip to content

Replace PROJECT_OPEN_NEW_PERSPECTIVE Constant with IDE.Preferences Equivalent #2971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elsazac
Copy link
Member

@elsazac elsazac commented May 12, 2025

The effective preference used by Eclipse is now under org.eclipse.ui.ide.
The deprecated constant (IWorkbenchPreferenceConstants.PROJECT_OPEN_NEW_PERSPECTIVE)
from org.eclipse.ui no longer affects the current project-opening behavior.

@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.swt;bundle-version="[3.128.0,4.0.0)";visibility:=reexport,
org.eclipse.jface;bundle-version="[3.34.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.workbench;bundle-version="[3.130.0,4.0.0)";visibility:=reexport,
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="3.22.600"
Copy link
Member

Choose a reason for hiding this comment

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

This adds cyclic dependency

Copy link
Member Author

@elsazac elsazac May 12, 2025

Choose a reason for hiding this comment

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

Is the presence of cyclic dependencies discouraged ?; is it okay to add the bundle requirement in the Import-Package instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we would want to make an IDE-independent part depend on the IDE all of a sudden, even if it were allowed (and it's not allowed.)

Copy link
Member Author

Choose a reason for hiding this comment

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

@merks Do you have any suggestions to go about this fix?

Copy link
Contributor

github-actions bot commented May 12, 2025

Test Results

 2 778 files  ±0   2 778 suites  ±0   1h 38m 53s ⏱️ + 2m 33s
 7 929 tests ±0   7 701 ✅ ±0  228 💤 ±0  0 ❌ ±0 
23 340 runs  ±0  22 594 ✅ ±0  746 💤 ±0  0 ❌ ±0 

Results for commit e0fa32b. ± Comparison against base commit f7d94e2.

♻️ This comment has been updated with latest results.

@merks
Copy link
Contributor

merks commented May 12, 2025

Maybe the deprecated addition (from 2004) should finally be removed from the preferences initializer?

image

@elsazac
Copy link
Member Author

elsazac commented Jun 19, 2025

Maybe the deprecated addition (from 2004) should finally be removed from the preferences initializer?

Can this be removed now? , as the effective preference used by the Eclipse IDE is the one under org.eclipse.ui.ide, not the one in org.eclipse.ui? I don’t think the deprecated one (IWorkbenchPreferenceConstants.PROJECT_OPEN_NEW_PERSPECTIVE) no longer influences current project-opening behaviour.

@merks
Copy link
Contributor

merks commented Jun 19, 2025

Yes I doubt it’s relevant

@elsazac elsazac force-pushed the UseIDEPref branch 2 times, most recently from ba478d0 to 06018c8 Compare June 20, 2025 12:11
@elsazac elsazac requested a review from iloveeclipse June 23, 2025 05:40
@elsazac
Copy link
Member Author

elsazac commented Jun 24, 2025

Yes I doubt it’s relevant

I’ve pushed the changes again — is this good to go now?

in IWorkbenchPreferenceConstants interface is deprecated and marked for
removal and hence it can be replaced with public static final String
PROJECT_OPEN_NEW_PERSPECTIVE = "PROJECT_OPEN_NEW_PERSPECTIVE" present in
IDE.Preferences.

Fixup : effective preference used by the Eclipse IDE is the one under
org.eclipse.ui.ide, not the one in org.eclipse.ui. deprecated
IWorkbenchPreferenceConstants.PROJECT_OPEN_NEW_PERSPECTIVE no longer
influences current project-opening behaviour.
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.

3 participants