diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp index 38b028395c0..57ff6ed2c24 100644 --- a/src/libs/qmljs/qmljsbind.cpp +++ b/src/libs/qmljs/qmljsbind.cpp @@ -48,17 +48,16 @@ using namespace QmlJS::AST; /*! \class QmlJS::Bind \brief Collected information about a single Document. - \sa QmlJS::Document QmlJS::Context + \sa Document Context - Each QmlJS::Document owns an instance of Bind. It provides access to data + Each Document owns an instance of Bind. It provides access to data that can be derived by looking at the document in isolation. If you need - information that goes beyond that, you need to use a - \l{QmlJS::Context}. + information that goes beyond that, you need to use a Context. The document's imports are classified and available through imports(). This class makes the structural information found in the AST available - for analysis through \l{QmlJS::Value} instances. See findQmlObject(), + for analysis through Value instances. See findQmlObject(), idEnvironment(), rootObjectValue() and findAttachedJSScope(). */ diff --git a/src/libs/qmljs/qmljscontext.cpp b/src/libs/qmljs/qmljscontext.cpp index 7288e299510..2782ec3b97a 100644 --- a/src/libs/qmljs/qmljscontext.cpp +++ b/src/libs/qmljs/qmljscontext.cpp @@ -39,10 +39,10 @@ using namespace QmlJS::AST; /*! \class QmlJS::Context - \brief Holds information about relationships between documents in a QmlJS::Snapshot. - \sa QmlJS::Document QmlJS::Link QmlJS::Snapshot + \brief Holds information about relationships between documents in a Snapshot. + \sa Document Link Snapshot - Contexts are usually created through \l{QmlJS::Link}. + Contexts are usually created through Link. Once created, a Context is immutable and can be freely shared between threads. diff --git a/src/libs/qmljs/qmljsdocument.cpp b/src/libs/qmljs/qmljsdocument.cpp index 121343c54b4..09d84732916 100644 --- a/src/libs/qmljs/qmljsdocument.cpp +++ b/src/libs/qmljs/qmljsdocument.cpp @@ -44,15 +44,15 @@ using namespace QmlJS::AST; /*! \class QmlJS::Document \brief A Qml or JavaScript document. - \sa QmlJS::Snapshot + \sa Snapshot - Documents are usually created by the \l{QmlJS::ModelManagerInterface} - and stored in a \l{QmlJS::Snapshot}. They allow access to data such as - the file path, source code, abstract syntax tree and the \l{QmlJS::Bind} + Documents are usually created by the ModelManagerInterface + and stored in a Snapshot. They allow access to data such as + the file path, source code, abstract syntax tree and the Bind instance for the document. To make sure unused and outdated documents are removed correctly, Document - instances are usually accessed through a shared pointer, see \l{Document::Ptr}. + instances are usually accessed through a shared pointer, see Document::Ptr. Documents in a Snapshot are immutable: They, or anything reachable through them, must not be changed. This allows Documents to be shared freely among threads @@ -62,9 +62,9 @@ using namespace QmlJS::AST; /*! \class QmlJS::LibraryInfo \brief A Qml library. - \sa QmlJS::Snapshot + \sa Snapshot - A LibraryInfo is created when the \l{QmlJS::ModelManagerInterface} finds + A LibraryInfo is created when the ModelManagerInterface finds a Qml library and parses the qmldir file. The instance holds information about which Components the library provides and which plugins to load. @@ -76,12 +76,12 @@ using namespace QmlJS::AST; /*! \class QmlJS::Snapshot \brief A set of Document::Ptr and LibraryInfo instances. - \sa QmlJS::Document QmlJS::LibraryInfo + \sa Document LibraryInfo A Snapshot holds and offers access to a set of Document and LibraryInfo instances. Usually Snapshots are copies of the snapshot maintained and updated by the - \l{QmlJS::ModelManagerInterface} that updates its instance as parsing + ModelManagerInterface that updates its instance as parsing threads finish and new information becomes available. */ diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 5ccbfb1b908..5a0dbefa4ad 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -61,6 +61,35 @@ using namespace LanguageUtils; using namespace QmlJS; using namespace QmlJS::AST; +/*! + \class QmlJS::Value + \brief Abstract base class for the result of a JS expression. + \sa Evaluate ValueOwner ValueVisitor + + A Value represents a category of JavaScript values, such as number + (NumberValue), string (StringValue) or functions with a + specific signature (FunctionValue). It can also represent internal + categories such as "a QML component instantiation defined in a file" + (ASTObjectValue), "a QML component defined in C++" + (CppComponentValue) or "no specific information is available" + (UnknownValue). + + The Value class itself provides accept() for admitting + \l{ValueVisitor}s and a do-nothing getSourceLocation(). + + Value instances should be cast to a derived type either through the + asXXX() helper functions such as asNumberValue() or via the + value_cast() template function. + + Values are the result of many operations in the QmlJS code model: + \list + \o \l{Evaluate} + \o Context::lookupType() and Context::lookupReference() + \o ScopeChain::lookup() + \o ObjectValue::lookupMember() + \endlist +*/ + namespace { class LookupMember: public MemberProcessor diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index c04c9fc6850..63ff773c330 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -126,7 +126,7 @@ public: /*! \class QmlJS::Link \brief Creates a Context for a Snapshot. - \sa QmlJS::Context QmlJS::Snapshot + \sa Context Snapshot Initializes a context by resolving imports. This is an expensive operation.