mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +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
|
@ -29,7 +29,16 @@ pub struct Assist {
|
|||
/// cumbersome, especially if you want to embed an assist into another data
|
||||
/// structure, such as a diagnostic.
|
||||
pub source_change: Option<SourceChange>,
|
||||
pub trigger_signature_help: bool,
|
||||
/// The command to execute after the assist is applied.
|
||||
pub command: Option<Command>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Command {
|
||||
/// Show the parameter hints popup.
|
||||
TriggerSignatureHelp,
|
||||
/// Rename the just inserted item.
|
||||
Rename,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue