Skip to content

Commit da3b5e3

Browse files
committed
Test inner and outer doc comments in hover
1 parent f8823e8 commit da3b5e3

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

crates/ide/src/hover.rs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,4 +3357,66 @@ impl Foo {
33573357
"#]],
33583358
);
33593359
}
3360+
3361+
#[test]
3362+
fn hover_doc_outer_inner() {
3363+
check(
3364+
r#"
3365+
/// Be quick;
3366+
mod Foo<|> {
3367+
//! time is mana
3368+
3369+
/// This comment belongs to the function
3370+
fn foo() {}
3371+
}
3372+
"#,
3373+
expect![[r#"
3374+
*Foo*
3375+
3376+
```rust
3377+
test
3378+
```
3379+
3380+
```rust
3381+
mod Foo
3382+
```
3383+
3384+
---
3385+
3386+
Be quick;
3387+
time is mana
3388+
"#]],
3389+
);
3390+
}
3391+
3392+
#[test]
3393+
fn hover_doc_outer_inner_attribue() {
3394+
check(
3395+
r#"
3396+
#[doc = "Be quick;"]
3397+
mod Foo<|> {
3398+
#![doc = "time is mana"]
3399+
3400+
#[doc = "This comment belongs to the function"]
3401+
fn foo() {}
3402+
}
3403+
"#,
3404+
expect![[r#"
3405+
*Foo*
3406+
3407+
```rust
3408+
test
3409+
```
3410+
3411+
```rust
3412+
mod Foo
3413+
```
3414+
3415+
---
3416+
3417+
Be quick;
3418+
time is mana
3419+
"#]],
3420+
);
3421+
}
33603422
}

0 commit comments

Comments
 (0)