MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / vbWithTarget

Method vbWithTarget

src/extraction/tree-sitter.ts:7025–7037  ·  view source on GitHub ↗

* What a VB.NET `.Member` is read through: the expression of the `With` * block it is in (a nested block's own `With .Inner` is read through the * block around it), or the object an initializer sets up (`New T With {.X = * 1}`). Null in an anonymous type's `New With {.X = 1}`, which declare

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

7023 * 1}`). Null in an anonymous type's `New With {.X = 1}`, which declares X.
7024 */
7025 private vbWithTarget(node: SyntaxNode): SyntaxNode | null {
7026 let child = node;
7027 for (let p = node.parent; p; child = p, p = p.parent) {
7028 if (p.type === 'with_statement') {
7029 const expression = getChildByField(p, 'expression');
7030 if (expression && expression.startIndex === child.startIndex && expression.endIndex === child.endIndex) continue;
7031 return expression;
7032 }
7033 if (p.type === 'object_initializer') return p.parent?.type === 'object_creation_expression' ? p.parent : null;
7034 if (p.type === 'anonymous_object_creation_expression') return null;
7035 }
7036 return null;
7037 }
7038
7039 /**
7040 * Find a `class_body` child of an `object_creation_expression` — the

Callers 3

extractCallMethod · 0.95
extractVbMemberReadMethod · 0.95
vbReceiverPathMethod · 0.95

Calls 1

getChildByFieldFunction · 0.90

Tested by

no test coverage detected