Skip to content

Auto complete class methods even in the presence of compilation errors #2922

@getaceres

Description

@getaceres

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.

image

If I define the projectInfo variable:

String projectInfo = "my project info"
MyProject.builder().projectInfo(projectInfo).

Now it auto completes correctly.

image

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

image

The same situation in IntelliJ shows the class methods.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions