java-language-server icon indicating copy to clipboard operation
java-language-server copied to clipboard

Add-import code action

Open georgewfraser opened this issue 6 years ago • 0 comments

Currently, JLS tries to automatically add imports on save. This works well for scenarios like copy-paste, but sometimes the correct import is ambiguous and it does nothing. Implementation is here:

https://github.com/georgewfraser/java-language-server/blob/65ca5e4e77e31edddefc1bb78e476912cf7c2ea3/src/main/java/org/javacs/CompileBatch.java#L291

We should have a code action to add imports, like TypeScript.

#44

@albfan

georgewfraser avatar May 05 '19 21:05 georgewfraser