(content *hcl.BodyContent, blockLabels []blockLabel)
| 846 | } |
| 847 | |
| 848 | func (s *BlockSetSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { |
| 849 | // We return the source range of the _first_ block of the given type, |
| 850 | // since they are not guaranteed to form a contiguous range. |
| 851 | |
| 852 | var childBlock *hcl.Block |
| 853 | for _, candidate := range content.Blocks { |
| 854 | if candidate.Type != s.TypeName { |
| 855 | continue |
| 856 | } |
| 857 | |
| 858 | childBlock = candidate |
| 859 | break |
| 860 | } |
| 861 | |
| 862 | if childBlock == nil { |
| 863 | return content.MissingItemRange |
| 864 | } |
| 865 | |
| 866 | return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) |
| 867 | } |
| 868 | |
| 869 | // A BlockMapSpec is a Spec that produces a cty map of the results of |
| 870 | // decoding all of the nested blocks of a given type, using a nested spec. |
nothing calls this directly
no test coverage detected