Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r--crates/ide/src/references.rs29
1 files changed, 25 insertions, 4 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs
index 64d717f88d..339315db57 100644
--- a/crates/ide/src/references.rs
+++ b/crates/ide/src/references.rs
@@ -1701,14 +1701,14 @@ fn f() {
}
"#,
expect![[r#"
- func Function FileId(0) 137..146 140..144
+ func Function FileId(0) 137..146 140..144 module
- FileId(0) 161..165
+ FileId(0) 181..185
- func Function FileId(0) 137..146 140..144 module
+ func Function FileId(0) 137..146 140..144
- FileId(0) 181..185
+ FileId(0) 161..165
"#]],
)
}
@@ -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
+ "#]],
+ );
+ }
}