atom / atom-languageclient

Language Server Protocol support for Atom (the basis of Atom-IDE)
https://ide.atom.io/
MIT License
389 stars 78 forks source link

Reconsider filtering autocompletion results, especially when results are complete #150

Closed rictic closed 6 years ago

rictic commented 6 years ago

Previous issue: https://github.com/atom/atom-languageclient/issues/41

Given a CompletionList with isIncomplete === false, the language client can provide lower latency filtering and scoring of results than the server can, and often this will be much lower latency as many servers are going to parse the document before they return results. Since the results are known to be complete, the server doesn't need to be queried at all for filtering of results.

This seems to be the intent of the LSP spec as well, since CompletionItems have a filterText property.

For the moment I'm going to do as @josa42 did and import fuzzaldrin and do the filtering on the server side for Atom users, but I think the user experience would be improved by doing filtering and scoring on the client instead.

rictic commented 6 years ago

Actually, if I filter on the server side then the results must be sent down with isIncomplete === true. So I'm going to send over a property in my atom client's capabilities to indicate that it doesn't do filtering, so that I can only do client-side filtering for clients that don't do it.

damieng commented 6 years ago

There's a lot of work going on autocomplete right now including https://github.com/atom/atom-languageclient/pull/128 which has the filtering and trigger character implementation. Also https://github.com/atom/atom-languageclient/pull/148 has the resolve implementation waiting on a merge into autocomplete+

damieng commented 6 years ago

Tracking on the other issue.

rictic commented 6 years ago

Which other issue, so I know which one to subscribe to?

damieng commented 6 years ago

https://github.com/atom/atom-languageclient/pull/128