mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Add support for doc on hover for macro 2.0
This commit is contained in:
parent
4520002b63
commit
eedadd7024
2 changed files with 33 additions and 2 deletions
|
@ -1234,6 +1234,37 @@ fn f() { fo$0o!(); }
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_macro2_invocation() {
|
||||
check(
|
||||
r#"
|
||||
/// foo bar
|
||||
///
|
||||
/// foo bar baz
|
||||
macro foo() {}
|
||||
|
||||
fn f() { fo$0o!(); }
|
||||
"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
macro foo
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
foo bar
|
||||
|
||||
foo bar baz
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_tuple_field() {
|
||||
check(
|
||||
|
|
|
@ -147,8 +147,8 @@ fn n_attached_trivias<'a>(
|
|||
trivias: impl Iterator<Item = (SyntaxKind, &'a str)>,
|
||||
) -> usize {
|
||||
match kind {
|
||||
MACRO_CALL | MACRO_RULES | CONST | TYPE_ALIAS | STRUCT | UNION | ENUM | VARIANT | FN
|
||||
| TRAIT | MODULE | RECORD_FIELD | STATIC | USE => {
|
||||
MACRO_CALL | MACRO_RULES | MACRO_DEF | CONST | TYPE_ALIAS | STRUCT | UNION | ENUM
|
||||
| VARIANT | FN | TRAIT | MODULE | RECORD_FIELD | STATIC | USE => {
|
||||
let mut res = 0;
|
||||
let mut trivias = trivias.enumerate().peekable();
|
||||
|
||||
|
|
Loading…
Reference in a new issue