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
Auto complete class methods even in the presence of compilation errors #2922
After an error, auto completion stops working until the compilation error is fixed.
Environment
Operating System: MacOS 13.1
JDK version: 17.0.3
Visual Studio Code version: 1.75.0
Java extension version: v1.14.0
Steps To Reproduce
When writing code with argument auto completion, it may generate a compilation error. Auto complete doesn't work after such error until it's fixed. Other IDEs have the ability to auto complete even in the presence of previous compilation errors.
Let's say that I'm writing code by completing a builder:
MyProject.builder().projectInfo(projectInfo).
At that point, if projectInfo variable is not defined, the next point will not get useful auto-complete information, like further methods of the builder or the build() method.
If I define the projectInfo variable:
String projectInfo = "my project info"
MyProject.builder().projectInfo(projectInfo).
Now it auto completes correctly.
IntelliJ always shows the auto complete information for a class, even if a compilation error, or multiple compilation errors, are present in the code previous to the moment in which you put the '.'
I don't know if it's a limitation of the language server, but it's something really nice in IntelliJ that can improve a lot the usability of VSCode when developing for Java.
Current Result
After a compilation error, writing a '.' doesn't show any meaningful class methods. It just shows some generic, non useful suggestions.
Expected Result
After a compilation error, writing a '.' shows the meaningful methods for the class as if the compilation error wasn't present.
Additional Informations
The same situation in IntelliJ shows the class methods.
Hi, I don't know if it is the same bug but after last update fix error does not working, only when I reaload vs code windows and after a new error the same problem appear. I provide an image. I tried to downgrade version of the pluguin "Language support of java by Red hat" but did not fix the problem.
Completion now works better in the presence of compilation errors. Both @getaceres and @snjeza's snippets now autocomplete despite the undefined variables.
Activity
snjeza commentedon Feb 7, 2023
This is an upstream jdt issue. I can reproduce it in Eclipse.
An example:
giacomoF5 commentedon Feb 15, 2023
Hi, I don't know if it is the same bug but after last update fix error does not working, only when I reaload vs code windows and after a new error the same problem appear. I provide an image. I tried to downgrade version of the pluguin "Language support of java by Red hat" but did not fix the problem.
Kind Regards,
Giacomo
snjeza commentedon Feb 15, 2023
@giacomoF5 It is a different issue. Could, you, please, create a new issue?
fbricon commentedon Oct 15, 2025
Completion now works better in the presence of compilation errors. Both @getaceres and @snjeza's snippets now autocomplete despite the undefined variables.