Skip to content

Commit 3262813

Browse files
authored
feat: add flag for rust-analyzer.cfg.setTest (#4599)
1 parent b3edf86 commit 3262813

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clients/lsp-rust.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,12 @@ which overrides any value that would otherwise be inherited from
616616
:group 'lsp-rust-analyzer
617617
:package-version '(lsp-mode . "9.0.0"))
618618

619+
(defcustom lsp-rust-analyzer-cfg-set-test t
620+
"force rust-analyzer to set `#[cfg(test)]` for the current crate / workspace."
621+
:type 'boolean
622+
:group 'lsp-rust-analyzer
623+
:package-version '(lsp-mode . "9.0.0"))
624+
619625
(defcustom lsp-rust-analyzer-use-client-watching t
620626
"Use client watching"
621627
:type 'boolean
@@ -1698,6 +1704,7 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
16981704
:files ( :exclude ,lsp-rust-analyzer-exclude-globs
16991705
:watcher ,(if lsp-rust-analyzer-use-client-watching "client" "notify")
17001706
:excludeDirs ,lsp-rust-analyzer-exclude-dirs)
1707+
:cfg ( :setTest ,(lsp-json-bool lsp-rust-analyzer-cfg-set-test) )
17011708
:cargo ( :allFeatures ,(lsp-json-bool lsp-rust-all-features)
17021709
:noDefaultFeatures ,(lsp-json-bool lsp-rust-no-default-features)
17031710
:features ,lsp-rust-features

0 commit comments

Comments
 (0)