Skip to content

Commit

Permalink
skip empty eol comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Mar 23, 2024
1 parent 88a15b7 commit 8bbbe89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions analyzer/psi/doc_comment_extractor.v
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ pub fn extract_doc_comment(el PsiElement) string {
if next is Comment {
comment_start_line := next.node.start_point().row
if comment_start_line == el_start_line {
field_eol_comment = '... ' + next.get_text().trim_string_left('//').trim_space()
field_eol_comment = next.get_text().trim_string_left('//').trim_space()
}
}
}
}

if comments.len == 0 {
return field_eol_comment
return if field_eol_comment != '' { '... ' + field_eol_comment } else { '' }
}

comments.reverse_in_place()
Expand Down Expand Up @@ -100,6 +100,6 @@ pub fn extract_doc_comment(el PsiElement) string {
}
}

res_str := res.str() + if field_eol_comment != '' { '\n\n' + field_eol_comment } else { '' }
res_str := res.str() + if field_eol_comment != '' { '\n\n... ' + field_eol_comment } else { '' }
return res_str
}

0 comments on commit 8bbbe89

Please sign in to comment.