mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
minor: Group extract_function
with other extraction assists
This commit is contained in:
parent
0cad614b3b
commit
21782b9a8d
2 changed files with 23 additions and 8 deletions
|
@ -7,6 +7,7 @@ use hir::{
|
|||
TypeInfo, TypeParam,
|
||||
};
|
||||
use ide_db::{
|
||||
assists::GroupLabel,
|
||||
defs::{Definition, NameRefClass},
|
||||
famous_defs::FamousDefs,
|
||||
helpers::mod_path_to_ast,
|
||||
|
@ -104,7 +105,8 @@ pub(crate) fn extract_function(acc: &mut Assists, ctx: &AssistContext<'_>) -> Op
|
|||
|
||||
let scope = ImportScope::find_insert_use_container(&node, &ctx.sema)?;
|
||||
|
||||
acc.add(
|
||||
acc.add_group(
|
||||
&GroupLabel("Extract into...".to_owned()),
|
||||
AssistId("extract_function", crate::AssistKind::RefactorExtract),
|
||||
"Extract into function",
|
||||
target_range,
|
||||
|
|
|
@ -363,7 +363,6 @@ pub fn test_some_range(a: int) -> bool {
|
|||
expect![[r#"
|
||||
Convert integer base
|
||||
Extract into...
|
||||
Extract into function
|
||||
Replace if let with match
|
||||
"#]]
|
||||
.assert_eq(&expected);
|
||||
|
@ -392,7 +391,6 @@ pub fn test_some_range(a: int) -> bool {
|
|||
expect![[r#"
|
||||
Convert integer base
|
||||
Extract into...
|
||||
Extract into function
|
||||
Replace if let with match
|
||||
"#]]
|
||||
.assert_eq(&expected);
|
||||
|
@ -406,7 +404,6 @@ pub fn test_some_range(a: int) -> bool {
|
|||
|
||||
expect![[r#"
|
||||
Extract into...
|
||||
Extract into function
|
||||
"#]]
|
||||
.assert_eq(&expected);
|
||||
}
|
||||
|
@ -511,7 +508,11 @@ pub fn test_some_range(a: int) -> bool {
|
|||
RefactorExtract,
|
||||
),
|
||||
label: "Extract into function",
|
||||
group: None,
|
||||
group: Some(
|
||||
GroupLabel(
|
||||
"Extract into...",
|
||||
),
|
||||
),
|
||||
target: 59..60,
|
||||
source_change: None,
|
||||
command: None,
|
||||
|
@ -601,7 +602,11 @@ pub fn test_some_range(a: int) -> bool {
|
|||
RefactorExtract,
|
||||
),
|
||||
label: "Extract into function",
|
||||
group: None,
|
||||
group: Some(
|
||||
GroupLabel(
|
||||
"Extract into...",
|
||||
),
|
||||
),
|
||||
target: 59..60,
|
||||
source_change: None,
|
||||
command: None,
|
||||
|
@ -734,7 +739,11 @@ pub fn test_some_range(a: int) -> bool {
|
|||
RefactorExtract,
|
||||
),
|
||||
label: "Extract into function",
|
||||
group: None,
|
||||
group: Some(
|
||||
GroupLabel(
|
||||
"Extract into...",
|
||||
),
|
||||
),
|
||||
target: 59..60,
|
||||
source_change: None,
|
||||
command: None,
|
||||
|
@ -953,7 +962,11 @@ pub fn test_some_range(a: int) -> bool {
|
|||
RefactorExtract,
|
||||
),
|
||||
label: "Extract into function",
|
||||
group: None,
|
||||
group: Some(
|
||||
GroupLabel(
|
||||
"Extract into...",
|
||||
),
|
||||
),
|
||||
target: 59..60,
|
||||
source_change: Some(
|
||||
SourceChange {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue