mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Trigger VSCode to rename after extract variable assist is applied
When the user applies the "Extract Variable" assist, the cursor is positioned at the newly inserted variable. This commit adds a command to the assist that triggers the rename action in VSCode. This way, the user can quickly rename the variable after applying the assist. Fixes part of: #17579
This commit is contained in:
parent
5577e4e3b1
commit
8efe8a8528
17 changed files with 80 additions and 33 deletions
|
@ -45,7 +45,7 @@ pub(crate) fn ssr_assists(
|
|||
group: Some(GroupLabel("Apply SSR".into())),
|
||||
target: comment_range,
|
||||
source_change,
|
||||
trigger_signature_help: false,
|
||||
command: None,
|
||||
};
|
||||
|
||||
ssr_assists.push(assist);
|
||||
|
@ -143,7 +143,7 @@ mod tests {
|
|||
is_snippet: false,
|
||||
},
|
||||
),
|
||||
trigger_signature_help: false,
|
||||
command: None,
|
||||
}
|
||||
"#]]
|
||||
.assert_debug_eq(&apply_in_file_assist);
|
||||
|
@ -196,7 +196,7 @@ mod tests {
|
|||
is_snippet: false,
|
||||
},
|
||||
),
|
||||
trigger_signature_help: false,
|
||||
command: None,
|
||||
}
|
||||
"#]]
|
||||
.assert_debug_eq(&apply_in_workspace_assist);
|
||||
|
@ -236,7 +236,7 @@ mod tests {
|
|||
),
|
||||
target: 10..21,
|
||||
source_change: None,
|
||||
trigger_signature_help: false,
|
||||
command: None,
|
||||
}
|
||||
"#]]
|
||||
.assert_debug_eq(&apply_in_file_assist);
|
||||
|
@ -256,7 +256,7 @@ mod tests {
|
|||
),
|
||||
target: 10..21,
|
||||
source_change: None,
|
||||
trigger_signature_help: false,
|
||||
command: None,
|
||||
}
|
||||
"#]]
|
||||
.assert_debug_eq(&apply_in_workspace_assist);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue