ClangCodeModel: Provide diagnostics via clangd

Change-Id: Ib45a62ebe200c2b56a1bb1a66f8a92103e60d092
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-06-02 17:51:31 +02:00
parent 54b4022987
commit 7bf52b0c0d
15 changed files with 320 additions and 48 deletions

View File

@@ -28,10 +28,14 @@
#include <clangsupport_global.h>
#include <clangsupport/diagnosticcontainer.h>
#include <languageserverprotocol/lsptypes.h>
#include <texteditor/textmark.h>
#include <functional>
namespace LanguageClient { class Client; }
namespace ClangCodeModel {
namespace Internal {
class ClangDiagnosticManager;
@@ -60,5 +64,21 @@ private:
const ClangDiagnosticManager * const m_diagMgr;
};
class ClangdTextMark : public TextEditor::TextMark
{
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
public:
ClangdTextMark(const ::Utils::FilePath &filePath,
const LanguageServerProtocol::Diagnostic &diagnostic,
const LanguageClient::Client *client);
private:
bool addToolTipContent(QLayout *target) const override;
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
const ClangBackEnd::DiagnosticContainer m_diagnostic;
const LanguageClient::Client * const m_client;
};
} // namespace Internal
} // namespace ClangCodeModel