]> git.lizzy.rs Git - rust.git/commitdiff
Be more pedantic when checking codeAction/resolve support
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 10 Nov 2020 19:38:10 +0000 (20:38 +0100)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 10 Nov 2020 19:38:34 +0000 (20:38 +0100)
crates/rust-analyzer/src/config.rs

index 9cc14fe827b7a98367c09d73a09dd1e7726f75e5..b4c738272b66da6b8ab90eb8214302c1ab07df7a 100644 (file)
@@ -385,10 +385,13 @@ pub fn update_caps(&mut self, caps: &ClientCapabilities) {
             }
 
             if let Some(code_action) = &doc_caps.code_action {
-                if let Some(resolve_support) = &code_action.resolve_support {
-                    if resolve_support.properties.iter().any(|it| it == "edit") {
-                        self.client_caps.code_action_resolve = true;
+                match (code_action.data_support, &code_action.resolve_support) {
+                    (Some(true), Some(resolve_support)) => {
+                        if resolve_support.properties.iter().any(|it| it == "edit") {
+                            self.client_caps.code_action_resolve = true;
+                        }
                     }
+                    _ => (),
                 }
             }
         }