diff --git a/CodeCompletion/FindReferences.cs b/CodeCompletion/FindReferences.cs index 7f18fc3f1..48dad299f 100644 --- a/CodeCompletion/FindReferences.cs +++ b/CodeCompletion/FindReferences.cs @@ -470,7 +470,7 @@ namespace CodeCompletion { if (with_body) { - if (cur_scope != null && cur_scope.IsEqual(founded_scope)) + if (cur_scope != null && (cur_scope.IsEqual(founded_scope) || founded_scope is IProcScope && (founded_scope as IProcScope).Realization != null && cur_scope.IsEqual((founded_scope as IProcScope).Realization))) pos_list.Add(get_position(_function_header.name.meth_name)); } else diff --git a/Parsers/PascalABCParserNewSaushkin/Parser.cs b/Parsers/PascalABCParserNewSaushkin/Parser.cs index c687f6c47..ca39cceca 100644 --- a/Parsers/PascalABCParserNewSaushkin/Parser.cs +++ b/Parsers/PascalABCParserNewSaushkin/Parser.cs @@ -220,10 +220,16 @@ namespace PascalABCCompiler.PascalABCNewParser public override syntax_tree_node BuildTreeInExprMode(string FileName, string Text) { // LineCorrection = -1 не забыть + string origText = Text; Text = String.Concat("<>", Environment.NewLine, Text); localparserhelper = new GPPGParserHelper(Errors, Warnings, FileName); // localparser.parsertools.LineCorrection = -1; syntax_tree_node root = localparserhelper.Parse(Text); + if (root == null && origText.Contains("<")) + { + Errors.Clear(); + root = localparserhelper.Parse(String.Concat("<>", Environment.NewLine, origText.Replace("<","&<"))); + } return root as expression; } diff --git a/TestSuite/intellisense_tests/generics6.pas b/TestSuite/intellisense_tests/generics6.pas new file mode 100644 index 000000000..193bf9c0b --- /dev/null +++ b/TestSuite/intellisense_tests/generics6.pas @@ -0,0 +1,11 @@ +type + t1 = class + + public + procedure p1; virtual; + + end; + +procedure t1.p1{@procedure t1<>.p1(); virtual;@} := p1; + +begin end. \ No newline at end of file