Skip to content

Commit 12befaa

Browse files
authored
lsp-rust: report command capabilities (#4529)
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.
1 parent fa89327 commit 12befaa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

clients/lsp-rust.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,17 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
17611761
:semantic-tokens-faces-overrides `( :discard-default-modifiers t
17621762
:modifiers ,(lsp-rust-analyzer--semantic-modifiers))
17631763
:server-id 'rust-analyzer
1764-
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode))))))
1764+
:custom-capabilities `((experimental .
1765+
((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode)))
1766+
(commands . ((commands .
1767+
[
1768+
"rust-analyzer.runSingle"
1769+
"rust-analyzer.debugSingle"
1770+
"rust-analyzer.showReferences"
1771+
;; "rust-analyzer.gotoLocation"
1772+
"rust-analyzer.triggerParameterHints"
1773+
;; "rust-analyzer.rename"
1774+
]))))))
17651775
:download-server-fn (lambda (_client callback error-callback _update?)
17661776
(lsp-package-ensure 'rust-analyzer callback error-callback))))
17671777

0 commit comments

Comments
 (0)