QmlJS: Improve completion and hints for functions.

* FunctionValues know about optional arguments (for builtins)
* ASTFunctionValues only report themselves as variadic if they
  use the 'arguments' array.
* Function argument hint shows optional args and variadic.
* Completion automatically adds parentheses.

Change-Id: Ib2598600ff8b1ce8c5de3bcabd24a3e171ff3a57
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-11-16 09:56:53 +01:00
parent 8e236db9f5
commit b671baeffb
6 changed files with 223 additions and 74 deletions

View File

@@ -142,8 +142,10 @@ public:
private:
void initializePrototypes();
Function *addFunction(ObjectValue *object, const QString &name, const Value *result, int argumentCount = 0);
Function *addFunction(ObjectValue *object, const QString &name, int argumentCount = 0);
Function *addFunction(ObjectValue *object, const QString &name, const Value *result,
int argumentCount = 0, int optionalCount = 0, bool variadic = false);
Function *addFunction(ObjectValue *object, const QString &name,
int argumentCount = 0, int optionalCount = 0, bool variadic = false);
private:
ObjectValue *_objectPrototype;