Skip to content

Commit

Permalink
lsp-rust: report command capabilities (#4529)
Browse files Browse the repository at this point in the history
Since
rust-lang/rust-analyzer@49184a1
rust-analyzer no longer assumes clients implement all remote commands.

Since it gates the lenses it returns based on the known commands in
the client, it no longer returns many useful ones.

This PR explicitly lists the available commands, as mapped in the code
a few lines above.
  • Loading branch information
alanz authored Aug 17, 2024
1 parent fa89327 commit 12befaa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,17 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
:semantic-tokens-faces-overrides `( :discard-default-modifiers t
:modifiers ,(lsp-rust-analyzer--semantic-modifiers))
:server-id 'rust-analyzer
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode))))))
:custom-capabilities `((experimental .
((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode)))
(commands . ((commands .
[
"rust-analyzer.runSingle"
"rust-analyzer.debugSingle"
"rust-analyzer.showReferences"
;; "rust-analyzer.gotoLocation"
"rust-analyzer.triggerParameterHints"
;; "rust-analyzer.rename"
]))))))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'rust-analyzer callback error-callback))))

Expand Down

0 comments on commit 12befaa

Please sign in to comment.