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

Method initSync

src/index.ts:345–362  ·  view source on GitHub ↗

* Initialize synchronously (without indexing)

(projectRoot: string)

Source from the content-addressed store, hash-verified

343 * Initialize synchronously (without indexing)
344 */
345 static initSync(projectRoot: string): CodeGraph {
346 const resolvedRoot = path.resolve(projectRoot);
347
348 // Check if already initialized
349 if (isInitialized(resolvedRoot)) {
350 throw new Error(`CodeGraph already initialized in ${resolvedRoot}`);
351 }
352
353 // Create directory structure
354 createDirectory(resolvedRoot);
355
356 // Initialize database
357 const dbPath = getDatabasePath(resolvedRoot);
358 const db = DatabaseConnection.initialize(dbPath);
359 const queries = new QueryBuilder(db.getDb());
360
361 return new CodeGraph(db, queries, resolvedRoot);
362 }
363
364 /**
365 * Open an existing CodeGraph project

Calls 6

isInitializedFunction · 0.90
createDirectoryFunction · 0.90
getDatabasePathFunction · 0.90
getDbMethod · 0.80
resolveMethod · 0.65
initializeMethod · 0.45

Tested by 15

buildProjectFunction · 0.64
buildProjectFunction · 0.64
indexFunction · 0.64
indexProjectFunction · 0.64
makeIndexedFunction · 0.64
mkIndexedFunction · 0.64
buildProjectFunction · 0.64
indexFunction · 0.64
buildProjectFunction · 0.64
runExploreFunction · 0.64
indexFunction · 0.64
openEngineFunction · 0.64