Skip to content

Commit d4c600f

Browse files
committed
internal/core/export: extract docs from nested Vertex values
Change-Id: I8649b2306846b608df09da9c4e2994f1f27437e3 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8101 Reviewed-by: CUE cueckoo <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 778719e commit d4c600f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/core/export/extract.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ func extractDocs(v *adt.Vertex, a []adt.Conjunct) (docs []*ast.CommentGroup) {
3737

3838
// Collect docs directly related to this Vertex.
3939
for _, x := range a {
40+
if v, ok := x.Expr().(*adt.Vertex); ok {
41+
docs = append(docs, extractDocs(v, v.Conjuncts)...)
42+
continue
43+
}
4044
f, ok := x.Source().(*ast.Field)
4145
if !ok || hasShorthandValue(f) {
4246
continue

0 commit comments

Comments
 (0)