Skip to content

Commit 3b9aef5

Browse files
author
Trinketer22
committed
Support for tensor expression declarations
1 parent 84d8cef commit 3b9aef5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

server/src/languages/func/psi/Reference.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,20 @@ export class Reference {
329329
}
330330
}
331331
}
332+
if (firstChild?.type === "tensor_expression") {
333+
// (int foo, cell bar) = (42, someCall())
334+
for (let childDeclaration of firstChild.descendantsOfType("local_vars_declaration")) {
335+
if (!childDeclaration) {
336+
continue;
337+
}
338+
const lhs = childDeclaration.childForFieldName("lhs")
339+
if (lhs) {
340+
if (!this.processVariableDeclaration(lhs, proc, file, state)) {
341+
return false
342+
}
343+
}
344+
}
345+
}
332346

333347
if (firstChild?.type === "typed_tuple") {
334348
// [_, int a, int b] = [1, 2];
@@ -355,7 +369,7 @@ export class Reference {
355369
if (!proc.execute(new VarDeclaration(lhs, file), state)) return false
356370
}
357371

358-
if (lhs.type === "tuple_vars_declaration" || lhs.type === "tensor_vars_declaration") {
372+
if (lhs.type === "tuple_vars_declaration" || lhs.type === "tensor_vars_declaration" || lhs.type === "nested_tensor_declaration") {
359373
const vars = lhs.childrenForFieldName("vars")
360374
for (const variable of vars) {
361375
if (!variable) continue

0 commit comments

Comments
 (0)