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

Method constructor

src/extraction/tree-sitter.ts:979–994  ·  view source on GitHub ↗
(
    filePath: string,
    source: string,
    language?: Language,
    options?: { sourceIsPreParsed?: boolean; sourceAsWritten?: string }
  )

Source from the content-addressed store, hash-verified

977 private reExportsAsWritten: boolean | null = null;
978
979 constructor(
980 filePath: string,
981 source: string,
982 language?: Language,
983 options?: { sourceIsPreParsed?: boolean; sourceAsWritten?: string }
984 ) {
985 this.filePath = filePath;
986 this.source = source;
987 this.language = language || detectLanguage(filePath, source);
988 this.extractor = EXTRACTORS[this.language] || null;
989 this.fnRefSpec = FN_REF_SPECS[this.language];
990 this.sourceIsPreParsed = options?.sourceIsPreParsed === true;
991 if (options?.sourceAsWritten !== undefined && options.sourceAsWritten !== source) {
992 this.sourceAsWritten = options.sourceAsWritten;
993 }
994 }
995
996 /** The text `getSignature` reads: the source as written when the extractor asks for it. */
997 private get signatureSource(): string {

Callers

nothing calls this directly

Calls 1

detectLanguageFunction · 0.90

Tested by

no test coverage detected