From 9e71fc0314a2555eda446a64057df7e8f78fb7c9 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sun, 17 May 2020 21:03:40 -0400 Subject: Mark fixes from diagnostics as quick fixes --- crates/rust-analyzer/src/main_loop/handlers.rs | 9 +++++++-- crates/rust-analyzer/tests/heavy_tests/main.rs | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 1bb8e4473..c2a5bf4d6 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs @@ -730,8 +730,13 @@ pub fn handle_code_action( for fix in fixes_from_diagnostics { let title = fix.label; let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?; - let action = - lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None }; + let action = lsp_ext::CodeAction { + title, + group: None, + kind: Some(lsp_types::code_action_kind::QUICKFIX.into()), + edit: Some(edit), + command: None, + }; res.push(action); } diff --git a/crates/rust-analyzer/tests/heavy_tests/main.rs b/crates/rust-analyzer/tests/heavy_tests/main.rs index c1805787a..ad3476310 100644 --- a/crates/rust-analyzer/tests/heavy_tests/main.rs +++ b/crates/rust-analyzer/tests/heavy_tests/main.rs @@ -298,6 +298,7 @@ fn main() {} } ] }, + "kind": "quickfix", "title": "Create module" }]), ); @@ -368,6 +369,7 @@ fn main() {{}} } ] }, + "kind": "quickfix", "title": "Create module" }]), ); -- cgit v1.2.3