The declarations at the block's own level, by name, in position order.
(mod: AmbientModule, context: ResolutionContext)
| 686 | |
| 687 | /** The declarations at the block's own level, by name, in position order. */ |
| 688 | function blockMembers(mod: AmbientModule, context: ResolutionContext): Map<string, Node[]> { |
| 689 | const memo = memoFor(context); |
| 690 | const key = `${mod.file}\0${mod.startLine}\0${mod.startColumn}`; |
| 691 | const cached = memo.members.get(key); |
| 692 | if (cached) return cached; |
| 693 | const members = new Map<string, Node[]>(); |
| 694 | const nodes = context |
| 695 | .getNodesInFile(mod.file) |
| 696 | .filter((n) => isBlockLevel(n) && inBlock(n, mod)) |
| 697 | .sort((a, b) => a.startLine - b.startLine || a.startColumn - b.startColumn); |
| 698 | for (const n of nodes) { |
| 699 | const list = members.get(n.name); |
| 700 | if (list) list.push(n); |
| 701 | else members.set(n.name, [n]); |
| 702 | } |
| 703 | memo.members.set(key, members); |
| 704 | return members; |
| 705 | } |
| 706 | |
| 707 | /** A path that is not the program's own: a test, a fixture, an example (see search/query-utils). */ |
| 708 | const isTestCode = (file: string): boolean => isTestFile(file); |
no test coverage detected