Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldomcomments_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QQMLDOMCOMMENTS_P_H
6#define QQMLDOMCOMMENTS_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include "qqmldom_fwd_p.h"
21#include "qqmldomitem_p.h"
23
24#include <QtQml/private/qqmljsast_p.h>
25#include <QtQml/private/qqmljsengine_p.h>
26
27#include <QtCore/QMultiMap>
28#include <QtCore/QHash>
29#include <QtCore/QStack>
30#include <QtCore/QCoreApplication>
31
32#include <memory>
33
35namespace QQmlJS {
36namespace Dom {
37
39{
41public:
43
44 QStringView preWhitespace() const { return rawComment.mid(0, commentBegin); }
45
46 QStringView comment() const { return rawComment.mid(commentBegin, commentEnd - commentBegin); }
47
49 {
50 return rawComment.mid(commentContentBegin, commentContentEnd - commentContentEnd);
51 }
52
54 {
55 return rawComment.mid(commentEnd, rawComment.size() - commentEnd);
56 }
57
58 // Comment source location populated during lexing doesn't include start strings // or /*
59 // Returns the location starting from // or /*
60 QQmlJS::SourceLocation sourceLocation() const { return commentLocation; }
61
68 bool hasStartNewline = false;
69 bool hasEndNewline = false;
74};
75
76/*!
77\internal
78Anchor comments at an AST::Node* (DefaultLocation) or at an QQmlJS::SourceLocation inside of the
79AST::Node*. In the latter case, the member location takes the value of the anchor's
80QQmlJS::SourceLocation::offset, so that the formatter can differentiate between multiple anchors
81inside the same AST::Node*.
82*/
84{
86 static CommentAnchor from(const SourceLocation &sl) { return CommentAnchor{ sl.begin() }; }
87 friend bool comparesEqual(const CommentAnchor &a, const CommentAnchor &b) noexcept
88 {
89 return a.location == b.location;
90 }
92};
93
94inline size_t qHash(const CommentAnchor &key, size_t seed = 0) noexcept
95{
96 return qHashMulti(seed, key.location);
97}
98
100{
101public:
103 DomType kind() const { return kindValue; }
104
106
107 Comment(const QString &c, const QQmlJS::SourceLocation &loc, int newlinesBefore = 1,
108 CommentType type = Pre)
109 : m_comment(c), m_location(loc), m_newlinesBefore(newlinesBefore), m_type(type)
110 {
111 }
112 Comment(QStringView c, const QQmlJS::SourceLocation &loc, int newlinesBefore = 1,
113 CommentType type = Pre)
114 : m_comment(c), m_location(loc), m_newlinesBefore(newlinesBefore), m_type(type)
115 {
116 }
117
118 bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const;
119 int newlinesBefore() const { return m_newlinesBefore; }
120 void setNewlinesBefore(int n) { m_newlinesBefore = n; }
121 QStringView rawComment() const { return m_comment; }
122 CommentInfo info() const { return CommentInfo(m_comment, m_location); }
123 QQmlJS::SourceLocation sourceLocation() const { return m_location; }
124 void write(OutWriter &lw) const;
125
126 CommentType type() const { return m_type; }
127
128 friend bool operator==(const Comment &c1, const Comment &c2)
129 {
130 return c1.m_newlinesBefore == c2.m_newlinesBefore && c1.m_comment == c2.m_comment;
131 }
132 friend bool operator!=(const Comment &c1, const Comment &c2) { return !(c1 == c2); }
133
134private:
135 QStringView m_comment;
136 QQmlJS::SourceLocation m_location;
137 int m_newlinesBefore;
138 CommentType m_type;
139};
140
142{
143public:
145 DomType kind() const { return kindValue; }
146
147 bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const;
148 void writePre(OutWriter &lw) const;
149 void writePost(OutWriter &lw) const;
150
151 friend bool operator==(const CommentedElement &c1, const CommentedElement &c2)
152 {
153 return c1.m_preComments == c2.m_preComments && c1.m_postComments == c2.m_postComments;
154 }
155 friend bool operator!=(const CommentedElement &c1, const CommentedElement &c2)
156 {
157 return !(c1 == c2);
158 }
159
160 void addComment(const Comment &comment)
161 {
162 if (comment.type() == Comment::CommentType::Pre)
163 m_preComments.append(comment);
164 else
165 m_postComments.append(comment);
166 }
167
168 QList<Comment> preComments() const { return m_preComments; }
169 QList<Comment> postComments() const { return m_postComments; }
170
171private:
172 QList<Comment> m_preComments;
173 QList<Comment> m_postComments;
174};
175
177{
178public:
180 DomType kind() const { return kindValue; }
181
182 bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const;
183
184 friend bool operator==(const RegionComments &c1, const RegionComments &c2)
185 {
186 return c1.m_regionComments == c2.m_regionComments;
187 }
188 friend bool operator!=(const RegionComments &c1, const RegionComments &c2)
189 {
190 return !(c1 == c2);
191 }
192
193 const QMap<FileLocationRegion, CommentedElement> &regionComments() const { return m_regionComments;}
194 Path addComment(const Comment &comment, FileLocationRegion region)
195 {
197 return addPreComment(comment, region);
198 else
199 return addPostComment(comment, region);
200 }
201
202private:
203 Path addPreComment(const Comment &comment, FileLocationRegion region)
204 {
205 const auto preList = m_regionComments[region].preComments();
206 index_type idx = preList.size();
207 m_regionComments[region].addComment(comment);
208 return Path::fromField(Fields::regionComments)
209 .withKey(fileLocationRegionName(region))
210 .withField(Fields::preComments)
211 .withIndex(idx);
212 }
213
214 Path addPostComment(const Comment &comment, FileLocationRegion region)
215 {
216 const auto postList = m_regionComments[region].postComments();
217 index_type idx = postList.size();
218 m_regionComments[region].addComment(comment);
219 return Path::fromField(Fields::regionComments)
220 .withKey(fileLocationRegionName(region))
221 .withField(Fields::postComments)
222 .withIndex(idx);
223 }
224
225 QMap<FileLocationRegion, CommentedElement> m_regionComments;
226};
227
229{
230protected:
231 std::shared_ptr<OwningItem> doCopy(const DomItem &) const override
232 {
233 return std::make_shared<AstComments>(*this);
234 }
235
237
238public:
240 DomType kind() const override { return kindValue; }
241 bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override;
242 std::shared_ptr<AstComments> makeCopy(const DomItem &self) const
243 {
244 return std::static_pointer_cast<AstComments>(doCopy(self));
245 }
246
247 Path canonicalPath(const DomItem &self) const override { return self.m_ownerPath; }
248 AstComments(const std::shared_ptr<Engine> &e) : m_engine(e) { }
253
254 // note: the returned pointer is invalidated when comments are added!
255 const CommentedElement *commentForNode(AST::Node *n, CommentAnchor location) const
256 {
257 const auto it = m_commentedElements.constFind(CommentKey{ n, location });
258 return it == m_commentedElements.end() ? nullptr : &*it;
259 }
260
262 {
265 for (const auto &element : m_commentedElements) {
268 }
269 return std::make_pair(pre, post);
270 }
271
276
278
279private:
280 // note: the returned reference is invalidated when m_commentedElements is modified!
281 CommentedElement &ensureCommentForNode(AST::Node *n, CommentAnchor location)
282 {
283 const CommentKey key{ n, location };
284 return m_commentedElements[key];
285 }
286
287 std::shared_ptr<Engine> m_engine;
288 QHash<CommentKey, CommentedElement> m_commentedElements;
289};
290
292{
293public:
294 CommentCollector() = default;
296 void collectComments();
297 void collectComments(const std::shared_ptr<Engine> &engine, AST::Node *rootNode,
298 const std::shared_ptr<AstComments> &astComments);
299
300private:
301 MutableDomItem m_rootItem;
302 FileLocations::Tree m_fileLocations;
303};
304
305class VisitAll : public AST::Visitor
306{
307public:
308 VisitAll() = default;
309
310 static QSet<int> uiKinds();
311
313
314 bool visit(AST::UiPublicMember *el) override
315 {
316 AST::Node::accept(el->annotations, this);
317 AST::Node::accept(el->memberType, this);
318 return true;
319 }
320
321 bool visit(AST::UiSourceElement *el) override
322 {
323 AST::Node::accept(el->annotations, this);
324 return true;
325 }
326
327 bool visit(AST::UiObjectDefinition *el) override
328 {
329 AST::Node::accept(el->annotations, this);
330 return true;
331 }
332
333 bool visit(AST::UiObjectBinding *el) override
334 {
335 AST::Node::accept(el->annotations, this);
336 return true;
337 }
338
339 bool visit(AST::UiScriptBinding *el) override
340 {
341 AST::Node::accept(el->annotations, this);
342 return true;
343 }
344
345 bool visit(AST::UiArrayBinding *el) override
346 {
347 AST::Node::accept(el->annotations, this);
348 return true;
349 }
350
351 bool visit(AST::UiParameterList *el) override
352 {
353 AST::Node::accept(el->type, this);
354 return true;
355 }
356
357 bool visit(AST::UiQualifiedId *el) override
358 {
359 AST::Node::accept(el->next, this);
360 return true;
361 }
362
363 bool visit(AST::UiEnumDeclaration *el) override
364 {
365 AST::Node::accept(el->annotations, this);
366 return true;
367 }
368
369 bool visit(AST::UiInlineComponent *el) override
370 {
371 AST::Node::accept(el->annotations, this);
372 return true;
373 }
374
375 void endVisit(AST::UiImport *el) override { AST::Node::accept(el->version, this); }
376 void endVisit(AST::UiPublicMember *el) override { AST::Node::accept(el->parameters, this); }
377
378 void endVisit(AST::UiParameterList *el) override
379 {
380 AST::Node::accept(el->next, this); // put other args at the same level as this one...
381 }
382
383 void endVisit(AST::UiEnumMemberList *el) override
384 {
385 AST::Node::accept(el->next,
386 this); // put other enum members at the same level as this one...
387 }
388
389 bool visit(AST::TemplateLiteral *el) override
390 {
391 AST::Node::accept(el->expression, this);
392 return true;
393 }
394
395 void endVisit(AST::Elision *el) override
396 {
397 AST::Node::accept(el->next, this); // emit other elisions at the same level
398 }
399};
400} // namespace Dom
401} // namespace QQmlJS
402QT_END_NAMESPACE
403
404#endif // QQMLDOMCOMMENTS_P_H
DomType kind() const override
Path canonicalPath(const DomItem &self) const override
const CommentedElement * commentForNode(AST::Node *n, CommentAnchor location) const
AstComments(const std::shared_ptr< Engine > &e)
std::pair< AST::Node *, CommentAnchor > CommentKey
AstComments(const AstComments &o)
std::shared_ptr< AstComments > makeCopy(const DomItem &self) const
std::shared_ptr< OwningItem > doCopy(const DomItem &) const override
static constexpr DomType kindValue
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
void setSemanticScope(const QQmlJSScope::ConstPtr &scope)
QQmlJSScope::ConstPtr m_semanticScope
void updatePathFromOwner(const Path &newPath)
QQmlJSScope::ConstPtr semanticScope() const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
Path addAnnotation(const Path &selfPathFromOwner, const QmlObject &annotation, QmlObject **aPtr=nullptr)
BindingValue(const QList< QmlObject > &l)
void updatePathFromOwner(const Path &newPath)
BindingValue(const std::shared_ptr< ScriptExpression > &o)
BindingValue(const BindingValue &o)
DomItem value(const DomItem &binding) const
BindingValue & operator=(const BindingValue &o)
std::shared_ptr< ScriptExpression > scriptExpression
BindingValue(const QmlObject &o)
void setValue(std::unique_ptr< BindingValue > &&value)
BindingType bindingType() const
std::shared_ptr< ScriptExpression > scriptExpressionValue() const
RegionComments & comments()
Binding & operator=(const Binding &)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const
void setBindingIdentifiers(const ScriptElementVariant &bindingIdentifiers)
Path addAnnotation(const Path &selfPathFromOwner, const QmlObject &a, QmlObject **aPtr=nullptr)
QList< QmlObject > annotations() const
void updatePathFromOwner(const Path &newPath)
static QString preCodeForName(QStringView n)
QmlObject const * objectValue() const
DomItem valueItem(const DomItem &self) const
QList< QmlObject > * arrayValue()
Binding(const Binding &o)
QList< QmlObject > const * arrayValue() const
static QString postCodeForName(QStringView)
void setAnnotations(const QList< QmlObject > &annotations)
Binding & operator=(Binding &&)=default
void writeOut(const DomItem &self, OutWriter &lw) const
Binding(const QString &m_name, const QString &scriptCode, BindingType bindingType=BindingType::Normal)
const RegionComments & comments() const
Binding(const QString &m_name, std::unique_ptr< BindingValue > &&value, BindingType bindingType=BindingType::Normal)
void writeOutValue(const DomItem &self, OutWriter &lw) const
Binding(const QString &m_name=QString())
static constexpr DomType kindValue
Binding(const QString &m_name, const QmlObject &value, BindingType bindingType=BindingType::Normal)
Binding(Binding &&o)=default
std::shared_ptr< ScriptExpression > scriptExpressionValue()
ScriptElementVariant bindingIdentifiers() const
BindingValueKind valueKind() const
Binding(const QString &m_name, const std::shared_ptr< ScriptExpression > &value, BindingType bindingType=BindingType::Normal)
CommentCollector(MutableDomItem item)
void collectComments(const std::shared_ptr< Engine > &engine, AST::Node *rootNode, const std::shared_ptr< AstComments > &astComments)
Collects and associates comments with javascript AST::Node pointers or with MutableDomItem.
Extracts various pieces and information out of a rawComment string.
QStringView postWhitespace() const
QStringView comment() const
QQmlJS::SourceLocation sourceLocation() const
QQmlJS::SourceLocation commentLocation
QStringView preWhitespace() const
QStringView commentContent() const
Represents a comment.
static constexpr DomType kindValue
CommentType type() const
void write(OutWriter &lw) const
QQmlJS::SourceLocation sourceLocation() const
QStringView rawComment() const
Comment(QStringView c, const QQmlJS::SourceLocation &loc, int newlinesBefore=1, CommentType type=Pre)
friend bool operator==(const Comment &c1, const Comment &c2)
friend bool operator!=(const Comment &c1, const Comment &c2)
CommentInfo info() const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
Expose attributes to the Dom.
Comment(const QString &c, const QQmlJS::SourceLocation &loc, int newlinesBefore=1, CommentType type=Pre)
const RegionComments & comments() const
CommentableDomElement & operator=(const CommentableDomElement &o)=default
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
CommentableDomElement(const CommentableDomElement &o)
CommentableDomElement(const Path &pathFromOwner=Path())
Keeps the comment associated with an element.
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
friend bool operator!=(const CommentedElement &c1, const CommentedElement &c2)
void writePre(OutWriter &lw) const
QList< Comment > preComments() const
void writePost(OutWriter &lw) const
static constexpr DomType kindValue
friend bool operator==(const CommentedElement &c1, const CommentedElement &c2)
void addComment(const Comment &comment)
QList< Comment > postComments() const
void setIsSingleton(bool isSingleton)
void updatePathFromOwner(const Path &newPath) override
Component(const Path &pathFromOwner=Path())
void setIsComposite(bool isComposite)
Component & operator=(const Component &)=default
void setIsCreatable(bool isCreatable)
void setObjects(const QList< QmlObject > &objects)
const QMultiMap< QString, EnumDecl > & enumerations() const &
Component(const Component &o)=default
Path addObject(const QmlObject &object, QmlObject **oPtr=nullptr)
void setName(const QString &name)
Path attachedTypePath(const DomItem &) const
void setEnumerations(const QMultiMap< QString, EnumDecl > &enumerations)
DomItem field(const DomItem &self, QStringView name) const override
Path addEnumeration(const EnumDecl &enumeration, AddOption option=AddOption::Overwrite, EnumDecl **ePtr=nullptr)
void setAttachedTypeName(const QString &name)
bool iterateDirectSubpaths(const DomItem &, DirectVisitor) const override
QString attachedTypeName() const
Component(const QString &name)
void setAttachedTypePath(const Path &p)
const QList< QmlObject > & objects() const &
DomKind domKind() const override
ConstantData(const Path &pathFromOwner, const QCborValue &value, Options options=Options::MapIsMap)
QCborValue value() const override
quintptr id() const override
static constexpr DomType kindValue
DomType kind() const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
ConstantData & operator*()
const ConstantData & operator*() const
const ConstantData * operator->() const
ConstantData * operator->()
QString typeName() const
virtual DomType kind() const =0
virtual DomKind domKind() const
virtual Path canonicalPath(const DomItem &self) const =0
virtual Path pathFromOwner() const =0
virtual QList< QString > fields(const DomItem &self) const
virtual bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const =0
virtual index_type indexes(const DomItem &self) const
const DomBase * domBase() const
virtual DomItem containingObject(const DomItem &self) const
virtual void writeOut(const DomItem &self, OutWriter &lw) const
virtual QSet< QString > const keys(const DomItem &self) const
virtual DomItem field(const DomItem &self, QStringView name) const
virtual quintptr id() const
virtual QCborValue value() const
virtual QString canonicalFilePath(const DomItem &self) const
virtual ~DomBase()=default
virtual void dump(const DomItem &, const Sink &sink, int indent, FilterT filter) const
virtual DomItem key(const DomItem &self, const QString &name) const
virtual DomItem index(const DomItem &self, index_type index) const
DomElement & operator=(const DomElement &)=default
virtual void updatePathFromOwner(const Path &newPath)
Path canonicalPath(const DomItem &self) const override
Path pathFromOwner() const override
DomElement(const DomElement &o)=default
DomElement(const Path &pathFromOwner=Path())
DomItem containingObject(const DomItem &self) const override
A value type that references any element of the Dom.
DomItem bindings() const
DomItem top() const
bool dvReferences(DirectVisitor visitor, const PathEls::PathComponent &c, const QList< Path > &paths) const
DomItem goUp(int) const
QDateTime createdAt() const
T const * as() const
bool resolve(const Path &path, Visitor visitor, const ErrorHandler &errorHandler, ResolveOptions options=ResolveOption::None, const Path &fullPath=Path(), QList< Path > *visitedRefs=nullptr) const
std::shared_ptr< OwningItem > owningItemPtr() const
DomItem operator[](const QString &component) const
QString toString() const
void writeOutPost(OutWriter &lw) const
bool visitTree(const Path &basePath, ChildrenVisitor visitor, VisitOptions options=VisitOption::Default, ChildrenVisitor openingVisitor=emptyChildrenVisitor, ChildrenVisitor closingVisitor=emptyChildrenVisitor, const FieldFilter &filter=FieldFilter::noFilter()) const
Visits recursively all the children of this item using the given visitors.
DomItem path(const Path &p, const ErrorHandler &h=&defaultErrorHandler) const
DomItem containingFile() const
DomItem filterUp(function_ref< bool(DomType k, const DomItem &)> filter, FilterUpOptions options) const
DomItem methods() const
QString internalKindStr() const
DomItem scope(FilterUpOptions options=FilterUpOptions::ReturnOuter) const
DomItem enumerations() const
DomItem subOwnerItem(const PathEls::PathComponent &c, Owner o) const
bool visitLookup1(const QString &symbolName, function_ref< bool(const DomItem &)> visitor, LookupOptions=LookupOption::Normal, const ErrorHandler &h=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
DomItem child(index_type i) const
bool dvValue(DirectVisitor visitor, const PathEls::PathComponent &c, const T &value, ConstantData::Options options=ConstantData::Options::MapIsMap) const
DomItem key(QStringView name) const
std::shared_ptr< T > ownerAs() const
DomItem get(const ErrorHandler &h=nullptr, QList< Path > *visitedRefs=nullptr) const
static ErrorGroups myErrors()
DomItem operator[](const char16_t *component) const
bool visitUp(function_ref< bool(const DomItem &)> visitor) const
Let the visitor visit the Dom Tree hierarchy of this DomItem.
index_type indexes() const
bool hasAnnotations() const
bool iterateSubOwners(function_ref< bool(const DomItem &owner)> visitor) const
MutableDomItem makeCopy(CopyOption option=CopyOption::EnvConnected) const
DomItem refreshed() const
function< void(const Path &, const DomItem &, const DomItem &)> Callback
bool iterateErrors(function_ref< bool(const DomItem &, const ErrorMessage &)> visitor, bool iterate, Path inPath=Path()) const
DomItem pragmas() const
bool dvItem(DirectVisitor visitor, const PathEls::PathComponent &c, function_ref< DomItem()> it) const
DomItem proceedToScope(const ErrorHandler &h=nullptr, QList< Path > *visitedRefs=nullptr) const
Dereference DomItems pointing to other DomItems.
QList< DomItem > values() const
DomItem universe() const
bool iterateDirectSubpaths(DirectVisitor v) const
DomItem container() const
void clearErrors(const ErrorGroups &groups=ErrorGroups({}), bool iterate=true) const
quintptr id() const
QList< QString > fields() const
DomItem globalScope() const
static DomItem fromCode(const QString &code, DomType fileType=DomType::QmlFile)
Creates a new document with the given code.
QString idStr() const
DomItem(const std::shared_ptr< DomEnvironment > &)
bool dvReferenceField(DirectVisitor visitor, QStringView f, const Path &referencedObject) const
bool dvWrapField(DirectVisitor visitor, QStringView f, T &obj) const
DomItem subDataItemField(QStringView f, const T &value, ConstantData::Options options=ConstantData::Options::MapIsMap) const
DomItem copy(const T &base) const
bool visitScopeChain(function_ref< bool(const DomItem &)> visitor, LookupOptions=LookupOption::Normal, const ErrorHandler &h=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
Let the visitor visit the QML scope hierarchy of this DomItem.
std::shared_ptr< DomTop > topPtr() const
QCborValue value() const
index_type size() const
bool dvReferencesField(DirectVisitor visitor, QStringView f, const QList< Path > &paths) const
QDateTime frozenAt() const
DomItem subListItem(const List &list) const
DomItem component(GoTo option=GoTo::Strict) const
bool visitLookup(const QString &symbolName, function_ref< bool(const DomItem &)> visitor, LookupType type=LookupType::Symbol, LookupOptions=LookupOption::Normal, const ErrorHandler &errorHandler=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
void writeOutPre(OutWriter &lw) const
DomItem lookupFirst(const QString &symbolName, LookupType type=LookupType::Symbol, LookupOptions=LookupOption::Normal, const ErrorHandler &errorHandler=nullptr) const
bool visitIndexes(function_ref< bool(const DomItem &)> visitor) const
DomItem fileObject(GoTo option=GoTo::Strict) const
bool dvReference(DirectVisitor visitor, const PathEls::PathComponent &c, const Path &referencedObject) const
bool visitKeys(function_ref< bool(const QString &, const DomItem &)> visitor) const
bool visitStaticTypePrototypeChains(function_ref< bool(const DomItem &)> visitor, VisitPrototypesOptions options=VisitPrototypesOption::Normal, const ErrorHandler &h=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
DomItem::visitStaticTypePrototypeChains.
QQmlJSScope::ConstPtr semanticScope() const
bool writeOutForFile(OutWriter &ow, WriteOutChecks extraChecks) const
bool commitToBase(const std::shared_ptr< DomEnvironment > &validPtr=nullptr) const
DomItem ids() const
DomItem copy(const Owner &owner, const Path &ownerPath) const
bool dvItemField(DirectVisitor visitor, QStringView f, function_ref< DomItem()> it) const
FileWriter::Status dump(const QString &path, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> filter=noFilter, int nBackups=2, int indent=0, FileWriter *fw=nullptr) const
bool visitSubSymbolsNamed(const QString &name, function_ref< bool(const DomItem &)> visitor) const
bool dvValueLazyField(DirectVisitor visitor, QStringView f, F valueF, ConstantData::Options options=ConstantData::Options::MapIsMap) const
DomItem wrap(const PathEls::PathComponent &c, const T &obj) const
bool dvWrap(DirectVisitor visitor, const PathEls::PathComponent &c, T &obj) const
QList< DomItem > lookup(const QString &symbolName, LookupType type=LookupType::Symbol, LookupOptions=LookupOption::Normal, const ErrorHandler &errorHandler=nullptr) const
void dump(const Sink &, int indent=0, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> filter=noFilter) const
bool dvValueLazy(DirectVisitor visitor, const PathEls::PathComponent &c, F valueF, ConstantData::Options options=ConstantData::Options::MapIsMap) const
friend QMLDOM_EXPORT bool operator==(const DomItem &, const DomItem &)
DomItem wrapField(QStringView f, const T &obj) const
QSet< QString > propertyInfoNames() const
static ErrorGroups myResolveErrors()
bool visitDirectAccessibleScopes(function_ref< bool(const DomItem &)> visitor, VisitPrototypesOptions options=VisitPrototypesOption::Normal, const ErrorHandler &h=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
DomItem environment() const
bool isCanonicalChild(const DomItem &child) const
index_type length() const
DomItem operator[](QStringView component) const
DomItem rootQmlObject(GoTo option=GoTo::Strict) const
DomItem subValueItem(const PathEls::PathComponent &c, const T &value, ConstantData::Options options=ConstantData::Options::MapIsMap) const
DomItem directParent() const
DomItem annotations() const
Path canonicalPath() const
QStringList sortedKeys() const
void addError(ErrorMessage &&msg) const
DomItem containingObject() const
DomItem containingScriptExpression() const
QList< DomItem > getAll(const ErrorHandler &h=nullptr, QList< Path > *visitedRefs=nullptr) const
bool visitPrototypeChain(function_ref< bool(const DomItem &)> visitor, VisitPrototypesOptions options=VisitPrototypesOption::Normal, const ErrorHandler &h=nullptr, QSet< quintptr > *visited=nullptr, QList< Path > *visitedRefs=nullptr) const
DomKind domKind() const
bool isContainer() const
DomItem index(index_type) const
DomItem subReferencesItem(const PathEls::PathComponent &c, const QList< Path > &paths) const
bool dvValueField(DirectVisitor visitor, QStringView f, const T &value, ConstantData::Options options=ConstantData::Options::MapIsMap) const
DomItem subMapItem(const Map &map) const
bool visitLocalSymbolsNamed(const QString &name, function_ref< bool(const DomItem &)> visitor) const
bool isExternalItem() const
DomItem subReferenceItem(const PathEls::PathComponent &c, const Path &referencedObject) const
void dumpPtr(const Sink &sink) const
auto visitEl(F f) const
InternalKind internalKind() const
DomItem path(const QString &p, const ErrorHandler &h=&defaultErrorHandler) const
bool isOwningItem() const
DomItem owner() const
The owner of an element, for an qmlObject this is the containing qml file.
ErrorHandler errorHandler() const
DomItem operator[](const Path &path) const
DomItem subObjectWrapItem(SimpleObjectWrap obj) const
static DomItem empty
DomItem subDataItem(const PathEls::PathComponent &c, const T &value, ConstantData::Options options=ConstantData::Options::MapIsMap) const
QQmlJSScope::ConstPtr nearestSemanticScope() const
QString canonicalFilePath() const
void writeOut(OutWriter &lw) const
bool writeOut(const QString &path, int nBackups=2, const LineWriterOptions &opt=LineWriterOptions(), FileWriter *fw=nullptr, WriteOutChecks extraChecks=WriteOutCheck::Default) const
Path pathFromOwner() const
DomItem qmlObject(GoTo option=GoTo::Strict, FilterUpOptions options=FilterUpOptions::ReturnOuter) const
Returns the QmlObject that this belongs to.
DomItem subScriptElementWrapperItem(const ScriptElementVariant &obj) const
DomItem path(QStringView p, const ErrorHandler &h=&defaultErrorHandler) const
DomItem copy(const Owner &owner, const Path &ownerPath, const T &base) const
DomItem key(const QString &name) const
PropertyInfo propertyInfoWithName(const QString &name) const
QSet< QString > keys() const
QString name() const
DomItem children() const
DomItem field(QStringView name) const
DomItem propertyDefs() const
DomItem subLocationItem(const PathEls::PathComponent &c, SourceLocation loc) const
DomItem goToFile(const QString &filePath) const
QDateTime lastDataUpdateAt() const
DomItem(const std::shared_ptr< DomUniverse > &)
static ErrorGroup domErrorGroup
DomItem propertyInfos() const
Helper class to accept eithe a string or a dumper (a function that writes to a sink)
void operator()(const Sink &s) const
void dump(const DomItem &, const Sink &s, int indent, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> filter) const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
static constexpr DomType kindValue
Path pathFromOwner() const override
Path canonicalPath(const DomItem &self) const override
const Empty & operator*() const
const Empty * operator->() const
DomType kind() const override
DomItem containingObject(const DomItem &self) const override
quintptr id() const override
const QList< QmlObject > & annotations() const &
const QList< EnumItem > & values() const &
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const override
void setAlias(const QString &aliasName)
void setAnnotations(const QList< QmlObject > &annotations)
EnumDecl(const QString &name=QString(), const QList< EnumItem > &values=QList< EnumItem >(), const Path &pathFromOwner=Path())
void writeOut(const DomItem &self, OutWriter &lw) const override
void updatePathFromOwner(const Path &newP) override
void setName(const QString &name)
Path addAnnotation(const QmlObject &child, QmlObject **cPtr=nullptr)
Path addValue(const EnumItem &value)
static constexpr DomType kindValue
void setValues(const QList< EnumItem > &values)
DomType kind() const override
EnumItem(const QString &name=QString(), int value=0, ValueKind valueKind=ValueKind::ImplicitValue)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
const RegionComments & comments() const
RegionComments & comments()
void writeOut(const DomItem &self, OutWriter &lw) const
static constexpr DomType kindValue
convenience macro creating a new ErrorGroup and registering its groupId as translatable string
QLatin1String groupId() const
void dumpId(const Sink &sink) const
Represents a set of tags grouping a set of related error messages.
ErrorMessage debug(const Dumper &message) const
ErrorMessage error(const QString &message) const
ErrorMessage errorMessage(const DiagnosticMessage &msg, const Path &element=Path(), const QString &canonicalFilePath=QString()) const
ErrorMessage warning(const Dumper &message) const
QVector< ErrorGroup > groups
static int cmp(const ErrorGroups &g1, const ErrorGroups &g2)
ErrorMessage debug(const QString &message) const
void dumpId(const Sink &sink) const
ErrorMessage info(const QString &message) const
ErrorMessage warning(const QString &message) const
ErrorMessage errorMessage(const Dumper &msg, ErrorLevel level, const Path &element=Path(), const QString &canonicalFilePath=QString(), SourceLocation location=SourceLocation()) const
ErrorMessage info(const Dumper &message) const
void fatal(const Dumper &msg, const Path &element=Path(), QStringView canonicalFilePath=u"", SourceLocation location=SourceLocation()) const
ErrorMessage error(const Dumper &message) const
Represents an error message connected to the dom.
ErrorMessage & withPath(const Path &)
ErrorMessage & withErrorId(QLatin1String errorId)
ErrorMessage(const ErrorGroups &errorGroups, const DiagnosticMessage &msg, const Path &path=Path(), const QString &file=QString(), QLatin1String errorId=QLatin1String(""))
static QLatin1String msg(QLatin1String errorId, ErrorMessage &&err)
ErrorMessage & withLocation(SourceLocation)
ErrorMessage handle(const ErrorHandler &errorHandler=nullptr)
static QLatin1String msg(const char *errorId, ErrorMessage &&err)
ErrorMessage & withFile(const QString &)
ErrorMessage & withItem(const DomItem &)
static ErrorMessage load(const char *errorId)
static ErrorMessage load(QLatin1String errorId, T... args)
ErrorMessage(const QString &message, const ErrorGroups &errorGroups, Level level=Level::Warning, const Path &path=Path(), const QString &file=QString(), SourceLocation location=SourceLocation(), QLatin1String errorId=QLatin1String(""))
void dump(const Sink &s) const
ErrorMessage & withFile(QStringView)
static ErrorMessage load(QLatin1String errorId)
friend int compare(const ErrorMessage &msg1, const ErrorMessage &msg2)
static void visitRegisteredMessages(function_ref< bool(const ErrorMessage &)> visitor)
static Export fromString(const Path &source, QStringView exp, const Path &typePath, const ErrorHandler &h)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
static FieldFilter noLocationFilter()
const QMultiMap< QString, QString > & fieldFilterAdd() const
bool operator()(const DomItem &, const Path &, const DomItem &) const
bool addFilter(const QString &f)
bool operator()(const DomItem &, const PathEls::PathComponent &c, const DomItem &) const
static FieldFilter compareNoCommentsFilter()
static FieldFilter defaultFilter()
static FieldFilter compareFilter()
static FieldFilter noFilter()
FieldFilter(const QMultiMap< QString, QString > &fieldFilterAdd={}, const QMultiMap< QString, QString > &fieldFilterRemove={})
QMultiMap< QString, QString > fieldFilterRemove() const
Represents a Node of FileLocations tree.
QString logicalPath() const
QString canonicalPath() const
void setCanonicalPath(const QString &canonicalPath)
void setLogicalPath(const QString &logicalPath)
std::optional< InMemoryContents > content() const
static FileToLoad fromFileSystem(const std::weak_ptr< DomEnvironment > &environment, const QString &canonicalPath)
static FileToLoad fromMemory(const std::weak_ptr< DomEnvironment > &environment, const QString &path, const QString &data)
FileToLoad(const std::weak_ptr< DomEnvironment > &environment, const QString &canonicalPath, const QString &logicalPath, const std::optional< InMemoryContents > &content)
std::weak_ptr< DomEnvironment > environment() const
Status write(const QString &targetFile, function_ref< bool(QTextStream &)> write, int nBk=2)
GlobalComponent(const Path &pathFromOwner=Path())
DomType kind() const override
static constexpr DomType kindValue
Path addAnnotation(const Path &selfPathFromOwner, const QmlObject &ann, QmlObject **aPtr=nullptr)
RegionComments comments
std::shared_ptr< ScriptExpression > value
static constexpr DomType kindValue
Id(const QString &idName=QString(), const Path &referredObject=Path())
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const
void updatePathFromOwner(const Path &pathFromOwner)
QList< QmlObject > annotations
const QList< Path > & importSourcePaths() const &
const QMap< QString, ImportScope > & subImports() const &
QList< DomItem > importedItemsWithName(const DomItem &self, const QString &name) const
QList< Export > importedExportsWithName(const DomItem &self, const QString &name) const
QSet< QString > importedNames(const DomItem &self) const
void addImport(const QStringList &p, const Path &targetExports)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
QList< Path > allSources(const DomItem &self) const
Import(const QmlUri &uri=QmlUri(), Version version=Version(), const QString &importId=QString())
Import baseImport() const
friend bool operator==(const Import &i1, const Import &i2)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const
static QRegularExpression importRe()
void writeOut(const DomItem &self, OutWriter &ow) const
static Import fromFileString(const QString &importStr, const QString &importId=QString(), const ErrorHandler &handler=nullptr)
friend bool operator!=(const Import &i1, const Import &i2)
static Import fromUriString(const QString &importStr, Version v=Version(), const QString &importId=QString(), const ErrorHandler &handler=nullptr)
IndentInfo(QStringView line, int tabSize, int initialColumn=0)
JsResource(const Path &pathFromOwner=Path())
DomType kind() const override
bool iterateDirectSubpaths(const DomItem &, DirectVisitor) const override
static constexpr DomType kindValue
const QString & currentLine() const
LineWriter & write(QStringView v, TextAddType tType=TextAddType::Normal)
LineWriter & ensureSemicolon(TextAddType t=TextAddType::Extra)
void handleTrailingSpace(LineWriterOptions::TrailingSpace s)
LineWriter & ensureNewline(int nNewlines=1, TextAddType t=TextAddType::Extra)
QMap< int, std::function< bool(LineWriter &, TextAddType)> > m_textAddCallbacks
LineWriter & ensureSpace(TextAddType t=TextAddType::Extra)
const LineWriterOptions & options() const
void eof(bool ensureNewline=true)
void addInnerSink(const SinkF &s)
std::function< void(QStringView)> sink()
int addNewlinesAutospacerCallback(int nLines)
virtual void reindentAndSplit(const QString &eol, bool eof=false)
void commitLine(const QString &eol, TextAddType t=TextAddType::Normal, int untilChar=-1)
SourceLocation currentSourceLocation() const
LineWriter & ensureSpace(QStringView space, TextAddType t=TextAddType::Extra)
SourceLocation committedLocation() const
void setLineIndent(int indentAmount)
int addTextAddCallback(std::function< bool(LineWriter &, TextAddType)> callback)
void textAddCallback(TextAddType t)
LineWriter(const SinkF &innerSink, const QString &fileName, const LineWriterOptions &options=LineWriterOptions(), int lineNr=0, int columnNr=0, int utf16Offset=0, const QString &currentLine=QString())
quintptr id() const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor v) const override
void writeOut(const DomItem &self, OutWriter &ow, bool compact) const
static constexpr DomType kindValue
index_type indexes(const DomItem &) const override
virtual void copyTo(ListPBase *) const
virtual void moveTo(ListPBase *) const
void writeOut(const DomItem &self, OutWriter &ow) const override
DomType kind() const override
QList< const void * > m_pList
ListPBase(const Path &pathFromOwner, const QList< const void * > &pList, const QString &elType)
void moveTo(ListPBase *t) const override
ListPT(const Path &pathFromOwner, const QList< T * > &pList, const QString &elType=QString(), ListOptions options=ListOptions::Normal)
DomItem index(const DomItem &self, index_type index) const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor v) const override
void copyTo(ListPBase *t) const override
static constexpr DomType kindValue
static constexpr DomType kindValue
ListPBase & operator*()
ListPBase * operator->()
const ListPBase * operator->() const
ListP(const Path &pathFromOwner, const QList< T * > &pList, const QString &elType=QString(), ListOptions options=ListOptions::Normal)
const ListPBase & operator*() const
void writeOut(const DomItem &self, OutWriter &ow, bool compact) const
List(const Path &pathFromOwner, const LookupFunction &lookup, const Length &length, const IteratorFunction &iterator, const QString &elType)
DomType kind() const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
const List & operator*() const
static List fromQList(const Path &pathFromOwner, const QList< T > &list, const std::function< DomItem(const DomItem &, const PathEls::PathComponent &, const T &)> &elWrapper, ListOptions options=ListOptions::Normal)
std::function< bool(const DomItem &, function_ref< bool(index_type, function_ref< DomItem()>)>)> IteratorFunction
static List fromQListRef(const Path &pathFromOwner, const QList< T > &list, const std::function< DomItem(const DomItem &, const PathEls::PathComponent &, const T &)> &elWrapper, ListOptions options=ListOptions::Normal)
void dump(const DomItem &, const Sink &s, int indent, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)>) const override
std::function< DomItem(const DomItem &, index_type)> LookupFunction
void writeOut(const DomItem &self, OutWriter &ow) const override
quintptr id() const override
static constexpr DomType kindValue
const List * operator->() const
index_type indexes(const DomItem &self) const override
DomItem index(const DomItem &self, index_type index) const override
std::function< index_type(const DomItem &)> Length
std::function< DomItem(const DomItem &, QString)> LookupFunction
static Map fromMultiMapRef(const Path &pathFromOwner, const QMultiMap< QString, T > &mmap)
const Map * operator->() const
static Map fromFileRegionMap(const Path &pathFromOwner, const QMap< FileLocationRegion, T > &map)
static Map fromFileRegionListMap(const Path &pathFromOwner, const QMap< FileLocationRegion, QList< T > > &map)
Map(const Path &pathFromOwner, const LookupFunction &lookup, const Keys &keys, const QString &targetType)
const Map & operator*() const
static Map fromMapRef(const Path &pathFromOwner, const QMap< QString, T > &mmap, const std::function< DomItem(const DomItem &, const PathEls::PathComponent &, const T &)> &elWrapper)
static Map fromMultiMap(const Path &pathFromOwner, const QMultiMap< QString, T > &mmap)
std::function< QSet< QString >(const DomItem &)> Keys
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
QSet< QString > const keys(const DomItem &self) const override
quintptr id() const override
DomItem key(const DomItem &self, const QString &name) const override
static constexpr DomType kindValue
DomType kind() const override
std::shared_ptr< ScriptExpression > body
Path typePath(const DomItem &) const
QList< MethodParameter > parameters
std::shared_ptr< ScriptExpression > returnType
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
void writeOut(const DomItem &self, OutWriter &ow) const
void writePre(const DomItem &self, OutWriter &ow) const
QString signature(const DomItem &self) const
std::shared_ptr< ScriptExpression > defaultValue
void writeOut(const DomItem &self, OutWriter &ow) const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
void writeOutSignal(const DomItem &self, OutWriter &ow) const
TypeAnnotationStyle typeAnnotationStyle
static constexpr DomType kindValue
std::shared_ptr< ScriptExpression > value
QMap< QString, QMap< QString, MockObject > > subMaps
friend bool operator==(const ModuleAutoExport &i1, const ModuleAutoExport &i2)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
friend bool operator!=(const ModuleAutoExport &i1, const ModuleAutoExport &i2)
static constexpr DomType kindValue
std::shared_ptr< T > ownerAs() const
MutableDomItem addChild(QmlObject child)
FileWriter::Status dump(const QString &path, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> filter=noFilter, int nBackups=2, int indent=0, FileWriter *fw=nullptr)
bool writeOut(const QString &path, int nBackups=2, const LineWriterOptions &opt=LineWriterOptions(), FileWriter *fw=nullptr)
friend bool operator==(const MutableDomItem &o1, const MutableDomItem &o2)
MutableDomItem addPropertyDef(const PropertyDefinition &propertyDef, AddOption option=AddOption::Overwrite)
bool commitToBase(const std::shared_ptr< DomEnvironment > &validEnvPtr=nullptr)
QString canonicalFilePath() const
MutableDomItem fileObject(GoTo option=GoTo::Strict)
MutableDomItem operator[](const char16_t *component)
MutableDomItem key(QStringView name)
MutableDomItem operator[](const QString &component)
MutableDomItem addMethod(const MethodInfo &functionDef, AddOption option=AddOption::Overwrite)
MutableDomItem field(QStringView name)
void dump(const Sink &s, int indent=0, function_ref< bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> filter=noFilter)
void writeOut(OutWriter &lw)
MutableDomItem(const DomItem &owner, const Path &pathFromOwner)
MutableDomItem containingObject()
void addError(ErrorMessage &&msg)
MutableDomItem path(const QString &p)
std::shared_ptr< DomTop > topPtr()
MutableDomItem key(const QString &name)
QSet< QString > const keys()
MutableDomItem qmlObject(GoTo option=GoTo::Strict, FilterUpOptions fOptions=FilterUpOptions::ReturnOuter)
QList< QString > const fields()
MutableDomItem component(GoTo option=GoTo::Strict)
MutableDomItem path(const Path &p)
MutableDomItem makeCopy(CopyOption option=CopyOption::EnvConnected)
MutableDomItem operator[](const Path &path)
MutableDomItem index(index_type i)
MutableDomItem child(index_type i)
MutableDomItem(const DomItem &item)
std::shared_ptr< OwningItem > owningItemPtr()
friend bool operator!=(const MutableDomItem &o1, const MutableDomItem &o2)
MutableDomItem rootQmlObject(GoTo option=GoTo::Strict)
DomItem::CopyOption CopyOption
MutableDomItem operator[](QStringView component)
MutableDomItem path(QStringView p)
MutableDomItem addBinding(Binding binding, AddOption option=AddOption::Overwrite)
A DomItem that owns other DomItems and is managed through a shared pointer.
QDateTime createdAt() const
virtual bool iterateSubOwners(const DomItem &self, function_ref< bool(const DomItem &owner)> visitor)
virtual int revision() const
QBasicMutex * mutex() const
DomItem containingObject(const DomItem &self) const override
virtual std::shared_ptr< OwningItem > doCopy(const DomItem &self) const =0
std::shared_ptr< OwningItem > makeCopy(const DomItem &self) const
Path pathFromOwner() const override final
OwningItem(const OwningItem &&)=delete
bool iterateErrors(const DomItem &self, function_ref< bool(const DomItem &source, const ErrorMessage &msg)> visitor, const Path &inPath=Path())
virtual void addError(const DomItem &self, ErrorMessage &&msg)
QDateTime frozenAt() const
void addErrorLocal(ErrorMessage &&msg)
virtual QDateTime lastDataUpdateAt() const
void clearErrors(const ErrorGroups &groups=ErrorGroups({}))
Path canonicalPath(const DomItem &self) const override=0
QMultiMap< Path, ErrorMessage > localErrors() const
OwningItem & operator=(const OwningItem &&)=delete
OwningItem(int derivedFrom, const QDateTime &lastDataUpdateAt)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
virtual bool frozen() const
virtual void refreshedDataAt(QDateTime tNew)
OwningItem(int derivedFrom=0)
OwningItem(const OwningItem &o)
void dump(const Sink &sink) const
bool checkName(QStringView s) const
index_type index(index_type defaultValue=-1) const
QStringView stringView() const
void dump(const Sink &sink, const QString &name, bool hasSquareBrackets) const
void dump(const Sink &sink) const
QStringView stringView() const
bool checkName(QStringView s) const
void dump(const Sink &sink) const
bool checkName(QStringView s) const
bool checkName(QStringView s) const
QStringView stringView() const
void dump(const Sink &sink) const
bool checkName(QStringView s) const
void dump(const Sink &sink) const
Filter(const std::function< bool(const DomItem &)> &f, QStringView filterDescription=u"<native code filter>")
QStringView stringView() const
std::function< bool(const DomItem &)> filterFunction
index_type index(index_type=-1) const
bool checkName(QStringView s) const
void dump(const Sink &sink) const
void dump(const Sink &sink) const
bool checkName(QStringView s) const
QStringView stringView() const
bool checkName(QStringView s) const
static int cmp(const PathComponent &p1, const PathComponent &p2)
PathComponent & operator=(PathComponent &&)=default
PathComponent & operator=(const PathComponent &)=default
index_type index(index_type defaultValue=-1) const
PathComponent(const PathComponent &)=default
PathComponent(PathComponent &&)=default
void dump(const Sink &sink) const
const Current * asCurrent() const
PathData(const QStringList &strData, const QVector< PathComponent > &components, const std::shared_ptr< PathData > &parent)
QVector< PathComponent > components
PathData(const QStringList &strData, const QVector< PathComponent > &components)
std::shared_ptr< PathData > parent
void dump(const Sink &sink) const
QStringView stringView() const
bool checkName(QStringView s) const
bool operator==(const PathIterator &o) const
PathIterator operator++(int)
bool operator!=(const PathIterator &o) const
Path withCurrent(const QString &s) const
PathCurrent headCurrent() const
Path dropTail(int n=1) const
Path withEmpty() const
index_type headIndex(index_type defaultValue=-1) const
Path withIndex(index_type i) const
static int cmp(const Path &p1, const Path &p2)
static Path fromField(const QString &s)
static Path fromField(QStringView s=u"")
static Path fromRoot(QStringView s=u"")
Path expandBack() const
Expand a path suffix hidden by slicing.
Path withKey(QStringView name) const
Path withPath(const Path &toAdd, bool avoidToAddAsBase=false) const
Returns a copy of this with toAdd appended to it.
static Path fromString(QStringView s, const ErrorHandler &errorHandler=nullptr)
QString headName() const
Source split() const
Splits the path at the last field, root or current Component.
const Component * pointer
PathIterator begin() const
PathEls::Kind Kind
static Path fromRoot(PathRoot r)
static Path fromCurrent(const QString &s)
Path withComponent(const PathEls::PathComponent &c)
static ErrorGroups myErrors()
Path withAny() const
bool checkHeadName(QStringView name) const
Path operator[](int i) const
static Path fromCurrent(QStringView s=u"")
Path withKey(const QString &name) const
Path head() const
Path withCurrent(QStringView s=u"") const
Path mid(int offset, int length) const
Path expandFront() const
Expand a path prefix hidden by slicing.
Path withFilter(const std::function< bool(const DomItem &)> &, QStringView desc=u"<native code filter>") const
Path withCurrent(PathCurrent s) const
void dump(const Sink &sink) const
Path last() const
Kind headKind() const
Path withFilter(const std::function< bool(const DomItem &)> &, const QString &) const
Path mid(int offset) const
const Path & reference
static Path fromString(const QString &s, const ErrorHandler &errorHandler=nullptr)
QString toString() const
static Path fromKey(const QString &s)
PathIterator end() const
Path withField(QStringView name) const
std::function< bool(const DomItem &)> headFilter() const
Path dropFront(int n=1) const
Path withField(const QString &name) const
static Path fromRoot(const QString &s)
PathEls::PathComponent Component
static Path fromCurrent(PathCurrent c)
PathRoot headRoot() const
static Path fromKey(QStringView s=u"")
Path(const PathEls::PathComponent &c)
static Path fromIndex(index_type i)
std::forward_iterator_tag iterator_category
Pragma(const QString &pragmaName=QString(), const QStringList &pragmaValues={})
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
void writeOut(const DomItem &self, OutWriter &ow) const
static constexpr DomType kindValue
static constexpr DomType kindValue
ScriptElementVariant m_nameIdentifiers
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
void writeOut(const DomItem &self, OutWriter &lw) const
ScriptElementVariant nameIdentifiers() const
void setNameIdentifiers(const ScriptElementVariant &name)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
static constexpr DomType kindValue
QQmlDomAstCreatorBase(const MutableDomItem &qmlFile)
void endVisit(AST::UiProgram *) override
void throwRecursionDepthError() override
void endVisitHelper(AST::PatternElement *pe, const std::shared_ptr< ScriptElements::GenericScriptElement > &element)
void loadAnnotations(AST::UiObjectMember *el)
bool visit(AST::UiProgram *program) override
void enableLoadFileLazily(bool enable=true)
void enableScriptExpressions(bool enable=true)
virtual QQmlJSASTClassListToVisit void throwRecursionDepthError() override
QQmlDomAstCreatorWithQQmlJSScope(const QQmlJSScope::Ptr &current, MutableDomItem &qmlFile, QQmlJSLogger *logger, QQmlJSImporter *importer)
QQmlJSScope::ConstPtr semanticScope() const
void setIds(const QMultiMap< QString, Id > &ids)
void setNextComponentPath(const Path &p)
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
QList< DomItem > subComponents(const DomItem &self) const
const QMultiMap< QString, Id > & ids() const &
void updatePathFromOwner(const Path &newPath) override
void setNameIdentifiers(const ScriptElementVariant &name)
static constexpr DomType kindValue
void writeOut(const DomItem &self, OutWriter &) const override
void setSemanticScope(const QQmlJSScope::ConstPtr &scope)
QmlComponent(const QString &name=QString())
QList< QString > subComponentsNames(const DomItem &self) const
Path addId(const Id &id, AddOption option=AddOption::Overwrite, Id **idPtr=nullptr)
ScriptElementVariant nameIdentifiers() const
DomType kind() const override
QList< QString > fields(const DomItem &) const override
void setNameIdentifiers(const ScriptElementVariant &name)
Path addChild(const QmlObject &child, QmlObject **cPtr=nullptr)
MutableDomItem addBinding(MutableDomItem &self, const Binding &binding, AddOption option)
void setMethods(const QMultiMap< QString, MethodInfo > &functionDefs)
void writeOut(const DomItem &self, OutWriter &ow, const QString &onTarget) const
ScriptElementVariant nameIdentifiers() const
void setName(const QString &name)
QList< std::pair< SourceLocation, DomItem > > orderOfAttributes(const DomItem &self, const DomItem &component) const
bool iterateSubOwners(const DomItem &self, function_ref< bool(const DomItem &owner)> visitor) const
MutableDomItem addChild(MutableDomItem &self, const QmlObject &child)
void setAnnotations(const QList< QmlObject > &annotations)
const QMultiMap< QString, Binding > & bindings() const &
DomType kind() const override
void setNextScopePath(const Path &nextScopePath)
void updatePathFromOwner(const Path &newPath) override
void setChildren(const QList< QmlObject > &children)
Path addBinding(const Binding &binding, AddOption option, Binding **bPtr=nullptr)
static constexpr DomType kindValue
Path addAnnotation(const QmlObject &annotation, QmlObject **aPtr=nullptr)
void writeOutSortedEnumerations(const DomItem &component, OutWriter &ow) const
LocallyResolvedAlias resolveAlias(const DomItem &self, std::shared_ptr< ScriptExpression > accessSequence) const
void writeOutId(const DomItem &self, OutWriter &ow) const
QList< QmlObject > children() const
LocallyResolvedAlias resolveAlias(const DomItem &self, const QStringList &accessSequence) const
const QList< Path > & prototypePaths() const &
void writeOutSortedPropertyDefinition(const DomItem &self, OutWriter &ow, QSet< QString > &mergedDefBinding) const
Path addPropertyDef(const PropertyDefinition &propertyDef, AddOption option, PropertyDefinition **pDef=nullptr)
const QMultiMap< QString, MethodInfo > & methods() const &
MutableDomItem addPropertyDef(MutableDomItem &self, const PropertyDefinition &propertyDef, AddOption option)
DomItem field(const DomItem &self, QStringView name) const override
void setBindings(const QMultiMap< QString, Binding > &bindings)
QString localDefaultPropertyName() const
QString defaultPropertyName(const DomItem &self) const
void setPropertyDefs(const QMultiMap< QString, PropertyDefinition > &propertyDefs)
QmlObject(const Path &pathFromOwner=Path())
void writeOutSortedAttributes(const DomItem &self, OutWriter &ow, const DomItem &component) const
MutableDomItem addMethod(MutableDomItem &self, const MethodInfo &functionDef, AddOption option)
void writeOutAttributes(const DomItem &self, OutWriter &ow, const DomItem &component, const QString &code) const
void setIdStr(const QString &id)
QQmlJSScope::ConstPtr semanticScope() const
const QMultiMap< QString, PropertyDefinition > & propertyDefs() const &
void writeOut(const DomItem &self, OutWriter &lw) const override
Path addPrototypePath(const Path &prototypePath)
void setSemanticScope(const QQmlJSScope::ConstPtr &scope)
void setDefaultPropertyName(const QString &name)
void setPrototypePaths(const QList< Path > &prototypePaths)
QList< QmlObject > annotations() const
QList< QString > fields() const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
Path addMethod(const MethodInfo &functionDef, AddOption option, MethodInfo **mPtr=nullptr)
bool iterateBaseDirectSubpaths(const DomItem &self, DirectVisitor) const
static QmlUri fromString(const QString &importStr)
QString absoluteLocalPath(const QString &basePath=QString()) const
QString directoryString() const
static QmlUri fromUriString(const QString &importStr)
QString localPath() const
QString moduleUri() const
friend bool operator==(const QmlUri &i1, const QmlUri &i2)
static QmlUri fromDirectoryString(const QString &importStr)
friend bool operator!=(const QmlUri &i1, const QmlUri &i2)
void setInterfaceNames(const QStringList &interfaces)
void setMetaRevisions(const QList< int > &metaRevisions)
QQmlJSScope::AccessSemantics accessSemantics() const
void setFileName(const QString &fileName)
static constexpr DomType kindValue
QQmlJSScope::ConstPtr semanticScope() const
void setAccessSemantics(QQmlJSScope::AccessSemantics v)
void setSemanticScope(const QQmlJSScope::ConstPtr &scope)
bool iterateDirectSubpaths(const DomItem &, DirectVisitor) const override
void setExtensionTypeName(const QString &name)
void setElementTypeName(const QString &name)
const QList< int > & metaRevisions() const &
const QList< Export > & exports() const &
void setExports(const QList< Export > &exports)
void addExport(const Export &exportedEntry)
const QStringList & interfaceNames() const &
QmltypesComponent(const Path &pathFromOwner=Path())
DomType kind() const override
QList< QString > fields(const DomItem &self) const override
quintptr id() const override
static constexpr DomType kindValue
const Reference & operator*() const
DomItem index(const DomItem &, index_type) const override
DomItem field(const DomItem &self, QStringView name) const override
DomItem get(const DomItem &self, const ErrorHandler &h=nullptr, QList< Path > *visitedRefs=nullptr) const
QList< DomItem > getAll(const DomItem &self, const ErrorHandler &h=nullptr, QList< Path > *visitedRefs=nullptr) const
index_type indexes(const DomItem &) const override
DomType kind() const override
QSet< QString > const keys(const DomItem &) const override
const Reference * operator->() const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const override
Reference(const Path &referredObject=Path(), const Path &pathFromOwner=Path(), const SourceLocation &loc=SourceLocation())
DomItem key(const DomItem &, const QString &) const override
Keeps the comments associated with a DomItem.
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const
friend bool operator!=(const RegionComments &c1, const RegionComments &c2)
const QMap< FileLocationRegion, CommentedElement > & regionComments() const
friend bool operator==(const RegionComments &c1, const RegionComments &c2)
Path addComment(const Comment &comment, FileLocationRegion region)
static constexpr DomType kindValue
const DomBase & operator*() const
const DomBase * operator->() const
static constexpr DomType kindValue
ScriptElementVariant element() const
ScriptElementDomWrapper(const ScriptElementVariant &element)
Use this to contain any script element.
void visitConst(F &&visitor) const
std::optional< ScriptElementT > data()
ScriptElement::PointerType< ScriptElement > base() const
Returns a pointer to the virtual base for virtual method calls.
static ScriptElementVariant fromElement(const T &element)
void setData(const ScriptElementT &data)
void replaceKindForGenericChildren(DomType oldType, DomType newType)
QStringView loc2Str(const SourceLocation &) const
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const override
DomType kind() const override
std::shared_ptr< AstComments > astComments() const
std::shared_ptr< QQmlJS::Engine > engine() const
ScriptExpression(const QString &code, ExpressionType expressionType)
static constexpr DomType kindValue
SourceLocation locationToLocal(const SourceLocation &x) const
std::shared_ptr< ScriptExpression > makeCopy(const DomItem &self) const
ScriptExpression(const ScriptExpression &e)
ExpressionType expressionType() const
void writeOut(const DomItem &self, OutWriter &lw) const override
SourceLocation globalLocation(const DomItem &self) const
ScriptExpression(QStringView code, const std::shared_ptr< QQmlJS::Engine > &engine, AST::Node *ast, const std::shared_ptr< AstComments > &comments, ExpressionType expressionType, const SourceLocation &localOffset=SourceLocation())
void setScriptElement(const ScriptElementVariant &p)
std::shared_ptr< OwningItem > doCopy(const DomItem &) const override
ScriptElementVariant scriptElement()
void astDumper(const Sink &s, AstDumperOptions options) const
SourceLocation localOffset() const
Path canonicalPath(const DomItem &self) const override
static constexpr DomType kindValue
bool iterateDirectSubpaths(const DomItem &, DirectVisitor) const override
SimpleObjectWrapBase(const Path &pathFromOwner, const QVariant &value, quintptr idValue, DomType kind=kindValue, SimpleWrapOptions options=SimpleWrapOption::None)
virtual void moveTo(SimpleObjectWrapBase *) const
DomKind domKind() const final override
virtual void copyTo(SimpleObjectWrapBase *) const
DomType kind() const final override
quintptr id() const final override
SimpleObjectWrapT(const Path &pathFromOwner, const QVariant &v, quintptr idValue, SimpleWrapOptions o)
void moveTo(SimpleObjectWrapBase *target) const override
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor visitor) const override
static constexpr DomType kindValue
void writeOut(const DomItem &self, OutWriter &lw) const override
void copyTo(SimpleObjectWrapBase *target) const override
const SimpleObjectWrapBase & operator*() const
SimpleObjectWrapBase & operator*()
static SimpleObjectWrap fromObjectRef(const Path &pathFromOwner, T &value)
const SimpleObjectWrapBase * operator->() const
static constexpr DomType kindValue
SimpleObjectWrapBase * operator->()
bool iterateDirectSubpaths(const DomItem &self, DirectVisitor) const
QString majorString() const
static constexpr DomType kindValue
Version(qint32 majorVersion=Undefined, qint32 minorVersion=Undefined)
QString minorString() const
int compare(Version o) const
static Version fromString(QStringView v)
QString stringValue() const
static constexpr qint32 Undefined
static constexpr qint32 Latest
QString majorSymbolicString() const
A vistor that visits all the AST:Node.
bool visit(AST::UiPublicMember *el) override
void throwRecursionDepthError() override
static QSet< int > uiKinds()
returns a set with all Ui* Nodes (i.e.
void endVisit(AST::UiImport *el) override
Provides entities to maintain mappings between elements and their location in a file.
Tree ensure(const Tree &base, const Path &basePath)
bool operator>=(const PathComponent &lhs, const PathComponent &rhs)
bool operator<=(const PathComponent &lhs, const PathComponent &rhs)
bool operator==(const PathComponent &lhs, const PathComponent &rhs)
bool operator!=(const PathComponent &lhs, const PathComponent &rhs)
bool operator>(const PathComponent &lhs, const PathComponent &rhs)
bool operator<(const PathComponent &lhs, const PathComponent &rhs)
Path lookupTypePath(const QString &name)
Path loadInfoPath(const Path &el)
Path moduleScopePath(const QString &uri, const ErrorHandler &errorHandler=nullptr)
Path qmltypesFilePath(const QString &path)
Path jsFilePath(const QString &path)
Path lookupCppTypePath(const QString &name)
Path qmlFileInfoPath(const QString &canonicalFilePath)
Path moduleIndexPath(const QString &uri, int majorVersion, const ErrorHandler &errorHandler=nullptr)
Path qmlFilePath(const QString &canonicalFilePath)
Path globalScopePath(const QString &name)
Path moduleScopePath(const QString &uri, const QString &version, const ErrorHandler &errorHandler=nullptr)
Path lookupSymbolPath(const QString &name)
Path jsFileInfoPath(const QString &path)
Path lookupPropertyPath(const QString &name)
Path moduleScopePath(const QString &uri, Version version, const ErrorHandler &errorHandler=nullptr)
Path qmlDirPath(const QString &path)
Path qmlDirectoryPath(const QString &path)
Path qmldirFilePath(const QString &path)
Path qmlDirectoryInfoPath(const QString &path)
Path qmltypesFileInfoPath(const QString &path)
Path qmldirFileInfoPath(const QString &path)
Path qmlDirInfoPath(const QString &path)
Path qmlFileObjectPath(const QString &canonicalFilePath)
Path globalScopeInfoPath(const QString &name)
bool operator>(Version v1, Version v2)
QMLDOM_EXPORT bool domTypeIsContainer(DomType k)
bool operator==(Version v1, Version v2)
QMLDOM_EXPORT void dumperToQDebug(const Dumper &dumper, QDebug debug)
void devNull(QStringView)
QMLDOM_EXPORT void errorToQDebug(const ErrorMessage &)
writes an ErrorMessage to QDebug
constexpr bool domTypeIsOwningItem(DomType)
Path appendUpdatableElementInQList(const Path &listPathFromOwner, QList< T > &list, const T &value, T **vPtr=nullptr)
bool operator<=(const ErrorMessage &e1, const ErrorMessage &e2)
QMLDOM_EXPORT void dumpErrorLevel(const Sink &s, ErrorLevel level)
Dumps a string describing the given error level (ErrorLevel::Error -> Error,...)
constexpr bool domTypeIsValueWrap(DomType k)
void sinkInt(const Sink &s, T i)
std::variant< ConstantData, Empty, List, ListP, Map, Reference, ScriptElementDomWrapper, SimpleObjectWrap, const AstComments *, const FileLocations::Node *, const DomEnvironment *, const DomUniverse *, const EnumDecl *, const ExternalItemInfoBase *, const ExternalItemPairBase *, const GlobalComponent *, const GlobalScope *, const JsFile *, const JsResource *, const LoadInfo *, const MockObject *, const MockOwner *, const ModuleIndex *, const ModuleScope *, const QmlComponent *, const QmlDirectory *, const QmlFile *, const QmlObject *, const QmldirFile *, const QmltypesComponent *, const QmltypesFile *, const ScriptExpression * > ElementT
QMLDOM_EXPORT void silentError(const ErrorMessage &)
Error handler that ignores all errors (excluding fatal ones)
Path insertUpdatableElementInMultiMap(const Path &mapPathFromOwner, QMultiMap< K, T > &mmap, K key, const T &value, AddOption option=AddOption::KeepExisting, T **valuePtr=nullptr)
size_t qHash(const CommentAnchor &key, size_t seed=0) noexcept
std::variant< std::monostate, std::shared_ptr< DomEnvironment >, std::shared_ptr< DomUniverse > > TopT
bool noFilter(const DomItem &, const PathEls::PathComponent &, const DomItem &)
QMLDOM_EXPORT void dumperToQDebug(const Dumper &dumper, ErrorLevel level=ErrorLevel::Debug)
writes the dumper to the QDebug object corrsponding to the given error level
QMLDOM_EXPORT void sinkNewline(const Sink &s, int indent=0)
sinks a neline and indents by the given amount
bool operator>=(const ErrorGroups &lhs, const ErrorGroups &rhs)
QMLDOM_EXPORT void setDefaultErrorHandler(const ErrorHandler &h)
Sets the default error handler.
QMLDOM_EXPORT ErrorLevel errorLevelFromQtMsgType(QtMsgType msgType)
QMLDOM_EXPORT QMap< DomKind, QString > domKindToStringMap()
size_t qHash(const Path &, size_t)
QMLDOM_EXPORT QDebug operator<<(QDebug debug, const DomItem &c)
std::shared_ptr< ExternalOwningItem > getFileItemOwner(const DomItem &fileItem)
DomKind kind2domKind(DomType k)
bool operator==(const ErrorGroups &lhs, const ErrorGroups &rhs)
static DomItem keyMultiMapHelper(const DomItem &self, const QString &key, const QMultiMap< QString, T > &mmap)
bool operator!=(const DomItem &o1, const DomItem &o2)
QMLDOM_EXPORT bool domTypeIsExternalItem(DomType k)
constexpr bool domTypeIsUnattachedOwningItem(DomType)
QMLDOM_EXPORT QMap< DomType, QString > domTypeToStringMap()
QMLDOM_EXPORT bool domTypeIsScope(DomType k)
bool operator!=(const ErrorMessage &e1, const ErrorMessage &e2)
bool operator<=(const Path &lhs, const Path &rhs)
bool operator==(const ErrorMessage &e1, const ErrorMessage &e2)
QMLDOM_EXPORT QDebug operator<<(QDebug debug, const MutableDomItem &c)
std::disjunction< std::is_same< U, V >... > IsInList
bool operator>(const Path &lhs, const Path &rhs)
bool operator<(const ErrorMessage &e1, const ErrorMessage &e2)
QMLDOM_EXPORT QString domTypeToString(DomType k)
std::variant< std::monostate, std::shared_ptr< ModuleIndex >, std::shared_ptr< MockOwner >, std::shared_ptr< ExternalItemInfoBase >, std::shared_ptr< ExternalItemPairBase >, std::shared_ptr< QmlDirectory >, std::shared_ptr< QmldirFile >, std::shared_ptr< JsFile >, std::shared_ptr< QmlFile >, std::shared_ptr< QmltypesFile >, std::shared_ptr< GlobalScope >, std::shared_ptr< ScriptExpression >, std::shared_ptr< AstComments >, std::shared_ptr< LoadInfo >, std::shared_ptr< FileLocations::Node >, std::shared_ptr< DomEnvironment >, std::shared_ptr< DomUniverse > > OwnerT
auto writeOutWrap(const T &, const DomItem &, OutWriter &, rank< 0 >) -> void
constexpr bool domTypeIsScriptElement(DomType)
QMLDOM_EXPORT QString domKindToString(DomKind k)
bool operator>=(const ErrorMessage &e1, const ErrorMessage &e2)
constexpr bool domTypeIsDomElement(DomType)
void updatePathFromOwnerQList(QList< T > &list, const Path &newPath)
constexpr bool domTypeCanBeInline(DomType k)
bool operator<(Version v1, Version v2)
bool operator<=(Version v1, Version v2)
bool operator!=(const ErrorGroups &lhs, const ErrorGroups &rhs)
QMLDOM_EXPORT QDebug operator<<(QDebug d, const Dumper &dumper)
auto writeOutWrap(const T &t, const DomItem &self, OutWriter &lw) -> void
QDebug operator<<(QDebug debug, const Path &p)
bool operator>=(const Path &lhs, const Path &rhs)
auto writeOutWrap(const T &t, const DomItem &self, OutWriter &lw, rank< 1 >) -> decltype(t.writeOut(self, lw))
bool operator!=(Version v1, Version v2)
bool operator>=(Version v1, Version v2)
bool operator<=(const ErrorGroups &lhs, const ErrorGroups &rhs)
bool operator!=(const Path &lhs, const Path &rhs)
bool operator<(const Path &lhs, const Path &rhs)
bool visitWithCustomListIteration(T *t, AST::Visitor *visitor)
std::function< void(const ErrorMessage &)> ErrorHandler
QMLDOM_EXPORT void sinkIndent(const Sink &s, int indent)
sinks the requested amount of spaces
bool operator>(const ErrorGroups &lhs, const ErrorGroups &rhs)
QMLDOM_EXPORT bool domTypeIsTopItem(DomType k)
QMLDOM_EXPORT void defaultErrorHandler(const ErrorMessage &)
Calls the default error handler (by default errorToQDebug)
void updatePathFromOwnerMultiMap(QMultiMap< K, T > &mmap, const Path &newPath)
bool operator<(const ErrorGroups &lhs, const ErrorGroups &rhs)
constexpr bool domTypeIsObjWrap(DomType k)
QMLDOM_EXPORT void sinkEscaped(const Sink &sink, QStringView s, EscapeOptions options=EscapeOptions::OuterQuotes)
dumps a string as quoted string (escaping things like quotes or newlines)
bool operator==(const Path &lhs, const Path &rhs)
bool operator>(const ErrorMessage &e1, const ErrorMessage &e2)
bool emptyChildrenVisitor(Path, const DomItem &, bool)
QMLDOM_EXPORT QString dumperToString(const Dumper &writer)
Converts a dumper to a string.
static ErrorGroups importErrors
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")
#define QMLDOM_EXPORT
#define Q_SCRIPTELEMENT_EXIT_IF(check)
#define Q_SCRIPTELEMENT_DISABLE()
#define NewErrorGroup(name)
QT_BEGIN_NAMESPACE QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY(writeOutLog, QMLDOM_EXPORT)
#define QMLDOM_FIELD(name)
#define QMLDOM_USTRING(s)
friend bool comparesEqual(const CommentAnchor &a, const CommentAnchor &b) noexcept
static CommentAnchor from(const SourceLocation &sl)
A common base class for all the script elements.
void setSemanticScope(const QQmlJSScope::ConstPtr &scope)
virtual void createFileLocations(const std::shared_ptr< FileLocations::Node > &fileLocationOfOwner)=0
std::shared_ptr< T > PointerType
QQmlJSScope::ConstPtr semanticScope()
SubclassStorage & operator=(const SubclassStorage &o)
SubclassStorage(const SubclassStorage &&o)
SubclassStorage(const SubclassStorage &o)