mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
fix go to parent module
This commit is contained in:
parent
4209022e5b
commit
077a02271c
2 changed files with 21 additions and 2 deletions
|
@ -12,7 +12,7 @@ pub(crate) fn parent_module(
|
|||
None => return Ok(Vec::new()),
|
||||
Some(it) => it,
|
||||
};
|
||||
let nav = NavigationTarget::from_module(db, module)?;
|
||||
let nav = NavigationTarget::from_module_to_decl(db, module)?;
|
||||
Ok(vec![nav])
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ mod tests {
|
|||
",
|
||||
);
|
||||
let nav = analysis.parent_module(pos).unwrap().pop().unwrap();
|
||||
nav.assert_match("foo SOURCE_FILE FileId(2) [0; 10)");
|
||||
nav.assert_match("foo MODULE FileId(1) [0; 8)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue