fix: Fix token downmapping failing for include! inputs

This commit is contained in:
Lukas Wirth 2024-10-21 16:58:34 +02:00
parent fb832ff2ba
commit d878b8caad
6 changed files with 125 additions and 41 deletions

View file

@ -2750,4 +2750,25 @@ impl Foo {
"#]],
);
}
#[test]
fn goto_ref_on_included_file() {
check(
r#"
//- minicore:include
//- /lib.rs
include!("foo.rs");
fn howdy() {
let _ = FOO;
}
//- /foo.rs
const FOO$0: i32 = 0;
"#,
expect![[r#"
FOO Const FileId(1) 0..19 6..9
FileId(0) 45..48
"#]],
);
}
}