diff --git a/gitnexus/package-lock.json b/gitnexus/package-lock.json index 585e015f4..f8a98f860 100644 --- a/gitnexus/package-lock.json +++ b/gitnexus/package-lock.json @@ -1,12 +1,12 @@ { "name": "gitnexus", - "version": "1.3.8", + "version": "1.3.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gitnexus", - "version": "1.3.8", + "version": "1.3.9", "hasInstallScript": true, "license": "PolyForm-Noncommercial-1.0.0", "dependencies": { diff --git a/gitnexus/package.json b/gitnexus/package.json index c8de59f60..f1ab25723 100644 --- a/gitnexus/package.json +++ b/gitnexus/package.json @@ -1,6 +1,6 @@ { "name": "gitnexus", - "version": "1.3.8", + "version": "1.3.9", "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.", "author": "Abhigyan Patwari", "license": "PolyForm-Noncommercial-1.0.0", diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index 2e9890b7b..b9d0b2bdb 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -291,7 +291,8 @@ const findEnclosingFunctionId = (node: any, filePath: string): string | null => if (current.type === 'init_declaration' || current.type === 'deinit_declaration') { const funcName = current.type === 'init_declaration' ? 'init' : 'deinit'; const label = 'Constructor'; - return generateId(label, `${filePath}:${funcName}`); + const startLine = current.startPosition?.row ?? 0; + return generateId(label, `${filePath}:${funcName}:${startLine}`); } if (['function_declaration', 'function_definition', 'async_function_declaration', @@ -327,7 +328,8 @@ const findEnclosingFunctionId = (node: any, filePath: string): string | null => } if (funcName) { - return generateId(label, `${filePath}:${funcName}`); + const startLine = current.startPosition?.row ?? 0; + return generateId(label, `${filePath}:${funcName}:${startLine}`); } } current = current.parent;