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

Method pascalDataNames

src/extraction/tree-sitter.ts:10523–10541  ·  view source on GitHub ↗

* The names data takes for a routine of class `classQn`, lowercased: the * class's fields, properties and constants, and the unit's variables and * constants. A bare name among them reads that data.

(classQn: string | null)

Source from the content-addressed store, hash-verified

10521 * constants. A bare name among them reads that data.
10522 */
10523 private pascalDataNames(classQn: string | null): Set<string> {
10524 const key = classQn ?? '';
10525 let names = this.pascalDataNameSets.get(key);
10526 if (names) return names;
10527 names = new Set();
10528 const prefix = classQn ? `${classQn.toLowerCase()}::` : null;
10529 for (const n of this.nodes) {
10530 if (n.kind === 'enum_member') {
10531 names.add(n.name.toLowerCase()); // enum values are visible unqualified
10532 continue;
10533 }
10534 if (n.kind !== 'field' && n.kind !== 'property' && n.kind !== 'constant' && n.kind !== 'variable') continue;
10535 const qn = n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase();
10536 const own = prefix !== null && qn.startsWith(prefix) && qn.indexOf('::', prefix.length) < 0;
10537 if (own || !qn.includes('::')) names.add(n.name.toLowerCase());
10538 }
10539 this.pascalDataNameSets.set(key, names);
10540 return names;
10541 }
10542}
10543
10544

Callers 1

Calls 3

getMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected