diff options
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 1b6ff6d21..cf04c3de0 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -3357,4 +3357,66 @@ impl Foo { | |||
3357 | "#]], | 3357 | "#]], |
3358 | ); | 3358 | ); |
3359 | } | 3359 | } |
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 | } | ||
3360 | } | 3422 | } |