forked from qt-creator/qt-creator
ClangCodeModel: Suppress "Unknown argument" error
Unknown compiler flags are an unsuppressable error in clang. But we do not want to maintain a blacklist of unsupported GCC and MSVC options or a whitelist of supported clang options, as both would constantly go out of date. As clangd seems to work fine despite the error message, we simply filter out this type of diagnostic. Fixes: QTCREATORBUG-27113 Change-Id: Ib32601831eded60daf80eb0ca5cf01bbd71493fa Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -90,7 +90,9 @@ void DiagnosticManager::setDiagnostics(const LanguageServerProtocol::DocumentUri
|
||||
const Utils::optional<int> &version)
|
||||
{
|
||||
hideDiagnostics(uri.toFilePath());
|
||||
m_diagnostics[uri] = {version, diagnostics};
|
||||
const QList<Diagnostic> filteredDiags = m_filter
|
||||
? Utils::filtered(diagnostics, m_filter) : diagnostics;
|
||||
m_diagnostics[uri] = {version, filteredDiags};
|
||||
}
|
||||
|
||||
void DiagnosticManager::hideDiagnostics(const Utils::FilePath &filePath)
|
||||
@@ -201,10 +203,12 @@ bool DiagnosticManager::hasDiagnostic(const LanguageServerProtocol::DocumentUri
|
||||
}
|
||||
|
||||
void DiagnosticManager::setDiagnosticsHandlers(const TextMarkCreator &textMarkCreator,
|
||||
const HideDiagnosticsHandler &removalHandler)
|
||||
const HideDiagnosticsHandler &removalHandler,
|
||||
const DiagnosticsFilter &filter)
|
||||
{
|
||||
m_textMarkCreator = textMarkCreator;
|
||||
m_hideHandler = removalHandler;
|
||||
m_filter = filter;
|
||||
}
|
||||
|
||||
} // namespace LanguageClient
|
||||
|
||||
Reference in New Issue
Block a user