MCPcopy
hub / github.com/BishopFox/jsluice / NewNode

Function NewNode

tree.go:34–39  ·  view source on GitHub ↗

NewNode creates a new Node for the provided tree-sitter node and a byte-slice containing the JavaScript source. The source provided should be the complete source code and not just the source for the node in question.

(n *sitter.Node, source []byte)

Source from the content-addressed store, hash-verified

32// The source provided should be the complete source code
33// and not just the source for the node in question.
34func NewNode(n *sitter.Node, source []byte) *Node {
35 return &Node{
36 node: n,
37 source: source,
38 }
39}
40
41// AsObject returns a Node as jsluice's internal object type,
42// to allow the fetching of keys etc

Callers 13

ChildByFieldNameMethod · 0.85
ChildMethod · 0.85
NamedChildMethod · 0.85
NextSiblingMethod · 0.85
NextNamedSiblingMethod · 0.85
PrevSiblingMethod · 0.85
PrevNamedSiblingMethod · 0.85
ParentMethod · 0.85
ForEachChildMethod · 0.85
ForEachNamedChildMethod · 0.85
QueryMultiMethod · 0.85
NewAnalyzerFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCollapsedStringFunction · 0.68