forked from qt-creator/qt-creator
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:
@@ -1759,6 +1759,14 @@ const Value *ASTVariableReference::value(ReferenceContext *referenceContext) con
|
|||||||
return evaluator(_ast->expression);
|
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)
|
ASTFunctionValue::ASTFunctionValue(FunctionExpression *ast, const Document *doc, ValueOwner *valueOwner)
|
||||||
: FunctionValue(valueOwner), _ast(ast), _doc(doc)
|
: FunctionValue(valueOwner), _ast(ast), _doc(doc)
|
||||||
{
|
{
|
||||||
|
@@ -716,6 +716,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
virtual const Value *value(ReferenceContext *referenceContext) const;
|
virtual const Value *value(ReferenceContext *referenceContext) const;
|
||||||
|
virtual bool getSourceLocation(QString *fileName, int *line, int *column) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLJS_EXPORT ASTFunctionValue: public FunctionValue
|
class QMLJS_EXPORT ASTFunctionValue: public FunctionValue
|
||||||
|
Reference in New Issue
Block a user