QmlJS: Add UiScriptBinding range if it has a script block.

Makes completion in code bindings have the right scope.

Change-Id: Ib76840cf7be5ab0a3c573e9ad087359816a9ced6
Reviewed-on: http://codereview.qt.nokia.com/1046
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-07-04 09:48:10 +02:00
parent e2ea5a8421
commit 7d67959366

View File

@@ -407,6 +407,14 @@ protected:
return true;
}
virtual bool visit(AST::UiScriptBinding *ast)
{
if (AST::Block *block = AST::cast<AST::Block *>(ast->statement)) {
_ranges.append(createRange(ast, block));
}
return true;
}
Range createRange(AST::UiObjectMember *member, AST::UiObjectInitializer *ast)
{
return createRange(member, member->firstSourceLocation(), ast->rbraceToken);