aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangtools/diagnosticmark.h
blob: 7218d89ebd54fbf34d0a5b13a702e2fd1f769349 (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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "clangtoolsdiagnostic.h"

#include <cppeditor/clangdiagnosticconfig.h>
#include <texteditor/textmark.h>

namespace ClangTools {
namespace Internal {

class DiagnosticMark : public TextEditor::TextMark
{
public:
    explicit DiagnosticMark(const Diagnostic &diagnostic);

    void disable();
    bool enabled() const;

    Diagnostic diagnostic() const;

    std::optional<CppEditor::ClangToolType> toolType;

private:
    const Diagnostic m_diagnostic;
    bool m_enabled = true;
};

} // namespace Internal
} // namespace ClangTools