mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Address feedback from @DropDemBits
- move `edit.rename()` to the end of the function - use a match statement to set `res.command`
This commit is contained in:
parent
8efe8a8528
commit
bfa6a5ca84
3 changed files with 10 additions and 13 deletions
|
@ -1128,7 +1128,7 @@ pub struct WorkspaceSymbolConfig {
|
|||
/// How many items are returned at most.
|
||||
pub search_limit: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct ClientCommandsConfig {
|
||||
pub run_single: bool,
|
||||
pub debug_single: bool,
|
||||
|
|
|
@ -1336,15 +1336,14 @@ pub(crate) fn code_action(
|
|||
command: None,
|
||||
};
|
||||
|
||||
if assist.command == Some(assists::Command::TriggerSignatureHelp)
|
||||
&& snap.config.client_commands().trigger_parameter_hints
|
||||
{
|
||||
res.command = Some(command::trigger_parameter_hints());
|
||||
} else if assist.command == Some(assists::Command::Rename)
|
||||
&& snap.config.client_commands().rename
|
||||
{
|
||||
res.command = Some(command::rename());
|
||||
}
|
||||
let commands = snap.config.client_commands();
|
||||
res.command = match assist.command {
|
||||
Some(assists::Command::TriggerSignatureHelp) if commands.trigger_parameter_hints => {
|
||||
Some(command::trigger_parameter_hints())
|
||||
}
|
||||
Some(assists::Command::Rename) if commands.rename => Some(command::rename()),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
match (assist.source_change, resolve_data) {
|
||||
(Some(it), _) => res.edit = Some(snippet_workspace_edit(snap, it)?),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue