mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Render matched macro arm on hover of macro calls
This commit is contained in:
parent
062e1b9b81
commit
6bfdd38c69
11 changed files with 133 additions and 65 deletions
|
@ -1560,21 +1560,21 @@ fn y() {
|
|||
fn test_hover_macro_invocation() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! foo { () => {} }
|
||||
macro_rules! foo { (a) => {}; () => {} }
|
||||
|
||||
fn f() { fo$0o!(); }
|
||||
"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
macro_rules! foo
|
||||
```
|
||||
"#]],
|
||||
```rust
|
||||
macro_rules! foo // matched arm #1
|
||||
```
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1590,22 +1590,22 @@ macro foo() {}
|
|||
fn f() { fo$0o!(); }
|
||||
"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
macro foo
|
||||
```
|
||||
```rust
|
||||
macro foo // matched arm #0
|
||||
```
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
foo bar
|
||||
foo bar
|
||||
|
||||
foo bar baz
|
||||
"#]],
|
||||
foo bar baz
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue