mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
type-safer source-map for bindings
This commit is contained in:
parent
1cd184d653
commit
10726fdb65
7 changed files with 45 additions and 30 deletions
|
@ -113,6 +113,7 @@ pub(crate) fn reference_definition(
|
|||
let ptr = source_map.pat_syntax(pat).expect("pattern not found in syntax mapping");
|
||||
let name =
|
||||
path.as_ident().cloned().expect("local binding from a multi-segment path");
|
||||
let ptr = ptr.either(|it| it.into(), |it| it.into());
|
||||
let nav = NavigationTarget::from_scope_entry(file_id, name, ptr);
|
||||
return Exact(nav);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue