@@ -11,13 +11,16 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) {
11
11
( $(
12
12
$( $src: ident) .+ -> $( $dst: ident) .+ ;
13
13
) +) => { $(
14
- if let Some ( it) = copy. pointer( concat!( $( "/" , stringify!( $src) ) ,+) ) . cloned( ) {
15
- let mut last = it;
16
- for segment in [ $( stringify!( $dst) ) ,+] . into_iter( ) . rev( ) {
17
- last = Value :: Object ( serde_json:: Map :: from_iter( std:: iter:: once( ( segment. to_string( ) , last) ) ) ) ;
18
- }
14
+ match copy. pointer( concat!( $( "/" , stringify!( $src) ) ,+) ) . cloned( ) {
15
+ Some ( Value :: Object ( _) ) | None => ( ) ,
16
+ Some ( it) => {
17
+ let mut last = it;
18
+ for segment in [ $( stringify!( $dst) ) ,+] . into_iter( ) . rev( ) {
19
+ last = Value :: Object ( serde_json:: Map :: from_iter( std:: iter:: once( ( segment. to_string( ) , last) ) ) ) ;
20
+ }
19
21
20
- merge( json, last) ;
22
+ merge( json, last) ;
23
+ } ,
21
24
}
22
25
) + } ;
23
26
}
@@ -36,7 +39,6 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) {
36
39
cargo. runBuildScripts -> cargo. runBuildScripts. overrideCommand;
37
40
cargo. runBuildScriptsCommand -> cargo. runBuildScripts. overrideCommand;
38
41
cargo. useRustcWrapperForBuildScripts -> cargo. runBuildScripts. useRustcWrapper;
39
- completion. snippets -> completion. snippets. custom;
40
42
diagnostics. enableExperimental -> diagnostics. experimental. enable;
41
43
experimental. procAttrMacros -> procMacro. attributes. enable;
42
44
highlighting. strings -> semanticHighlighting. strings. enable;
@@ -66,6 +68,22 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) {
66
68
rustfmt. enableRangeFormatting -> rustfmt. rangeFormatting. enable;
67
69
}
68
70
71
+ // completion.snippets -> completion.snippets.custom;
72
+ if let Some ( Value :: Object ( obj) ) = copy. pointer ( "/completion/snippets" ) . cloned ( ) {
73
+ if obj. len ( ) != 1 || obj. get ( "custom" ) . is_none ( ) {
74
+ merge (
75
+ json,
76
+ json ! { {
77
+ "completion" : {
78
+ "snippets" : {
79
+ "custom" : obj
80
+ } ,
81
+ } ,
82
+ } } ,
83
+ ) ;
84
+ }
85
+ }
86
+
69
87
// callInfo_full -> signatureInfo_detail, signatureInfo_documentation_enable
70
88
if let Some ( Value :: Bool ( b) ) = copy. pointer ( "/callInfo/full" ) {
71
89
let sig_info = match b {
0 commit comments