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

Function innermostBlock

src/resolution/import-resolver.ts:3252–3259  ·  view source on GitHub ↗

The innermost namespace block a node starts in.

(node: Pick<Node, 'startLine' | 'startColumn'>, blocks: readonly NamespaceBlock[])

Source from the content-addressed store, hash-verified

3250
3251/** The innermost namespace block a node starts in. */
3252function innermostBlock(node: Pick<Node, 'startLine' | 'startColumn'>, blocks: readonly NamespaceBlock[]): NamespaceBlock | undefined {
3253 let inner: NamespaceBlock | undefined;
3254 for (const block of blocks) {
3255 if (!inBlock(node, block)) continue;
3256 if (!inner || block.startLine > inner.startLine || (block.startLine === inner.startLine && block.startColumn > inner.startColumn)) inner = block;
3257 }
3258 return inner;
3259}
3260
3261/** The file that declares the namespace a module exports as `name`, through its re-exports, and the name it declares it under. */
3262function namespaceDeclaringFile(

Callers 2

globalTypeMemberFunction · 0.85
declarationsInFunction · 0.85

Calls 1

inBlockFunction · 0.90

Tested by

no test coverage detected