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)