Skip to content

rust: add rust-analyzer option to unset #[cfg(test)] in specified crates #3156

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ The command should include `--message=format=json` or similar option."
:group 'lsp-rust-analyzer
:package-version '(lsp-mode . "6.2.2"))

(defcustom lsp-rust-analyzer-cargo-unset-test []
"force rust-analyzer to unset `#[cfg(test)]` for the specified crates."
:type 'lsp-string-vector
:group 'lsp-rust-analyzer
:package-version '(lsp-mode . "6.2.2"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package version should be something higher 8.0.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed that after the merge.


(defcustom lsp-rust-analyzer-use-client-watching t
"Use client watching"
:type 'boolean
Expand Down Expand Up @@ -651,7 +657,8 @@ https://rust-analyzer.github.io/manual.html#auto-import.
; Obsolete, but used by old Rust-Analyzer versions
:loadOutDirsFromCheck ,(lsp-json-bool lsp-rust-analyzer-cargo-run-build-scripts)
:autoreload ,(lsp-json-bool lsp-rust-analyzer-cargo-auto-reload)
:useRustcWrapperForBuildScripts ,(lsp-json-bool lsp-rust-analyzer-use-rustc-wrapper-for-build-scripts))
:useRustcWrapperForBuildScripts ,(lsp-json-bool lsp-rust-analyzer-use-rustc-wrapper-for-build-scripts)
:unsetTest ,lsp-rust-analyzer-cargo-unset-test)
:rustfmt (:extraArgs ,lsp-rust-analyzer-rustfmt-extra-args
:overrideCommand ,lsp-rust-analyzer-rustfmt-override-command)
:inlayHints (:typeHints ,(lsp-json-bool lsp-rust-analyzer-server-display-inlay-hints)
Expand Down