(content *hcl.BodyContent, blockLabels []blockLabel)
| 686 | } |
| 687 | |
| 688 | func (s *BlockTupleSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { |
| 689 | // We return the source range of the _first_ block of the given type, |
| 690 | // since they are not guaranteed to form a contiguous range. |
| 691 | |
| 692 | var childBlock *hcl.Block |
| 693 | for _, candidate := range content.Blocks { |
| 694 | if candidate.Type != s.TypeName { |
| 695 | continue |
| 696 | } |
| 697 | |
| 698 | childBlock = candidate |
| 699 | break |
| 700 | } |
| 701 | |
| 702 | if childBlock == nil { |
| 703 | return content.MissingItemRange |
| 704 | } |
| 705 | |
| 706 | return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) |
| 707 | } |
| 708 | |
| 709 | // A BlockSetSpec is a Spec that produces a cty set of the results of |
| 710 | // decoding all of the nested blocks of a given type, using a nested spec. |
nothing calls this directly
no test coverage detected