diff --git a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs index fd928d6cc..c194f73da 100644 --- a/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs +++ b/VisualPascalABCNET/IB/CodeCompletion/CodeCompletionHighlighter.cs @@ -51,6 +51,8 @@ namespace VisualPascalABC { if (isClassMember(beg_off, textArea)) return; + if (isClassPredefinition(end_off, textArea)) + return; } TmpPos end_pos = GetPositionOfEnd(textArea, end_off); if (end_pos != null) @@ -112,6 +114,34 @@ namespace VisualPascalABC return true; } + private static bool isClassPredefinition(int end_off, TextArea textArea) + { + int off = end_off; + if (off >= textArea.Document.TextContent.Length) + return true; + char c = textArea.Document.TextContent[off]; + while (char.IsWhiteSpace(c) || c == '{') + { + if (c == '{') + { + while (c != '}') + { + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + } + off++; + if (off >= textArea.Document.TextContent.Length) + break; + c = textArea.Document.TextContent[off]; + } + if (c == ';') + return true; + return false; + } + private static bool isClassMember(int beg_off, TextArea textArea) { int off = beg_off - 1;