ClangCodeModel: pass ClangdClient to text mark constructor

Change-Id: Ie7b9c23365648fcf6034175e0e18970d342e25e6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-05-12 08:48:50 +02:00
parent 04f1a0d6ab
commit fa577eb049
2 changed files with 5 additions and 3 deletions

View File

@@ -312,7 +312,7 @@ Task createTask(const ClangDiagnostic &diagnostic)
ClangdTextMark::ClangdTextMark(const FilePath &filePath,
const Diagnostic &diagnostic,
bool isProjectFile,
Client *client)
ClangdClient *client)
: TextEditor::TextMark(filePath, int(diagnostic.range().start().line() + 1), client->id())
, m_lspDiagnostic(diagnostic)
, m_diagnostic(convertDiagnostic(ClangdDiagnostic(diagnostic), filePath))
@@ -330,7 +330,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
setLineAnnotation(diagnostic.message());
setColor(isError ? Theme::CodeModel_Error_TextMarkColor
: Theme::CodeModel_Warning_TextMarkColor);
qobject_cast<ClangdClient *>(client)->addTask(createTask(m_diagnostic));
client->addTask(createTask(m_diagnostic));
}
// Copy to clipboard action

View File

@@ -40,6 +40,8 @@ namespace LanguageClient { class Client; }
namespace ClangCodeModel {
namespace Internal {
class ClangdClient;
class ClangdTextMark : public TextEditor::TextMark
{
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
@@ -47,7 +49,7 @@ public:
ClangdTextMark(const ::Utils::FilePath &filePath,
const LanguageServerProtocol::Diagnostic &diagnostic,
bool isProjectFile,
LanguageClient::Client *client);
ClangdClient *client);
private:
bool addToolTipContent(QLayout *target) const override;