-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add option to condense completion menu items (would address #581) #582
base: main
Are you sure you want to change the base?
Add option to condense completion menu items (would address #581) #582
Conversation
i like your idea, but:
|
i knew your idea, but my concern:
1. d.word maybe empty, so you compared abbr's len with word's len, maybe wrong?
2. something cfg e.g 'filterCompletionDuplicates' if on, i am worried you changing those value made the result not reflect the truth.
3. still about lazy doc servers, how you deal with them?
…--
shane.xb.qian
|
Let's address your concerns:
This was also a concern I worried myself. At the end, all I'm doing, is replacing the attribute
I kept the handling of lazy doc servers as is. That means, if I recognize in line 328
that the LSP server is providing its doc lazily, I do not touch the info-attribute at all. If it worked well up to now than it will work as well after applying my pull request. With the consequence that if e.g. the attribute |
> 1. d.word maybe empty, so you compared abbr's len with word's len, maybe wrong?
`d.word` **must not** be empty at the location, where my pull request applies, otherwise the existing code before my patch is doing something wrong.
well, who knows, at least, if d.word is empty, then d.abbr should not get from it.
> 2. something cfg e.g 'filterCompletionDuplicates' if on, i am worried you changing those value made the result not reflect the truth.
This was also a concern I worried myself. At the end, all I'm doing, is replacing the attribute `d.abbr` by `d.word` and `d.word` is exactly what gets inserted into your code after you accept the completion item. So far with my pull request, you get far more WYSIWG (what you see is what you get) as before. E.g. before applying my pull request a LSP server would provide _"zzTop"_ in the attribute `d.word` and _"Bee Gees"_ in the attribute `d.abbr` with the consequence that _"Bee Gees"_ is displayed in the completion menu whereas _"zzTop"_ get inserted into your code. After applying my pull request _"zzTop"_ is displayed in the completion menu **and** will be inserted into your code.
but you changed d.menu to '' empty too, not only switched d.word and d.abbr
> 3. still about lazy doc servers, how you deal with them?
I kept the handling of lazy doc servers __as is__. That means, if I recognize in line 328
```
if !lspserver.completionLazyDoc && !empty(infoText)
```
that the LSP server is providing its doc lazily, I do not touch the info-attribute at all. If it worked well up to now than it will work as well after applying my pull request. With the consequence that if e.g. the attribute `d.menu` is being emptied before it will not be shown at all, as it is not moved to the info-pop where it would be overwritten by the lazily supplied doc anyway. Most LSP servers I tried out do show the data provided in `d.menu` also in the (lazily provided) info doc.
But if you are worrying about you could just disable this option anyway. Which is the default, i.e. it is per default **disabled** in order to preserve the existing behavior.
maybe let `!lspserver.completionLazyDoc` helped the d.word and d.abbr too, not only d.menu?
…--
shane.xb.qian
|
See also my remark from above:
Intentionally my modifications are inserted after the deduplication. Why: Because for e.g. the java language server
The worst thing that could happen is that the lazily provided documentation by the LSP server will override the moved information, i.e. |
This will add a new option
condensedCompletionMenu
, which allows to condense (or minimize) the text (width) of the completion menu items:The default behavior for the completion menu items does not only display the word that will be completed but also additional details, like completion kind and detailed information, provided by the language LSP server. Typically, especially for typed languages for functions their call parameters with all their types are included. This makes the display of the completion menu items surprisingly overwhelming 😄
When this option new
condensedCompletionMenu
is enabled only the (key-) word and its kind is part of the completion menu item. The additional provided details from the LSP server are moved to the info popup, which is shown as soon as a completion item is selected.This enhancement would address the issue:
Improve complete-popup on vertical screens #581 #581 (comment)
Here is a screenshot of the default completion menu:
and here if this new option has been enabled:
Instead of sprinkling the necessary modifications all over the source code, I decided to collect them in one place, which maybe would be less efficient but would improve the readability of this enhancement.
Caveat: For completion LazyDoc the detailed information which is moved to the info popup will be automatically overwritten with the lazily delivered documentation from the LSP server.
#581