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

Function jsModuleFile

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

Source from the content-addressed store, hash-verified

2878 * but its own.
2879 */
2880export function jsModuleFile(ref: UnresolvedRef, context: ResolutionContext): string | null {
2881 if (!isJsPathImportRef(ref) && !isJsBareModuleRef(ref, context)) return null;
2882 const declaring = declaredModuleFile(ref.referenceName, ref, context);
2883 if (declaring) return declaring.filePath;
2884 const file = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
2885 return file && file !== ref.filePath ? file : null;
2886}
2887
2888/** PHP reference kinds whose name is a class name, written as in the source. */
2889const 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