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
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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