MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / createIndexer

Function createIndexer

src/lib.ts:156–178  ·  view source on GitHub ↗
(
  rootPath: string,
  options?: Partial<Omit<import('./core/indexer.js').IndexerOptions, 'rootPath'>>
)

Source from the content-addressed store, hash-verified

154 * @returns A configured CodebaseIndexer instance
155 */
156export function createIndexer(
157 rootPath: string,
158 options?: Partial<Omit<import('./core/indexer.js').IndexerOptions, 'rootPath'>>
159): import('./core/indexer.js').CodebaseIndexer {
160 // Register default analyzers if not already registered
161 if (!analyzerRegistry.get('angular')) {
162 analyzerRegistry.register(new AngularAnalyzer());
163 }
164 if (!analyzerRegistry.get('nextjs')) {
165 analyzerRegistry.register(new NextJsAnalyzer());
166 }
167 if (!analyzerRegistry.get('react')) {
168 analyzerRegistry.register(new ReactAnalyzer());
169 }
170 if (!analyzerRegistry.get('generic')) {
171 analyzerRegistry.register(new GenericAnalyzer());
172 }
173
174 return new CodebaseIndexer({
175 rootPath,
176 ...options
177 });
178}
179
180/**
181 * Convenience function to create a searcher for an indexed codebase

Callers

nothing calls this directly

Calls 2

registerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected