QmlJS: Fix highlighting and completion for property declarations.

When property declarations use a custom type such as

property Foo bar

we now
* highlight Foo as a QML type if it's found
* complete bar. as a Foo

Change-Id: I82c249646af19bfeb9f5a7a7692f0dc10b009835
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Christian Kamm
2011-12-06 14:47:36 +01:00
parent 387d7a20ed
commit e1d1c9e6d6
2 changed files with 17 additions and 1 deletions

View File

@@ -305,6 +305,10 @@ protected:
bool visit(UiPublicMember *ast)
{
if (ast->typeToken.isValid() && !ast->memberType.isEmpty()) {
if (m_scopeChain.context()->lookupType(m_scopeChain.document().data(), QStringList(ast->memberType.toString())))
addUse(ast->typeToken, SemanticHighlighter::QmlTypeType);
}
if (ast->identifierToken.isValid())
addUse(ast->identifierToken, SemanticHighlighter::BindingNameType);
scopedAccept(ast, ast->statement);