Correctly classify Rename Names

This commit is contained in:
Lukas Wirth 2021-07-23 02:14:59 +02:00
parent b744e3369d
commit ef6fed052c
2 changed files with 78 additions and 25 deletions

View file

@ -3780,4 +3780,63 @@ struct Foo;
"#]],
)
}
#[test]
fn hover_rename() {
check(
r#"
use self as foo$0;
"#,
expect![[r#"
*foo*
```rust
extern crate test
```
"#]],
);
check(
r#"
mod bar {}
use bar::{self as foo$0};
"#,
expect![[r#"
*foo*
```rust
test
```
```rust
mod bar
```
"#]],
);
check(
r#"
mod bar {
use super as foo$0;
}
"#,
expect![[r#"
*foo*
```rust
extern crate test
```
"#]],
);
check(
r#"
use crate as foo$0;
"#,
expect![[r#"
*foo*
```rust
extern crate test
```
"#]],
);
}
}