forked from qt-creator/qt-creator
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:
@@ -312,7 +312,7 @@ Task createTask(const ClangDiagnostic &diagnostic)
|
|||||||
ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
||||||
const Diagnostic &diagnostic,
|
const Diagnostic &diagnostic,
|
||||||
bool isProjectFile,
|
bool isProjectFile,
|
||||||
Client *client)
|
ClangdClient *client)
|
||||||
: TextEditor::TextMark(filePath, int(diagnostic.range().start().line() + 1), client->id())
|
: TextEditor::TextMark(filePath, int(diagnostic.range().start().line() + 1), client->id())
|
||||||
, m_lspDiagnostic(diagnostic)
|
, m_lspDiagnostic(diagnostic)
|
||||||
, m_diagnostic(convertDiagnostic(ClangdDiagnostic(diagnostic), filePath))
|
, m_diagnostic(convertDiagnostic(ClangdDiagnostic(diagnostic), filePath))
|
||||||
@@ -330,7 +330,7 @@ ClangdTextMark::ClangdTextMark(const FilePath &filePath,
|
|||||||
setLineAnnotation(diagnostic.message());
|
setLineAnnotation(diagnostic.message());
|
||||||
setColor(isError ? Theme::CodeModel_Error_TextMarkColor
|
setColor(isError ? Theme::CodeModel_Error_TextMarkColor
|
||||||
: Theme::CodeModel_Warning_TextMarkColor);
|
: Theme::CodeModel_Warning_TextMarkColor);
|
||||||
qobject_cast<ClangdClient *>(client)->addTask(createTask(m_diagnostic));
|
client->addTask(createTask(m_diagnostic));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy to clipboard action
|
// Copy to clipboard action
|
||||||
|
@@ -40,6 +40,8 @@ namespace LanguageClient { class Client; }
|
|||||||
namespace ClangCodeModel {
|
namespace ClangCodeModel {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class ClangdClient;
|
||||||
|
|
||||||
class ClangdTextMark : public TextEditor::TextMark
|
class ClangdTextMark : public TextEditor::TextMark
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
|
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
|
||||||
@@ -47,7 +49,7 @@ public:
|
|||||||
ClangdTextMark(const ::Utils::FilePath &filePath,
|
ClangdTextMark(const ::Utils::FilePath &filePath,
|
||||||
const LanguageServerProtocol::Diagnostic &diagnostic,
|
const LanguageServerProtocol::Diagnostic &diagnostic,
|
||||||
bool isProjectFile,
|
bool isProjectFile,
|
||||||
LanguageClient::Client *client);
|
ClangdClient *client);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool addToolTipContent(QLayout *target) const override;
|
bool addToolTipContent(QLayout *target) const override;
|
||||||
|
Reference in New Issue
Block a user