-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
rust: no details in completion popup #4591
Comments
Thanks for reporting this issue. Is this the expected behavior from the upstream (language server)? 🤔 |
rust-analyzer developers say in rust-lang/rust-analyzer#18351 (comment)
This was added by rust-lang/rust-analyzer#18167 Recommendation sounds very expensive to me (but I do not have any idea about the LSP protocol) and disabling lazy-resolve support sounds better. |
Can you try to move to the next item in the completion list to see if the function detail will be displayed for the previously selected item? |
does not have an effect; details are not shown I do not see any lsp communication in the
Does this really result in better performance? For me, this sounds very expensive. E.g. instead of parsing a "detail" (and perhaps "documentation") attribute in hundreds/thousands of completion candidates, you have to send hundreds/thousands resolve requests, wait for their responses and parse them. |
The point is server can opt-in into this if it makes sense for them. You can see, fetching documentation and details of hundreds/thousands of candidates can be very expensive as it hit disk to get the documentation. Moreover, that fetching happens on every single keystroke that most likely the user doesn't care about. Also, that make processing every keystroke become slower. When lazy-resolving is supported, that means there's no waste to retrieve more information (and potentially disk reading) when the user is typing. Now, after the user has finish typing and starts looking at the candidates, we can start fetching candidates' detail when the user is interacting with normally a smaller number of candidates instead of all candidates. And they should be quicker than fetching the whole data at the beginning so the user would feel LSP run faster as well. |
Sounds like a design flaw of the LSP protocol... Clients should be able to set this per request. E.g. minimal set of information for the per-keystroke action and detailed set for the dropdown list with completions.
I do not see this here:
For my use case I do not see a big reduction of candidates. E.g. often when I look in the completion dropdown list, I have only a raw idea about the method (naming, return type) and have to browse large parts of the list to find the correct one. I am ok with fetching "documentation" lazily (large amount of text which should be displayed only for a selected item); but "detail" is an essential information which should be made available in the dropdown list immediately. |
Even in that case, you will have more time to look at each candidate than having to fetch everything at first. Btw, I've tried with the nightly build of Windows and it seems that the detail is still fetched and not lazy-resolved. |
this seems to make lazy-resolving yet more slower... Hundreds of resolve requests to fill the completion dialog might be no network issue when sent locally. But over TRAMP? What would be the effects when "detail" is removed from "resolveSupport"? Would this attribute be missing from the resolve answer? Or would it just reenable the field in the
At least with rust, the "detail" property is so small compared with the rest of the response, that the difference is probably not noticable.
strange; here it is
and I tested it with |
I think the push for RA to use lazy-resolving is because the language server can be on remote instead of local, at least that's what pointed out in the discussion. Also, the idle delay is controlled by the completion framework (
It's indeed very strange. I'm not sure why. |
It was thought that PR #4610 might solve this, but in testing with rust-analyzer at commit rust-lang/rust-analyzer@fc98e06 along with lsp-mode |
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
With recent "rust-analyzer" versions, completion does not contain details anymore. E.g. with rust-analyzer 1.83.0- nightly (eb4e234 2024-10-09) and later I get
Previous versions (e.g. rust-analyzer 1.83.0-nightly (55a22d2 2024-10-06)) showed
Looking in the io log shows that "detail" and "documentation" attributes are missing with recent rust-analyzer.
See rust-lang/rust-analyzer#18351 too.
Steps to reproduce
Try to complete in rust sources.
Expected behavior
full function signature should be shown in the popup
Which Language Server did you use?
rust-analyzer
OS
Linux
Error callstack
No response
Anything else?
Removing "documentation" + "detail" from
lsp-mode/lsp-mode.el
Lines 3761 to 3762 in 27d6e79
The text was updated successfully, but these errors were encountered: