File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -924,7 +924,7 @@ impl Config {
924
924
let mut json_errors = vec ! [ ] ;
925
925
let detached_files = get_field_json :: < Vec < Utf8PathBuf > > (
926
926
& mut json,
927
- & mut json_errors ,
927
+ & mut Vec :: new ( ) ,
928
928
"detachedFiles" ,
929
929
None ,
930
930
)
@@ -936,17 +936,19 @@ impl Config {
936
936
patch_old_style:: patch_json_for_outdated_configs ( & mut json) ;
937
937
938
938
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 ( ) ) ;
939
+
940
+ let input = FullConfigInput :: from_json ( json, & mut json_errors) ;
946
941
947
942
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
948
943
config. snippets . clear ( ) ;
949
944
945
+ let snips = input
946
+ . global
947
+ . completion_snippets_custom
948
+ . as_ref ( )
949
+ . unwrap_or ( & self . default_config . global . completion_snippets_custom ) ;
950
+ #[ allow( dead_code) ]
951
+ let _ = Self :: completion_snippets_custom;
950
952
for ( name, def) in snips. iter ( ) {
951
953
if def. prefix . is_empty ( ) && def. postfix . is_empty ( ) {
952
954
continue ;
@@ -973,8 +975,9 @@ impl Config {
973
975
) ) ,
974
976
}
975
977
}
978
+
976
979
config. client_config = (
977
- FullConfigInput :: from_json ( json , & mut json_errors ) ,
980
+ input ,
978
981
ConfigErrors (
979
982
json_errors
980
983
. into_iter ( )
You can’t perform that action at this time.
0 commit comments