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

Method pascalDataNames

src/extraction/tree-sitter.ts:9948–9966  ·  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

9946 * constants. A bare name among them reads that data.
9947 */
9948 private pascalDataNames(classQn: string | null): Set<string> {
9949 const key = classQn ?? '';
9950 let names = this.pascalDataNameSets.get(key);
9951 if (names) return names;
9952 names = new Set();
9953 const prefix = classQn ? `${classQn.toLowerCase()}::` : null;
9954 for (const n of this.nodes) {
9955 if (n.kind === 'enum_member') {
9956 names.add(n.name.toLowerCase()); // enum values are visible unqualified
9957 continue;
9958 }
9959 if (n.kind !== 'field' && n.kind !== 'property' && n.kind !== 'constant' && n.kind !== 'variable') continue;
9960 const qn = n.qualifiedName.replace(/<[^>]*>/g, '').toLowerCase();
9961 const own = prefix !== null && qn.startsWith(prefix) && qn.indexOf('::', prefix.length) < 0;
9962 if (own || !qn.includes('::')) names.add(n.name.toLowerCase());
9963 }
9964 this.pascalDataNameSets.set(key, names);
9965 return names;
9966 }
9967}
9968
9969

Callers 1

Calls 3

getMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected