gitnexus 1.6.3-rc.37 → 1.6.3-rc.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -287,31 +287,47 @@ const findEnclosingFunctionId = (node, filePath, provider) => {
287
287
  }
288
288
  // Qualify with enclosing class to match definition-phase node IDs
289
289
  const classInfo = cachedFindEnclosingClassInfo(current, filePath, provider.resolveEnclosingOwner);
290
- const qualifiedName = classInfo ? `${classInfo.className}.${funcName}` : funcName;
290
+ const encLang = getLanguageFromFilename(filePath);
291
+ const standaloneMethodInfo = (finalLabel === 'Method' || finalLabel === 'Constructor') &&
292
+ encLang === SupportedLanguages.Go &&
293
+ provider.methodExtractor?.extractFromNode
294
+ ? provider.methodExtractor.extractFromNode(current, {
295
+ filePath,
296
+ language: encLang,
297
+ })
298
+ : null;
299
+ const ownerName = classInfo?.className ?? standaloneMethodInfo?.receiverType ?? undefined;
300
+ const qualifiedName = ownerName ? `${ownerName}.${funcName}` : funcName;
291
301
  // Include #<arity> suffix to match definition-phase Method/Constructor IDs.
292
302
  // Use the same MethodExtractor (getMethodInfo) as the definition phase.
293
303
  // When same-arity collisions exist, also append ~type1,type2.
294
304
  let arity;
295
305
  let encTypeTag = '';
296
306
  if (finalLabel === 'Method' || finalLabel === 'Constructor') {
297
- const encLang = getLanguageFromFilename(filePath);
298
- const classNode = findEnclosingClassNode(current) ?? findClassNodeByQualifiedName(current);
299
- if (classNode && encLang) {
300
- const methodMap = getMethodInfo(classNode, provider, {
301
- filePath,
302
- language: encLang,
303
- });
304
- const defLine = current.startPosition.row + 1;
305
- const info = methodMap?.get(`${funcName}:${defLine}`);
306
- if (info) {
307
- arity = info.parameters.some((p) => p.isVariadic)
308
- ? undefined
309
- : info.parameters.length;
310
- if (methodMap && arity !== undefined) {
311
- const g = buildCollisionGroups(methodMap);
312
- encTypeTag =
313
- typeTagForId(methodMap, funcName, arity, info, encLang, g) +
314
- constTagForId(methodMap, funcName, arity, info, g);
307
+ if (standaloneMethodInfo) {
308
+ arity = standaloneMethodInfo.parameters.some((p) => p.isVariadic)
309
+ ? undefined
310
+ : standaloneMethodInfo.parameters.length;
311
+ }
312
+ else {
313
+ const classNode = findEnclosingClassNode(current) ?? findClassNodeByQualifiedName(current);
314
+ if (classNode && encLang) {
315
+ const methodMap = getMethodInfo(classNode, provider, {
316
+ filePath,
317
+ language: encLang,
318
+ });
319
+ const defLine = current.startPosition.row + 1;
320
+ const info = methodMap?.get(`${funcName}:${defLine}`);
321
+ if (info) {
322
+ arity = info.parameters.some((p) => p.isVariadic)
323
+ ? undefined
324
+ : info.parameters.length;
325
+ if (methodMap && arity !== undefined) {
326
+ const g = buildCollisionGroups(methodMap);
327
+ encTypeTag =
328
+ typeTagForId(methodMap, funcName, arity, info, encLang, g) +
329
+ constTagForId(methodMap, funcName, arity, info, g);
330
+ }
315
331
  }
316
332
  }
317
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.3-rc.37",
3
+ "version": "1.6.3-rc.38",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",