-
Notifications
You must be signed in to change notification settings - Fork 78
All completion proposals filtered out from YAML language #218
Comments
Actually, it's not just YAML, it's |
To reproduce:
This package lets you edit Create
Note that there is no CA shown... however if you type a space or Roll back to the initial content with no prefix for the memory value (as show above) Note that |
I'm experiencing the exact same problem with the Serenata language server; I'm trying to return an intelligent list of results from the server, but the culprit call to fuzzaldrin's I understand this filtering and ordering may be useful and sometimes even desirable, but in some cases the server knows what's best for the language and should get complete dictatorship over the list. The client may still identify matching characters in the result, of course, but it may not filter or re-sort. It may be worth looking at the |
There have been some changes to autocomplete in the current master branch, so I would like to know how they affect your issue. I’m not sure what you mean by disallowing filtering and sorting though; do you want the server to recalculate and provide a new list on every character typed? The client will normally only request the completion once, presenting the initial ones ordered via sorttext, and use the filtertext property to sort and filter them as the user types. Requesting each time seems quite wasteful, especially for large amounts of completions. Finally, to disallow it would need to be in the LSP spec somewhere, which if we are not following would be a legitimate bug. If it is a custom extension, you would first need to get it into the LSP spec. |
Thanks for your reply. I made some new discoveries after I posted, and I'll list them here: I did not know about the Suggesting, as I did, that the client not filter at all, is probably wrong. The This suggests that either filtering is being applied on top of what is returned by the server (which already consists only of filtered matches on the same text, in my case), and this filtering results in different results, or the filtered results are the same, and the ordering is altered afterwards, disregarding the For what it's worth, I can currently work around this additional filtering and sorting by doing the following, which may help someone: getSuggestions(request) {
request.prefix = '';
return super.getSuggestions(request);
} The prefix is not used anywhere else and used to determine whether filtering must be applied. Finally, your statement The reason for recalculating is that, in order for the client to filter based on the prefix, the full set of relevant results must be returned that are relevant in that context. This includes classes, functions, and other relevant structural elements. There are thousands of these in a fairly large code base in my case, which need to be transmitted over the socket (every time a new cursor location is used and the client cannot fall back to its cache), just so the client can apply its filtering. This is not only expensive for the server to send, it is also expensive for the client to process and filter. Furthermore, this list changes fairly often, as new structural elements are added or renamed, so any client side cache is short-lived. I used this approach in php-ide-serenata before it was a language client, and it was... not great, to say the least, CPU spiked every so often to ship over the new lists. You cannot limit in a fashion similar to "return 10 arbitrary classes, return 10 arbitrary functions" either, as then the client will not be able to filter out relevant matches once the user starts typing (since they were never returned, to begin with). You then automatically end up at letting the server do a reasonable amount of filtering based on the prefix before sending the results back, to reduce the result count, at which point you're basically already fuzzy matching server side and all filtering performed by the client becomes pretty much unnecessary. Of course, I may simply have reached the boundary of my abilities, and someone else has a genius suggestion that will fix all my problems 😄 . |
Development of atom-languageclient has officially moved to https://github.com/atom-ide-community/atom-languageclient 🎉 If this is still an issue please consider opening an issue on that repo. |
memory: 1^
- works with atom language client and shows proposals coming from the LSmemory: ^
- doesn't show any proposals, but language client receives proposals from the LSThe culprit of the problem is around here: https://github.com/atom/atom-languageclient/blob/master/lib/adapters/autocomplete-adapter.ts#L103-L107
The
prefix
of the request:": "
but the trigger is""
. The LS is unaware of theprefix
is not part of LSP. The proposals text does not include": "
I'm guessing this is the reason from0
score and consequently all proposals from the server are filtered out...Perhaps this is something special about the YAML grammar definition... wonder if we could put a workaround in the language client to include proposals with
0
score or make the new filtering optional such that it could be turned off by setting a flag inAutoLanguageClient
?The text was updated successfully, but these errors were encountered: