MCPcopy
hub / github.com/pelletier/go-toml / keyLocation

Function keyLocation

strict.go:89–108  ·  view source on GitHub ↗

keyLocation returns the range of the document covering all the parts of the key of the given node.

(node *unstable.Node)

Source from the content-addressed store, hash-verified

87// keyLocation returns the range of the document covering all the parts of
88// the key of the given node.
89func keyLocation(node *unstable.Node) unstable.Range {
90 k := node.Key()
91
92 hasOne := k.Next()
93 if !hasOne {
94 panic("should not be called with empty key")
95 }
96
97 start := k.Node().Raw
98 end := start
99
100 for k.Next() {
101 end = k.Node().Raw
102 }
103
104 return unstable.Range{
105 Offset: start.Offset,
106 Length: end.Offset + end.Length - start.Offset,
107 }
108}

Callers 3

MissingTableMethod · 0.85
MissingFieldMethod · 0.85

Calls 3

NodeMethod · 0.80
KeyMethod · 0.45
NextMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…