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

Method vbWithTarget

src/extraction/tree-sitter.ts:7233–7245  ·  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

7231 * 1}`). Null in an anonymous type's `New With {.X = 1}`, which declares X.
7232 */
7233 private vbWithTarget(node: SyntaxNode): SyntaxNode | null {
7234 let child = node;
7235 for (let p = node.parent; p; child = p, p = p.parent) {
7236 if (p.type === 'with_statement') {
7237 const expression = getChildByField(p, 'expression');
7238 if (expression && expression.startIndex === child.startIndex && expression.endIndex === child.endIndex) continue;
7239 return expression;
7240 }
7241 if (p.type === 'object_initializer') return p.parent?.type === 'object_creation_expression' ? p.parent : null;
7242 if (p.type === 'anonymous_object_creation_expression') return null;
7243 }
7244 return null;
7245 }
7246
7247 /**
7248 * 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