aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/checkidentifiers.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-09-30 15:31:43 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-02 15:33:23 +0200
commitb2e1183cb7f4f552bb4409172f82327111f754bb (patch)
treef72311abf4c27dc6dd73acb005f5ceabb074d610 /tools/qmllint/checkidentifiers.h
parent65b6365ffbde369894f7af1ed735ea34a584d357 (diff)
qmllint: Remove member access chains from ScopeTree
What we need there is a proper type inference. This should be added separately. For now, keep the member access chains local in qmllint and don't pollute ScopeTree with them. Change-Id: I9f50aa4e54b285bd93e7bd4cd17797509df0c168 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/checkidentifiers.h')
-rw-r--r--tools/qmllint/checkidentifiers.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/qmllint/checkidentifiers.h b/tools/qmllint/checkidentifiers.h
index 2056a80f80..f05a227be7 100644
--- a/tools/qmllint/checkidentifiers.h
+++ b/tools/qmllint/checkidentifiers.h
@@ -39,6 +39,15 @@ struct SignalHandler {
bool isMultiline;
};
+struct FieldMember
+{
+ QString m_name;
+ QString m_parentType;
+ QQmlJS::SourceLocation m_location;
+};
+
+using MemberAccessChains = QHash<ScopeTree::ConstPtr, QVector<QVector<FieldMember>>>;
+
class CheckIdentifiers
{
public:
@@ -49,13 +58,14 @@ public:
bool operator ()(const QHash<QString, ScopeTree::ConstPtr> &qmlIDs,
const QHash<QQmlJS::SourceLocation, SignalHandler> &signalHandlers,
+ const MemberAccessChains &memberAccessChains,
const ScopeTree::ConstPtr &root, const QString &rootId) const;
static void printContext(const QString &code, ColorOutput *output,
const QQmlJS::SourceLocation &location);
private:
- bool checkMemberAccess(const QVector<ScopeTree::FieldMember> &members,
+ bool checkMemberAccess(const QVector<FieldMember> &members,
const ScopeTree::ConstPtr &outerScope,
const MetaProperty *prop = nullptr) const;