Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
8d14f18e
Commit
8d14f18e
authored
Feb 22, 2010
by
Christian Kamm
Browse files
Add an accessor to get the flat scope list from ScopeChain.
Done-with: Erik Verbruggen
parent
e9039db9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljsinterpreter.cpp
View file @
8d14f18e
...
...
@@ -745,22 +745,27 @@ void ScopeChain::QmlComponentChain::add(QList<const ObjectValue *> *list) const
void
ScopeChain
::
update
()
{
all
.
clear
();
_
all
.
clear
();
all
+=
globalScope
;
_
all
+=
globalScope
;
foreach
(
QmlComponentChain
*
parent
,
qmlComponentScope
.
instantiatingComponents
)
parent
->
add
(
&
all
);
parent
->
add
(
&
_
all
);
if
(
qmlComponentScope
.
rootObject
)
all
+=
qmlComponentScope
.
rootObject
;
all
+=
qmlScopeObjects
;
all
+=
qmlComponentScope
.
functionScopes
;
_
all
+=
qmlComponentScope
.
rootObject
;
_
all
+=
qmlScopeObjects
;
_
all
+=
qmlComponentScope
.
functionScopes
;
if
(
qmlComponentScope
.
ids
)
all
+=
qmlComponentScope
.
ids
;
_
all
+=
qmlComponentScope
.
ids
;
if
(
qmlTypes
)
all
+=
qmlTypes
;
all
+=
jsScopes
;
_all
+=
qmlTypes
;
_all
+=
jsScopes
;
}
QList
<
const
ObjectValue
*>
ScopeChain
::
all
()
const
{
return
_all
;
}
...
...
@@ -819,7 +824,7 @@ void Context::setTypeEnvironment(const QmlJS::Document *doc, const ObjectValue *
const
Value
*
Context
::
lookup
(
const
QString
&
name
)
{
QList
<
const
ObjectValue
*>
scopes
=
_scopeChain
.
all
;
QList
<
const
ObjectValue
*>
scopes
=
_scopeChain
.
all
()
;
for
(
int
index
=
scopes
.
size
()
-
1
;
index
!=
-
1
;
--
index
)
{
const
ObjectValue
*
scope
=
scopes
.
at
(
index
);
...
...
src/libs/qmljs/qmljsinterpreter.h
View file @
8d14f18e
...
...
@@ -249,7 +249,10 @@ public:
// rebuilds the flat list of all scopes
void
update
();
QList
<
const
ObjectValue
*>
all
;
QList
<
const
ObjectValue
*>
all
()
const
;
private:
QList
<
const
ObjectValue
*>
_all
;
};
class
QMLJS_EXPORT
Context
...
...
src/plugins/qmljseditor/qmljscodecompletion.cpp
View file @
8d14f18e
...
...
@@ -189,7 +189,7 @@ public:
_properties
.
clear
();
_currentObject
=
0
;
foreach
(
const
Interpreter
::
ObjectValue
*
scope
,
_context
->
scopeChain
().
all
)
foreach
(
const
Interpreter
::
ObjectValue
*
scope
,
_context
->
scopeChain
().
all
()
)
enumerateProperties
(
scope
);
return
_properties
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment