forked from qt-creator/qt-creator
Qmljs: added scope for blocks in UiScriptBindings and UiPublicMember
correctly insert the scope for code blocks in UiScriptBindings and UiPublicMember, and improve find usages for types (correctly detecting variables in the same scope) Change-Id: Iaaf1a59f041f3831fbe04243b220fb85fde76479 Reviewed-on: http://codereview.qt.nokia.com/335 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
@@ -66,6 +66,31 @@ bool ScopeAstPath::preVisit(Node *node)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScopeAstPath::visit(UiPublicMember *node)
|
||||
{
|
||||
if (node && node->statement && node->statement->kind == node->Kind_Block
|
||||
&& containsOffset(node->statement->firstSourceLocation(),
|
||||
node->statement->lastSourceLocation())) {
|
||||
_result.append(node);
|
||||
Node::accept(node->statement, this);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScopeAstPath::visit(UiScriptBinding *node)
|
||||
{
|
||||
if (node && node->statement && node->statement->kind == node->Kind_Block
|
||||
&& containsOffset(node->statement->firstSourceLocation(),
|
||||
node->statement->lastSourceLocation()))
|
||||
{
|
||||
_result.append(node);
|
||||
Node::accept(node->statement, this);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScopeAstPath::visit(UiObjectDefinition *node)
|
||||
{
|
||||
_result.append(node);
|
||||
|
||||
Reference in New Issue
Block a user