diff --git a/CodeCompletion/SymTable.cs b/CodeCompletion/SymTable.cs index f6baf3a7d..e2707b457 100644 --- a/CodeCompletion/SymTable.cs +++ b/CodeCompletion/SymTable.cs @@ -933,7 +933,7 @@ namespace CodeCompletion if (string.Compare(ss.si.name, name, !CodeCompletionController.CurrentParser.LanguageInformation.CaseSensitive) == 0) if (ss.loc != null && loc != null && check_for_def && cur_line != -1 && cur_col != -1) { - if (string.Compare(ss.loc.doc.file_name, loc.doc.file_name, true) == 0 && this != ss) + if (string.Compare(ss.loc.doc.file_name, loc.doc.file_name, true) == 0 && this != ss && ss.topScope != this) { if (IsAfterDefinition(ss.loc.begin_line_num, ss.loc.begin_column_num)) { diff --git a/TestSuite/intellisense_tests/class4.pas b/TestSuite/intellisense_tests/class4.pas new file mode 100644 index 000000000..12c2f2297 --- /dev/null +++ b/TestSuite/intellisense_tests/class4.pas @@ -0,0 +1,21 @@ +type + T = class + public constructor; + begin + p{@procedure T.p(a: integer);@}(0); + p2{@@}(); + end; + + public procedure p(a: integer); + begin + + end; + end; + + procedure p2; + begin + + end; +begin + +end. \ No newline at end of file