gitnexus 1.6.6-rc.140 → 1.6.6-rc.141
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.
|
@@ -43,11 +43,13 @@ function findEnclosingTypeDeclaration(node) {
|
|
|
43
43
|
function typeName(typeNode) {
|
|
44
44
|
return typeNode.childForFieldName('name')?.text ?? null;
|
|
45
45
|
}
|
|
46
|
-
/** First entry in the type's `base_list`, read as raw text. C#
|
|
47
|
-
* generic and qualified bases (`Foo<T>`, `N.M.Base`); we keep
|
|
48
|
-
* form so downstream
|
|
49
|
-
*
|
|
50
|
-
* type
|
|
46
|
+
/** First entry in the type's `base_list`, read as raw type text. C#
|
|
47
|
+
* allows generic and qualified bases (`Foo<T>`, `N.M.Base`); we keep
|
|
48
|
+
* that form so downstream interpretation can strip generics and
|
|
49
|
+
* qualifiers consistently. A record primary-constructor base wraps
|
|
50
|
+
* its type and constructor arguments in `primary_constructor_base_type`,
|
|
51
|
+
* so read its `type` field instead of leaking `(args)` into the binding.
|
|
52
|
+
* Returns null when the type has no base (or an empty base_list). */
|
|
51
53
|
function firstBaseText(typeNode) {
|
|
52
54
|
for (let i = 0; i < typeNode.namedChildCount; i++) {
|
|
53
55
|
const child = typeNode.namedChild(i);
|
|
@@ -56,7 +58,9 @@ function firstBaseText(typeNode) {
|
|
|
56
58
|
const firstBase = child.namedChild(0);
|
|
57
59
|
if (firstBase === null)
|
|
58
60
|
return null;
|
|
59
|
-
return firstBase.
|
|
61
|
+
return firstBase.type === 'primary_constructor_base_type'
|
|
62
|
+
? (firstBase.childForFieldName('type')?.text ?? firstBase.text)
|
|
63
|
+
: firstBase.text;
|
|
60
64
|
}
|
|
61
65
|
return null;
|
|
62
66
|
}
|
package/package.json
CHANGED