From f6e58b076ca430c29f164b65678bbf6bc64a39b7 Mon Sep 17 00:00:00 2001 From: Matt Dumler Date: Wed, 27 May 2020 16:38:36 -0500 Subject: fix(doc): handle comments at the top of the file (#5891) --- cli/doc/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/doc/parser.rs') diff --git a/cli/doc/parser.rs b/cli/doc/parser.rs index 9215637c5..3746e3dfb 100644 --- a/cli/doc/parser.rs +++ b/cli/doc/parser.rs @@ -530,7 +530,7 @@ impl DocParser { pub fn js_doc_for_span(&self, span: Span) -> Option { let comments = self.ast_parser.get_span_comments(span); - let js_doc_comment = comments.iter().find(|comment| { + let js_doc_comment = comments.iter().rev().find(|comment| { comment.kind == CommentKind::Block && comment.text.starts_with('*') })?; -- cgit v1.2.3