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

Function jsModuleFile

src/resolution/import-resolver.ts:3227–3233  ·  view source on GitHub ↗
(ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

3225 * but its own.
3226 */
3227export function jsModuleFile(ref: UnresolvedRef, context: ResolutionContext): string | null {
3228 if (!isJsPathImportRef(ref) && !isJsBareModuleRef(ref, context)) return null;
3229 const declaring = declaredModuleFile(ref.referenceName, ref, context);
3230 if (declaring) return declaring.filePath;
3231 const file = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
3232 return file && file !== ref.filePath ? file : null;
3233}
3234
3235/** PHP reference kinds whose name is a class name, written as in the source. */
3236const PHP_CLASS_NAME_REFS: ReadonlySet<string> = new Set(['instantiates', 'extends', 'implements', 'references']);

Callers 2

couldNameAnyOfMethod · 0.90
resolveViaImportFunction · 0.85

Calls 4

isJsPathImportRefFunction · 0.85
isJsBareModuleRefFunction · 0.85
declaredModuleFileFunction · 0.85
resolveImportPathFunction · 0.85

Tested by

no test coverage detected