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

Method importSource

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

* The text an import node reads its statement from: for a re-export, the * source as written when the extractor asks (`reExportAsWritten`), so * `export type * from './x'` keeps its `type` (#2474).

(node: SyntaxNode)

Source from the content-addressed store, hash-verified

1004 * `export type * from './x'` keeps its `type` (#2474).
1005 */
1006 private importSource(node: SyntaxNode): string {
1007 if (node.type !== 'export_statement' || this.sourceAsWritten === null) return this.source;
1008 this.reExportsAsWritten ??= this.extractor?.reExportAsWritten?.(this.sourceAsWritten) === true;
1009 return this.reExportsAsWritten ? this.sourceAsWritten : this.source;
1010 }
1011
1012 /**
1013 * Parse and extract from the source code

Callers 1

extractImportMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected