diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index 292818b8c..a4484ac7e 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -422,9 +422,9 @@ void AssistEditor::SetAnnotations(const CppFileInfo& f) SyncTip(); } -bool InFileIncludedFrom(const String& s) +bool IgnoredError(const String& s) { - return s.Find("in file included from") >= 0; + return s.Find("in file included from") >= 0 || s.Find("to match this '{'") >= 0; } void AssistEditor::SyncCurrentFile(const CurrentFileContext& cfx) @@ -445,7 +445,7 @@ void AssistEditor::SyncCurrentFile(const CurrentFileContext& cfx) int k = ds[di].kind; bool group_valid = false; auto Do = [&](const Diagnostic& d) { - if(d.pos.y < 0 || InFileIncludedFrom(d.text) || path != d.path) + if(d.pos.y < 0 || IgnoredError(d.text) || path != d.path) return; Point pos = d.pos; FromUtf8x(pos); @@ -577,11 +577,11 @@ bool AssistEditor::AssistTip(CodeEditor::MouseTip& mt) int ii0 = di; bool found = false; if(IsWarning(k) || IsError(k)) { - if(errors[di].path == path && errors[di].pos == pos && !InFileIncludedFrom(errors[di].text)) + if(errors[di].path == path && errors[di].pos == pos && !IgnoredError(errors[di].text)) found = true; di++; while(di < errors.GetCount() && errors[di].detail) { - if(errors[di].path == path && errors[di].pos == pos && !InFileIncludedFrom(errors[di].text)) + if(errors[di].path == path && errors[di].pos == pos && !IgnoredError(errors[di].text)) found = true; di++; } @@ -590,10 +590,12 @@ bool AssistEditor::AssistTip(CodeEditor::MouseTip& mt) String qtf = "[g "; for(int i = ii0; i < di; i++) { Diagnostic& d = errors[i]; + if(d.pos.y < 0 || IgnoredError(d.text)) + continue; if(i > ii0) qtf << "&"; qtf << "["; - if(d.path == path && d.pos == pos && !InFileIncludedFrom(d.text)) + if(d.path == path && d.pos == pos) qtf << "*"; qtf << " "; qtf << "[@B \1" << GetFileName(d.path) << "\1] " << d.pos.y << ": "; diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index dcac99024..d00b0cd4e 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -471,6 +471,8 @@ void Ide::StopDebug() bool Ide::EditorTip(CodeEditor::MouseTip& mt) { DR_LOG("EditorTip"); + if(editor.AssistTip(mt)) + return true; if(debugger) { int pos = mt.pos; String e; @@ -501,5 +503,5 @@ bool Ide::EditorTip(CodeEditor::MouseTip& mt) DR_LOG("debugger->Tip"); return debugger->Tip(e, mt); } - return editor.AssistTip(mt); + return false; }