Skip to content

Commit

Permalink
allow removing comments from assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Feb 4, 2024
1 parent e419d78 commit bebed8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ast/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func (doc *Document) Set(input *Assignment, options SetOptions) (bool, error) {
existing.Comments = nil

for _, comment := range comments {
if len(comment) == 0 && len(comments) == 1 {
continue
}

existing.Comments = append(existing.Comments, NewComment(comment))
}
}
Expand Down

0 comments on commit bebed8a

Please sign in to comment.