aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/clangtextmark.h
blob: 78fb6f75901db040118a4e67f08d6a91689d09d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include "clangutils.h"

#include <languageserverprotocol/lsptypes.h>

#include <texteditor/textmark.h>

#include <QPointer>

#include <functional>

namespace LanguageClient { class Client; }

namespace ClangCodeModel {
namespace Internal {

class ClangdClient;

class ClangdTextMark : public TextEditor::TextMark
{
    Q_DECLARE_TR_FUNCTIONS(ClangdTextMark)
public:
    ClangdTextMark(const ::Utils::FilePath &filePath,
                   const LanguageServerProtocol::Diagnostic &diagnostic,
                   bool isProjectFile,
                   ClangdClient *client);

private:
    bool addToolTipContent(QLayout *target) const override;

    const LanguageServerProtocol::Diagnostic m_lspDiagnostic;
    const ClangDiagnostic m_diagnostic;
    const QPointer<const LanguageClient::Client> m_client;
};

} // namespace Internal
} // namespace ClangCodeModel