From fed0786795db4812effd995d553ae9a582c70f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B5=D0=BC=D0=BB=D1=8F=D0=BA?= <92867056+AlexanderZemlyak@users.noreply.github.com> Date: Fri, 16 Jan 2026 23:06:38 +0300 Subject: [PATCH] Add basic support for first_assignment_defines_type in Intellisense (#3376) --- CodeCompletion/DomSyntaxTreeVisitor.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CodeCompletion/DomSyntaxTreeVisitor.cs b/CodeCompletion/DomSyntaxTreeVisitor.cs index 13c2b8751..82f59cc00 100644 --- a/CodeCompletion/DomSyntaxTreeVisitor.cs +++ b/CodeCompletion/DomSyntaxTreeVisitor.cs @@ -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)