mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Special case for empty comments
This commit is contained in:
parent
44e6c2cb54
commit
d20eea073e
2 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue