|
DomType | kind () const override |
|
bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override |
|
std::shared_ptr< AstComments > | makeCopy (const DomItem &self) const |
|
Path | canonicalPath (const DomItem &self) const override |
|
| AstComments (const std::shared_ptr< Engine > &e) |
|
| AstComments (const AstComments &o) |
|
const QHash< AST::Node *, CommentedElement > & | commentedElements () const |
|
QHash< AST::Node *, CommentedElement > & | commentedElements () |
|
CommentedElement * | commentForNode (AST::Node *n) |
|
QMultiMap< quint32, const QList< Comment > * > | allCommentsInNode (AST::Node *n) |
|
| OwningItem (const OwningItem &o) |
|
| OwningItem (int derivedFrom=0) |
|
| OwningItem (int derivedFrom, const QDateTime &lastDataUpdateAt) |
|
| OwningItem (const OwningItem &&)=delete |
|
OwningItem & | operator= (const OwningItem &&)=delete |
|
bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override |
|
std::shared_ptr< OwningItem > | makeCopy (const DomItem &self) const |
|
Path | pathFromOwner () const |
|
Path | pathFromOwner (const DomItem &) const override final |
|
DomItem | containingObject (const DomItem &self) const override |
|
int | derivedFrom () const |
|
virtual int | revision () const |
|
QDateTime | createdAt () const |
|
virtual QDateTime | lastDataUpdateAt () const |
|
virtual void | refreshedDataAt (QDateTime tNew) |
|
virtual bool | frozen () const |
|
virtual bool | freeze () |
|
QDateTime | frozenAt () const |
|
virtual void | addError (const DomItem &self, ErrorMessage &&msg) |
|
void | addErrorLocal (ErrorMessage &&msg) |
|
void | clearErrors (const ErrorGroups &groups=ErrorGroups({})) |
|
bool | iterateErrors (const DomItem &self, function_ref< bool(const DomItem &source, const ErrorMessage &msg)> visitor, const Path &inPath=Path()) |
|
QMultiMap< Path, ErrorMessage > | localErrors () const |
|
virtual bool | iterateSubOwners (const DomItem &self, function_ref< bool(const DomItem &owner)> visitor) |
|
QBasicMutex * | mutex () const |
|
virtual | ~DomBase ()=default |
|
DomBase * | domBase () |
|
const DomBase * | domBase () const |
|
virtual DomKind | domKind () const |
|
bool | iterateDirectSubpathsConst (const DomItem &self, DirectVisitor) const |
|
virtual void | dump (const DomItem &, const Sink &sink, int indent, FilterT filter) const |
|
virtual quintptr | id () const |
|
QString | typeName () const |
|
virtual QList< QString > | fields (const DomItem &self) const |
|
virtual DomItem | field (const DomItem &self, QStringView name) const |
|
virtual index_type | indexes (const DomItem &self) const |
|
virtual DomItem | index (const DomItem &self, index_type index) const |
|
virtual QSet< QString > const | keys (const DomItem &self) const |
|
virtual DomItem | key (const DomItem &self, const QString &name) const |
|
virtual QString | canonicalFilePath (const DomItem &self) const |
|
virtual void | writeOut (const DomItem &self, OutWriter &lw) const |
|
virtual QCborValue | value () const |
|
Associates comments with AST::Node *.
Stores the comments associated with javascript AST::Node pointers.
Comments are associated to the largest closest node with the following algorithm: \list
- comments of a node can either be preComments or postComments (before or after the element)
- define start and end for each element, if two elements start (or end) at the same place the first (larger) wins.
- associate the comments either with the element just before or just after unless the comments is inside an element (meaning that going back there is a start before finding an end, or going forward an end is met before a start).
- to choose between the element before or after, we look at the start of the comment, if it is on a new line then associating it as preComment to the element after is preferred, otherwise post comment of the previous element (inline element). This is the only space dependent choice, making comment assignment quite robust
- if the comment is intrinsically inside all elements then it is moved to before the smallest element. This is the largest reorganization performed, and it is still quite small and difficult to trigger.
- the comments are stored with the whitespace surrounding them, from the preceding newline (and recording if a newline is required before it) until the newline after. This allows a better reproduction of the comments. \endlist
Definition at line 200 of file qqmldomcomments_p.h.