forked from qt-creator/qt-creator
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:
@@ -1965,7 +1965,19 @@ const Value *ASTPropertyReference::value(ReferenceContext *referenceContext) con
|
||||
return evaluator(_ast->statement);
|
||||
}
|
||||
|
||||
return valueOwner()->defaultValueForBuiltinType(_ast->memberType.toString());
|
||||
const QString memberType = _ast->memberType.toString();
|
||||
|
||||
const Value *builtin = valueOwner()->defaultValueForBuiltinType(memberType);
|
||||
if (!builtin->asUndefinedValue())
|
||||
return builtin;
|
||||
|
||||
if (_ast->typeModifier.isEmpty()) {
|
||||
const Value *type = referenceContext->context()->lookupType(_doc, QStringList(memberType));
|
||||
if (type)
|
||||
return type;
|
||||
}
|
||||
|
||||
return referenceContext->context()->valueOwner()->undefinedValue();
|
||||
}
|
||||
|
||||
ASTSignal::ASTSignal(UiPublicMember *ast, const Document *doc, ValueOwner *valueOwner)
|
||||
|
||||
Reference in New Issue
Block a user