I’ve spent 8 hours or so to get the dev environment to work again in Eclipse, and I’m starting to have a pretty good idea of what happened. This is unrelated to the topic of whether these files should be included in git, but it could be useful for others to be aware of.
I use VSCode for things like HTML, JavaScript, the odd Python and similar things. I don’t consider it a proper IDE, it’s more like an “advanced text editor plus”. But it’s fine for languages where I don’t have a dedicated IDE.
I was a bit frustrated with the GitHub review process and the fact that it’s often so hard to find the code comments (not all appear on the “PR page”, so you just have to scroll through all the changes, and hope that you spot them (some are collapsed)). So, I figured out that you can do reviews from VSCode as well, and as far as I could understand, there’s a key binding to “jump to the prev/next comment”. That sounds like a dream, so I figured I’d give it a go and installed the extension. I then saw that you could only access PRs in the Git repo that was in the “open folder” in VSCode, so I “opened” the root folder of the core repo in VSCode. Never again!
What happened next is that VSCode started “preparing” and whatnot, and essentially crawled almost to a halt. The same with Eclipse, it started building and refreshing constantly. I realized that this smelled like disaster and closed the folder again in VSCode. I’m always afraid of messing up the Eclipse setup because it is so brilliant when it works, but can take hours and hours of frustration when it won’t work. But Eclipse was still going with whatever this had started. I quit VSCode completely, but that made no difference.
I then started doing the things I’ve experienced that usually is needed when Eclipse is acting up - “Update Maven project” for select bundles, rebuilding some from Maven, opening and closing projects and whatnot. I restarted Eclipse completely several times, closing down more and more stuff, but the same thing happened. It wouldn’t really say what it was doing except some generic “preparing index”, “building” and similar, and the progress would either stay at 0% or increase a little bit and then get stuck.
None of “my usual tricks” were working, and I was losing hope that I would be able to get it to work again. I noticed that some .project and .classpath files had been changed (but that happens sometimes because Eclipse does so). But, after much frustration, I looked more closely into that. Since I don’t want these files to be committed, I mark them with “skip worktree” so that Git ignores them despite them being in the repo. So, I opted to “unhide” all files that were hidden by “skip worktree”, and that was when the full consequence was revealed. VSCode had apparently modified a lot (probably would have modified all if it had enough time) of these files, most of which were “invisible” to me since they were marked “skip worktree”. And, somehow these changes made Eclipse go completely crazy. Eclipse was unable to resolve it after chewing on this for hours, after rebuilding core entirely, updating and refreshing everything etc.
I quit Eclipse, and then used Git to revert all these modified files. Once that was done, I started Eclipse, it built like it does, but when it was done, it was actually working again (and this time the progress actually moved).
I found this description online:
Eclipse Compatibility: The VS Code Java extensions use technology from the Eclipse JDT Language Server. To manage project configurations (like source paths, libraries, and settings), the extensions use standard Eclipse metadata files, including .project and .classpath.
To translate, what it actually does is corrupt these files in such a way that Eclipse is unable to work. All the changes VSCode does must be reverted to get things up and playing again, and this is done “without your consent” simply by opening the “folder” with the Git repo in VSCode. This is actually a very bad thing to do, and people need to be aware of this. I think the VS Code Java extension is “dangerous” to have installed. If I couldn’t use Git to revert them, I would probably have had to delete them all (it’s too much work to figure out what was “wrong” and how to fix that manually in all these files), and import every bundle again. I still lost all the settings I have made for individual bundles, but it could have been worse.
Extremely bad behavior by the VS Code Java extension.