-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
corfu for variables not working in php-mode with serenata ls #3817
Comments
I've figured it out. I'd followed minads instructions for setting up corfu with lsp-mode, which configures the completion style for lsp-capf. The problem with that is that lsp-mode configures its own The reason why it breaks variable completion with the serenata language server (might not be the only one, but that what I have available) without Removing the configuration from the wiki doesn't help, as that kills all variable filtering and just presents a popup with all the variables (makes sense, corfu lets the completion style handle filtering, and This is not limited to corfu, vanilla I've read up on the PR #2975 and the issue #2970, which is what introduced I've come up with a possible solution, see #3825 |
Company restarts the Capf on every keypress, such that the language server is called again on every keypress. Therefore the passthrough style works for Company. Corfu works differently. It calls the Capf once, obtains the completion table and caches it. Then the candidates are filtered using the completions style. In case you want to emulate the Company behavior you can use the cape-capf-buster, which busts the cache and recalls the Capf on every keypress. The advantages of the Corfu behavior are efficiency thanks to the cache and the flexibility offered by the completion styles. You can for example use Orderless filtering on the cached completion table. The downside is that you don't get immediate updates from the Lsp server, but you could use the cape-capf-buster if you prefer that and if you can live with the lower completion performance. |
Closing this as the problem seems limited to the one server, which is minimally maintained these days anyway. |
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
When using corfu as completion frontend rather than company, assuming a defined
$varname
, completing$var
doesn't work. Typing thevar
prefix without the$
does work, and adds the missing$
.@minad says it must be a lsp-mode issue.
Steps to reproduce
Haven't been able to make one yet.
lsp-start-plain
didn't make me wiser as it only have company (which works).Expected behavior
That
$varname
can be completed by typing$var
rather thanvar
.Which Language Server did you use?
PHP, serenata
OS
Linux
Error callstack
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: