aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cppcursorinfo.h
blob: a2731e61c7a2ad6ae54ef32615ec44b7746412cf (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
42
43
44
45
46
47
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "cppeditor_global.h"

#include "cppsemanticinfo.h"

#include <QTextCursor>
#include <QVector>

namespace CppEditor {

class CPPEDITOR_EXPORT CursorInfoParams
{
public:
    SemanticInfo semanticInfo;
    QTextCursor textCursor;
};

class CPPEDITOR_EXPORT CursorInfo
{
public:
    struct Range {
        Range() = default;
        Range(int line, int column, int length)
            : line(line)
            , column(column)
            , length(length)
        {
        }

        int line = 0; // 1-based
        int column = 0; // 1-based
        int length = 0;
    };
    using Ranges = QVector<Range>;

    Ranges useRanges;
    bool areUseRangesForLocalVariable = false;

    Ranges unusedVariablesRanges;
    SemanticInfo::LocalUseMap localUses;
};

} // namespace CppEditor