Small fixes

This commit is contained in:
Kirill Bulatov 2024-09-23 22:10:51 +03:00
parent 01ad453285
commit c03f5b63e2
2 changed files with 6 additions and 6 deletions

View file

@ -1060,7 +1060,7 @@ pub(crate) fn handle_completion_resolve(
forced_resolve_completions_config.fields_to_resolve = CompletionFieldsToResolve::empty(); forced_resolve_completions_config.fields_to_resolve = CompletionFieldsToResolve::empty();
let position = FilePosition { file_id, offset }; let position = FilePosition { file_id, offset };
let Some(unresolved_completions) = snap.analysis.completions( let Some(resolved_completions) = snap.analysis.completions(
&forced_resolve_completions_config, &forced_resolve_completions_config,
position, position,
resolve_data.trigger_character, resolve_data.trigger_character,
@ -1075,7 +1075,7 @@ pub(crate) fn handle_completion_resolve(
snap.file_version(position.file_id), snap.file_version(position.file_id),
resolve_data.position, resolve_data.position,
resolve_data.trigger_character, resolve_data.trigger_character,
unresolved_completions, resolved_completions,
); );
let Some(mut resolved_completion) = resolved_completions.into_iter().find(|completion| { let Some(mut resolved_completion) = resolved_completions.into_iter().find(|completion| {
completion.label == original_completion.label completion.label == original_completion.label

View file

@ -286,12 +286,12 @@ fn completion_item(
Some(item.lookup().to_owned()) 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 { let text_edit = if fields_to_resolve.resolve_text_edit {
something_to_resolve = true; something_to_resolve = true;
None None
} else { } 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 mut text_edit = None;
let source_range = item.source_range; let source_range = item.source_range;
for indel in item.text_edit { 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 { let command = if item.trigger_call_info && config.client_commands().trigger_parameter_hints {
if fields_to_resolve.resolve_command { if fields_to_resolve.resolve_command {
something_to_resolve = true; something_to_resolve = true;
Some(command::trigger_parameter_hints())
} else {
None None
} else {
Some(command::trigger_parameter_hints())
} }
} else { } else {
None None