Skip to content
Snippets Groups Projects
Commit 46d42919 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Add to the completion box the names used in JavaScript functions.

parent 4d4b1ae2
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,40 @@ protected:
return true;
}
virtual bool visit(AST::FunctionExpression *node)
{
if (node->name)
_words.insert(node->name->asString());
for (AST::FormalParameterList *it = node->formals; it; it = it->next) {
if (it->name)
_words.insert(it->name->asString());
}
return true;
}
virtual bool visit(AST::FunctionDeclaration *node)
{
if (node->name)
_words.insert(node->name->asString());
for (AST::FormalParameterList *it = node->formals; it; it = it->next) {
if (it->name)
_words.insert(it->name->asString());
}
return true;
}
virtual bool visit(AST::VariableDeclaration *node)
{
if (node->name)
_words.insert(node->name->asString());
return true;
}
private:
QSet<QString> _words;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment