You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renaming a variable leads to entire contents of the file editor being replaced with one word- Error #1974
I tried setting up an new project in my workspace and tried editing a JS file by refactoring (renaming) a variable which led to the entire contents of the file being replaced with just one word 'Error'. I would have to close the file and open it again to see its modified contents, which are correct.
What I've observed:
I've observed that this only happens in a nested Gradle project which contains both Java and JavaScript files. I tried the same in a different project (not a Gradle project with sub-projects) and it worked without any issues.
I created a new file in my project with just one small function with two lines and the same thing happened again.
There are no unique errors reported in the 'Error Log' or 'Problems' view when comparing the two projects (one where the issue occurs and the other where it doesn't).
I enabled printing language server logs to the 'Console' view and observed that there was no mention of words 'error' or 'parse' in the Console.
I predicted it would be an issue with JSDT, so I downloaded Spring Tools Eclipse IDE which doesn't contain JSDT and I still get the same issue.
Any help would be appreciated.
Thank you for developing this project.
changed the title [-]Renaming a variable leads to entire contents of the file being replaced with one word- Error[/-][+]Renaming a variable leads to entire contents of the file editor being replaced with one word- Error[/+]on Nov 19, 2025
Generate a sample Spring Boot project, lets call the directory 'demoAppOne'
Create a copy of the entire project and name the directory 'demoAppTwo'
Place both projects in a parent directory called 'NewGradleProjectSample'
Create a settings.gradle file in the parent directory and remove the same in the two child directories
Import the parent directory as a Gradle project in Eclipse IDE.
Create a sample JS file in one of the two sub-projects (NewGradleProjectSample/demoAppOne/src/main/webapp/js/testFile.js)
Make sure that sub-projects are recognized by right clicking the root directory and selecting Gradle -> Refresh Gradle Project.
Try re-naming a variable in the JS file.
I normally wouldn't create a Gradle project this way, just did the above steps for the sake of re-creating the issue.
I've created a sample repo: https://github.com/iamnotserious/NewGradleProjectSample
Please let me know if you want any more information.
One temporary workaround was to remove the project (delete, including the nested projects) from the workspace. Then delete files generated by Eclipse using the file explorer (.classpath, .settings/, .project and bin/). Now choose to import a new project with the option "Projects from the Folder or Archive" and select only one nested project folder to import. Build the classpath for the new project via Terminal using 'gradle eclipseClasspath'. Refresh the project in Eclipse. Now renaming variables in JS file works. TLDR: I would have to import each nested project as a separate project.
I still don't know what causes the issue, if its a bug in a component of the IDE or something that I've done wrong.
Update: following this answer also seems to work: https://stackoverflow.com/a/45975110/1668384
In the parent project's properties, I added a Resource Filter (Exclude All) that excluded each sub-project directory.
This still appears to be a bug, I'd love for someone to clarify or explain what went wrong.
Activity
[-]Renaming a variable leads to entire contents of the file being replaced with one word- Error[/-][+]Renaming a variable leads to entire contents of the file editor being replaced with one word- Error[/+]mickaelistria commentedon Nov 19, 2025
Can you please provide detailed minimal steps to reproduce from a fresh Eclipse workspace?
iamnotserious commentedon Nov 19, 2025
@mickaelistria
I normally wouldn't create a Gradle project this way, just did the above steps for the sake of re-creating the issue.
I've created a sample repo: https://github.com/iamnotserious/NewGradleProjectSample
Please let me know if you want any more information.
iamnotserious commentedon Nov 21, 2025
Hi, was any one able to take a look at this? I'm using the latest version of MacOS.
iamnotserious commentedon Nov 22, 2025
One temporary workaround was to remove the project (delete, including the nested projects) from the workspace. Then delete files generated by Eclipse using the file explorer (.classpath, .settings/, .project and bin/). Now choose to import a new project with the option "Projects from the Folder or Archive" and select only one nested project folder to import. Build the classpath for the new project via Terminal using 'gradle eclipseClasspath'. Refresh the project in Eclipse. Now renaming variables in JS file works. TLDR: I would have to import each nested project as a separate project.
I still don't know what causes the issue, if its a bug in a component of the IDE or something that I've done wrong.
iamnotserious commentedon Nov 27, 2025
Update: following this answer also seems to work: https://stackoverflow.com/a/45975110/1668384
In the parent project's properties, I added a Resource Filter (Exclude All) that excluded each sub-project directory.
This still appears to be a bug, I'd love for someone to clarify or explain what went wrong.