![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Represents a consistent set of types organized in modules, it is the top level of the DOM. More...
#include <qqmldomtop_p.h>
Classes | |
struct | LoadResult |
Public Types | |
enum class | Option { Default = 0x0 , KeepValid = 0x1 , Exported = 0x2 , NoReload = 0x4 , WeakLoad = 0x8 , SingleThreaded = 0x10 , NoDependencies = 0x20 } |
Public Types inherited from QQmlJS::Dom::DomTop | |
using | Callback = DomItem::Callback |
Public Types inherited from QQmlJS::Dom::DomBase | |
using | FilterT = function_ref<bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> |
Static Public Member Functions | |
static ErrorGroups | myErrors () |
static std::shared_ptr< DomEnvironment > | create (const QStringList &loadPaths, Options options=Option::SingleThreaded, DomCreationOption creationOption=DomCreationOption::Default, const DomItem &universe=DomItem::empty) |
static QList< Import > | defaultImplicitImports () |
Static Public Member Functions inherited from QQmlJS::Dom::OwningItem | |
static int | nextRevision () |
Static Public Attributes | |
static constexpr DomType | kindValue = DomType::DomEnvironment |
Protected Member Functions | |
std::shared_ptr< OwningItem > | doCopy (const DomItem &self) const override |
Friends | |
class | RefCacheEntry |
Represents a consistent set of types organized in modules, it is the top level of the DOM.
The DomEnvironment keeps a pointer m_lastValidBase to the last used valid DomEnvironment in the commitToBase() method. This allows the qqmldomastcreator to commit lazily loaded dependencies to the valid environment used by qmlls.
Definition at line 717 of file qqmldomtop_p.h.
|
strong |
Enumerator | |
---|---|
Default | |
KeepValid | |
Exported | |
NoReload | |
WeakLoad | |
SingleThreaded | |
NoDependencies |
Definition at line 742 of file qqmldomtop_p.h.
|
explicit |
|
explicit |
|
delete |
void QQmlJS::Dom::DomEnvironment::addAllLoadedCallback | ( | const DomItem & | self, |
DomTop::Callback | c ) |
Definition at line 2219 of file qqmldomtop.cpp.
References QQmlJS::Dom::Path::Path().
Depending on the creation options, this function adds LoadInfo of the provided path
Definition at line 1753 of file qqmldomtop.cpp.
References addLoadInfo().
Referenced by addExternalItemInfo().
|
inline |
Definition at line 915 of file qqmldomtop_p.h.
References addDependenciesToLoad().
void QQmlJS::Dom::DomEnvironment::addGlobalScope | ( | const std::shared_ptr< GlobalScope > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1940 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::addJsFile | ( | const std::shared_ptr< JsFile > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1935 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::addLoadInfo | ( | const DomItem & | self, |
const std::shared_ptr< LoadInfo > & | loadInfo ) |
Enqueues path to the m_loadsWithWork (queue of the pending "load" jobs). In simpler words, schedule the load of the dependencies of the path from loadInfo.
Definition at line 1768 of file qqmldomtop.cpp.
References QQmlJS::Dom::DomItem::addError(), QQmlJS::Dom::LoadInfo::Done, QQmlJS::Dom::ErrorGroups::error(), and myErrors().
Referenced by addDependenciesToLoad(), and moduleIndexWithUri().
void QQmlJS::Dom::DomEnvironment::addQmlDirectory | ( | const std::shared_ptr< QmlDirectory > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1920 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::addQmldirFile | ( | const std::shared_ptr< QmldirFile > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1925 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::addQmlFile | ( | const std::shared_ptr< QmlFile > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1904 of file qqmldomtop.cpp.
References domCreationOption(), and QQmlJS::Dom::Extended.
void QQmlJS::Dom::DomEnvironment::addQmltypesFile | ( | const std::shared_ptr< QmltypesFile > & | file, |
AddOption | option = AddOption::KeepExisting ) |
Definition at line 1930 of file qqmldomtop.cpp.
Definition at line 2166 of file qqmldomtop.cpp.
std::shared_ptr< DomEnvironment > QQmlJS::Dom::DomEnvironment::base | ( | ) | const |
Definition at line 2177 of file qqmldomtop.cpp.
Referenced by commitToBase().
|
overridevirtual |
Implements QQmlJS::Dom::DomTop.
Definition at line 881 of file qqmldomtop.cpp.
References QQmlJS::Dom::Path::fromRoot().
QQml::Dom::DomTop::loadFile.
filePath | the file path to load |
logicalPath | the path from the |
callback | a callback called with an canonical path, the old value, and the current value. |
loadOptions | are if force is true the file is always read |
Implements QQmlJS::Dom::OwningItem.
Definition at line 154 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::clearReferenceCache | ( | ) |
Definition at line 2235 of file qqmldomtop.cpp.
bool QQmlJS::Dom::DomEnvironment::commitToBase | ( | const DomItem & | self, |
const std::shared_ptr< DomEnvironment > & | validEnv = nullptr ) |
Definition at line 1981 of file qqmldomtop.cpp.
References base(), and semanticAnalysis().
|
static |
Definition at line 1884 of file qqmldomtop.cpp.
Definition at line 2208 of file qqmldomtop.cpp.
|
overrideprotectedvirtual |
Implements QQmlJS::Dom::OwningItem.
Definition at line 1105 of file qqmldomtop.cpp.
Referenced by makeCopy().
|
inline |
Definition at line 950 of file qqmldomtop_p.h.
Referenced by addQmlFile(), and semanticAnalysis().
std::shared_ptr< ExternalItemInfo< GlobalScope > > QQmlJS::Dom::DomEnvironment::ensureGlobalScopeWithName | ( | const DomItem & | self, |
const QString & | name, | ||
EnvLookup | lookup = EnvLookup::Normal ) |
Definition at line 1701 of file qqmldomtop.cpp.
|
finaloverridevirtual |
Reimplemented from QQmlJS::Dom::DomBase.
Definition at line 1095 of file qqmldomtop.cpp.
bool QQmlJS::Dom::DomEnvironment::finishLoadingDependencies | ( | int | waitMSec = 30000 | ) |
Definition at line 2138 of file qqmldomtop.cpp.
References QQmlJS::Dom::LoadInfo::Done, and loadPendingDependencies().
QString QQmlJS::Dom::DomEnvironment::globalScopeName | ( | ) | const |
Definition at line 2203 of file qqmldomtop.cpp.
QSet< QString > QQmlJS::Dom::DomEnvironment::globalScopeNames | ( | const DomItem & | self, |
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1724 of file qqmldomtop.cpp.
References QQmlJS::Dom::BaseOnly.
std::shared_ptr< ExternalItemInfo< GlobalScope > > QQmlJS::Dom::DomEnvironment::globalScopeWithName | ( | const DomItem & | self, |
const QString & | name, | ||
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1694 of file qqmldomtop.cpp.
Definition at line 2214 of file qqmldomtop.cpp.
|
inline |
Definition at line 875 of file qqmldomtop_p.h.
References QQmlJS::Dom::BaseOnly.
|
overridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 886 of file qqmldomtop.cpp.
References universe().
QSet< QString > QQmlJS::Dom::DomEnvironment::jsFilePaths | ( | const DomItem & | self, |
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1667 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfo< JsFile > > QQmlJS::Dom::DomEnvironment::jsFileWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1662 of file qqmldomtop.cpp.
|
overridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 876 of file qqmldomtop.cpp.
References kindValue.
void QQmlJS::Dom::DomEnvironment::loadBuiltins | ( | const Callback & | callback = nullptr, |
const ErrorHandler & | h = nullptr ) |
Definition at line 1381 of file qqmldomtop.cpp.
References QQmlJS::Dom::ErrorGroups::error(), and myErrors().
void QQmlJS::Dom::DomEnvironment::loadFile | ( | const FileToLoad & | file, |
const Callback & | callback, | ||
std::optional< DomType > | fileType = std::optional<DomType>(), | ||
const ErrorHandler & | h = nullptr ) |
Definition at line 1116 of file qqmldomtop.cpp.
Definition at line 1790 of file qqmldomtop.cpp.
Definition at line 1802 of file qqmldomtop.cpp.
Definition at line 1796 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::loadModuleDependency | ( | const QString & | uri, |
Version | v, | ||
const Callback & | callback = nullptr, | ||
const ErrorHandler & | = nullptr ) |
QStringList QQmlJS::Dom::DomEnvironment::loadPaths | ( | ) | const |
Definition at line 2191 of file qqmldomtop.cpp.
void QQmlJS::Dom::DomEnvironment::loadPendingDependencies | ( | ) |
Definition at line 2094 of file qqmldomtop.cpp.
Referenced by finishLoadingDependencies().
std::shared_ptr< DomEnvironment > QQmlJS::Dom::DomEnvironment::makeCopy | ( | const DomItem & | self | ) | const |
Definition at line 1100 of file qqmldomtop.cpp.
References doCopy().
QSet< int > QQmlJS::Dom::DomEnvironment::moduleIndexMajorVersions | ( | const DomItem & | self, |
const QString & | uri, | ||
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1453 of file qqmldomtop.cpp.
References QQmlJS::Dom::BaseOnly.
QSet< QString > QQmlJS::Dom::DomEnvironment::moduleIndexUris | ( | const DomItem & | self, |
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1445 of file qqmldomtop.cpp.
std::shared_ptr< ModuleIndex > QQmlJS::Dom::DomEnvironment::moduleIndexWithUri | ( | const DomItem & | self, |
const QString & | uri, | ||
int | majorVersion, | ||
EnvLookup | lookup, | ||
Changeable | changeable, | ||
const ErrorHandler & | errorHandler = nullptr ) |
Definition at line 1522 of file qqmldomtop.cpp.
References addLoadInfo(), QQmlJS::Dom::DomItem::canonicalPath(), QQmlJS::Dom::ErrorGroups::error(), myErrors(), and QQmlJS::Dom::ReadOnly.
std::shared_ptr< ModuleIndex > QQmlJS::Dom::DomEnvironment::moduleIndexWithUri | ( | const DomItem & | self, |
const QString & | uri, | ||
int | majorVersion, | ||
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1581 of file qqmldomtop.cpp.
|
static |
Definition at line 870 of file qqmldomtop.cpp.
Referenced by addLoadInfo(), QQmlJS::Dom::LoadInfo::advanceLoad(), QQmlJS::Dom::LoadInfo::doCopy(), QQmlJS::Dom::LoadInfo::finishedLoadingDep(), loadBuiltins(), and moduleIndexWithUri().
DomEnvironment::Options QQmlJS::Dom::DomEnvironment::options | ( | ) | const |
Definition at line 2172 of file qqmldomtop.cpp.
Referenced by testing.tools.test_runner._TestCaseRunner::_NewImageArtifact(), testing.tools.test_runner._TestCaseRunner::_RegenerateIfNeeded(), testing.tools.test_runner.TestRunner::IsSkiaGoldEnabled(), testing.tools.test_runner._TestCaseRunner::TestPixel(), and testing.tools.test_runner._TestCaseRunner::TestText().
void QQmlJS::Dom::DomEnvironment::populateFromQmlFile | ( | MutableDomItem && | qmlFile | ) |
Definition at line 2240 of file qqmldomtop.cpp.
References QQmlJS::Dom::CommentCollector::CommentCollector(), QQmlJS::Dom::CommentCollector::collectComments(), QQmlJS::Dom::Default, QQmlJS::Dom::Extended, QQmlJS::Dom::Minimal, and semanticAnalysis().
QSet< QString > QQmlJS::Dom::DomEnvironment::qmlDirectoryPaths | ( | const DomItem & | self, |
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1594 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfo< QmlDirectory > > QQmlJS::Dom::DomEnvironment::qmlDirectoryWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1589 of file qqmldomtop.cpp.
QSet< QString > QQmlJS::Dom::DomEnvironment::qmldirFilePaths | ( | const DomItem & | self, |
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1610 of file qqmldomtop.cpp.
QStringList QQmlJS::Dom::DomEnvironment::qmldirFiles | ( | ) | const |
Definition at line 2197 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfo< QmldirFile > > QQmlJS::Dom::DomEnvironment::qmldirFileWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1605 of file qqmldomtop.cpp.
QSet< QString > QQmlJS::Dom::DomEnvironment::qmlDirPaths | ( | const DomItem & | self, |
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1628 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfoBase > QQmlJS::Dom::DomEnvironment::qmlDirWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1620 of file qqmldomtop.cpp.
QSet< QString > QQmlJS::Dom::DomEnvironment::qmlFilePaths | ( | const DomItem & | self, |
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1651 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfo< QmlFile > > QQmlJS::Dom::DomEnvironment::qmlFileWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1646 of file qqmldomtop.cpp.
QSet< QString > QQmlJS::Dom::DomEnvironment::qmltypesFilePaths | ( | const DomItem & | self, |
EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1683 of file qqmldomtop.cpp.
std::shared_ptr< ExternalItemInfo< QmltypesFile > > QQmlJS::Dom::DomEnvironment::qmltypesFileWithPath | ( | const DomItem & | self, |
const QString & | path, | ||
EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1678 of file qqmldomtop.cpp.
Definition at line 1397 of file qqmldomtop.cpp.
DomEnvironment::SemanticAnalysis QQmlJS::Dom::DomEnvironment::semanticAnalysis | ( | ) |
Do not call this method inside of DomEnvironment's constructor! It requires weak_from_this() that only works after the constructor call finished.
Definition at line 1839 of file qqmldomtop.cpp.
References domCreationOption(), and QQmlJS::Dom::Extended.
Referenced by commitToBase(), and populateFromQmlFile().
void QQmlJS::Dom::DomEnvironment::setLoadPaths | ( | const QStringList & | v | ) |
Definition at line 2182 of file qqmldomtop.cpp.
shared_ptr< DomUniverse > QQmlJS::Dom::DomEnvironment::universe | ( | ) | const |
Definition at line 1411 of file qqmldomtop.cpp.
Referenced by iterateDirectSubpaths().
|
friend |
Definition at line 953 of file qqmldomtop_p.h.
|
staticconstexpr |
Definition at line 755 of file qqmldomtop_p.h.
Referenced by kind().