]> git.lizzy.rs Git - rust.git/commitdiff
Mark most assists as the base "refactor" type
authorkjeremy <kjeremy@gmail.com>
Sun, 26 Apr 2020 22:58:15 +0000 (18:58 -0400)
committerkjeremy <kjeremy@gmail.com>
Fri, 1 May 2020 17:44:32 +0000 (13:44 -0400)
Most of them area. We will separate them out later but this gets them to
show up in the "refactor" menu of vscode.

crates/rust-analyzer/src/main_loop/handlers.rs

index b4e5399065987dd4c876b4c1c3ab28b93a15547c..647bdc42627a190fc086cf20e11b9cac4d7fd1f2 100644 (file)
@@ -19,8 +19,7 @@
     TextEdit, Url, WorkspaceEdit,
 };
 use ra_ide::{
-    Assist, AssistId, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind,
-    SearchScope,
+    Assist, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind, SearchScope,
 };
 use ra_prof::profile;
 use ra_syntax::{AstNode, SyntaxKind, TextRange, TextSize};
@@ -702,15 +701,9 @@ fn create_single_code_action(assist: Assist, world: &WorldSnapshot) -> Result<Co
         arguments: Some(vec![arg]),
     };
 
-    let kind = match assist.id {
-        AssistId("introduce_variable") => Some("refactor.extract.variable".to_string()),
-        AssistId("add_custom_impl") => Some("refactor.rewrite.add_custom_impl".to_string()),
-        _ => None,
-    };
-
     Ok(CodeAction {
         title,
-        kind,
+        kind: Some("refactor".to_owned()),
         diagnostics: None,
         edit: None,
         command: Some(command),