feat: Handle operators like their trait functions in the IDE

This commit is contained in:
Lukas Wirth 2022-08-05 14:16:36 +02:00
parent cb52271701
commit d6e78b04d0
12 changed files with 459 additions and 68 deletions

View file

@ -5051,3 +5051,37 @@ fn f() {
```"#]],
);
}
#[test]
fn hover_deref() {
check(
r#"
//- minicore: deref
struct Struct(usize);
impl core::ops::Deref for Struct {
type Target = usize;
fn deref(&self) -> &Self::Target {
&self.0
}
}
fn f() {
$0*Struct(0);
}
"#,
expect![[r#"
***
```rust
test::Struct
```
```rust
fn deref(&self) -> &Self::Target
```
"#]],
);
}