Commit ece400cf authored by Christian Kamm's avatar Christian Kamm

QmlJS: Enable 'follow symbol' for local variables.

Task-number: QTCREATORBUG-6094
Change-Id: Icf286bc412b48dbd1cb38c47ad7b91040b5aae0f
Reviewed-on: http://codereview.qt-project.org/4864Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent bfe5b520
......@@ -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)
{
......
......@@ -716,6 +716,7 @@ public:
private:
virtual const Value *value(ReferenceContext *referenceContext) const;
virtual bool getSourceLocation(QString *fileName, int *line, int *column) const;
};
class QMLJS_EXPORT ASTFunctionValue: public FunctionValue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment