aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-25 11:53:40 +0100
committerGitHub <[email protected]>2020-04-25 11:53:40 +0100
commit7bc71732300a57fad928393220ecbe5f751cc20f (patch)
treec63d098391e44f1973c7ff2401be7db4c8261f6f /crates/ra_syntax/src/ast
parentf654f4943552888c2b8f079cf687970268d81f18 (diff)
parentf0fece4be07e338bbccb212ed06a7345b8d04a40 (diff)
Merge #4134
4134: Special case for empty comments in doc comment kind r=matklad a=edwin0cheng Part of #4103 Fix `ui/empty/empty-comment.rs macros` Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/tokens.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs
index 8e04b0bbd..3865729b8 100644
--- a/crates/ra_syntax/src/ast/tokens.rs
+++ b/crates/ra_syntax/src/ast/tokens.rs
@@ -58,6 +58,9 @@ const COMMENT_PREFIX_TO_KIND: &[(&str, CommentKind)] = {
58}; 58};
59 59
60fn kind_by_prefix(text: &str) -> CommentKind { 60fn kind_by_prefix(text: &str) -> CommentKind {
61 if text == "/**/" {
62 return CommentKind { shape: CommentShape::Block, doc: None };
63 }
61 for (prefix, kind) in COMMENT_PREFIX_TO_KIND.iter() { 64 for (prefix, kind) in COMMENT_PREFIX_TO_KIND.iter() {
62 if text.starts_with(prefix) { 65 if text.starts_with(prefix) {
63 return *kind; 66 return *kind;