From d20eea073eff348cbc38c03c45305cf21e428f69 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sat, 25 Apr 2020 17:37:34 +0800 Subject: Special case for empty comments --- crates/ra_syntax/src/ast/tokens.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index e8320b57e..a60768056 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs @@ -56,6 +56,9 @@ const COMMENT_PREFIX_TO_KIND: &[(&str, CommentKind)] = { }; fn kind_by_prefix(text: &str) -> CommentKind { + if text == "/**/" { + return CommentKind { shape: CommentShape::Block, doc: None }; + } for (prefix, kind) in COMMENT_PREFIX_TO_KIND.iter() { if text.starts_with(prefix) { return *kind; -- cgit v1.2.3