diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2017-07-10 09:53:34 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2017-07-10 12:32:07 +0000 |
commit | e1de989e16ee913dca41062d26313f675e1bdfcc (patch) | |
tree | 65dfd2adcd36ae8c3f19fd4f3645097ae97767c8 /src/plugins/clangcodemodel/clangdiagnosticmanager.cpp | |
parent | dc1bdc9bec1fdd8ce88934830793a48904908832 (diff) | |
download | qt-creator-e1de989e16ee913dca41062d26313f675e1bdfcc.tar.gz |
Clang: Show inline diagnostics only for project files
When navigating to headers that are not part of the project, avoid
showing the inline diagnostics. In most cases, these files can't be
changed.
This helps also for the session-load case where files are opened/parsed
when no project information is available yet.
Change-Id: I7fce24af78b3b1efbf64dd27d8ca2a053e02d4ec
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangdiagnosticmanager.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangdiagnosticmanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp index f5fe4d6368..c8da6e6c6a 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp @@ -376,9 +376,11 @@ void ClangDiagnosticManager::generateEditorSelections() } void ClangDiagnosticManager::processNewDiagnostics( - const QVector<ClangBackEnd::DiagnosticContainer> &allDiagnostics) + const QVector<ClangBackEnd::DiagnosticContainer> &allDiagnostics, + bool showTextMarkAnnotations) { m_diagnosticsInvalidated = false; + m_showTextMarkAnnotations = showTextMarkAnnotations; filterDiagnostics(allDiagnostics); generateTextMarks(); @@ -401,7 +403,8 @@ void ClangDiagnosticManager::addClangTextMarks( m_clangTextMarks.erase(it, m_clangTextMarks.end()); delete mark; }; - auto textMark = new ClangTextMark(filePath(), diagnostic, onMarkRemoved); + auto textMark = new ClangTextMark(filePath(), diagnostic, onMarkRemoved, + m_showTextMarkAnnotations); m_clangTextMarks.push_back(textMark); m_textDocument->addMark(textMark); } |