Skip to content

Commit af301a8

Browse files
committed
Back out "When changing the config, do not emit an error if a field is missing"
This backs out commit 8497fc3.
1 parent 723121e commit af301a8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,10 +921,10 @@ impl Config {
921921
tracing::info!("updating config from JSON: {:#}", json);
922922

923923
if !(json.is_null() || json.as_object().is_some_and(|it| it.is_empty())) {
924+
let mut json_errors = vec![];
924925
let detached_files = get_field_json::<Vec<Utf8PathBuf>>(
925926
&mut json,
926-
// Do not record errors here; it is not an error if a field is missing here.
927-
&mut Vec::new(),
927+
&mut json_errors,
928928
"detachedFiles",
929929
None,
930930
)
@@ -935,16 +935,15 @@ impl Config {
935935

936936
patch_old_style::patch_json_for_outdated_configs(&mut json);
937937

938+
let mut json_errors = vec![];
938939
let snips = get_field_json::<FxIndexMap<String, SnippetDef>>(
939940
&mut json,
940-
// Do not record errors here; it is not an error if a field is missing here.
941-
&mut Vec::new(),
941+
&mut json_errors,
942942
"completion_snippets_custom",
943943
None,
944944
)
945945
.unwrap_or(self.completion_snippets_custom().to_owned());
946946

947-
let mut json_errors = vec![];
948947
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
949948
config.snippets.clear();
950949

0 commit comments

Comments
 (0)