MCPcopy
hub / github.com/hashicorp/hcl / SourceRange

Method SourceRange

traversal.go:163–171  ·  view source on GitHub ↗

SourceRange returns the source range for the traversal.

()

Source from the content-addressed store, hash-verified

161
162// SourceRange returns the source range for the traversal.
163func (t Traversal) SourceRange() Range {
164 if len(t) == 0 {
165 // Nothing useful to return here, but we'll return something
166 // that's correctly-typed at least.
167 return Range{}
168 }
169
170 return RangeBetween(t[0].SourceRange(), t[len(t)-1].SourceRange())
171}
172
173// TraversalSplit represents a pair of traversals, the first of which is
174// an absolute traversal and the second of which is relative to the first.

Callers

nothing calls this directly

Calls 2

RangeBetweenFunction · 0.85
SourceRangeMethod · 0.65

Tested by

no test coverage detected