-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
Right now, we automatically add imports on save: https://github.com/georgewfraser/java-language-server/blob/incremental/src/main/java/org/javacs/CompileBatch.java#L291
This works well for scenarios like copy-pasting large blocks of code, but it doesn't work great when you autocomplete:
- User starts typing the name of an unimported class
- User selects a particular unimported class and tab completes
- This class is still not imported, so subsequent autocomplete is broken until the user saves
For example, new SomeNotImportedClass()._
will not autocomplete.
The Language Server Protocol provides for this exact scenario with CompletionItem#additionalTextEdits: https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
Metadata
Metadata
Assignees
Labels
No labels