Skip to content

Commit

Permalink
fix: do not offer completions within macro strings
Browse files Browse the repository at this point in the history
  • Loading branch information
vishruth-thimmaiah committed Jan 4, 2025
1 parent d1d4319 commit 54a3002
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/ide-completion/src/context/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,14 @@ fn analyze(
derive_ctx,
} = expansion_result;

if original_token.kind() != self_token.kind()
&& !(original_token.kind().is_punct() || original_token.kind().is_trivia())
&& !(SyntaxKind::is_any_identifier(original_token.kind())
&& SyntaxKind::is_any_identifier(self_token.kind()))
{
return None;
}

// Overwrite the path kind for derives
if let Some((original_file, file_with_fake_ident, offset, origin_attr)) = derive_ctx {
if let Some(ast::NameLike::NameRef(name_ref)) =
Expand Down

0 comments on commit 54a3002

Please sign in to comment.