fix: find Self reference

This commit is contained in:
Young-Flash 2023-11-10 19:54:43 +08:00
parent 3b7c7f97e4
commit e0276dc5dd
2 changed files with 27 additions and 1 deletions

View file

@ -683,6 +683,32 @@ enum Foo {
);
}
#[test]
fn test_self() {
check(
r#"
struct S$0<T> {
t: PhantomData<T>,
}
impl<T> S<T> {
fn new() -> Self {
Self {
t: Default::default(),
}
}
}
"#,
expect![[r#"
S Struct FileId(0) 0..38 7..8
FileId(0) 48..49
FileId(0) 71..75
FileId(0) 86..90
"#]],
)
}
#[test]
fn test_find_all_refs_two_modules() {
check(