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

Function pythonMemberLines

src/resolution/name-matcher.ts:411–420  ·  view source on GitHub ↗
(filePath: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

409
410const PYTHON_MEMBER_LINES = new WeakMap<ResolutionContext, Map<string, string[]>>();
411function pythonMemberLines(filePath: string, context: ResolutionContext): string[] {
412 let files = PYTHON_MEMBER_LINES.get(context);
413 if (!files) { files = new Map(); PYTHON_MEMBER_LINES.set(context, files); }
414 let lines = files.get(filePath);
415 if (!lines) {
416 lines = stripCommentsForRegex(context.readFile(filePath) ?? '', 'python').split('\n');
417 files.set(filePath, lines);
418 }
419 return lines;
420}
421
422function pythonLocalType(receiver: string, ref: UnresolvedRef, context: ResolutionContext): string | null {
423 if (!/^\w+$/.test(receiver)) return null;

Callers 12

pythonMembersFunction · 0.85
pythonLocalTypeFunction · 0.85
pythonStatementStartsFunction · 0.85
pythonOwnLinesFunction · 0.85
pythonBindsLocallyFunction · 0.85
scanPythonImportKeysFunction · 0.85
scanPythonGlobalBindingsFunction · 0.85
pythonModuleAliasesFunction · 0.85
pythonMainBlockLinesFunction · 0.85
pythonExternalWritesFunction · 0.85
pythonDynamicGlobalWriteFunction · 0.85
pythonFieldTypeFunction · 0.85

Calls 4

stripCommentsForRegexFunction · 0.90
readFileMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected