![]() |
Qt 6.x
The Qt SDK
|
Associates comments with AST::Node *. More...
#include <qqmldomcomments_p.h>
Static Public Member Functions | |
static void | collectComments (MutableDomItem &item) |
static void | collectComments (std::shared_ptr< Engine > engine, AST::Node *n, std::shared_ptr< AstComments > collectComments, MutableDomItem rootItem, FileLocations::Tree rootItemLocations) |
Collects and associates comments with javascript AST::Node pointers and MutableDomItem in rootItem. | |
![]() | |
static int | nextRevision () |
Static Public Attributes | |
static constexpr DomType | kindValue = DomType::AstComments |
Protected Member Functions | |
std::shared_ptr< OwningItem > | doCopy (DomItem &) const override |
virtual std::shared_ptr< OwningItem > | doCopy (DomItem &self) const =0 |
Additional Inherited Members | |
![]() | |
using | FilterT = function_ref< bool(DomItem &, const PathEls::PathComponent &, DomItem &)> |
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
Definition at line 170 of file qqmldomcomments_p.h.
|
inline |
Definition at line 192 of file qqmldomcomments_p.h.
|
inline |
Definition at line 193 of file qqmldomcomments_p.h.
QMultiMap< quint32, const QList< Comment > * > QQmlJS::Dom::AstComments::allCommentsInNode | ( | AST::Node * | n | ) |
low level method returns all comments in a node (including its subnodes)
The comments are roughly ordered in the order they appear in the file. Multiple values are in reverse order if the index is even.
Definition at line 725 of file qqmldomcomments.cpp.
Implements QQmlJS::Dom::OwningItem.
Definition at line 187 of file qqmldomcomments_p.h.
|
static |
Definition at line 467 of file qqmldomcomments.cpp.
References item, and qCWarning.
Referenced by QQmlJS::Dom::createDom().
|
static |
Collects and associates comments with javascript AST::Node pointers and MutableDomItem in rootItem.
Definition at line 488 of file qqmldomcomments.cpp.
References QQmlJS::Dom::AstRangesVisitor::addItemRanges(), QQmlJS::Dom::AstRangesVisitor::addNodeRanges(), QString::at(), QStringView::at(), QHash< Key, T >::begin(), QQmlJS::Dom::ElementRef::element, QQmlJS::Dom::AstRangesVisitor::ends, engine, i, QStringView::isEmpty(), QChar::isSpace(), QQmlJS::Dom::locationToData(), QString::mid(), QQmlJS::Dom::CommentedElement::postComments, QQmlJS::Dom::CommentedElement::preComments, Q_ASSERT, qCWarning, QQmlJS::Dom::Comment::rawComment(), rootItem(), QString::size(), QQmlJS::Dom::ElementRef::size, and QQmlJS::Dom::AstRangesVisitor::starts.
|
inline |
Definition at line 198 of file qqmldomcomments_p.h.
|
inline |
Definition at line 202 of file qqmldomcomments_p.h.
|
inlineoverrideprotectedvirtual |
Implements QQmlJS::Dom::OwningItem.
Definition at line 173 of file qqmldomcomments_p.h.
|
overridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 435 of file qqmldomcomments.cpp.
References map.
|
inlineoverridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 180 of file qqmldomcomments_p.h.
|
inline |
Definition at line 182 of file qqmldomcomments_p.h.
|
staticconstexpr |
Definition at line 179 of file qqmldomcomments_p.h.