Skip to content

Commit

Permalink
Merge pull request #18889 from ChayimFriedman2/subtle-completion
Browse files Browse the repository at this point in the history
fix: Fix actual token lookup in completion's `expand()`
  • Loading branch information
Veykril authored Jan 9, 2025
2 parents 2e234e3 + 0c77bce commit cc016df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/ide-completion/src/context/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ fn expand(
) -> Option<ExpansionResult> {
let _p = tracing::info_span!("CompletionContext::expand").entered();

// Left biased since there may already be an identifier token there, and we appended to it.
if !sema.might_be_inside_macro_call(&fake_ident_token)
&& original_file
.token_at_offset(original_offset + relative_offset)
.right_biased()
.left_biased()
.is_some_and(|original_token| !sema.might_be_inside_macro_call(&original_token))
{
// Recursion base case.
Expand Down

0 comments on commit cc016df

Please sign in to comment.