QmlJS: Make 'follow symbol' work on JS functions.

Task-number: QTCREATORBUG-1757
This commit is contained in:
Christian Kamm
2010-07-16 10:50:28 +02:00
parent 68be307b49
commit 4ecf0349c5
3 changed files with 15 additions and 4 deletions

View File

@@ -2959,8 +2959,8 @@ const Value *ASTVariableReference::value(Context *context) const
return check(_ast->expression);
}
ASTFunctionValue::ASTFunctionValue(FunctionDeclaration *ast, Engine *engine)
: FunctionValue(engine), _ast(ast)
ASTFunctionValue::ASTFunctionValue(FunctionDeclaration *ast, const Document *doc, Engine *engine)
: FunctionValue(engine), _doc(doc), _ast(ast)
{
setPrototype(engine->functionPrototype());
@@ -3007,6 +3007,14 @@ bool ASTFunctionValue::isVariadic() const
return true;
}
bool ASTFunctionValue::getSourceLocation(QString *fileName, int *line, int *column) const
{
*fileName = _doc->fileName();
*line = _ast->identifierToken.startLine;
*column = _ast->identifierToken.startColumn;
return true;
}
QmlPrototypeReference::QmlPrototypeReference(UiQualifiedId *qmlTypeName, const QmlJS::Document *doc,
Engine *engine)
: Reference(engine),