Description
A feature I remember from Java IDEs that was very nice was that completion would offer options from modules that were not (yet) imported, but were available. Selecting that completion would also insert the appropriate import. When combined with auto-organizing imports this lets you almost ignore imports and just work from the completion prompt.
I think we could do this, although there's a risk that we might end up returning a really large number of completions! Completions from other modules in the package, would be nice, but doing it for dependencies too would be great. I would love to be able to just complete Map
and have it imported!
(The LSP protocol supports this: CompletionItem
s have a list of additionalTextEdit
s which even calls out "adding an additional import at the top of the file" as a example usecase.)