QmlJS: Enable 'follow symbol' for local variables.

Task-number: QTCREATORBUG-6094
Change-Id: Icf286bc412b48dbd1cb38c47ad7b91040b5aae0f
Reviewed-on: http://codereview.qt-project.org/4864
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-14 09:28:49 +02:00
parent bfe5b520f1
commit ece400cfb6
2 changed files with 9 additions and 0 deletions

View File

@@ -1759,6 +1759,14 @@ const Value *ASTVariableReference::value(ReferenceContext *referenceContext) con
return evaluator(_ast->expression);
}
bool ASTVariableReference::getSourceLocation(QString *fileName, int *line, int *column) const
{
*fileName = _doc->fileName();
*line = _ast->identifierToken.startLine;
*column = _ast->identifierToken.startColumn;
return true;
}
ASTFunctionValue::ASTFunctionValue(FunctionExpression *ast, const Document *doc, ValueOwner *valueOwner)
: FunctionValue(valueOwner), _ast(ast), _doc(doc)
{