-
-
Notifications
You must be signed in to change notification settings - Fork 896
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
:company-docsig
support
#3201
Comments
The question is which property from the lsp spec should we show there... |
yeah, the documentation could be large to show on the echo area, right? maybe only the first line of the docs as we do with eldoc would be good? |
It's typical to use the same thing eldoc gives in the echo area. I'd personally find it useful to have both calling syntax and the 1st line of doc prose. |
@jdtsmith we cannot obtain it, because the text has to be inserted in the buffer in order to get its docs. That is how the protocol works. |
Interesting. There is the
Do you know if servers usually return useful documentation upon |
Tested with a few servers, it won't work well. |
There is already |
Aha, thanks. That uses resolve? If so, I wonder if it would be possible to have docsig do the same thing and show 1st line only, caching documentation locally for any later |
Caching is not an issue here. Using the first line/sentence doesn't seem to make sense because this is not docsig but just the first line of the docs(it won't be the same thing that we display for eldoc). |
I'd definitely find it very valuable to see that 1st line when sorting through a bunch of similar-sounding function names! Caching would only be so that if the user later (during the same completion session) invokes the full |
@jdtsmith have you considered using https://github.com/company-mode/company-quickhelp or similar? It will show the docs in popup near the completion selection dialog? |
@minad I am not against supporting it but my concern is that if we implement it in a hacky way over lsp protocol(because there is no 100% match in the spec) it will cause people to complain. In this case, I think that on lsp-mode side the best implementation will be to take N chars from doc and return it in docsig otherwise it may cause resize of the modeline. The same thing can be implemented on the front-end side. |
I just worked up a proof of principle shimming in a :company-docsig property, which runs the :company-doc-buffer function, pulling the first non-blank line out. Seems to work OK. On a related topic, I noticed eldoc places the entire (truncated to about a half page) doc string into the echo area. Is this expected? BTW, the highlighting for function arguments in lsp-mode's eldoc is exceptional! I'd only ever seen that for emacs-lisp. A big advantage. Thanks for all your work. |
To circle back on this, I don't think my hackery to shim in a :company-docsig is a good solution, but does demonstrate the utility. It would be better if lsp-mode itself provided the "first-n-chars of doc as docsig" option. It's too bad LSP only gives you full access to parameters/etc. after the text is in buffer. |
A very useful company property many backends provide is
:company-docsig
, which is a function which gives a short documentation signature (the same as eldoc usually). UI's usually show these in the echo area as you select through completion candidates.This would be a great lsp-mode addition. Thanks for considering.
The text was updated successfully, but these errors were encountered: