2015-08-31 16:28:26 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2015-08-31 16:28:26 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2015-08-31 16:28:26 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2015-08-31 16:28:26 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2015-08-31 16:28:26 +02:00
|
|
|
|
2017-08-24 12:28:01 +02:00
|
|
|
#include <clangsupport_global.h>
|
|
|
|
|
#include <clangsupport/diagnosticcontainer.h>
|
2015-08-31 16:28:26 +02:00
|
|
|
|
2021-06-02 17:51:31 +02:00
|
|
|
#include <languageserverprotocol/lsptypes.h>
|
|
|
|
|
|
2015-08-31 16:28:26 +02:00
|
|
|
#include <texteditor/textmark.h>
|
|
|
|
|
|
2021-06-30 13:15:41 +02:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
2016-11-17 15:55:06 +01:00
|
|
|
#include <functional>
|
|
|
|
|
|
2021-06-02 17:51:31 +02:00
|
|
|
namespace LanguageClient { class Client; }
|
|
|
|
|
|
2015-08-31 16:28:26 +02:00
|
|
|
namespace ClangCodeModel {
|
2019-02-06 16:17:03 +01:00
|
|
|
namespace Internal {
|
2020-11-20 17:26:26 +01:00
|
|
|
class ClangDiagnosticManager;
|
2015-08-31 16:28:26 +02:00
|
|
|
|
|
|
|
|
class ClangTextMark : public TextEditor::TextMark
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-11-17 15:55:06 +01:00
|
|
|
using RemovedFromEditorHandler = std::function<void(ClangTextMark *)>;
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
ClangTextMark(const ::Utils::FilePath &fileName,
|
2016-11-17 15:55:06 +01:00
|
|
|
const ClangBackEnd::DiagnosticContainer &diagnostic,
|
2017-07-10 09:53:34 +02:00
|
|
|
const RemovedFromEditorHandler &removedHandler,
|
2020-11-20 17:26:26 +01:00
|
|
|
bool fullVisualization,
|
|
|
|
|
const ClangDiagnosticManager *diagMgr);
|
2015-09-01 10:10:20 +02:00
|
|
|
|
2019-01-31 13:16:44 +01:00
|
|
|
ClangBackEnd::DiagnosticContainer diagnostic() const { return m_diagnostic; }
|
2017-07-03 13:29:30 +02:00
|
|
|
void updateIcon(bool valid = true);
|
2019-01-31 13:16:44 +01:00
|
|
|
|
2015-09-21 16:09:53 +02:00
|
|
|
private:
|
2017-06-20 08:28:10 +02:00
|
|
|
bool addToolTipContent(QLayout *target) const override;
|
2016-11-17 15:55:06 +01:00
|
|
|
void removedFromEditor() override;
|
|
|
|
|
|
|
|
|
|
private:
|
2016-07-22 08:57:32 +02:00
|
|
|
ClangBackEnd::DiagnosticContainer m_diagnostic;
|
2016-11-17 15:55:06 +01:00
|
|
|
RemovedFromEditorHandler m_removedFromEditorHandler;
|
2020-11-20 17:26:26 +01:00
|
|
|
const ClangDiagnosticManager * const m_diagMgr;
|
2015-08-31 16:28:26 +02:00
|
|
|
};
|
|
|
|
|
|
2021-06-02 17:51:31 +02:00
|
|
|
class ClangdTextMark : public TextEditor::TextMark
|
|
|
|
|
{
|
|
|
|
|
Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
|
|
|
|
|
public:
|
|
|
|
|
ClangdTextMark(const ::Utils::FilePath &filePath,
|
|
|
|
|
const LanguageServerProtocol::Diagnostic &diagnostic,
|
2022-02-25 09:31:40 +01:00
|
|
|
bool isProjectFile,
|
2021-06-02 17:51:31 +02:00
|
|
|
const LanguageClient::Client *client);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool addToolTipContent(QLayout *target) const override;
|
|
|
|
|
|
|
|
|
|
const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
|
|
|
|
|
const ClangBackEnd::DiagnosticContainer m_diagnostic;
|
2021-06-30 13:15:41 +02:00
|
|
|
const QPointer<const LanguageClient::Client> m_client;
|
2021-06-02 17:51:31 +02:00
|
|
|
};
|
|
|
|
|
|
2019-02-06 16:17:03 +01:00
|
|
|
} // namespace Internal
|
2015-08-31 16:28:26 +02:00
|
|
|
} // namespace ClangCodeModel
|