Skip to content

Commit 49984c3

Browse files
committed
Auto merge of rust-lang#17552 - Veykril:fn-param-comp-fix, r=Veykril
fix: Fix parameter completions using macro expanded source ranges Fixes rust-lang/rust-analyzer#17550
2 parents cf69ccd + faa13cb commit 49984c3

File tree

1 file changed

+2
-1
lines changed
  • src/tools/rust-analyzer/crates/ide-completion/src/completions

1 file changed

+2
-1
lines changed

src/tools/rust-analyzer/crates/ide-completion/src/completions/fn_param.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ fn should_add_self_completions(
173173
}
174174

175175
fn comma_wrapper(ctx: &CompletionContext<'_>) -> Option<(impl Fn(&str) -> String, TextRange)> {
176-
let param = ctx.token.parent_ancestors().find(|node| node.kind() == SyntaxKind::PARAM)?;
176+
let param =
177+
ctx.original_token.parent_ancestors().find(|node| node.kind() == SyntaxKind::PARAM)?;
177178

178179
let next_token_kind = {
179180
let t = param.last_token()?.next_token()?;

0 commit comments

Comments
 (0)