Skip to content

Restore lsp-rust-analyzer-cargo-all-targets #3974

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 2 commits into from
Feb 26, 2023
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
7 changes: 7 additions & 0 deletions clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,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-check-all-targets t
"Enables --all-targets for `cargo check`."
:type 'boolean
:group 'lsp-rust-analyzer
:package-version '(lsp-mode . "8.0.2"))

(defcustom lsp-rust-analyzer-checkonsave-features []
"List of features to activate.
Set this to `\"all\"` to pass `--all-features` to cargo."
Expand Down Expand Up @@ -747,6 +753,7 @@ or JSON objects in `rust-project.json` format."
:checkOnSave (:enable ,(lsp-json-bool lsp-rust-analyzer-cargo-watch-enable)
Copy link
Member

Choose a reason for hiding this comment

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

although it is internally renamed by rust-analyzer to rust-analyzer.check.allTargets which is the new version

So we also have to replace checkonsave with check right ?

Copy link
Member

Choose a reason for hiding this comment

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

But keep this line for rust-analyzer.checkOnSave

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need to rename checkOnSave (just yet), they do the renaming internally currently (for backward compatibility). However, eventually we probably want to go over all flags and try to follow the newest convention.

Copy link
Member

Choose a reason for hiding this comment

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

I see, so it's probably the best solution to wait until they are happy and stop changing it =)

:command ,lsp-rust-analyzer-cargo-watch-command
:extraArgs ,lsp-rust-analyzer-cargo-watch-args
:allTargets ,(lsp-json-bool lsp-rust-analyzer-check-all-targets)
:features ,lsp-rust-analyzer-checkonsave-features
:overrideCommand ,lsp-rust-analyzer-cargo-override-command)
:files (:exclude ,lsp-rust-analyzer-exclude-globs
Expand Down