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

Function cppNamespaceAliases

src/resolution/cpp-namespaces.ts:37–47  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

35
36/** The project's namespace aliases: `namespace py = pybind11;`. */
37export function cppNamespaceAliases(context: ResolutionContext): Map<string, string> {
38 const hit = CPP_NS_ALIASES.get(context);
39 if (hit) return hit;
40 const aliases = new Map<string, string>();
41 for (const file of context.getAllFiles()) {
42 const source = CPP_NS_ALIAS_FILE.test(file) ? context.readFile(file) : null;
43 if (source) addNamespaceAliases(file, source, aliases);
44 }
45 CPP_NS_ALIASES.set(context, aliases);
46 return aliases;
47}
48
49/**
50 * For a walk over `getAllFiles` in its order, which holds every file's text

Callers 4

lookUpCppClassFunction · 0.90
cppNamespaceScansFunction · 0.85

Calls 5

addNamespaceAliasesFunction · 0.85
readFileMethod · 0.80
getMethod · 0.65
getAllFilesMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected