-
Notifications
You must be signed in to change notification settings - Fork 446
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
Starting from version 1.36.0 it is not possible to use the Quick fix Add constructor in classes that use inheritance #3905
Starting from version 1.36.0 it is not possible to use the Quick fix Add constructor in classes that use inheritance #3905
Comments
I've also been having this exact issue for a while with Eclipse Adoptium JDK 1.8, 11 and 21. I can also confirm that reverting to Operating System: Windows 11 Pro 24H2 (26100.2605) |
Thanks for filing this. I'm able to reproduce even on Linux. Looks like it's a bug from a new feature, #3780 . It's happening somewhere on https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/c61609814aa34e7ddab34afa282cba18bf56f933/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/SnippetUtils.java#L109 . Specifically, Update: I have a fix for this that just works around the issue. It ends up being as good as upstream JDT's generated code action. Just some notes for myself (and possibly others) regarding the
In this case, the JDT api offers the ability to directly link the parameter declaration to the super invocation, so that if the user opts to change "name", it will be updated in both positions dynamically. The problem is that entire constructor has no offsets in the model because it hasn't been applied yet (I think). So the offset ends up being |
Thank you for such a quick response @rgrunber! |
Starting from version 1.36.0 it is not possible to use the Quick fix Add constructor in classes that use inheritance.
I tried following the Troubleshooting guide recommendations and also manually cleaning the workspaceStorage directory. Even reinstalling vscode among other alternatives, the only one that worked was installing the vscode extension from version 1.35.1 downwards.
Sample class
Language Support for Java log
Developer tools log
Other details
The project is a simple class but I'm uploading it:
AddConstructor.zip
Environment
Operating System: Windows 10 Pro x64
JDK version: Eclipse Adoptium JDK 8 / 17 (both can reproduce the problem)
Visual Studio Code version: 1.96.2
Language Support for Java(TM) by Red Hat version: 1.38.0 to 1.36.0
Video demonstration
1.36.0 version (not working): https://vimeo.com/1042281037/c6bad7911b
1.35.1 version (working): https://vimeo.com/1042284085/46e808f05a
The text was updated successfully, but these errors were encountered: