Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore committed Sep 23, 2024
1 parent 01ad453 commit c03f5b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/rust-analyzer/src/handlers/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions crates/rust-analyzer/src/lsp/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c03f5b6

Please sign in to comment.