(content *hcl.BodyContent, blockLabels []blockLabel)
| 1000 | } |
| 1001 | |
| 1002 | func (s *BlockMapSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { |
| 1003 | // We return the source range of the _first_ block of the given type, |
| 1004 | // since they are not guaranteed to form a contiguous range. |
| 1005 | |
| 1006 | var childBlock *hcl.Block |
| 1007 | for _, candidate := range content.Blocks { |
| 1008 | if candidate.Type != s.TypeName { |
| 1009 | continue |
| 1010 | } |
| 1011 | |
| 1012 | childBlock = candidate |
| 1013 | break |
| 1014 | } |
| 1015 | |
| 1016 | if childBlock == nil { |
| 1017 | return content.MissingItemRange |
| 1018 | } |
| 1019 | |
| 1020 | return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) |
| 1021 | } |
| 1022 | |
| 1023 | // A BlockObjectSpec is a Spec that produces a cty object of the results of |
| 1024 | // decoding all of the nested blocks of a given type, using a nested spec. |
nothing calls this directly
no test coverage detected