Module: util/treeSitterUtils
Functions
getAncestors
▸ getAncestors(node
, includeNode?
): SyntaxNode
[]
Returns a list of the node's ancestors, including the node itself if
includeNode
is true
Parameters
Name | Type | Default value | Description |
---|---|---|---|
node | SyntaxNode | undefined | The node to iterate ancestors from |
includeNode | boolean | true | Whether to include the node itself in the returned list |
Returns
A list of ancestors possibly including the includeNode node itself
Defined in
util/treeSitterUtils.ts:47
getChildNodesForFieldName
▸ getChildNodesForFieldName(node
, fieldName
): SyntaxNode
[]
Parameters
Name | Type |
---|---|
node | SyntaxNode |
fieldName | string |
Returns
Defined in
util/treeSitterUtils.ts:18
getDeclarationNode
▸ Const
getDeclarationNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:15
getDefinitionNode
▸ Const
getDefinitionNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:12
getKeyNode
▸ Const
getKeyNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:10
getLeftNode
▸ Const
getLeftNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:6
getNameNode
▸ Const
getNameNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:8
getValueNode
▸ Const
getValueNode(node
): null
| SyntaxNode
Parameters
Name | Type |
---|---|
node | SyntaxNode |
Returns
null
| SyntaxNode
Defined in
util/treeSitterUtils.ts:3
isContainedInErrorNode
▸ isContainedInErrorNode(node
): boolean
Determines whether the given node or one of its ancestors is an error node
Parameters
Name | Type | Description |
---|---|---|
node | SyntaxNode | The node to check |
Returns
boolean
True if the given node is contained in an error node
Defined in
util/treeSitterUtils.ts:66