forked from qt-creator/qt-creator
QmlJS: Fix member completion at the end of a nested object definition.
The parser's error recovery generates three nested object definitions
for code like
Item { Item { font } }
where the innermost definition corresponds to 'font }' and has an empty
lbrace token.
If we create a Range for this recovered definition, code completion will
fail for 'font.'.
Task-number: QTCREATORBUG-2767
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -404,14 +404,14 @@ protected:
|
||||
|
||||
virtual bool visit(AST::UiObjectBinding *ast)
|
||||
{
|
||||
if (ast->initializer)
|
||||
if (ast->initializer && ast->initializer->lbraceToken.length)
|
||||
_ranges.append(createRange(ast, ast->initializer));
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool visit(AST::UiObjectDefinition *ast)
|
||||
{
|
||||
if (ast->initializer)
|
||||
if (ast->initializer && ast->initializer->lbraceToken.length)
|
||||
_ranges.append(createRange(ast, ast->initializer));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user