@@ -80,13 +80,6 @@ config_data! {
8080 pub ( crate ) cargo_autoreload: bool = true ,
8181 /// Run build scripts (`build.rs`) for more precise code analysis.
8282 cargo_buildScripts_enable: bool = true ,
83- /// Specifies the working directory for running build scripts.
84- /// - "workspace": run build scripts for a workspace in the workspace's root directory.
85- /// This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.
86- /// - "root": run build scripts in the project's root directory.
87- /// This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
88- /// is set.
89- cargo_buildScripts_invocationLocation: InvocationLocation = InvocationLocation :: Workspace ,
9083 /// Specifies the invocation strategy to use when running the build scripts command.
9184 /// If `per_workspace` is set, the command will be executed for each workspace.
9285 /// If `once` is set, the command will be executed once.
@@ -101,8 +94,7 @@ config_data! {
10194 /// If there are multiple linked projects/workspaces, this command is invoked for
10295 /// each of them, with the working directory being the workspace root
10396 /// (i.e., the folder containing the `Cargo.toml`). This can be overwritten
104- /// by changing `#rust-analyzer.cargo.buildScripts.invocationStrategy#` and
105- /// `#rust-analyzer.cargo.buildScripts.invocationLocation#`.
97+ /// by changing `#rust-analyzer.cargo.buildScripts.invocationStrategy#`.
10698 ///
10799 /// By default, a cargo invocation will be constructed for the configured
108100 /// targets and features, with the following base command line:
@@ -182,14 +174,6 @@ config_data! {
182174 ///
183175 /// For example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,...
184176 check_ignore: FxHashSet <String > = FxHashSet :: default ( ) ,
185- /// Specifies the working directory for running checks.
186- /// - "workspace": run checks for workspaces in the corresponding workspaces' root directories.
187- // FIXME: Ideally we would support this in some way
188- /// This falls back to "root" if `#rust-analyzer.check.invocationStrategy#` is set to `once`.
189- /// - "root": run checks in the project's root directory.
190- /// This config only has an effect when `#rust-analyzer.check.overrideCommand#`
191- /// is set.
192- check_invocationLocation | checkOnSave_invocationLocation: InvocationLocation = InvocationLocation :: Workspace ,
193177 /// Specifies the invocation strategy to use when running the check command.
194178 /// If `per_workspace` is set, the command will be executed for each workspace.
195179 /// If `once` is set, the command will be executed once.
@@ -212,8 +196,7 @@ config_data! {
212196 /// If there are multiple linked projects/workspaces, this command is invoked for
213197 /// each of them, with the working directory being the workspace root
214198 /// (i.e., the folder containing the `Cargo.toml`). This can be overwritten
215- /// by changing `#rust-analyzer.check.invocationStrategy#` and
216- /// `#rust-analyzer.check.invocationLocation#`.
199+ /// by changing `#rust-analyzer.check.invocationStrategy#`.
217200 ///
218201 /// If `$saved_file` is part of the command, rust-analyzer will pass
219202 /// the absolute path of the saved file to the provided command. This is
@@ -1868,12 +1851,6 @@ impl Config {
18681851 InvocationStrategy :: Once => project_model:: InvocationStrategy :: Once ,
18691852 InvocationStrategy :: PerWorkspace => project_model:: InvocationStrategy :: PerWorkspace ,
18701853 } ,
1871- invocation_location : match self . cargo_buildScripts_invocationLocation ( None ) {
1872- InvocationLocation :: Root => {
1873- project_model:: InvocationLocation :: Root ( self . root_path . clone ( ) )
1874- }
1875- InvocationLocation :: Workspace => project_model:: InvocationLocation :: Workspace ,
1876- } ,
18771854 run_build_script_command : self . cargo_buildScripts_overrideCommand ( None ) . clone ( ) ,
18781855 extra_args : self . cargo_extraArgs ( None ) . clone ( ) ,
18791856 extra_env : self . cargo_extraEnv ( None ) . clone ( ) ,
@@ -1930,14 +1907,6 @@ impl Config {
19301907 crate :: flycheck:: InvocationStrategy :: PerWorkspace
19311908 }
19321909 } ,
1933- invocation_location : match self . check_invocationLocation ( None ) {
1934- InvocationLocation :: Root => {
1935- crate :: flycheck:: InvocationLocation :: Root ( self . root_path . clone ( ) )
1936- }
1937- InvocationLocation :: Workspace => {
1938- crate :: flycheck:: InvocationLocation :: Workspace
1939- }
1940- } ,
19411910 }
19421911 }
19431912 Some ( _) | None => FlycheckConfig :: CargoCommand {
@@ -2348,13 +2317,6 @@ pub(crate) enum InvocationStrategy {
23482317#[ derive( Serialize , Deserialize , Debug , Clone ) ]
23492318struct CheckOnSaveTargets ( #[ serde( with = "single_or_array" ) ] Vec < String > ) ;
23502319
2351- #[ derive( Serialize , Deserialize , Debug , Clone ) ]
2352- #[ serde( rename_all = "snake_case" ) ]
2353- enum InvocationLocation {
2354- Root ,
2355- Workspace ,
2356- }
2357-
23582320#[ derive( Serialize , Deserialize , Debug , Clone ) ]
23592321#[ serde( rename_all = "snake_case" ) ]
23602322enum LifetimeElisionDef {
@@ -3196,14 +3158,6 @@ fn field_props(field: &str, ty: &str, doc: &[&str], default: &str) -> serde_json
31963158 "The command will be executed once."
31973159 ] ,
31983160 } ,
3199- "InvocationLocation" => set ! {
3200- "type" : "string" ,
3201- "enum" : [ "workspace" , "root" ] ,
3202- "enumDescriptions" : [
3203- "The command will be executed in the corresponding workspace root." ,
3204- "The command will be executed in the project root."
3205- ] ,
3206- } ,
32073161 "Option<CheckOnSaveTargets>" => set ! {
32083162 "anyOf" : [
32093163 {
0 commit comments