eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

Support open closed projects with missing .project file

Open laeubi opened this issue 2 months ago • 4 comments

Currently when the .project file was deleted, the project is shown as closed in Eclipse (what is somehow fine).

But when one then tries to open the project a nasty error dialog is shown:

The project description file (.project) for ''{0}'' is missing. This file contains important information about the project. The project will not function properly until this file is restored.

but we already store the important data in the workspace area with https://github.com/eclipse-platform/eclipse.platform/pull/2033

a much better approach therefore would be to restore as much data as we can and show a warning and we actually have already

The project description file (.project) for ''{0}'' was missing. This file contains important information about the project. A new project description file has been created, but some information about the project may have been lost.

laeubi avatar Nov 13 '25 10:11 laeubi

Currently when the .project file was deleted, the project is shown as closed in Eclipse (what is somehow fine).

What about deleting the project from workspace in such case?

But when one then tries to open the project

Should we offer the possibility to open the project in such case. ie shouldn't action be disabled?

In case no project description is available, the appropriate action would probably be to re-run the importer for this project instead. So the "Open Project" could be replaced by some "Reimport project".

mickaelistria avatar Nov 13 '25 11:11 mickaelistria

What about deleting the project from workspace in such case?

Well currently one needs to do that and then needs to import it again (what the creates an empty project file). Especially when switching branches or stashing / reset its not very convenient.

Should we offer the possibility to open the project in such case. ie shouldn't action be disabled?

I'm not sure what would be the immediate benefit of that?

In case no project description is available, the appropriate action would probably be to re-run the importer for this project instead.

maybe yes, maybe no ... but currently it is not possible because Eclipse complains that a project with that name already exits in the workspace ;-)

laeubi avatar Nov 13 '25 11:11 laeubi

Without looking into the code, just from user perspective.

There are multiple ways how this problem (missing .project file) can happen, like

  • branch switch / update / bisect back that removes the .project file or entire project
  • external file tree changes

If the original data is "lost", the metadata should be updated to remove the "zombie" (assuming we can do that without other side effects) and a warning should be shown (or just logged) that the project was removed from the workspace.

Once removed, all follow up problems would disappear, such like:

the project is shown as closed creates an empty project file Eclipse complains that a project with that name already exits in the workspace

iloveeclipse avatar Nov 13 '25 13:11 iloveeclipse

If the original data is "lost", the metadata should be updated to remove the "zombie" (assuming we can do that without other side effects) and a warning should be shown (or just logged) that the project was removed from the workspace.

Well for me it is an side effect if some project suddenly disappears and I need to import it again (hopefully I remember the location!).

Once removed, all follow up problems would disappear,

The problem is that I don not want it to disappear at all... that Eclipse requires a .project file is more an implementation detail for me. Also Eclipse seems to be happy unless I try to open such project (again).

laeubi avatar Nov 13 '25 14:11 laeubi

Do not recreate a .project file after a branch switch that deletes it. It pollutes VCS repository and creates random metge conflicts.

basilevs avatar Nov 30 '25 07:11 basilevs