diff options
author | kjeremy <[email protected]> | 2020-04-26 23:58:15 +0100 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-05-01 18:44:32 +0100 |
commit | ee1628dba051e691a4ced756ab3cb360543609fa (patch) | |
tree | 88d910802043971f343f8cd60c1fd55fb7c32fed /crates | |
parent | e75565c73f935b7b4ee4182e632dfab210b26cff (diff) |
Mark most assists as the base "refactor" type
Most of them area. We will separate them out later but this gets them to
show up in the "refactor" menu of vscode.
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index b4e539906..647bdc426 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -19,8 +19,7 @@ use lsp_types::{ | |||
19 | TextEdit, Url, WorkspaceEdit, | 19 | TextEdit, Url, WorkspaceEdit, |
20 | }; | 20 | }; |
21 | use ra_ide::{ | 21 | use ra_ide::{ |
22 | Assist, AssistId, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind, | 22 | Assist, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind, SearchScope, |
23 | SearchScope, | ||
24 | }; | 23 | }; |
25 | use ra_prof::profile; | 24 | use ra_prof::profile; |
26 | use ra_syntax::{AstNode, SyntaxKind, TextRange, TextSize}; | 25 | use ra_syntax::{AstNode, SyntaxKind, TextRange, TextSize}; |
@@ -702,15 +701,9 @@ fn create_single_code_action(assist: Assist, world: &WorldSnapshot) -> Result<Co | |||
702 | arguments: Some(vec![arg]), | 701 | arguments: Some(vec![arg]), |
703 | }; | 702 | }; |
704 | 703 | ||
705 | let kind = match assist.id { | ||
706 | AssistId("introduce_variable") => Some("refactor.extract.variable".to_string()), | ||
707 | AssistId("add_custom_impl") => Some("refactor.rewrite.add_custom_impl".to_string()), | ||
708 | _ => None, | ||
709 | }; | ||
710 | |||
711 | Ok(CodeAction { | 704 | Ok(CodeAction { |
712 | title, | 705 | title, |
713 | kind, | 706 | kind: Some("refactor".to_owned()), |
714 | diagnostics: None, | 707 | diagnostics: None, |
715 | edit: None, | 708 | edit: None, |
716 | command: Some(command), | 709 | command: Some(command), |