diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs index 5eab96e245..9773d8dbce 100644 --- a/crates/rust-analyzer/src/handlers/request.rs +++ b/crates/rust-analyzer/src/handlers/request.rs @@ -1060,7 +1060,7 @@ pub(crate) fn handle_completion_resolve( forced_resolve_completions_config.fields_to_resolve = CompletionFieldsToResolve::empty(); let position = FilePosition { file_id, offset }; - let Some(unresolved_completions) = snap.analysis.completions( + let Some(resolved_completions) = snap.analysis.completions( &forced_resolve_completions_config, position, resolve_data.trigger_character, @@ -1075,7 +1075,7 @@ pub(crate) fn handle_completion_resolve( snap.file_version(position.file_id), resolve_data.position, resolve_data.trigger_character, - unresolved_completions, + resolved_completions, ); let Some(mut resolved_completion) = resolved_completions.into_iter().find(|completion| { completion.label == original_completion.label diff --git a/crates/rust-analyzer/src/lsp/to_proto.rs b/crates/rust-analyzer/src/lsp/to_proto.rs index c6a57c6114..375b7428c2 100644 --- a/crates/rust-analyzer/src/lsp/to_proto.rs +++ b/crates/rust-analyzer/src/lsp/to_proto.rs @@ -286,12 +286,12 @@ fn completion_item( Some(item.lookup().to_owned()) }; - // LSP does not allow arbitrary edits in completion, so we have to do a - // non-trivial mapping here. let text_edit = if fields_to_resolve.resolve_text_edit { something_to_resolve = true; None } else { + // LSP does not allow arbitrary edits in completion, so we have to do a + // non-trivial mapping here. let mut text_edit = None; let source_range = item.source_range; for indel in item.text_edit { @@ -327,9 +327,9 @@ fn completion_item( let command = if item.trigger_call_info && config.client_commands().trigger_parameter_hints { if fields_to_resolve.resolve_command { something_to_resolve = true; - Some(command::trigger_parameter_hints()) - } else { None + } else { + Some(command::trigger_parameter_hints()) } } else { None