aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-04-25 10:37:34 +0100
committerEdwin Cheng <[email protected]>2020-04-25 10:37:34 +0100
commitd20eea073eff348cbc38c03c45305cf21e428f69 (patch)
tree249e116dffe89c2104748f1befe110469d05a128 /crates/ra_syntax/src/ast
parent44e6c2cb54312e14b3c7bd9d64a9fa0547c17ad7 (diff)
Special case for empty comments
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 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)] = {
56}; 56};
57 57
58fn kind_by_prefix(text: &str) -> CommentKind { 58fn kind_by_prefix(text: &str) -> CommentKind {
59 if text == "/**/" {
60 return CommentKind { shape: CommentShape::Block, doc: None };
61 }
59 for (prefix, kind) in COMMENT_PREFIX_TO_KIND.iter() { 62 for (prefix, kind) in COMMENT_PREFIX_TO_KIND.iter() {
60 if text.starts_with(prefix) { 63 if text.starts_with(prefix) {
61 return *kind; 64 return *kind;