File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,21 @@ function server.load_rust_analyzer_settings(project_root, opts)
2222 local default_settings = opts .default_settings or config .server .default_settings
2323 local use_clippy = config .tools .enable_clippy and vim .fn .executable (' cargo-clippy' ) == 1
2424 --- @diagnostic disable-next-line : undefined-field
25- if default_settings [' rust-analyzer' ].checkOnSave == nil and use_clippy then
25+ if
26+ default_settings [' rust-analyzer' ].check == nil
27+ and use_clippy
28+ and type (default_settings [' rust-analyzer' ].checkOnSave ) ~= ' table'
29+ then
2630 --- @diagnostic disable-next-line : inject-field
27- default_settings [' rust-analyzer' ].checkOnSave = {
31+ default_settings [' rust-analyzer' ].check = {
2832 allFeatures = true ,
2933 command = ' clippy' ,
3034 extraArgs = { ' --no-deps' },
3135 }
36+ if type (default_settings [' rust-analyzer' ].checkOnSave ) ~= ' boolean' then
37+ --- @diagnostic disable-next-line : inject-field
38+ default_settings [' rust-analyzer' ].checkOnSave = true
39+ end
3240 end
3341 if not project_root then
3442 return default_settings
You can’t perform that action at this time.
0 commit comments