Skip to content
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

Declare labelDetailsSupport client capability #4644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wyuenho
Copy link
Contributor

@wyuenho wyuenho commented Dec 17, 2024

While #3495 claimed labelDetails was implemented, it really wasn't because the client capability was never declared, so AFAICT, servers do not sends them down.

Servers tested against:

  • pyright (server does not support labelDetails)
  • typescript-language-server (server does not support labelDetails)
  • gopls (server does not support labelDetails)
  • jdtls (server supports labelDetails fully, spec compliant)
  • clangd (server supports labelDetails, but the CompletionItemLabelDetails#description property is never filled in, so it's a noop as far as lsp-mode is concerned, but still spec compliant)
  • rust-analyzer (server supports labelDetails, but the signature is in CompletionItemLabelDetails#description, not spec compliant)

P.S. For jdtls, the annotation function will return a really long partly qualified method signature for CompletionItem#detail, concatenated to the return type, which is the CompletionItemLabelDetails#description. To avoid this verbosity and duplication of information, the users are advised to do this:

;; or java-ts-mode for emacs 29
(add-hook 'java-mode (lambda () (setq-local lsp-completion-show-detail nil)))

P.P.S rust-analyzer's implementation for labelDetails has always been wrong in all channels as of 2024-12-17, but wrong in a way that incidentally can alleviate #4591. If and when the R-A team decides to collectively sit down, study and implement the spec properly, we can see if there's any adjustment we need to do, but otherwise I assume the user can do their own adjustments similar to jdtls.

@wyuenho wyuenho changed the title Declare labelDetailSupport client capability Declare labelDetailsSupport client capability Dec 17, 2024
@wyuenho wyuenho force-pushed the labelDetailsSupport branch from ac31b09 to 650e8c9 Compare December 17, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant