Skip to content

Commit

Permalink
internal/core/export: extract docs from nested Vertex values
Browse files Browse the repository at this point in the history
Change-Id: I8649b2306846b608df09da9c4e2994f1f27437e3
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8101
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Jan 9, 2021
1 parent 778719e commit d4c600f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/core/export/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func extractDocs(v *adt.Vertex, a []adt.Conjunct) (docs []*ast.CommentGroup) {

// Collect docs directly related to this Vertex.
for _, x := range a {
if v, ok := x.Expr().(*adt.Vertex); ok {
docs = append(docs, extractDocs(v, v.Conjuncts)...)
continue
}
f, ok := x.Source().(*ast.Field)
if !ok || hasShorthandValue(f) {
continue
Expand Down

0 comments on commit d4c600f

Please sign in to comment.