Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
Represents and maintains a mapping between elements and their location in a file. More...
#include <qqmldomattachedinfo_p.h>
Public Types | |
using | Tree = std::shared_ptr<AttachedInfoT<FileLocations>> |
Public Member Functions | |
DomType | kind () const |
bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const |
Static Public Member Functions | |
static Tree | createTree (const Path &basePath) |
static Tree | ensure (const Tree &base, const Path &basePath, AttachedInfo::PathType pType=AttachedInfo::PathType::Relative) |
static Tree | find (const Tree &self, const Path &p, AttachedInfo::PathType pType=AttachedInfo::PathType::Relative) |
static AttachedInfoLookupResult< Tree > | findAttachedInfo (const DomItem &item) |
static FileLocations::Tree | treeOf (const DomItem &) |
static const FileLocations * | fileLocationsOf (const DomItem &) |
static void | updateFullLocation (const Tree &fLoc, SourceLocation loc) |
static void | addRegion (const Tree &fLoc, FileLocationRegion region, SourceLocation loc) |
static QQmlJS::SourceLocation | region (const Tree &fLoc, FileLocationRegion region) |
Public Attributes | |
SourceLocation | fullRegion |
QMap< FileLocationRegion, SourceLocation > | regions |
QMap< FileLocationRegion, QList< SourceLocation > > | preCommentLocations |
QMap< FileLocationRegion, QList< SourceLocation > > | postCommentLocations |
Static Public Attributes | |
static constexpr DomType | kindValue = DomType::FileLocations |
Represents and maintains a mapping between elements and their location in a file.
The location information is attached to the element it refers to via AttachedInfo There are static methods to simplify the handling of the tree of AttachedInfo.
Attributes: \list
Definition at line 245 of file qqmldomattachedinfo_p.h.
using QQmlJS::Dom::FileLocations::Tree = std::shared_ptr<AttachedInfoT<FileLocations>> |
Definition at line 247 of file qqmldomattachedinfo_p.h.
|
static |
Definition at line 128 of file qqmldomattachedinfo.cpp.
References Q_ASSERT, region(), and updateFullLocation().
Referenced by QQmlJS::Dom::ScriptElements::ScriptElementBase< type >::createFileLocations(), QQmlJS::Dom::OutWriter::regionStart(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), and QQmlJS::Dom::QQmlDomAstCreator::visit().
|
static |
Definition at line 62 of file qqmldomattachedinfo.cpp.
References QQmlJS::Dom::AttachedInfoT< Info >::createTree().
|
static |
Definition at line 66 of file qqmldomattachedinfo.cpp.
References base, and QQmlJS::Dom::AttachedInfoT< Info >::ensure().
Referenced by QQmlJS::Dom::ScriptElements::ScriptElementBase< type >::createFileLocations(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::QQmlDomAstCreator::endVisit(), QQmlJS::Dom::OutWriter::itemStart(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), QQmlJS::Dom::QQmlDomAstCreator::visit(), and QQmlJS::Dom::QQmlDomAstCreator::visit().
|
static |
Returns the filelocation Info corresponding to a DomItem.
Definition at line 100 of file qqmldomattachedinfo.cpp.
References item, and treeOf().
|
inlinestatic |
Definition at line 255 of file qqmldomattachedinfo_p.h.
|
static |
Allows to query information about the FileLocations::Tree obtained from item, such as path of the Tree root in the Dom, the path of this item's Tree in the Dom, and so on.
{qDebug() << item.path(FileLocations::findAttachedInfo(item).foundTreePath)} or
{item.path(FileLocations::findAttachedInfo(item).foundTreePath).toString()} to print out the Tree of item, for example, as Tree's cannot be printed when outside the Dom. Definition at line 82 of file qqmldomattachedinfo.cpp.
References QQmlJS::Dom::AttachedInfoT< Info >::findAttachedInfo(), and item.
Referenced by treeOf().
bool QQmlJS::Dom::FileLocations::iterateDirectSubpaths | ( | const DomItem & | self, |
DirectVisitor | visitor ) const |
Definition at line 34 of file qqmldomattachedinfo.cpp.
References fullRegion, map, postCommentLocations, preCommentLocations, regions, and QQmlJS::Dom::sourceLocationToQCborValue().
|
inline |
Definition at line 249 of file qqmldomattachedinfo_p.h.
|
static |
Definition at line 136 of file qqmldomattachedinfo.cpp.
References it, QQmlJS::Dom::MainRegion, Q_ASSERT, region(), and regions.
Referenced by addRegion(), QQmlJS::Dom::CommentCollector::collectComments(), findUsagesOfNonJSIdentifiers(), locationFromDomItem(), region(), and QQmlJS::Dom::ErrorMessage::withItem().
|
static |
Returns the tree corresponding to a DomItem.
Definition at line 91 of file qqmldomattachedinfo.cpp.
References findAttachedInfo(), and item.
Referenced by fileLocationsOf(), QQmlLSUtils::findDefinitionOf(), findMethodDefinitionOf(), findPropertyDefinitionOf(), findUsagesHelper(), findUsagesOfNonJSIdentifiers(), locationFromDomItem(), HighlightingVisitor::operator()(), and QQmlJS::Dom::ErrorMessage::withItem().
|
static |
Definition at line 107 of file qqmldomattachedinfo.cpp.
References QQmlJS::SourceLocation::begin(), QQmlJS::SourceLocation::end(), QQmlJS::Dom::MainRegion, and Q_ASSERT.
Referenced by addRegion(), and QQmlJS::Dom::OutWriter::itemStart().
SourceLocation QQmlJS::Dom::FileLocations::fullRegion |
Definition at line 274 of file qqmldomattachedinfo_p.h.
Referenced by iterateDirectSubpaths().
|
staticconstexpr |
Definition at line 248 of file qqmldomattachedinfo_p.h.
QMap<FileLocationRegion, QList<SourceLocation> > QQmlJS::Dom::FileLocations::postCommentLocations |
Definition at line 277 of file qqmldomattachedinfo_p.h.
Referenced by iterateDirectSubpaths().
QMap<FileLocationRegion, QList<SourceLocation> > QQmlJS::Dom::FileLocations::preCommentLocations |
Definition at line 276 of file qqmldomattachedinfo_p.h.
Referenced by iterateDirectSubpaths().
QMap<FileLocationRegion, SourceLocation> QQmlJS::Dom::FileLocations::regions |
Definition at line 275 of file qqmldomattachedinfo_p.h.
Referenced by iterateDirectSubpaths(), and region().