@@ -124,20 +124,6 @@ config_data! {
124
124
/// This config takes a map of crate names with the exported proc-macro names to ignore as values.
125
125
procMacro_ignored: FxHashMap <Box <str >, Box <[ Box <str >] >> = FxHashMap :: default ( ) ,
126
126
127
- /// Command to be executed instead of 'cargo' for runnables.
128
- runnables_command: Option <String > = None ,
129
- /// Additional arguments to be passed to cargo for runnables such as
130
- /// tests or binaries. For example, it may be `--release`.
131
- runnables_extraArgs: Vec <String > = vec![ ] ,
132
- /// Additional arguments to be passed through Cargo to launched tests, benchmarks, or
133
- /// doc-tests.
134
- ///
135
- /// Unless the launched target uses a
136
- /// [custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),
137
- /// they will end up being interpreted as options to
138
- /// [`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).
139
- runnables_extraTestBinaryArgs: Vec <String > = vec![ "--show-output" . to_owned( ) ] ,
140
-
141
127
/// Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
142
128
/// projects, or "discover" to try to automatically find it if the `rustc-dev` component
143
129
/// is installed.
@@ -367,7 +353,7 @@ config_data! {
367
353
checkOnSave | checkOnSave_enable: bool = true ,
368
354
369
355
370
- /// Check all targets and tests (`--all-targets`). Defaults to
356
+ /// Check all targets and tests (`--all-targets`). Defaults to
371
357
/// `#rust-analyzer.cargo.allTargets#`.
372
358
check_allTargets | checkOnSave_allTargets: Option <bool > = None ,
373
359
/// Cargo command to use for `cargo check`.
@@ -433,6 +419,20 @@ config_data! {
433
419
/// If false, `-p <package>` will be passed instead.
434
420
check_workspace: bool = true ,
435
421
422
+ /// Command to be executed instead of 'cargo' for runnables.
423
+ runnables_command: Option <String > = None ,
424
+ /// Additional arguments to be passed to cargo for runnables such as
425
+ /// tests or binaries. For example, it may be `--release`.
426
+ runnables_extraArgs: Vec <String > = vec![ ] ,
427
+ /// Additional arguments to be passed through Cargo to launched tests, benchmarks, or
428
+ /// doc-tests.
429
+ ///
430
+ /// Unless the launched target uses a
431
+ /// [custom test harness](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-harness-field),
432
+ /// they will end up being interpreted as options to
433
+ /// [`rustc`’s built-in test harness (“libtest”)](https://doc.rust-lang.org/rustc/tests/index.html#cli-arguments).
434
+ runnables_extraTestBinaryArgs: Vec <String > = vec![ "--show-output" . to_owned( ) ] ,
435
+
436
436
/// Additional arguments to `rustfmt`.
437
437
rustfmt_extraArgs: Vec <String > = vec![ ] ,
438
438
/// Advanced option, fully override the command rust-analyzer uses for
@@ -1972,11 +1972,11 @@ impl Config {
1972
1972
* self . cargo_buildScripts_rebuildOnSave ( source_root)
1973
1973
}
1974
1974
1975
- pub fn runnables ( & self ) -> RunnablesConfig {
1975
+ pub fn runnables ( & self , source_root : Option < SourceRootId > ) -> RunnablesConfig {
1976
1976
RunnablesConfig {
1977
- override_cargo : self . runnables_command ( ) . clone ( ) ,
1978
- cargo_extra_args : self . runnables_extraArgs ( ) . clone ( ) ,
1979
- extra_test_binary_args : self . runnables_extraTestBinaryArgs ( ) . clone ( ) ,
1977
+ override_cargo : self . runnables_command ( source_root ) . clone ( ) ,
1978
+ cargo_extra_args : self . runnables_extraArgs ( source_root ) . clone ( ) ,
1979
+ extra_test_binary_args : self . runnables_extraTestBinaryArgs ( source_root ) . clone ( ) ,
1980
1980
}
1981
1981
}
1982
1982
0 commit comments