MCPcopy Create free account
hub / github.com/anus-dev/ANUS / initialize

Function initialize

packages/cli/src/ui/hooks/useAtCompletion.ts:163–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161 // The "Worker" that performs async operations based on status.
162 useEffect(() => {
163 const initialize = async () => {
164 try {
165 const searcher = FileSearchFactory.create({
166 projectRoot: cwd,
167 ignoreDirs: [],
168 useGitignore:
169 config?.getFileFilteringOptions()?.respectGitIgnore ?? true,
170 useAnusignore:
171 config?.getFileFilteringOptions()?.respectAnusIgnore ?? true,
172 cache: true,
173 cacheTtl: 30, // 30 seconds
174 enableRecursiveFileSearch:
175 config?.getEnableRecursiveFileSearch() ?? true,
176 });
177 await searcher.initialize();
178 fileSearch.current = searcher;
179 dispatch({ type: 'INITIALIZE_SUCCESS' });
180 if (state.pattern !== null) {
181 dispatch({ type: 'SEARCH', payload: state.pattern });
182 }
183 } catch (_) {
184 dispatch({ type: 'ERROR' });
185 }
186 };
187
188 const search = async () => {
189 if (!fileSearch.current || state.pattern === null) {

Callers 1

useAtCompletionFunction · 0.85

Calls 4

initializeMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected