Add basic support for first_assignment_defines_type in Intellisense (#3376)

This commit is contained in:
Александр Земляк 2026-01-16 23:06:38 +03:00 committed by GitHub
parent 42d7ca97a3
commit fed0786795
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,7 +308,8 @@ namespace CodeCompletion
var co = new CompilerOptions();
co.SavePCU = false;
co.GenerateCode = false;
co.UnitSyntaxTree = cu;
if (!currentUnitLanguage.ApplySyntaxTreeConvertersForIntellisense)
co.UnitSyntaxTree = cu;
co.SourceFileName = cu.source_context.FileName;
co.ForIntellisense = true;
co.SaveDocumentation = false;
@ -488,6 +489,13 @@ namespace CodeCompletion
}
}
}
if (_assign.first_assignment_defines_type)
{
_assign.from.visit(this);
var variableScope = (ElementScope)cur_scope.FindName(((ident)_assign.to).name);
variableScope.sc = returned_scope;
}
}
public override void visit(bin_expr _bin_expr)