Skip to content

Commit

Permalink
🥅 (completion): Ignore errors during value completion
Browse files Browse the repository at this point in the history
Previously, an invalid template would halt value processing
  • Loading branch information
gabe565 committed Mar 7, 2023
1 parent c69c656 commit 87d6156
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/visitor/find_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ func (visitor *FindArgs) Run(n *yaml.Node) error {
switch {
case len(n.Content) == 0:
// Node has no children. Search current node.
if err := visitor.FindArgs(n, n.Value); err != nil {
return err
}
_ = visitor.FindArgs(n, n.Value)
case n.Kind == yaml.MappingNode:
for i := 0; i < len(n.Content); i += 2 {
// Attempt to fetch template from comments on the key.
Expand All @@ -80,9 +78,7 @@ func (visitor *FindArgs) Run(n *yaml.Node) error {
} else {
// Template is on key's comment instead of value.
// This typically happens if the value is left empty with an implied null.
if err := visitor.FindArgs(key, val.Value); err != nil {
return err
}
_ = visitor.FindArgs(key, val.Value)
}
}
default:
Expand Down

0 comments on commit 87d6156

Please sign in to comment.