aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/config.rs21
1 files changed, 19 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs
index f3d8773cc..04f5bb473 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -133,13 +133,30 @@ impl Config {
133 set(value, "/cargo/allFeatures", &mut self.cargo.all_features); 133 set(value, "/cargo/allFeatures", &mut self.cargo.all_features);
134 set(value, "/cargo/features", &mut self.cargo.features); 134 set(value, "/cargo/features", &mut self.cargo.features);
135 set(value, "/cargo/loadOutDirsFromCheck", &mut self.cargo.load_out_dirs_from_check); 135 set(value, "/cargo/loadOutDirsFromCheck", &mut self.cargo.load_out_dirs_from_check);
136 if let RustfmtConfig::Rustfmt { extra_args } = &mut self.rustfmt { 136 if let Some(mut args) = get::<Vec<String>>(value, "/rustfmt/overrideCommand") {
137 if !args.is_empty() {
138 let command = args.remove(0);
139 self.rustfmt = RustfmtConfig::CustomCommand {
140 command,
141 args,
142 }
143 }
144 } else if let RustfmtConfig::Rustfmt { extra_args } = &mut self.rustfmt {
137 set(value, "/rustfmt/extraArgs", extra_args); 145 set(value, "/rustfmt/extraArgs", extra_args);
138 } 146 }
139 if let Some(false) = get(value, "/checkOnSave/enable") { 147 if let Some(false) = get(value, "/checkOnSave/enable") {
140 self.check = None 148 self.check = None
141 } else { 149 } else {
142 if let Some(FlycheckConfig::CargoCommand { command, extra_args, all_targets }) = &mut self.check 150 if let Some(mut args) = get::<Vec<String>>(value, "/checkOnSave/overrideCommand") {
151 if !args.is_empty() {
152 let command = args.remove(0);
153 self.check = Some(FlycheckConfig::CustomCommand {
154 command,
155 args,
156 })
157 }
158
159 } else if let Some(FlycheckConfig::CargoCommand { command, extra_args, all_targets }) = &mut self.check
143 { 160 {
144 set(value, "/checkOnSave/extraArgs", extra_args); 161 set(value, "/checkOnSave/extraArgs", extra_args);
145 set(value, "/checkOnSave/command", command); 162 set(value, "/checkOnSave/command", command);