diff options
| author | Jeremy Kolb <kjeremy@gmail.com> | 2020-05-17 21:03:40 -0400 |
|---|---|---|
| committer | kjeremy <kjeremy@gmail.com> | 2020-06-03 09:31:32 -0400 |
| commit | 9e71fc0314a2555eda446a64057df7e8f78fb7c9 (patch) | |
| tree | 2572317108200ebd2b3b6cc42b2c0708cc17bb7a | |
| parent | e644f64f2a68a14a841adb3f3e897d1fcb35f23f (diff) | |
| download | rust-9e71fc0314a2555eda446a64057df7e8f78fb7c9.tar.gz rust-9e71fc0314a2555eda446a64057df7e8f78fb7c9.zip | |
Mark fixes from diagnostics as quick fixes
| -rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 9 | ||||
| -rw-r--r-- | 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 1bb8e44735f..c2a5bf4d6b8 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 c1805787a39..ad347631054 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" }]), ); |
