mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Auto merge of #17647 - joshka:jm/rename-commands, r=Veykril
Rename rust-analyzer commands The commands `editor.action.triggerParameterHints` and `editor.action.rename` are now renamed to `rust-analyzer.triggerParameterHints` and `rust-analyzer.rename` This change helps make it clear that these commands are specific to rust-analyzer and not part of the default set of commands provided by VSCode. Fixes: https://github.com/rust-lang/rust-analyzer/issues/17644 Note: This seems like it will be a breaking change for any RA client that previously reacted to `editor.action.triggerParameterHints` - naive search: https://github.com/search?q=editor.action.triggerParameterHints+AND+%28NOT+is%3Afork%29+rust-analyzer&type=code
This commit is contained in:
commit
c29bac1cdf
6 changed files with 9 additions and 9 deletions
|
@ -124,7 +124,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext<'_>) -> Opti
|
|||
"Add `::<>`",
|
||||
ident.text_range(),
|
||||
|edit| {
|
||||
edit.trigger_signature_help();
|
||||
edit.trigger_parameter_hints();
|
||||
|
||||
let new_arg_list = match turbofish_target {
|
||||
Either::Left(path_segment) => {
|
||||
|
|
|
@ -36,7 +36,7 @@ pub struct Assist {
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Command {
|
||||
/// Show the parameter hints popup.
|
||||
TriggerSignatureHelp,
|
||||
TriggerParameterHints,
|
||||
/// Rename the just inserted item.
|
||||
Rename,
|
||||
}
|
||||
|
|
|
@ -307,8 +307,8 @@ impl SourceChangeBuilder {
|
|||
}
|
||||
|
||||
/// Triggers the parameter hint popup after the assist is applied
|
||||
pub fn trigger_signature_help(&mut self) {
|
||||
self.command = Some(Command::TriggerSignatureHelp);
|
||||
pub fn trigger_parameter_hints(&mut self) {
|
||||
self.command = Some(Command::TriggerParameterHints);
|
||||
}
|
||||
|
||||
/// Renames the item at the cursor position after the assist is applied
|
||||
|
|
|
@ -2042,8 +2042,8 @@ impl Config {
|
|||
debug_single: get("rust-analyzer.debugSingle"),
|
||||
show_reference: get("rust-analyzer.showReferences"),
|
||||
goto_location: get("rust-analyzer.gotoLocation"),
|
||||
trigger_parameter_hints: get("editor.action.triggerParameterHints"),
|
||||
rename: get("editor.action.rename"),
|
||||
trigger_parameter_hints: get("rust-analyzer.triggerParameterHints"),
|
||||
rename: get("rust-analyzer.rename"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1338,7 +1338,7 @@ pub(crate) fn code_action(
|
|||
|
||||
let commands = snap.config.client_commands();
|
||||
res.command = match assist.command {
|
||||
Some(assists::Command::TriggerSignatureHelp) if commands.trigger_parameter_hints => {
|
||||
Some(assists::Command::TriggerParameterHints) if commands.trigger_parameter_hints => {
|
||||
Some(command::trigger_parameter_hints())
|
||||
}
|
||||
Some(assists::Command::Rename) if commands.rename => Some(command::rename()),
|
||||
|
|
|
@ -347,8 +347,8 @@ class ExperimentalFeatures implements lc.StaticFeature {
|
|||
"rust-analyzer.debugSingle",
|
||||
"rust-analyzer.showReferences",
|
||||
"rust-analyzer.gotoLocation",
|
||||
"editor.action.triggerParameterHints",
|
||||
"editor.action.rename",
|
||||
"rust-analyzer.triggerParameterHints",
|
||||
"rust-analyzer.rename",
|
||||
],
|
||||
},
|
||||
...capabilities.experimental,
|
||||
|
|
Loading…
Reference in a new issue