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

Always remove deleted projects from working sets #2250

Open
2 tasks done
HannesWell opened this issue Sep 6, 2024 · 11 comments
Open
2 tasks done

Always remove deleted projects from working sets #2250

HannesWell opened this issue Sep 6, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@HannesWell
Copy link
Member

Suggestion

If I delete a project from the disk via the package explorer it often happens it remains as closed project in the working set it was assigned too. This is especially annoying because I then cannot delete the project from the working set because the dialog then says that the project does not exist anymore and therefore cannot be deleted.
A workaround seems to be to explicitly remove the project from the working sets (e.g. in its properties).

Ideally the latter would always happen automatically when a project is deleted.

Community

  • I understand suggesting an enhancement doesn't mandate anyone to implement it. Other contributors may consider this suggestion, or not, at their own convenience. The most efficient way to get it fixed is that I implement it myself and contribute it back as a good quality patch to the project.
@HannesWell HannesWell added the enhancement New feature or request label Sep 6, 2024
@jukzi
Copy link
Contributor

jukzi commented Sep 9, 2024

duplicate of eclipse-platform/eclipse.platform#1074 ?

@iloveeclipse
Copy link
Member

Interestingly, I always (since years) work with working sets and never needed to delete any project from working set after project deletion.

I guess it's not about working sets, but about projects remaining "known" by the workspace after they were deleted outside of Eclipse and so shown in all "explorers"?

@HannesWell
Copy link
Member Author

duplicate of eclipse-platform/eclipse.platform#1074 ?

Not exactly, but it happens in the same scenario. While it is probably makes sense to work on both at the same time, this is only about projects removed from the file-system staying in working sets.

I guess it's not about working sets, but about projects remaining "known" by the workspace after they were deleted outside of Eclipse and so shown in all "explorers"?

As far as I can tell from my experiments the projects are not displayed when e.g. the Package-Explorer is configured to have project's as top level elements. But they remain present if working sets are selected as top level elements and I still can remove them from the configuration of the working set in its settings.

@opcoach opcoach added the good first issue Good for newcomers label Sep 30, 2024
@jim-zy
Copy link

jim-zy commented Oct 6, 2024

I'm working on this

@HannesWell
Copy link
Member Author

I'm working on this

Great. You are one of the students from CodeDays, aren't you?

Much success on this task and don't hesitate to ask for help if you need any.

@A-Lauper
Copy link

Hi, I am part of Jim’s student team with CodeDay. Thank you for your words of encouragement.
I am having difficulty reproducing the issue as I understand it.

What I have tried:

Attempt 1
Set the Package Explorer top level elements to “working sets”.
Delete from disk a project assigned to a working set through the Package Explorer in Eclipse.
The project appears to have been removed from the working set.
Video: https://www.youtube.com/watch?v=uq35eJurQW8

Attempt 2
Delete a project from the system file explorer outside of Eclipse.
The project remains in the working set.
If I refresh the Package Explorer, it detects that the project has been deleted and prompts to delete the project from the workspace.
Video: https://www.youtube.com/watch?v=FeAUICRkyxY

I have attempted with both Java and Resource working sets and have had the same results.

To clarify, is the issue that projects are not automatically removed from the workspace when deleted outside of Eclipse, or is the issue directly related to when projects are deleted through the Package Explorer in Eclipse?

Build Id Information:
Eclipse Platform
Version: 2024-12 (4.34)
Build id: I20241016-2000
OS: Windows 11, v.10.0, x86_64 / win32
Java vendor: Oracle Corporation
Java runtime version: 17.0.11+7-LTS-207
Java version: 17.0.11

Thank you!

@jim-zy
Copy link

jim-zy commented Nov 1, 2024

I'm working on this

Great. You are one of the students from CodeDays, aren't you?

Much success on this task and don't hesitate to ask for help if you need any.

Hi, we found the same issue when deleting plug-in projects from a plug-in working set, the project remains in the working set after deleted in the package explorer, did you encounter the issue with plug-in project? @HannesWell

@HannesWell
Copy link
Member Author

Sorry for the delayed reply.

I'm working on this

Great. You are one of the students from CodeDays, aren't you?
Much success on this task and don't hesitate to ask for help if you need any.

Hi, we found the same issue when deleting plug-in projects from a plug-in working set, the project remains in the working set after deleted in the package explorer, did you encounter the issue with plug-in project? @HannesWell

Great! Yes I encountered this problem with a Plug-in project (i.e. with a project that has PDE's nature org.eclipse.pde.PluginNature specified in the .project file.
I haven't tested it with projects that don't have that nature. Can you check if the nature makes a difference? If yes that could already be a strong hint for the underlying cause.

@jim-zy
Copy link

jim-zy commented Nov 3, 2024

Sorry for the delayed reply.

I'm working on this

Great. You are one of the students from CodeDays, aren't you?
Much success on this task and don't hesitate to ask for help if you need any.

Hi, we found the same issue when deleting plug-in projects from a plug-in working set, the project remains in the working set after deleted in the package explorer, did you encounter the issue with plug-in project? @HannesWell

Great! Yes I encountered this problem with a Plug-in project (i.e. with a project that has PDE's nature org.eclipse.pde.PluginNature specified in the .project file. I haven't tested it with projects that don't have that nature. Can you check if the nature makes a difference? If yes that could already be a strong hint for the underlying cause.

Yes, the nature matters and a Java project could be deleted automatically from the working set. Also, I found that the PDE related problem you mentioned could be solved if you press F5 as the refresh button in the project explorer, then the project that was deleted from the package explorer will disappear. So this could be a UI problem.

@HannesWell
Copy link
Member Author

I also did some experiments and for me the nature of the project didn't made a difference.

In general the modification of working-sets seems not to work well, even additions didn't always work in my workspace with many working sets and many projects and not the creation of the working sets themself was displayed in the Package Explorer immediately.

But since I couldn't create the working-set or project a second time, then the error was that it already exists, I agree that it's probably a UI problem.

One cause could maybe also be that the org.eclipse.ui.navigator.resources.ProjectExplorer provided by eclipse.platform.ui
and the org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart provided by eclipse.jdt.ui interfere somehow.

Maybe you can check those two classes if they might interfere or if they are maybe not correctly updated if the underlying resource model changes?

@freyajiang
Copy link

just discovered that deleting projects from the Package Explorer triggers the removeWorkingSet(IWorkingSet workingSet) function in the codebase. This might be a useful starting point for addressing the issue at hand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants