aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-05-18 02:03:40 +0100
committerkjeremy <[email protected]>2020-06-03 14:31:32 +0100
commit9e71fc0314a2555eda446a64057df7e8f78fb7c9 (patch)
tree2572317108200ebd2b3b6cc42b2c0708cc17bb7a /crates
parente644f64f2a68a14a841adb3f3e897d1fcb35f23f (diff)
Mark fixes from diagnostics as quick fixes
Diffstat (limited to 'crates')
-rw-r--r--crates/rust-analyzer/src/main_loop/handlers.rs9
-rw-r--r--crates/rust-analyzer/tests/heavy_tests/main.rs2
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(
730 for fix in fixes_from_diagnostics { 730 for fix in fixes_from_diagnostics {
731 let title = fix.label; 731 let title = fix.label;
732 let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?; 732 let edit = to_proto::snippet_workspace_edit(&snap, fix.source_change)?;
733 let action = 733 let action = lsp_ext::CodeAction {
734 lsp_ext::CodeAction { title, group: None, kind: None, edit: Some(edit), command: None }; 734 title,
735 group: None,
736 kind: Some(lsp_types::code_action_kind::QUICKFIX.into()),
737 edit: Some(edit),
738 command: None,
739 };
735 res.push(action); 740 res.push(action);
736 } 741 }
737 742
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() {}
298 } 298 }
299 ] 299 ]
300 }, 300 },
301 "kind": "quickfix",
301 "title": "Create module" 302 "title": "Create module"
302 }]), 303 }]),
303 ); 304 );
@@ -368,6 +369,7 @@ fn main() {{}}
368 } 369 }
369 ] 370 ]
370 }, 371 },
372 "kind": "quickfix",
371 "title": "Create module" 373 "title": "Create module"
372 }]), 374 }]),
373 ); 375 );