Skip to content

Commit

Permalink
[analyzer] fix doc_comment_extractor (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lycs-D authored Mar 23, 2024
1 parent 625fece commit 78dafd7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions analyzer/psi/doc_comment_extractor.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ pub fn extract_doc_comment(el PsiElement) string {
break
}

comments << comment
comment = comment.prev_sibling() or { break }
if prev := comment.prev_sibling() {
if prev.node.start_point().row == comment_start_line {
break
}
comments << comment
comment = prev
} else {
comments << comment
break
}
}

comments.reverse_in_place()
Expand Down

0 comments on commit 78dafd7

Please sign in to comment.