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

Method findByQualifiedName

src/graph/queries.ts:163–196  ·  view source on GitHub ↗

* Find symbols by qualified name pattern * * @param pattern - Pattern to match (supports * wildcard) * @returns Array of matching nodes

(pattern: string)

Source from the content-addressed store, hash-verified

161 * @returns Array of matching nodes
162 */
163 findByQualifiedName(pattern: string): Node[] {
164 // Convert glob pattern to regex
165 const regexPattern = pattern
166 .replace(/[.+^${}()|[\]\\]/g, '\\$&')
167 .replace(/\*/g, '.*')
168 .replace(/\?/g, '.');
169
170 const regex = new RegExp(`^${regexPattern}$`);
171
172 // This is inefficient for large graphs - would need FTS index on qualified_name
173 // For now, use kind-based filtering if possible
174 const allNodes: Node[] = [];
175 const kinds: Node['kind'][] = [
176 'class',
177 'union',
178 'function',
179 'method',
180 'interface',
181 'type_alias',
182 'variable',
183 'constant',
184 ];
185
186 for (const kind of kinds) {
187 const nodes = this.queries.getNodesByKind(kind);
188 for (const node of nodes) {
189 if (regex.test(node.qualifiedName)) {
190 allNodes.push(node);
191 }
192 }
193 }
194
195 return allNodes;
196 }
197
198 /**
199 * Get the module/package structure

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
getNodesByKindMethod · 0.65

Tested by

no test coverage detected