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

Method constructor

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

Source from the content-addressed store, hash-verified

941 private reExportsAsWritten: boolean | null = null;
942
943 constructor(
944 filePath: string,
945 source: string,
946 language?: Language,
947 options?: { sourceIsPreParsed?: boolean; sourceAsWritten?: string }
948 ) {
949 this.filePath = filePath;
950 this.source = source;
951 this.language = language || detectLanguage(filePath, source);
952 this.extractor = EXTRACTORS[this.language] || null;
953 this.fnRefSpec = FN_REF_SPECS[this.language];
954 this.sourceIsPreParsed = options?.sourceIsPreParsed === true;
955 if (options?.sourceAsWritten !== undefined && options.sourceAsWritten !== source) {
956 this.sourceAsWritten = options.sourceAsWritten;
957 }
958 }
959
960 /** The text `getSignature` reads: the source as written when the extractor asks for it. */
961 private get signatureSource(): string {

Callers

nothing calls this directly

Calls 1

detectLanguageFunction · 0.90

Tested by

no test coverage detected