Skip to content

internal: Rename rust-analyzer commands #17647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/ide-assists/src/handlers/add_turbo_fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-db/src/assists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/ide-db/src/source_change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/lsp/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
4 changes: 2 additions & 2 deletions editors/code/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down