blob: 6598f8b480d2b02fa4af0475f0148b707c35465c (
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
48
49
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "qmljs_global.h"
#include <qmljs/qmljslineinfo.h>
#include <QStringList>
#include <QTextCursor>
namespace QmlJS {
class QMLJS_EXPORT CompletionContextFinder : public LineInfo
{
public:
CompletionContextFinder(const QTextCursor &cursor);
QStringList qmlObjectTypeName() const;
bool isInQmlContext() const;
bool isInLhsOfBinding() const;
bool isInRhsOfBinding() const;
bool isAfterOnInLhsOfBinding() const;
QStringList bindingPropertyName() const;
bool isInStringLiteral() const;
bool isInImport() const;
QString libVersionImport() const;
private:
int findOpeningBrace(int startTokenIndex);
void getQmlObjectTypeName(int startTokenIndex);
void checkBinding();
void checkImport();
QTextCursor m_cursor;
QStringList m_qmlObjectTypeName;
QStringList m_bindingPropertyName;
int m_startTokenIndex;
int m_colonCount;
bool m_behaviorBinding;
bool m_inStringLiteral;
bool m_inImport;
QString m_libVersion;
};
} // namespace QmlJS
|