mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Improve goto definition for MBE
This commit is contained in:
parent
6c1ec865fb
commit
371961be0e
6 changed files with 55 additions and 9 deletions
|
@ -216,6 +216,29 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goto_definition_works_for_macros_from_other_crates() {
|
||||
covers!(goto_definition_works_for_macros);
|
||||
check_goto(
|
||||
"
|
||||
//- /lib.rs
|
||||
use foo::foo;
|
||||
fn bar() {
|
||||
<|>foo!();
|
||||
}
|
||||
|
||||
//- /foo/lib.rs
|
||||
#[macro_export]
|
||||
macro_rules! foo {
|
||||
() => {
|
||||
{}
|
||||
};
|
||||
}
|
||||
",
|
||||
"foo MACRO_CALL FileId(2) [0; 79) [29; 32)",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goto_definition_works_for_methods() {
|
||||
covers!(goto_definition_works_for_methods);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue