Skip to content

Commit dd12627

Browse files
lsp-rust: add lsp-rust-analyzer-cargo-cfgs config (#4904)
1 parent c3b5fea commit dd12627

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clients/lsp-rust.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,13 @@ or JSON objects in `rust-project.json` format."
859859
:group 'lsp-rust-analyzer
860860
:package-version '(lsp-mode . "8.0.0"))
861861

862+
;; https://rust-analyzer.github.io/book/configuration#cargo.cfgs
863+
(defcustom lsp-rust-analyzer-cargo-cfgs ["debug_assertions", "miri"]
864+
"Extra configurations that are passed to every cargo invocation."
865+
:type 'lsp-string-vector
866+
:group 'lsp-rust-analyzer
867+
:package-version '(lsp-mode . "9.0.0"))
868+
862869
(defcustom lsp-rust-analyzer-cargo-extra-args []
863870
"Extra arguments that are passed to every cargo invocation."
864871
:type 'lsp-string-vector
@@ -1728,6 +1735,7 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
17281735
:cargo ( :allFeatures ,(lsp-json-bool lsp-rust-all-features)
17291736
:noDefaultFeatures ,(lsp-json-bool lsp-rust-no-default-features)
17301737
:features ,lsp-rust-features
1738+
:cfgs ,lsp-rust-analyzer-cargo-cfgs
17311739
:extraArgs ,lsp-rust-analyzer-cargo-extra-args
17321740
:extraEnv ,lsp-rust-analyzer-cargo-extra-env
17331741
:target ,lsp-rust-analyzer-cargo-target

0 commit comments

Comments
 (0)