about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2025-04-21 08:09:35 +0200
committerLukas Wirth <lukastw97@gmail.com>2025-04-21 08:10:00 +0200
commitc85f63d42e589c7a77d0620fdb3f91679f02949c (patch)
tree722a42fae7257b91ed4473e0e47d8414ce6b0f40 /src/tools/rust-analyzer
parent31c591846348793d59f99a86778e2dd2e3df2442 (diff)
downloadrust-c85f63d42e589c7a77d0620fdb3f91679f02949c.tar.gz
rust-c85f63d42e589c7a77d0620fdb3f91679f02949c.zip
Back out "When changing the config, do not emit an error if a field is missing"
This backs out commit 8497fc321cad420b923e15f600106f8e22324930.
Diffstat (limited to 'src/tools/rust-analyzer')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
index 1f44889883f..41fa7b4fbb8 100644
--- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
+++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
@@ -921,10 +921,10 @@ impl Config {
             tracing::info!("updating config from JSON: {:#}", json);
 
             if !(json.is_null() || json.as_object().is_some_and(|it| it.is_empty())) {
+                let mut json_errors = vec![];
                 let detached_files = get_field_json::<Vec<Utf8PathBuf>>(
                     &mut json,
-                    // Do not record errors here; it is not an error if a field is missing here.
-                    &mut Vec::new(),
+                    &mut json_errors,
                     "detachedFiles",
                     None,
                 )
@@ -935,16 +935,15 @@ impl Config {
 
                 patch_old_style::patch_json_for_outdated_configs(&mut json);
 
+                let mut json_errors = vec![];
                 let snips = get_field_json::<FxIndexMap<String, SnippetDef>>(
                     &mut json,
-                    // Do not record errors here; it is not an error if a field is missing here.
-                    &mut Vec::new(),
+                    &mut json_errors,
                     "completion_snippets_custom",
                     None,
                 )
                 .unwrap_or(self.completion_snippets_custom().to_owned());
 
-                let mut json_errors = vec![];
                 // IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
                 config.snippets.clear();