Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
parent
9e8ec72bd5
commit
8f567383e4
281 changed files with 6628 additions and 7089 deletions
|
@ -2341,15 +2341,14 @@ impl LspCommand for GetCompletions {
|
|||
.zip(completion_edits)
|
||||
.map(|(mut lsp_completion, mut edit)| {
|
||||
LineEnding::normalize(&mut edit.new_text);
|
||||
if lsp_completion.data.is_none() {
|
||||
if let Some(default_data) = lsp_defaults
|
||||
if lsp_completion.data.is_none()
|
||||
&& let Some(default_data) = lsp_defaults
|
||||
.as_ref()
|
||||
.and_then(|item_defaults| item_defaults.data.clone())
|
||||
{
|
||||
// Servers (e.g. JDTLS) prefer unchanged completions, when resolving the items later,
|
||||
// so we do not insert the defaults here, but `data` is needed for resolving, so this is an exception.
|
||||
lsp_completion.data = Some(default_data);
|
||||
}
|
||||
{
|
||||
// Servers (e.g. JDTLS) prefer unchanged completions, when resolving the items later,
|
||||
// so we do not insert the defaults here, but `data` is needed for resolving, so this is an exception.
|
||||
lsp_completion.data = Some(default_data);
|
||||
}
|
||||
CoreCompletion {
|
||||
replace_range: edit.replace_range,
|
||||
|
@ -2623,10 +2622,10 @@ impl LspCommand for GetCodeActions {
|
|||
.filter_map(|entry| {
|
||||
let (lsp_action, resolved) = match entry {
|
||||
lsp::CodeActionOrCommand::CodeAction(lsp_action) => {
|
||||
if let Some(command) = lsp_action.command.as_ref() {
|
||||
if !available_commands.contains(&command.command) {
|
||||
return None;
|
||||
}
|
||||
if let Some(command) = lsp_action.command.as_ref()
|
||||
&& !available_commands.contains(&command.command)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
(LspAction::Action(Box::new(lsp_action)), false)
|
||||
}
|
||||
|
@ -2641,10 +2640,9 @@ impl LspCommand for GetCodeActions {
|
|||
|
||||
if let Some((requested_kinds, kind)) =
|
||||
requested_kinds_set.as_ref().zip(lsp_action.action_kind())
|
||||
&& !requested_kinds.contains(&kind)
|
||||
{
|
||||
if !requested_kinds.contains(&kind) {
|
||||
return None;
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(CodeAction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue