(filePath: string, context: ResolutionContext)
| 409 | |
| 410 | const PYTHON_MEMBER_LINES = new WeakMap<ResolutionContext, Map<string, string[]>>(); |
| 411 | function 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 | |
| 422 | function pythonLocalType(receiver: string, ref: UnresolvedRef, context: ResolutionContext): string | null { |
| 423 | if (!/^\w+$/.test(receiver)) return null; |
no test coverage detected