@@ -921,10 +921,9 @@ impl Config {
921
921
tracing:: info!( "updating config from JSON: {:#}" , json) ;
922
922
923
923
if !( json. is_null ( ) || json. as_object ( ) . is_some_and ( |it| it. is_empty ( ) ) ) {
924
- let mut json_errors = vec ! [ ] ;
925
924
let detached_files = get_field_json :: < Vec < Utf8PathBuf > > (
926
925
& mut json,
927
- & mut json_errors ,
926
+ & mut Vec :: new ( ) ,
928
927
"detachedFiles" ,
929
928
None ,
930
929
)
@@ -936,17 +935,19 @@ impl Config {
936
935
patch_old_style:: patch_json_for_outdated_configs ( & mut json) ;
937
936
938
937
let mut json_errors = vec ! [ ] ;
939
- let snips = get_field_json :: < FxIndexMap < String , SnippetDef > > (
940
- & mut json,
941
- & mut json_errors,
942
- "completion_snippets_custom" ,
943
- None ,
944
- )
945
- . unwrap_or ( self . completion_snippets_custom ( ) . to_owned ( ) ) ;
938
+
939
+ let input = FullConfigInput :: from_json ( json, & mut json_errors) ;
946
940
947
941
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
948
942
config. snippets . clear ( ) ;
949
943
944
+ let snips = input
945
+ . global
946
+ . completion_snippets_custom
947
+ . as_ref ( )
948
+ . unwrap_or ( & self . default_config . global . completion_snippets_custom ) ;
949
+ #[ allow( dead_code) ]
950
+ let _ = Self :: completion_snippets_custom;
950
951
for ( name, def) in snips. iter ( ) {
951
952
if def. prefix . is_empty ( ) && def. postfix . is_empty ( ) {
952
953
continue ;
@@ -973,8 +974,9 @@ impl Config {
973
974
) ) ,
974
975
}
975
976
}
977
+
976
978
config. client_config = (
977
- FullConfigInput :: from_json ( json , & mut json_errors ) ,
979
+ input ,
978
980
ConfigErrors (
979
981
json_errors
980
982
. into_iter ( )
0 commit comments