-
-
Notifications
You must be signed in to change notification settings - Fork 160
Provide structured data (docstring, arglist, etc.) for completionItem #1929
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
Comments
@lynaghk the data field is used to trafic information server -> client so when client resolves the item in a next request (completionItem/resolve), send again that field to resolve extra things like docs.
|
Thanks @ericdallo for the feedback and pointers. I took a closer look at
Would it be appropriate to add a machine-parsable data field on this response? Then the editor could format additional information in the popup (docstring, arglists, etc.) |
@kiennq any idea why lsp-mode doesn't call resolveItem automatically like other editors? |
The
I've tried to preemptively call the |
@ericdallo |
@wyuenho, vscode and zed that I'm aware of, they resolve the item as soon it's hovered in the completion popup (which makes sense to me as they show more info in the completion for the hovered item) |
That's the Show More/Less feature from VSCode that requires completion frontend cooperation in Emacs. No completion frontend in Emacs supports that at the moment but emacs-lsp/lsp-mode#4625 laid the groundwork for that. @dgutov will need to take advantage of For now, you can give https://github.com/wyuenho/emacs-corfu-pixel-perfect a try. The README is very much outdated but the package works quite well, I'm using it daily. |
As a side node, I think clojure-lsp's response to If clojure-lsp supports |
I don't think completion is bad currently. We have already iterated multiple times to improve performance, and there are no complaints about performance at the moment. |
Would y'all be open to a PR that populates the optional
data
field of the LSP completionItem with a map of more structured information?E.g., for a function it would include the symbol, fully qualified symbol, docstring, arglist, etc.
This would allow clients to display more structured information.
I started investigating this when I noticed that the Emacs completions were quite bare for lsp-mode Clojure:
compared to the built-in Emacs describe function:
(These screenshots are using the Vertico and Marginalia Emacs packages.)
I would love for the completion to actually search for matches in docstrings too, though that would likely be a more involved change.
(I'd probably build an n-gram index using roaring bitmaps.)
Anyway, just wanted to float the idea before I started working on anything.
I totally understand if this would be out of scope for the project and more appropriate for a fork / standalone thing.
Clojure LSP is really cool and I will continue to use it either way --- thanks for all the great work!
The text was updated successfully, but these errors were encountered: