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

Function jsModuleFile

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

Source from the content-addressed store, hash-verified

2979 * but its own.
2980 */
2981export function jsModuleFile(ref: UnresolvedRef, context: ResolutionContext): string | null {
2982 if (!isJsPathImportRef(ref) && !isJsBareModuleRef(ref, context)) return null;
2983 const declaring = declaredModuleFile(ref.referenceName, ref, context);
2984 if (declaring) return declaring.filePath;
2985 const file = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
2986 return file && file !== ref.filePath ? file : null;
2987}
2988
2989/** PHP reference kinds whose name is a class name, written as in the source. */
2990const 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