Skip to content

Commit

Permalink
Doesn't handle lists when computing the synopsis
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow authored and jonludlam committed Mar 25, 2021
1 parent 4a0a17b commit 069b961
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/model/comment.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,8 @@ type docs = block_element with_location list

type docs_or_stop = [ `Docs of docs | `Stop ]

(** The synopsis is the first element of a comment if it is a paragraph or a
list. In the case of a list, the first item is considered. Otherwise, there
is no synopsis. *)
let rec synopsis docs =
let open Location_ in
match docs with
| { value = `Paragraph p; _ } :: _ -> Some p
| { value = `List (_, first_item :: _); _ } :: _ ->
synopsis (first_item :> docs)
(** The synopsis is the first element of a comment if it is a paragraph.
Otherwise, there is no synopsis. *)
let synopsis = function
| { Location_.value = `Paragraph p; _ } :: _ -> Some p
| _ -> None

0 comments on commit 069b961

Please sign in to comment.