Skip to content
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

Refresh option only available for projects #1904

Closed
2 tasks done
DaveCarpeneto opened this issue May 30, 2024 · 11 comments
Closed
2 tasks done

Refresh option only available for projects #1904

DaveCarpeneto opened this issue May 30, 2024 · 11 comments
Labels
bug Something isn't working regression

Comments

@DaveCarpeneto
Copy link
Contributor

Reporting this against Eclipse IDE for Java Developers, Version: 2024-03 (4.31.0), Build id: 20240307-1437 ( https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2024-03/R/eclipse-java-2024-03-R-win32-x86_64.zip )

This situation is NOT seen in the previous quarterly release (Version: 2023-12 (4.30.0), Build id: 20231201-2043), and I don't see anything mentioned regarding this functionality @ https://eclipse.dev/eclipse/news/4.31/ . As such I'm guessing this is a bug.

I'm using Eclipse on Windows.

Steps to reproduce

A plugin that I work on has a view that extends org.eclipse.ui.navigator.CommonNavigator . In previous versions this provided 'Refresh (F5)' in the contextual menu for any resource. However as of 2024-03 the mentu option only exists for projects, but not other resources.

Fairly easy to trigger / reproduce. Plug-in Spy tells me the following for the menu entry I'm talking about here:

oldEclipseOScript

... I tried to quickly look through things based on this, but I'm not smart enough to see what might be the cause of this.

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
@DaveCarpeneto DaveCarpeneto added the bug Something isn't working label May 30, 2024
@iloveeclipse
Copy link
Member

@DaveCarpeneto
Copy link
Contributor Author

@iloveeclipse : unfortunately still an issue :-(

@DaveCarpeneto
Copy link
Contributor Author

OK, a very kind & intelligent coworker spotted where the change was introduced: eclipse-platform/eclipse.platform#876

... this change means that the 'refresh' option is now only shown for open projects (prior to this change refresh was shown unless one of the selections was a closed project).

So if refresh was indeed intended to be project-only, then this change results in the 'correct' behavior.

If however the Eclipse project would rather continue to allow the refresh menu item for all resources (which is how the JDT plugin des things in the 'Package Explorer' view, and is super-helpful when you have a massive project & you're only looking to refresh a small section) then further changes to bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java would be appreciated, perhaps the following:

 -	// To refresh, even if one project is open
 -	if (hasOpenProjects) {
 +	// To refresh if any selection is (a) an open project, or (b) a non-project
 +	if (hasOpenProjects || !isProjectSelection) {
		refreshAction.selectionChanged(selection);
		menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, refreshAction);
	}

... thoughts? I've not got an environment over here that's convenient to test this, but to me it makes sense & largely allows for the old behavior whilst simultaneously retaining the fix introduced by @vogella via the aforementioned ticket.

@iloveeclipse
Copy link
Member

Please provide a PR

@merks
Copy link
Contributor

merks commented May 31, 2024

It's really easy to set up a development environment automatically via the link there:

https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md#creating-an-eclipse-development-environment

@DaveCarpeneto
Copy link
Contributor Author

Thanks @merks for the link; I'm just checking with my manager as to what legal hoops I need to jump through before I'm allowed to attempt to contribute here.

DaveCarpeneto added a commit to DaveCarpeneto/eclipse.platform.ui that referenced this issue Jun 26, 2024
Returns functionality whereby open projects _and_ non-project resources get the 'refresh' contextual menu (option was removed for non-project resources via the fix @ eclipse-platform/eclipse.platform#876 ).
mickaelistria pushed a commit that referenced this issue Jun 26, 2024
Returns functionality whereby open projects _and_ non-project resources get the 'refresh' contextual menu (option was removed for non-project resources via the fix @ eclipse-platform/eclipse.platform#876 ).
@iloveeclipse
Copy link
Member

Is this fixed via #2003? Please close if that is the case.

@c-delanneau
Copy link

Hello, the problem is still present for me.
I'm on version 2024-09 of Eclipse and I found the code updated by the PR in the package org.eclipse.ui.navigator.resources_3.9.400.v20240722-1923.jar, however the 'Refresh (F5)' menu still doesn't appear when I select a resource in an open project.
Does this work correctly for you?

@DaveCarpeneto
Copy link
Contributor Author

@c-delanneau : no - the fix I submitted was partial. I'm currently getting approval from my org to submit a revised fix. Apologies for the impact on this.

@DaveCarpeneto
Copy link
Contributor Author

As mentioned above, the fix initially checked in was a partial fix. Further changes are needed to resolve this issue.

@DaveCarpeneto DaveCarpeneto reopened this Oct 30, 2024
DaveCarpeneto added a commit to DaveCarpeneto/eclipse.platform.ui that referenced this issue Oct 30, 2024
Further fixes, since the initial change didn't cover all cases
@DaveCarpeneto
Copy link
Contributor Author

Closing, since I've opened #2492 as a new issue so that it gets picked up my project admins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
Development

No branches or pull requests

4 participants