aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldom/qqmldomattachedinfo_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmldom/qqmldomattachedinfo_p.h')
-rw-r--r--src/qmldom/qqmldomattachedinfo_p.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/qmldom/qqmldomattachedinfo_p.h b/src/qmldom/qqmldomattachedinfo_p.h
index ea080f3fbc..668df88f8b 100644
--- a/src/qmldom/qqmldomattachedinfo_p.h
+++ b/src/qmldom/qqmldomattachedinfo_p.h
@@ -304,6 +304,33 @@ public:
QMap<QString, QList<SourceLocation>> postCommentLocations;
};
+class QMLDOM_EXPORT UpdatedScriptExpression
+{
+ Q_GADGET
+public:
+ using Tree = std::shared_ptr<AttachedInfoT<UpdatedScriptExpression>>;
+ constexpr static DomType kindValue = DomType::UpdatedScriptExpression;
+ DomType kind() const { return kindValue; }
+ bool iterateDirectSubpaths(DomItem &self, DirectVisitor);
+
+ static Tree createTree(Path basePath);
+ static Tree ensure(Tree base, Path basePath, AttachedInfo::PathType pType);
+
+ // returns the path looked up and the found tree when looking for the info attached to item
+ static AttachedInfoLookupResult<Tree>
+ findAttachedInfo(DomItem &item,
+ AttachedInfo::FindOptions options = AttachedInfo::FindOption::Default);
+ // convenience: find FileLocations::Tree attached to the given item
+ static Tree treePtr(DomItem &);
+ // convenience: find FileLocations* attached to the given item (if there is one)
+ static const UpdatedScriptExpression *exprPtr(DomItem &);
+
+ static bool visitTree(Tree base, function_ref<bool(Path, Tree)> visitor,
+ Path basePath = Path());
+
+ std::shared_ptr<ScriptExpression> expr;
+};
+
} // end namespace Dom
} // end namespace QQmlJS