mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 21:43:37 +00:00
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.
This commit is contained in:
parent
e75565c73f
commit
ee1628dba0
1 changed files with 2 additions and 9 deletions
|
@ -19,8 +19,7 @@ use lsp_types::{
|
||||||
TextEdit, Url, WorkspaceEdit,
|
TextEdit, Url, WorkspaceEdit,
|
||||||
};
|
};
|
||||||
use ra_ide::{
|
use ra_ide::{
|
||||||
Assist, AssistId, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind,
|
Assist, FileId, FilePosition, FileRange, Query, RangeInfo, Runnable, RunnableKind, SearchScope,
|
||||||
SearchScope,
|
|
||||||
};
|
};
|
||||||
use ra_prof::profile;
|
use ra_prof::profile;
|
||||||
use ra_syntax::{AstNode, SyntaxKind, TextRange, TextSize};
|
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]),
|
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 {
|
Ok(CodeAction {
|
||||||
title,
|
title,
|
||||||
kind,
|
kind: Some("refactor".to_owned()),
|
||||||
diagnostics: None,
|
diagnostics: None,
|
||||||
edit: None,
|
edit: None,
|
||||||
command: Some(command),
|
command: Some(command),
|
||||||
|
|
Loading…
Reference in a new issue