@@ -923,7 +923,6 @@ impl Config {
923
923
if !( json. is_null ( ) || json. as_object ( ) . is_some_and ( |it| it. is_empty ( ) ) ) {
924
924
let detached_files = get_field_json :: < Vec < Utf8PathBuf > > (
925
925
& mut json,
926
- // Do not record errors here; it is not an error if a field is missing here.
927
926
& mut Vec :: new ( ) ,
928
927
"detachedFiles" ,
929
928
None ,
@@ -935,19 +934,20 @@ impl Config {
935
934
936
935
patch_old_style:: patch_json_for_outdated_configs ( & mut json) ;
937
936
938
- let snips = get_field_json :: < FxIndexMap < String , SnippetDef > > (
939
- & mut json,
940
- // Do not record errors here; it is not an error if a field is missing here.
941
- & mut Vec :: new ( ) ,
942
- "completion_snippets_custom" ,
943
- None ,
944
- )
945
- . unwrap_or ( self . completion_snippets_custom ( ) . to_owned ( ) ) ;
946
-
947
937
let mut json_errors = vec ! [ ] ;
938
+
939
+ let input = FullConfigInput :: from_json ( json, & mut json_errors) ;
940
+
948
941
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
949
942
config. snippets . clear ( ) ;
950
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;
951
951
for ( name, def) in snips. iter ( ) {
952
952
if def. prefix . is_empty ( ) && def. postfix . is_empty ( ) {
953
953
continue ;
@@ -974,8 +974,9 @@ impl Config {
974
974
) ) ,
975
975
}
976
976
}
977
+
977
978
config. client_config = (
978
- FullConfigInput :: from_json ( json , & mut json_errors ) ,
979
+ input ,
979
980
ConfigErrors (
980
981
json_errors
981
982
. into_iter ( )
0 commit comments