diff --git a/CodeCompletion/ExpressionVisitor.cs b/CodeCompletion/ExpressionVisitor.cs index 490e58252..b473ab30e 100644 --- a/CodeCompletion/ExpressionVisitor.cs +++ b/CodeCompletion/ExpressionVisitor.cs @@ -1707,7 +1707,40 @@ namespace CodeCompletion public override void visit(ident_with_templateparams node) { node.name.visit(this); - if (this.returned_scope != null) + if (returned_scopes.Count > 0 && returned_scopes[0] is ProcScope) + { + ProcScope ps = returned_scopes[0] as ProcScope; + List template_params = new List(); + foreach (type_definition td in node.template_params.params_list) + { + td.visit(this); + if (returned_scope is TypeScope) + template_params.Add(returned_scope as TypeScope); + else + { + return; + } + } + returned_scopes[0] = ps.GetInstance(template_params); + } + else if (returned_scope is ProcScope) + { + ProcScope ps = returned_scope as ProcScope; + List template_params = new List(); + foreach (type_definition td in node.template_params.params_list) + { + td.visit(this); + if (returned_scope is TypeScope) + template_params.Add(returned_scope as TypeScope); + else + { + returned_scope = ps; + return; + } + } + returned_scope = ps.GetInstance(template_params); + } + /*else if (this.returned_scope != null) { if (this.returned_scope is TypeScope) { @@ -1721,7 +1754,7 @@ namespace CodeCompletion } returned_scope = ts.GetInstance(instances); } - } + }*/ } public override void visit(bracket_expr _bracket_expr) diff --git a/TestSuite/intellisense_tests/extensionmethods3.pas b/TestSuite/intellisense_tests/extensionmethods3.pas new file mode 100644 index 000000000..e7fba2b3f --- /dev/null +++ b/TestSuite/intellisense_tests/extensionmethods3.pas @@ -0,0 +1,7 @@ +function f(x: sequence of T): T; +begin +end; + +begin + f&(Arr(1,2,3)).Round{@(расширение) function real.Round(): integer;@}(); +end. \ No newline at end of file