-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completions highlighted but not narrowed #79
Comments
It looks like the server didn't receive content update when typing, or server responded regardless the update. Can you try the following:
Thanks |
Same problem here, using company-tng.
|
Looks like the php lang server does no filter candidates, or provide sorting hints. This contradicts with other language servers. I can provide a custom option to use prefix filter for the result. |
On a second thought, can you set |
Should this be brought upstream, is it against spec? The PHP server is written in PHP, so one could make a case for leaving the sorting and filtering of suggestions to the LSP client which might be more efficient in string handling. |
I can confirm the same behaviour for the Microsoft Python Language Server so I don't think it's PHP specific. |
I wish to report the same for |
Same with |
So it's common that language servers return unfiltered candidates. I'll implement client-side filtering so that it works regardless of the value of |
That's great! This implementation targets vscode which caches the candidates once the server returns |
A new custom option `company-lsp-filter-candidates` is added to allow customizing whether or not to filter candidates when `company-lsp-cache-candidates` is set to nil. The option can be either set to a boolean, or an alist for configuring it on a per-server basis. When `company-lsp-cache-candidates` is set to non-nil values, this option doesn't affect the filtering behavior since candidates are always filtered in this case. This should fix #79.
Hi all, please take a look at pull request #86 which is supposed to fix this issue. I'll merge it in a week or upon the first few LGTM. I've tried it with JS language server and it worked for me. However I don't use the JS/CSS language servers on a daily basis so I don't have enough usage for this change yet. |
If you set |
I can report the same behaviour for lsp-python.
becomes
Its hard to explain, I hope you know what I mean. What is that and how can I change that? |
@CDitzel The easiest way to set But lsp-python should support server-side filtering. I don't have this issue on my side. I wonder if something is wrong in synchronizing the editor content with the server. Can you turn on |
thank you for your reply. The two problems remain.
I appended the output of the log buffer below also when I open a python file, there is this content initially in the log buffer
What is the difference between the MS language server and palantir/pyls? My entire config file is quite small and reads
|
I have the very same issues as @xendk describes |
@xendk @CDitzel I suspect there is something wrong with your The first few lines in my help doc is shown as follows:
|
will do that a soon as I get home. In the meantimey this video shows how vanilla emacs acts when I only include lsp stuff and nothing else and enter a python file https://youtu.be/IVHt9G7aaNA |
This is an attempt to solve the out-of-order response from language servers. Possible mitigation for #79.
@CDitzel Thanks for trying out vanilla emacs. Now I'm suspecting if it's caused by company-lsp not handling out-of-order response correctly. It seems to me that your Python language server is substantially slower than mine. Not sure if it's caused by the number of packages installed on your side. Can you try out #90 to see if it mitigates your issue? |
This is an attempt to solve the out-of-order response from language servers. Possible mitigation for #79.
This is an attempt to solve the out-of-order response from language servers. Possible mitigation for #79.
A new custom option `company-lsp-filter-candidates` is added to allow customizing whether or not to filter candidates when `company-lsp-cache-candidates` is set to nil. The option can be either set to a boolean, or an alist for configuring it on a per-server basis. When `company-lsp-cache-candidates` is set to non-nil values, this option doesn't affect the filtering behavior since candidates are always filtered in this case. This should fix #79.
This is an attempt to solve the out-of-order response from language servers. Possible mitigation for #79.
I will, thank you. If I download company-lsp from melpa now, it has the changes included already I guess? I dont use straight until now... |
Ok so I tried it and I cant really tell if there is a difference. I am using a minimal config, i.e. only lsp stuff is included. And for both palantirs as well as MS-lsp implementation the delay/lag/freeze if typing is so high that I cannot work with it. This problem occurs on both my powerful working machine as well as on my lenovo laptop. No idea what the problem is or where it originates from |
@CDitzel do you still see the narrowing issue? High latency may come from JSON parsing or language server. That part I don't have control of. Does setting If you experience this issue when working on open source projects, please let me know which project you are working on. I'd like to try it out to get similar performance issue as you experienced, so that I can investigate possible solutions. |
Here the same as xendk. |
Per spec filterText should be used for filtering when the server provides it. If it's not provided, label should be used. Some language server such as clangd adds some prefix to labels, such as empty spaces. They don't work well with prefix-based filter since the additional prefix will never match the completion prefix. Should fix #92 and may also help #79.
Per spec filterText should be used for filtering when the server provides it. If it's not provided, label should be used. Some language server such as clangd adds some prefix to labels, such as empty spaces. They don't work well with prefix-based filter since the additional prefix will never match the completion prefix. Should fix #92 and may also help #79.
Per spec filterText should be used for filtering when the server provides it. If it's not provided, label should be used. Some language server such as clangd adds some prefix to labels, such as empty spaces. They don't work well with prefix-based filter since the additional prefix will never match the completion prefix. Should fix #92 and may also help #79.
I'm still struggling in making php-ls working for me :( I guess the problem is that php-ls is too slow and it takes too much time for the server to return the candidates when typing more characters? What's the value of |
I take my word back. I finally successfully setup php-ls and tried it out. It turned out that the server only sends back completion candidates for the first completion request. After that the server always sends back empty list for me. I think it's a server bug. |
@tigersoldier can we try to specify the trigger type in the completion request?
|
@yyoncho It doesn't look like a completion issue. My experience is that whenever I change anything, e.g. deleting a line, the server stops working. The server does send response for completion, but the candidates are just an empty list with incomplete set to true |
I filed felixfbecker/php-language-server#708 upstream. This may just be some error in my setup but I need to make it work so that I can look into the php issues on company-lsp side. |
I have been using company-lsp for PHP completion. The completion seems to be working as expected, but instead of narrowing the completion results, it is highlighting only.
e.g.
Using:
The text was updated successfully, but these errors were encountered: