gitnexus 1.6.4-rc.75 → 1.6.4-rc.76
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.
|
@@ -17,10 +17,10 @@ export function populateGoRangeBindings(parsedFiles, _indexes, ctx) {
|
|
|
17
17
|
const scopeMap = new Map(parsed.scopes.map((s) => [s.id, s]));
|
|
18
18
|
for (const rangeNode of tree.rootNode.descendantsOfType('for_statement')) {
|
|
19
19
|
const rangeClause = rangeNode.namedChildren.find((c) => c.type === 'range_clause');
|
|
20
|
-
if (rangeClause ===
|
|
20
|
+
if (rangeClause === undefined)
|
|
21
21
|
continue;
|
|
22
22
|
const left = rangeClause.namedChildren.find((c) => c.type === 'expression_list');
|
|
23
|
-
if (left ===
|
|
23
|
+
if (left === undefined)
|
|
24
24
|
continue;
|
|
25
25
|
const rangeExpr = rangeClause.namedChildren.find((c, idx) => c.type !== 'expression_list' && idx > rangeClause.namedChildren.indexOf(left));
|
|
26
26
|
if (rangeExpr === undefined)
|
|
@@ -38,7 +38,7 @@ export function synthesizeGoTypeBindings(rootNode) {
|
|
|
38
38
|
const args = expr.childForFieldName('arguments');
|
|
39
39
|
if (fn?.type === 'identifier' && fn.text === 'new' && args !== null) {
|
|
40
40
|
const typeArg = args.namedChildren.find((c) => ['type_identifier', 'qualified_type'].includes(c.type));
|
|
41
|
-
if (typeArg !==
|
|
41
|
+
if (typeArg !== undefined) {
|
|
42
42
|
const typeName = extractSimpleTypeNameText(typeArg);
|
|
43
43
|
const nameNodes = lhs.namedChildren.filter((c) => c.type === 'identifier');
|
|
44
44
|
if (nameNodes.length > 0) {
|
|
@@ -54,11 +54,11 @@ export function synthesizeGoTypeBindings(rootNode) {
|
|
|
54
54
|
const sliceOrMap = args.namedChildren.find((c) =>
|
|
55
55
|
// V1: channel_type not handled — make(chan T) produces no typeBinding.
|
|
56
56
|
['slice_type', 'map_type'].includes(c.type));
|
|
57
|
-
if (sliceOrMap !==
|
|
57
|
+
if (sliceOrMap !== undefined) {
|
|
58
58
|
let typeName = '';
|
|
59
59
|
if (sliceOrMap.type === 'slice_type') {
|
|
60
60
|
const elem = sliceOrMap.namedChildren.find((c) => ['type_identifier', 'qualified_type'].includes(c.type));
|
|
61
|
-
if (elem !==
|
|
61
|
+
if (elem !== undefined)
|
|
62
62
|
typeName = extractSimpleTypeNameText(elem);
|
|
63
63
|
}
|
|
64
64
|
else if (sliceOrMap.type === 'map_type') {
|
package/package.json
CHANGED