diff options
author | Josh Mcguigan <[email protected]> | 2020-10-23 04:43:07 +0100 |
---|---|---|
committer | Josh Mcguigan <[email protected]> | 2020-10-24 03:36:30 +0100 |
commit | 4e76e884bd74430223919f29d49d7ae9710b48cf (patch) | |
tree | 1f96284c93950f539f6e64b65d7e5991399f1a10 /crates/ide | |
parent | 8b3c851dd37f39f79e7e8807378f45fdde7f6411 (diff) |
correct hover for items with doc attribute with raw strings
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/hover.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 6466422c5..508e8af20 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -638,6 +638,33 @@ fn main() { } | |||
638 | } | 638 | } |
639 | 639 | ||
640 | #[test] | 640 | #[test] |
641 | fn hover_shows_fn_doc_attr_raw_string() { | ||
642 | check( | ||
643 | r##" | ||
644 | #[doc = r#"Raw string doc attr"#] | ||
645 | pub fn foo<|>(_: &Path) {} | ||
646 | |||
647 | fn main() { } | ||
648 | "##, | ||
649 | expect![[r##" | ||
650 | *foo* | ||
651 | |||
652 | ```rust | ||
653 | test | ||
654 | ``` | ||
655 | |||
656 | ```rust | ||
657 | pub fn foo(_: &Path) | ||
658 | ``` | ||
659 | |||
660 | --- | ||
661 | |||
662 | Raw string doc attr | ||
663 | "##]], | ||
664 | ); | ||
665 | } | ||
666 | |||
667 | #[test] | ||
641 | fn hover_shows_struct_field_info() { | 668 | fn hover_shows_struct_field_info() { |
642 | // Hovering over the field when instantiating | 669 | // Hovering over the field when instantiating |
643 | check( | 670 | check( |