mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
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 <edwin0cheng@gmail.com>
This commit is contained in:
commit
7bc7173230
2 changed files with 16 additions and 0 deletions
|
@ -58,6 +58,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