summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljscontext.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-11-24 12:07:49 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2011-11-24 19:11:18 +0100
commit3e48bb6d19177f7c1c5e9dbde69b2667663353b4 (patch)
tree13586e335db946436e9ba9c9e0a3971ffd8280ca /src/libs/qmljs/qmljscontext.cpp
parentd5b8638b482dbf05fd6e6a2b2b27b2091f64f0e9 (diff)
downloadqt-creator-3e48bb6d19177f7c1c5e9dbde69b2667663353b4.tar.gz
QmlJS: Add documentation for ScopeChain.
Clear up Context documentation a little. Change-Id: I2ede3dc0f15a972d2748cef1aa579a04f0786106 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/libs/qmljs/qmljscontext.cpp')
-rw-r--r--src/libs/qmljs/qmljscontext.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libs/qmljs/qmljscontext.cpp b/src/libs/qmljs/qmljscontext.cpp
index 2782ec3b97..cacaae99aa 100644
--- a/src/libs/qmljs/qmljscontext.cpp
+++ b/src/libs/qmljs/qmljscontext.cpp
@@ -42,13 +42,18 @@ using namespace QmlJS::AST;
\brief Holds information about relationships between documents in a Snapshot.
\sa Document Link Snapshot
- Contexts are usually created through Link.
-
- Once created, a Context is immutable and can be freely shared between threads.
+ Contexts are usually created through Link. Once created, a Context is immutable
+ and can be freely shared between threads.
Their main purpose is to allow lookup of types with lookupType() and resolving
- of references through lookupReference(). Information about the imports of
- a QmlJS::Document can be accessed with imports().
+ of references through lookupReference(). As such, they form the basis for creating
+ a ScopeChain.
+
+ Information about the imports of a Document can be accessed with imports().
+
+ When dealing with a QmlJSEditor::QmlJSTextEditorWidget it is unnecessary to
+ construct a new Context manually. Instead use
+ QmlJSTextEditorWidget::semanticInfo()::context.
*/
ContextPtr Context::create(const QmlJS::Snapshot &snapshot, ValueOwner *valueOwner, const ImportsPerDocument &imports)