From dd0c3c41b927654553fa407fbb654bb3a2c64a48 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Wed, 19 Feb 2020 13:13:29 +0900 Subject: Fix a crash with non-ascii whitespace in doc-comments --- crates/ra_ide/src/hover.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ra_ide/src/hover.rs') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 3f88bb260..1de3cb579 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -743,4 +743,21 @@ fn func(foo: i32) { if true { <|>foo; }; } &["u32"], ); } + + #[test] + fn test_hover_non_ascii_space_doc() { + check_hover_result( + " + //- /lib.rs + /// <- `\u{3000}` here + fn foo() { + } + + fn bar() { + fo<|>o(); + } + ", + &["fn foo()\n```\n\n<- `\u{3000}` here"], + ); + } } -- cgit v1.2.3