mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 12:04:43 +00:00 
			
		
		
		
	Back out "When changing the config, do not emit an error if a field is missing"
This backs out commit 8497fc321c.
			
			
This commit is contained in:
		
							parent
							
								
									723121e595
								
							
						
					
					
						commit
						af301a88ec
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		|  | @ -921,10 +921,10 @@ impl Config { | ||||||
|             tracing::info!("updating config from JSON: {:#}", json); |             tracing::info!("updating config from JSON: {:#}", json); | ||||||
| 
 | 
 | ||||||
|             if !(json.is_null() || json.as_object().is_some_and(|it| it.is_empty())) { |             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>>( |                 let detached_files = get_field_json::<Vec<Utf8PathBuf>>( | ||||||
|                     &mut json, |                     &mut json, | ||||||
|                     // Do not record errors here; it is not an error if a field is missing here.
 |                     &mut json_errors, | ||||||
|                     &mut Vec::new(), |  | ||||||
|                     "detachedFiles", |                     "detachedFiles", | ||||||
|                     None, |                     None, | ||||||
|                 ) |                 ) | ||||||
|  | @ -935,16 +935,15 @@ impl Config { | ||||||
| 
 | 
 | ||||||
|                 patch_old_style::patch_json_for_outdated_configs(&mut json); |                 patch_old_style::patch_json_for_outdated_configs(&mut json); | ||||||
| 
 | 
 | ||||||
|  |                 let mut json_errors = vec![]; | ||||||
|                 let snips = get_field_json::<FxIndexMap<String, SnippetDef>>( |                 let snips = get_field_json::<FxIndexMap<String, SnippetDef>>( | ||||||
|                     &mut json, |                     &mut json, | ||||||
|                     // Do not record errors here; it is not an error if a field is missing here.
 |                     &mut json_errors, | ||||||
|                     &mut Vec::new(), |  | ||||||
|                     "completion_snippets_custom", |                     "completion_snippets_custom", | ||||||
|                     None, |                     None, | ||||||
|                 ) |                 ) | ||||||
|                 .unwrap_or(self.completion_snippets_custom().to_owned()); |                 .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`.
 |                 // IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
 | ||||||
|                 config.snippets.clear(); |                 config.snippets.clear(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Wirth
						Lukas Wirth