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

Function scopeStartLine

src/resolution/vbnet-receivers.ts:337–349  ·  view source on GitHub ↗

The 0-based line a call's own declarations start on: its member's first line, which holds a method's parameters.

(ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

335
336/** The 0-based line a call's own declarations start on: its member's first line, which holds a method's parameters. */
337function scopeStartLine(ref: UnresolvedRef, context: ResolutionContext): number {
338 const from = context.getNodeById?.(ref.fromNodeId);
339 if (from && from.filePath === ref.filePath && from.startLine <= ref.line && from.endLine >= ref.line &&
340 (from.kind === 'method' || from.kind === 'function' || from.kind === 'property' || from.kind === 'field')) {
341 return from.startLine - 1;
342 }
343 let start = -1;
344 for (const n of context.getNodesInFile(ref.filePath)) {
345 if (n.kind !== 'method' && n.kind !== 'function' && n.kind !== 'property') continue;
346 if (n.startLine <= ref.line && n.endLine >= ref.line && n.startLine - 1 > start) start = n.startLine - 1;
347 }
348 return start < 0 ? ref.line - 1 : start;
349}
350
351const VB_WORD_LINES = new WeakMap<ResolutionContext, Map<string, Map<string, number[]>>>();
352

Callers 1

localBindingFunction · 0.85

Calls 2

getNodeByIdMethod · 0.65
getNodesInFileMethod · 0.65

Tested by

no test coverage detected