nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Autocompletion for already existing identifiers #142

Closed wclr closed 2 years ago

wclr commented 3 years ago

There is an annoying case for autocompletion: when already have, say singleton imported from Data.Array, when I start typing this identifier it offers autocompletion with another variant first in the list (from Control.Monad...).

image

Usually still convenient and automatic to use autocompletion: press tab, it inserts the import, has to press Ctrl+Z so it removes the import. This is still annoying and seems bad experience.

So it either should just show only one completion variant (from the existing import). Or show this variant as the first in the list. Any suggestions on how this can be dealt with?

nwolverson commented 3 years ago

Yes, that is annoying.

The information on the current module imports is available when we do the completion request. In fact there is or was an option to only complete from existing imports so some of the logic may be there already. Whether it requires post-processing or 2 requests should be very possible in the language server.