File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
crates/emmylua_ls/src/handlers/initialized/client_config Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,26 @@ pub async fn get_client_config_default(
57
57
info ! ( "no client config found" ) ;
58
58
}
59
59
60
+ for config in & mut configs {
61
+ // VSCode always sends default values for all options, even those that weren't
62
+ // explicitly configured by user. This results in `null`s being sent for
63
+ // every option. Naturally, serde chokes on these nulls when applying partial
64
+ // configuration.
65
+ //
66
+ // Because of this, we have to ignore them here.
67
+ skip_nulls ( config) ;
68
+ }
69
+
60
70
config. partial_emmyrcs = Some ( configs) ;
61
71
62
72
Some ( ( ) )
63
73
}
74
+
75
+ fn skip_nulls ( v : & mut Value ) {
76
+ if let Value :: Object ( obj) = v {
77
+ obj. retain ( |_, v| !v. is_null ( ) ) ;
78
+ for ( _, v) in obj {
79
+ skip_nulls ( v) ;
80
+ }
81
+ }
82
+ }
You can’t perform that action at this time.
0 commit comments