diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-03 14:39:30 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-03 14:39:30 +0100 |
commit | a33cfcb55db4fafc873c0ce6d508cb27d6531cb6 (patch) | |
tree | f3c5655ecc9efc42b89954530210f4871a16d941 /crates/rust-analyzer/src/main_loop/handlers.rs | |
parent | 1edf6d2d4fe613b43796554d9765056183efe21a (diff) | |
parent | 9e71fc0314a2555eda446a64057df7e8f78fb7c9 (diff) |
Merge #4502
4502: Mark fixes from diagnostics as quick fixes r=kjeremy a=kjeremy
Populates the diagnostic UI with fixes:
Before:

After:

Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/rust-analyzer/src/main_loop/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 9 |
1 files changed, 7 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 | ||