Skip to content

Commit

Permalink
Check workspace with all targets in vscode, emacs configs
Browse files Browse the repository at this point in the history
Add `--workspace` and `--all-targets` switches to both vscode
and emacs configs, that are generated in `cargo component new`.
This is in line with what rust-analyzer uses when
`rust-analyzer.check.overrideCommand` is empty.
  • Loading branch information
tomasol committed Jan 11, 2024
1 parent 205c6ee commit 58a41f9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,14 @@ world example {{
fs::write(
&settings_path,
r#"{
"rust-analyzer.check.overrideCommand": ["cargo", "component", "check", "--message-format=json"]
"rust-analyzer.check.overrideCommand": [
"cargo",
"component",
"check",
"--workspace",
"--all-targets",
"--message-format=json"
],
}
"#,
)
Expand All @@ -466,6 +473,8 @@ world example {{
(lsp-rust-analyzer-cargo-override-command . ["cargo"
(\, "component")
(\, "check")
(\, "--workspace")
(\, "--all-targets")
(\, "--message-format=json")]))))
"#,
)
Expand Down

0 comments on commit 58a41f9

Please sign in to comment.