-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scip output doesn't include implicit field references during struct initialization #19393
Labels
Comments
Seems like the bug is around here: // FIXME: This is a weird function
pub fn get_definition(
sema: &Semantics<'_, RootDatabase>,
token: SyntaxToken,
) -> Option<Definition> {
for token in sema.descend_into_macros_exact(token) {
let def = IdentClass::classify_token(sema, &token).map(IdentClass::definitions_no_ops);
if let Some(&[x]) = def.as_deref() {
return Some(x);
}
}
None
} |
jrmuizel
added a commit
to jrmuizel/rust-analyzer
that referenced
this issue
Apr 4, 2025
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes rust-lang#19393
jrmuizel
added a commit
to jrmuizel/rust-analyzer
that referenced
this issue
Apr 4, 2025
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes rust-lang#19393
jrmuizel
added a commit
to jrmuizel/rust-analyzer
that referenced
this issue
Apr 4, 2025
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes rust-lang#19393
jrmuizel
added a commit
to jrmuizel/rust-analyzer
that referenced
this issue
Apr 4, 2025
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes rust-lang#19393
jrmuizel
added a commit
to jrmuizel/rust-analyzer
that referenced
this issue
Apr 4, 2025
Implicit field references during struct initialization were being dropped because get_definition was returning None because there were multiple definitions. This adds a new helper, `get_defintions`, that supports returning more than one definition for a given token and hooks it up. Fixes rust-lang#19393
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rust-analyzer version: rust-analyzer 1.85.0 (4d91de4e 2025-02-17)
code snippet to reproduce:
scip print index.scip
gives:for the line
let mut p = Point {x, y };
We should include field references for
Point#x
andPoint#y
like is done if it wasPoint{x:x, y:y}
The text was updated successfully, but these errors were encountered: