9#include <QtCore/qfileinfo.h>
10#include <QtCore/qdir.h>
11#include <QtCore/qqueue.h>
12#include <QtCore/qscopedvaluerollback.h>
13#include <QtCore/qpoint.h>
14#include <QtCore/qrect.h>
15#include <QtCore/qsize.h>
17#include <QtQml/private/qqmlsignalnames_p.h>
18#include <QtQml/private/qv4codegen_p.h>
19#include <QtQml/private/qqmlstringconverters_p.h>
20#include <QtQml/private/qqmlirbuilder_p.h>
54 const bool propertyVerdict =
property.type()->internalName() == u
"QQmlComponent";
56 const bool assignedTypeVerdict = [&assignedType]() {
67 if (cppBase->internalName() == u
"QQmlComponent")
69 for (; cppBase; cppBase = cppBase->baseType()) {
70 if (cppBase->internalName() == u
"QQmlAbstractDelegateComponent")
76 return propertyVerdict && assignedTypeVerdict;
107template<
typename Node>
122 : m_implicitImportDirectory(implicitImportDirectory),
123 m_qmldirFiles(qmldirFiles),
125 m_exportedRootScope(
target),
126 m_importer(importer),
135 m_globalScope = m_currentScope;
136 m_currentScope->setIsComposite(
true);
138 m_currentScope->setInternalName(u
"global"_s);
161 for (
const auto &jsGlobVar : jsGlobVars)
162 m_currentScope->insertJSIdentifier(jsGlobVar, globalJavaScript);
167void QQmlJSImportVisitor::populateCurrentScope(
204 return s->internalName() ==
name;
209 auto it = std::find_if(scopes.begin(), scopes.end(), pred);
210 if (
it == scopes.
end()) {
241void QQmlJSImportVisitor::resolveAliasesAndIds()
243 QQueue<QQmlJSScope::Ptr> objects;
246 qsizetype lastRequeueLength = std::numeric_limits<qsizetype>::max();
247 QQueue<QQmlJSScope::Ptr> requeue;
249 while (!objects.isEmpty()) {
251 const auto properties =
object->ownProperties();
253 bool doRequeue =
false;
261 bool foundProperty =
false;
266 if (!
type.isNull()) {
267 foundProperty =
true;
278 foundProperty =
false;
316 if (!typeScope.isNull() && !
object->isPropertyLocallyRequired(
property.propertyName())) {
317 object->setPropertyLocallyRequired(
319 typeScope->isPropertyRequired(targetProperty.
propertyName()));
326 object->addOwnProperty(newProperty);
330 const auto childScopes =
object->childScopes();
331 for (
const auto &childScope : childScopes) {
336 if (!deferred.isNull()) {
342 objects.enqueue(childScope);
346 requeue.enqueue(
object);
348 if (objects.isEmpty() && requeue.size() < lastRequeueLength) {
349 lastRequeueLength = requeue.size();
350 objects.swap(requeue);
354 while (!requeue.isEmpty()) {
356 const auto properties =
object->ownProperties();
371 const auto resource =
mapper->entry(
373 if (resource.isValid()) {
374 return resource.resourcePath.contains(u
'/')
375 ? (u
':' + resource.resourcePath.left(
376 resource.resourcePath.lastIndexOf(u
'/') + 1))
384void QQmlJSImportVisitor::processImportWarnings(
388 if (warnings.isEmpty())
396void QQmlJSImportVisitor::importBaseModules()
404 addImportWithLocation(*
it, invalidLoc);
460 resolveAliasesAndIds();
476 unusedImports.
remove(importLocation);
479 if (unusedImports.isEmpty())
484 unusedImports.remove(
import);
486 for (
const auto &
import : unusedImports) {
501 case Node::Kind_StringLiteral:
502 return cast<StringLiteral *>(expr->
expression)->value.toString();
503 case Node::Kind_NumericLiteral:
504 return cast<NumericLiteral *>(expr->
expression)->value;
513 QVector<QQmlJSAnnotation> annotationList;
522 switch (memberItem->member->kind) {
523 case Node::Kind_UiScriptBinding: {
524 auto *scriptBinding = QQmlJS::AST::cast<UiScriptBinding*>(memberItem->member);
525 qqmljsAnnotation.bindings[
buildName(scriptBinding->qualifiedId)]
535 annotationList.append(qqmljsAnnotation);
538 return annotationList;
546 if (!
type->isFullyResolved()) {
547 if (!
type->isInCustomParserParent()) {
554 auto binding =
it->create();
555 if (binding.isValid())
556 type->addOwnPropertyBinding(binding,
it->specifier);
581 parentScope = parentScope->
baseType();
583 const QString defaultPropertyName =
586 if (defaultPropertyName.
isEmpty()) {
589 bool isComponent =
false;
606 auto propType = defaultProp.
type();
610 "missing an import.")
611 .arg(defaultPropertyName)
616 if (propType.isNull()) {
617 handleUnresolvedDefaultProperty(propType);
623 && !propType->isListProperty()) {
625 QStringLiteral(
"Cannot assign multiple objects to a default non-list property"),
638 if (propType->canAssign(scope)) {
639 scope->setIsWrappedInImplicitComponent(
655 auto property =
type.scope->ownProperty(
type.name);
657 if (
const auto propertyType =
659 property.setType(propertyType);
663 +
QStringLiteral(
" was not found. Did you add all import paths?"),
675 if (
const auto returnType =
677 it->setReturnType({ returnType });
679 m_logger->
log(u
"\"%1\" was not found for the return type of method \"%2\"."_s.arg(
680 it->returnTypeName(),
it->methodName()),
684 for (
auto [parameter, parameterEnd] =
it->mutableParametersRange();
685 parameter != parameterEnd; ++parameter) {
686 if (
const auto parameterType =
689 parameter->setType({ parameterType });
692 u
"\"%1\" was not found for the type of parameter \"%2\" in method \"%3\"."_s
693 .
arg(parameter->typeName(), parameter->name(),
704 QSet<QPair<QQmlJSScope::Ptr, QString>> foundLiterals;
712 QSet<QPair<QQmlJSScope::Ptr, QString>> visited;
716 const auto uniqueBindingId =
qMakePair(objectBinding.scope, objectBinding.name);
717 if (visited.contains(uniqueBindingId))
719 visited.insert(uniqueBindingId);
721 auto [existingBindingsBegin, existingBindingsEnd] =
722 uniqueBindingId.first->ownPropertyBindings(uniqueBindingId.second);
723 const bool hasLiteralBindings =
724 std::any_of(existingBindingsBegin, existingBindingsEnd,
726 if (hasLiteralBindings)
727 foundLiterals.insert(uniqueBindingId);
731 QSet<QPair<QQmlJSScope::Ptr, QString>> foundObjects;
732 QSet<QPair<QQmlJSScope::Ptr, QString>> foundInterceptors;
733 QSet<QPair<QQmlJSScope::Ptr, QString>> foundValueSources;
737 const QString propertyName = objectBinding.name;
753 "missing an import.")
759 handleUnresolvedProperty(
property.type());
769 if (!objectBinding.onToken && !
property.type()->canAssign(childScope)) {
772 "incompatible type \"%3\"")
780 objectBinding.childScope->setIsWrappedInImplicitComponent(
784 const auto uniqueBindingId =
qMakePair(objectBinding.scope, objectBinding.name);
787 if (objectBinding.onToken) {
789 if (foundInterceptors.contains(uniqueBindingId)) {
794 foundInterceptors.insert(uniqueBindingId);
797 if (foundValueSources.contains(uniqueBindingId)) {
801 }
else if (foundObjects.contains(uniqueBindingId)
802 || foundLiterals.contains(uniqueBindingId)) {
808 foundValueSources.insert(uniqueBindingId);
818 if (foundValueSources.contains(uniqueBindingId)) {
820 QStringLiteral(
"Cannot combine value source and binding on property \"%1\"")
824 foundObjects.insert(uniqueBindingId);
833 if (!required.scope->hasProperty(required.name)) {
835 QStringLiteral(
"Property \"%1\" was marked as required but does not exist.")
845 QVector<QQmlJSScope::ConstPtr> scopesToSearch;
847 scopesToSearch << scope;
848 const auto ownProperties = scope->ownProperties();
849 for (
auto propertyIt = ownProperties.constBegin();
850 propertyIt != ownProperties.constEnd(); ++propertyIt) {
851 const QString propName = propertyIt.key();
855 if (requiredScope->isPropertyLocallyRequired(propName)) {
857 std::find_if(scopesToSearch.constBegin(), scopesToSearch.constEnd(),
859 return scope->hasPropertyBindings(propName);
861 != scopesToSearch.constEnd();
865 bool propertyUsedInRootAlias =
false;
873 property.aliasExpression().split(u
'.');
875 if (aliasExpression.size() != 2)
877 if (aliasExpression[0] == scopeId
878 && aliasExpression[1] == propName) {
879 propertyUsedInRootAlias =
true;
885 if (propertyUsedInRootAlias)
889 ? scopesToSearch.at(scopesToSearch.size() - 2)
896 const QString requiredScopeName = prevRequiredScope
900 std::optional<QQmlJSFixSuggestion> suggestion;
904 "Component is missing required property %1 from %2")
906 .arg(propertyScopeName);
907 if (requiredScope != scope) {
908 if (!prevRequiredScope.isNull()) {
909 auto sourceScope = prevRequiredScope->baseType();
911 "%1:%2:%3: Property marked as required in %4."_L1
912 .arg(sourceScope->filePath())
913 .arg(sourceScope->sourceLocation().startLine)
914 .arg(sourceScope->sourceLocation().startColumn)
915 .arg(requiredScopeName),
916 sourceScope->sourceLocation()
921 .arg(requiredScopeName);
929 prevRequiredScope = requiredScope;
949 std::optional<QQmlJSFixSuggestion> fixSuggestion;
952 baseScope = baseScope->baseType()) {
955 suggestion.has_value()) {
956 fixSuggestion = suggestion;
962 "exists in the current element.")
971 "to a missing import statement or incomplete "
977 const auto &annotations =
property.annotations();
979 const auto deprecationAnn =
980 std::find_if(annotations.cbegin(), annotations.cend(),
983 if (deprecationAnn != annotations.cend()) {
984 const auto deprecation = deprecationAnn->deprecation();
989 if (!deprecation.reason.isEmpty())
998void QQmlJSImportVisitor::checkSignal(
1004 std::optional<QQmlJSMetaMethod> signalMethod;
1011 if (
signal.has_value()) {
1012 if (signalScope->hasMethod(*
signal)) {
1013 setSignalMethod(signalScope, *
signal);
1019 if (
auto notify =
p->notify(); !notify.isEmpty()) {
1020 setSignalMethod(signalScope, notify);
1028 if (!signalMethod.has_value()) {
1029 std::optional<QQmlJSFixSuggestion> fix;
1034 if (signalScope->baseTypeName() ==
QStringLiteral(
"Connections")) {
1042 "Implicitly defining %1 as signal handler in Connections is deprecated. "
1043 "Create a function instead."_L1.arg(handlerName),
1046 "function %1(%2) { ... }"_L1.arg(handlerName, handlerParameters.join(u
", "))
1056 const auto signalParameters = signalMethod->parameters();
1057 QHash<QString, qsizetype> parameterNameIndexes;
1059 for (
int i = 0,
end = signalParameters.size();
i <
end;
i++) {
1060 auto &
p = signalParameters[
i];
1061 parameterNameIndexes[
p.name()] =
i;
1063 auto signalName = [&]() {
1065 return u
" called %1"_s.arg(*
signal);
1068 auto type =
p.type();
1072 "Type %1 of parameter %2 in signal%3 was not found, but is "
1073 "required to compile %4. Did you add all import paths?")
1074 .
arg(
p.typeName(),
p.name(), signalName(), handlerName),
1079 if (
type->isComposite())
1087 auto parameterName = [&]() {
1088 if (
p.name().isEmpty())
1090 return u
" called %1"_s.
arg(
p.name());
1092 switch (
type->accessSemantics()) {
1093 case QQmlJSScope::AccessSemantics::Reference:
1096 "passed by pointer to be able to compile %4. ")
1097 .arg(
p.typeName(), parameterName(), signalName(),
1101 case QQmlJSScope::AccessSemantics::Value:
1102 case QQmlJSScope::AccessSemantics::Sequence:
1106 "Type %1 of parameter%2 in signal%3 should be passed by "
1107 "value or const reference to be able to compile %4. ")
1108 .arg(
p.typeName(), parameterName(), signalName(),
1112 case QQmlJSScope::AccessSemantics::None:
1114 QStringLiteral(
"Type %1 of parameter%2 in signal%3 required by the "
1115 "compilation of %4 cannot be used. ")
1116 .arg(
p.typeName(), parameterName(), signalName(), handlerName),
1122 if (handlerParameters.size() > signalParameters.size()) {
1124 " parameters than the signal it handles.")
1132 auto it = parameterNameIndexes.
constFind(handlerParameter.toString());
1141 " is called \"%3\". The signal has a parameter"
1142 " of the same name in position %4.")
1144 .arg(handlerName, handlerParameter)
1173 parentScope = parentScope->
baseType();
1175 const QString defaultPropertyName =
1178 if (defaultPropertyName.
isEmpty())
1192 QList<QQmlJSScope::ConstPtr> scopes;
1194 if (scopes.contains(scope)) {
1196 for (
const auto &seen : std::as_const(scopes)) {
1197 inheritenceCycle.
append(seen->baseTypeName());
1200 inheritenceCycle.
append(scopes.first()->baseTypeName());
1205 originalScope->clearBaseType();
1206 originalScope->setBaseTypeError(
message);
1210 scopes.append(scope);
1212 const auto newScope = scope->
baseType();
1213 if (newScope.isNull()) {
1216 if (!
error.isEmpty()) {
1218 }
else if (!
name.isEmpty()) {
1236 if (annotation.isDeprecation()) {
1259 while (!children.isEmpty()) {
1260 auto childScope = children.takeFirst();
1261 const auto type = childScope->scopeType();
1265 if (!childScope->baseType()) {
1270 childScope->internalName()),
1273 children.append(childScope->childScopes());
1329 auto nameToVerify =
name.isEmpty() ? u
"<anon>"_s :
name;
1358 if (!suitableScope(scope))
1361 QList<QQmlJSMetaMethod::AbsoluteFunctionIndex>
indices;
1366 const auto &functionsAndExpressions = *
it;
1367 for (
const QString &functionOrExpression : functionsAndExpressions) {
1424 ||
s.contains(
QChar(0x2029u))) {
1427 bool escaped =
false;
1428 const QChar stringQuote =
s[0];
1434 }
else if (escaped) {
1436 if (
c == stringQuote)
1437 templateString.chop(1);
1442 templateString += u
'\\';
1443 if (
c == u
'$' &&
i + 1 <
s.size() - 1 &&
s[
i + 1] == u
'{')
1444 templateString += u
'\\';
1447 templateString +=
c;
1450 QQmlJSFixSuggestion suggestion = {
"Use a template literal instead."_L1, sl->literalToken,
1451 u
"`" % templateString % u
"`" };
1469 namespaceName = namespaceName.
first(namespaceName.indexOf(u
'.'));
1470 logger->
log(u
"Namespace '%1' of '%2' must start with an upper case letter."_s.arg(namespaceName)
1485 const qsizetype indexOfTypeName = superType.lastIndexOf(u
'.');
1486 const bool looksLikeGroupedProperty = superType.front().isLower();
1488 if (indexOfTypeName != -1 && looksLikeGroupedProperty) {
1493 if (!looksLikeGroupedProperty) {
1496 definition->firstSourceLocation());
1499 definition->firstSourceLocation());
1506 if (isRoot &&
base->internalName() == u
"QQmlComponent") {
1508 definition->qualifiedTypeNameId->identifierToken,
true,
true);
1511 m_logger->
log(u
"Singleton Type %1 is not creatable."_s.arg(
1516 }
else if (!
base->isCreatable()) {
1540 definition->firstSourceLocation());
1542 definition->firstSourceLocation()));
1574 m_logger->
log(u
"Inline component declaration must be followed by a typename"_s,
1582 switch (publicMember->type) {
1587 publicMember->firstSourceLocation());
1591 method.setMethodType(QQmlJSMetaMethodType::Signal);
1592 method.setMethodName(publicMember->name.toString());
1593 method.setSourceLocation(combine(publicMember->firstSourceLocation(),
1594 publicMember->lastSourceLocation()));
1598 param->name.toString(),
1610 publicMember->firstSourceLocation());
1618 const bool isAlias = (
typeName == u
"alias"_s);
1620 auto tryParseAlias = [&]() {
1622 if (!publicMember->statement) {
1624 qmlSyntax, publicMember->memberType->firstSourceLocation());
1627 const auto expression = cast<ExpressionStatement *>(publicMember->statement);
1628 auto node = expression ? expression->expression :
nullptr;
1629 auto fex = cast<FieldMemberExpression *>(node);
1632 aliasExpr.prepend(u
'.' + fex->name.toString());
1633 fex = cast<FieldMemberExpression *>(node);
1636 if (
const auto idExpression = cast<IdentifierExpression *>(node)) {
1637 aliasExpr.prepend(idExpression->name.toString());
1642 "member expressions can be aliased."),
1643 qmlSyntax, publicMember->statement->firstSourceLocation());
1665 }
else if (!isAlias) {
1667 publicMember->firstSourceLocation() };
1671 if (publicMember->isDefaultMember())
1675 if (publicMember->isRequired())
1691 publicMember->statement->firstSourceLocation());
1725 auto name = fexpr->name.toString();
1727 if (!
name.isEmpty()) {
1729 method.setMethodType(QQmlJSMetaMethodType::Method);
1730 method.setSourceLocation(combine(fexpr->firstSourceLocation(), fexpr->lastSourceLocation()));
1740 bool formalsFullyTyped = parseTypes;
1741 bool anyFormalTyped =
false;
1742 if (
const auto *formals = parseTypes ? fexpr->formals :
nullptr) {
1743 const auto parameters = formals->formals();
1744 for (
const auto ¶meter : parameters) {
1746 ? parameter.typeAnnotation->type->toString()
1748 if (
type.isEmpty()) {
1749 formalsFullyTyped =
false;
1752 anyFormalTyped =
true;
1758 combine(parameter.typeAnnotation->firstSourceLocation(),
1759 parameter.typeAnnotation->lastSourceLocation())
1768 method.setIsJavaScriptFunction(!formalsFullyTyped);
1774 if (parseTypes && fexpr->typeAnnotation) {
1775 method.setReturnTypeName(fexpr->typeAnnotation->type->toString());
1779 combine(fexpr->typeAnnotation->firstSourceLocation(),
1780 fexpr->typeAnnotation->lastSourceLocation())
1784 }
else if (anyFormalTyped)
1795 fexpr->firstSourceLocation(),
1796 method.returnTypeName(),
false });
1802 fexpr->firstSourceLocation());
1808 visitFunctionExpressionHelper(fexpr);
1826 visitFunctionExpressionHelper(fdecl);
1881 registerMainString, registerCommentString, registerContextString, finalizeBinding);
1888 if (statement ==
nullptr)
1891 const auto *exprStatement = cast<const ExpressionStatement *>(statement);
1893 if (exprStatement ==
nullptr) {
1896 if (
const auto *block = cast<const Block *>(statement); block && block->statements) {
1897 location = block->statements->firstSourceLocation();
1905 [binding = std::move(binding)]() {
return binding; }
1910 auto expr = exprStatement->expression;
1912 combine(expr->firstSourceLocation(), expr->lastSourceLocation()),
1915 bool isUndefinedBinding =
false;
1917 switch (expr->kind) {
1918 case Node::Kind_TrueLiteral:
1921 case Node::Kind_FalseLiteral:
1924 case Node::Kind_NullExpression:
1927 case Node::Kind_IdentifierExpression: {
1928 auto idExpr = QQmlJS::AST::cast<QQmlJS::AST::IdentifierExpression *>(expr);
1930 isUndefinedBinding = (idExpr->name == u
"undefined");
1933 case Node::Kind_NumericLiteral:
1936 case Node::Kind_StringLiteral:
1939 case Node::Kind_RegExpLiteral:
1942 case Node::Kind_TemplateLiteral: {
1943 auto templateLit = QQmlJS::AST::cast<QQmlJS::AST::TemplateLiteral *>(expr);
1945 if (templateLit->hasNoSubstitution) {
1952 expression->accept(
this);
1982 if (!QQmlJSMetaPropertyBinding::isLiteralBinding(binding.
bindingType()))
1998 const auto *statement = cast<ExpressionStatement *>(scriptBinding->statement);
2001 scriptBinding->statement->firstSourceLocation());
2005 if (
const auto *idExpression = cast<IdentifierExpression *>(statement->expression))
2006 return idExpression->name.toString();
2007 else if (
const auto *idString = cast<StringLiteral *>(statement->expression)) {
2009 idString->firstSourceLocation());
2010 return idString->value.toString();
2013 statement->expression->firstSourceLocation());
2021 auto otherLocation = otherScopeWithID->sourceLocation();
2024 m_logger->
log(u
"Found a duplicated id. id %1 was first declared at %2:%3"_s.arg(
2028 scriptBinding->firstSourceLocation());
2031 if (!
name.isEmpty())
2054 const bool alreadyHasBinding = std::any_of(propertyBindings.first, propertyBindings.second,
2056 return binding.bindingType() == bindingType;
2058 if (alreadyHasBinding)
2063 binding.
setGroupBinding(
static_cast<QSharedPointer<QQmlJSScope>
>(scope));
2076 const auto id = scriptBinding->qualifiedId;
2078 handleIdDeclaration(scriptBinding);
2091 prefix =
name + u
'.';
2095 const bool isAttachedProperty =
name.
front().isUpper();
2096 if (isAttachedProperty) {
2099 group->firstSourceLocation());
2103 group->firstSourceLocation());
2106 group->firstSourceLocation()));
2111 const auto name =
group->name.toString();
2124 const auto statement = scriptBinding->statement;
2130 signalParameters << formal->element->bindingIdentifier.toString();
2139 const auto firstSourceLocation = statement->firstSourceLocation();
2140 bool hasMultilineStatementBody =
2141 statement->lastSourceLocation().startLine > firstSourceLocation.startLine;
2144 { scopeSignal.parameterNames(), hasMultilineStatementBody });
2155 firstSourceLocation,
2156 groupLocation =
group->firstSourceLocation(),
2157 signalParameters]() {
2161 const auto methods = scope->
methods(signalName, QQmlJSMetaMethodType::Signal);
2164 checkSignal(scope, groupLocation,
name, signalParameters);
2167 checkSignal(scope, groupLocation,
name, signalParameters);
2175 checkSignal(scope, groupLocation,
name, signalParameters);
2195 scriptBinding->statement->firstSourceLocation());
2220 arrayBinding->firstSourceLocation());
2240 for (
auto element = arrayBinding->members; element; element = element->next, ++
i) {
2241 const auto &
type = children[
i];
2243 m_logger->
log(u
"Declaring an object which is not an Qml object"
2244 " as a list member."_s,
qmlSyntax, element->firstSourceLocation());
2249 element->firstSourceLocation(),
false };
2255 [binding = std::move(binding)]() {
return binding; },
2265 uied->firstSourceLocation());
2269 for (
const auto *member = uied->members; member; member = member->next) {
2270 qmlEnum.
addKey(member->member.toString());
2271 qmlEnum.
addValue(
int(member->value));
2277void QQmlJSImportVisitor::addImportWithLocation(
const QString &
name,
2295 if (!fileInfo.exists()) {
2296 m_logger->
log(
"File or directory you are trying to import does not exist: %1."_L1.arg(
path),
2301 if (fileInfo.isFile()) {
2305 addImportWithLocation(actualPrefix,
location);
2306 }
else if (fileInfo.isDir()) {
2309 for (
auto it = scopes.types().keyBegin(),
end = scopes.types().keyEnd();
it !=
end;
it++)
2313 "%1 is neither a file nor a directory. Are sure the import path is correct?"_L1.arg(
2330 addImportWithLocation(actualPrefix,
location);
2334 for (
auto it = scopes.types().keyBegin(),
end = scopes.types().keyEnd();
it !=
end;
it++)
2344 if (import->asToken.isValid()) {
2345 prefix +=
import->importId;
2346 if (!import->importId.isEmpty() && !import->importId.front().isUpper()) {
2347 m_logger->
log(u
"Import qualifier '%1' must start with a capital letter."_s.arg(
2349 qmlImport, import->importIdToken,
true,
true);
2353 const QString filename =
import->fileName.toString();
2358 if (scheme ==
""_L1) {
2364 importFromQrc(absolute, prefix, importLocation);
2366 importFromHost(absolute, prefix, importLocation);
2368 processImportWarnings(
"path \"%1\""_L1.arg(
url.
path()), importLocation);
2370 }
else if (scheme ==
"file"_L1) {
2371 importFromHost(
url.
path(), prefix, importLocation);
2372 processImportWarnings(
"URL \"%1\""_L1.arg(
url.
path()), importLocation);
2374 }
else if (scheme ==
"qrc"_L1) {
2375 importFromQrc(
":"_L1 +
url.
path(), prefix, importLocation);
2376 processImportWarnings(
"URL \"%1\""_L1.arg(
url.
path()), importLocation);
2379 m_logger->
log(
"Unknown import syntax. Imports can be paths, qrc urls or file urls"_L1,
2380 qmlImport, import->firstSourceLocation());
2390 &staticModulesProvided);
2392 for (
auto it = imported.types().keyBegin(),
end = imported.types().keyEnd();
it !=
end;
it++)
2393 addImportWithLocation(*
it, import->firstSourceLocation());
2396 for (
const QString &staticModule : staticModulesProvided) {
2409#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
2420 assign(pragma->value);
2426 if (pragma->name == u
"Strict"_s) {
2436 }
else if (pragma->name == u
"Singleton") {
2438 }
else if (pragma->name == u
"ComponentBehavior") {
2440 if (
value == u
"Bound") {
2442 }
else if (
value == u
"Unbound") {
2445 m_logger->
log(u
"Unknown argument \"%1\" to pragma ComponentBehavior"_s.arg(
value),
2446 qmlSyntax, pragma->firstSourceLocation());
2449 }
else if (pragma->name == u
"FunctionSignatureBehavior") {
2451 if (
value == u
"Enforced") {
2453 }
else if (
value == u
"Ignored") {
2457 u
"Unknown argument \"%1\" to pragma FunctionSignatureBehavior"_s.arg(
value),
2458 qmlSyntax, pragma->firstSourceLocation());
2461 }
else if (pragma->name == u
"ValueTypeBehavior") {
2463 if (
value == u
"Copy") {
2465 }
else if (
value == u
"Reference") {
2467 }
else if (
value == u
"Addressable") {
2469 }
else if (
value == u
"Inaddressable") {
2472 m_logger->
log(u
"Unknown argument \"%1\" to pragma ValueTypeBehavior"_s.arg(
value),
2473 qmlSyntax, pragma->firstSourceLocation());
2554 catchStatement->firstSourceLocation());
2556 catchStatement->patternElement->bindingIdentifier.toString(),
2557 { QQmlJSScope::JavaScriptIdentifier::LexicalScoped,
2558 catchStatement->patternElement->firstSourceLocation(), std::nullopt,
2559 catchStatement->patternElement->scope == QQmlJS::AST::VariableScope::Const });
2574 "and might cause false positives when analysing unqualified "
2590 if (
TypeAnnotation *annotation = vdl->declaration->typeAnnotation)
2595 vdl->declaration->bindingIdentifier.toString(),
2596 { (vdl->declaration->scope == QQmlJS::AST::VariableScope::Var)
2597 ? QQmlJSScope::JavaScriptIdentifier::FunctionScoped
2598 : QQmlJSScope::JavaScriptIdentifier::LexicalScoped,
2599 vdl->declaration->firstSourceLocation(), typeName,
2600 vdl->declaration->scope == QQmlJS::AST::VariableScope::Const });
2608 for (
auto const &boundName : fpl->boundNames()) {
2611 if (
TypeAnnotation *annotation = boundName.typeAnnotation.data())
2616 boundName.location,
typeName,
false });
2625 Q_ASSERT(uiob->qualifiedTypeNameId);
2627 bool needsResolution =
false;
2628 int scopesEnteredCounter = 0;
2639 if (idName.isEmpty())
2643 prefix = idName + u
'.';
2654 group->firstSourceLocation()));
2656 ++scopesEnteredCounter;
2657 needsResolution = needsResolution || !exists;
2662 for (
int i=0;
i < scopesEnteredCounter; ++
i) {
2667 if (needsResolution)
2671 uiob->qualifiedTypeNameId->identifierToken);
2686 auto group = uiob->qualifiedId;
2687 int scopesEnteredCounter = 0;
2693 if (idName.isEmpty())
2697 prefix = idName + u
'.';
2704 [[maybe_unused]]
bool exists =
2707 scopesEnteredCounter++;
2718 bool foundIds =
false;
2719 QList<QQmlJSScope::ConstPtr> childScopes { childScope };
2721 while (!childScopes.isEmpty()) {
2733 u
"Cannot defer property assignment to \"%1\". Assigning an id to an object or one of its sub-objects bound to a deferred property will make the assignment immediate."_s
2745 uiob->firstSourceLocation(), uiob->hasOnToken };
2748 if (uiob->hasOnToken) {
2749 if (childScope->
hasInterface(u
"QQmlPropertyValueInterceptor"_s)) {
2763 for (
int i = 0;
i < scopesEnteredCounter; ++
i)
2789 importBaseModules();
2806 importBaseModules();
2819 const QString name = fieldMember->name.toString();
2822 if (
type.scope.isNull()) {
2825 }
else if (!
type.scope->ownAttachedTypeName().isEmpty()) {
static JNINativeMethod methods[]
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
QString baseName() const
Returns the base name of the file without the path.
QString absoluteFilePath() const
QString canonicalPath() const
Returns the file system entry's canonical path (excluding the entry's name), i.e.
bool isRelative() const
Returns true if the file system entry's path is relative, otherwise returns false (that is,...
bool remove(const Key &key)
Removes the item that has the key from the hash.
qsizetype size() const noexcept
Returns the number of items in the hash.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
bool contains(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void setFilename(const QString &filename)
void setAutoApplicable(bool autoApply=true)
QStack< FunctionOrExpressionIdentifier > m_functionStack
void checkGroupedAndAttachedScopes(QQmlJSScope::ConstPtr scope)
void processPropertyBindings()
void addDefaultProperties()
QHash< QQmlJSScope::ConstPtr, QList< QString > > m_functionsAndExpressions
bool m_thisScriptBindingIsJavaScript
QMultiHash< QString, QQmlJS::SourceLocation > m_importTypeLocationMap
QQmlJSScope::Ptr m_currentScope
void checkRequiredProperties()
QMultiHash< QString, QQmlJS::SourceLocation > m_importStaticModuleLocationMap
QSet< QString > m_usedTypes
QQmlJS::SourceLocation m_pendingSignalHandler
QQmlJSImporter * m_importer
QString m_implicitImportDirectory
QQmlJSScope::ConstPtr m_globalScope
void breakInheritanceCycles(const QQmlJSScope::Ptr &scope)
QList< QQmlJSScope::ConstPtr > m_qmlTypes
void checkDeprecation(const QQmlJSScope::ConstPtr &scope)
QStringList m_qmldirFiles
QQmlJSScope::Ptr m_savedBindingOuterScope
static QString implicitImportDirectory(const QString &localFile, QQmlJSResourceFileMapper *mapper)
void populateRuntimeFunctionIndicesForDocument() const
QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandler > m_signalHandlers
QHash< QV4::CompiledData::Location, QQmlJSScope::ConstPtr > m_scopesByIrLocation
QList< UnfinishedBinding > m_bindings
QHash< QQmlJSScope::Ptr, QVector< QQmlJSScope::Ptr > > m_pendingDefaultProperties
QVector< QQmlJSScope::Ptr > m_objectDefinitionScopes
QVector< QQmlJSAnnotation > m_pendingMethodAnnotations
bool m_nextIsInlineComponent
QQmlJSScope::RootDocumentNameType RootDocumentNameType
void endVisit(QQmlJS::AST::ExpressionStatement *ast) override
bool enterEnvironmentNonUnique(QQmlJSScope::ScopeType type, const QString &name, const QQmlJS::SourceLocation &location)
void throwRecursionDepthError() override
void forgetFunctionExpression(const QString &name)
QVector< PendingMethodType > m_pendingMethodTypes
QHash< FunctionOrExpressionIdentifier, int > m_innerFunctions
QQmlJSMetaMethod::RelativeFunctionIndex addFunctionOrExpression(const QQmlJSScope::ConstPtr &scope, const QString &name)
void processDefaultProperties()
bool isImportPrefix(QString prefix) const
QVector< QQmlJSAnnotation > parseAnnotations(QQmlJS::AST::UiAnnotationList *list)
QVector< PendingPropertyObjectBinding > m_pendingPropertyObjectBindings
BindingExpressionParseResult
void flushPendingSignalParameters()
void processPropertyTypes()
QSet< QQmlJS::SourceLocation > m_importLocations
QVector< RequiredProperty > m_requiredProperties
QVector< PendingPropertyType > m_pendingPropertyTypes
int synthesizeCompilationUnitRuntimeFunctionIndices(const QQmlJSScope::Ptr &scope, int count) const
void processMethodTypes()
QVector< QQmlJSScope::Ptr > m_objectBindingScopes
QSet< QQmlJSScope::ConstPtr > m_literalScopesToCheck
bool rootScopeIsValid() const
bool isTypeResolved(const QQmlJSScope::ConstPtr &type, ErrorHandler handle)
void enterEnvironment(QQmlJSScope::ScopeType type, const QString &name, const QQmlJS::SourceLocation &location)
bool visit(QQmlJS::AST::StringLiteral *) override
const QQmlJSScope::Ptr m_exportedRootScope
BindingExpressionParseResult parseBindingExpression(const QString &name, const QQmlJS::AST::Statement *statement)
QQmlJSImporter::ImportedTypes m_rootScopeImports
QHash< QQmlJSScope::Ptr, QVector< WithVisibilityScope< QString > > > m_propertyBindings
void processPropertyBindingObjects()
QQmlJSScopesById m_scopesById
QQmlJSScope::InlineComponentOrDocumentRootName m_currentRootName
void importQmldirs(const QStringList &qmltypesFiles)
Imports types from the specified qmltypesFiles.
ImportedTypes builtinInternalNames()
QQmlJSScope::Ptr importFile(const QString &file)
ImportedTypes importBuiltins()
Imports builtins.qmltypes and jsroot.qmltypes found in any of the import paths.
QList< QQmlJS::DiagnosticMessage > takeWarnings()
ImportedTypes importDirectory(const QString &directory, const QString &prefix=QString())
QQmlJSResourceFileMapper * resourceFileMapper() const
ImportedTypes importModule(const QString &module, const QString &prefix=QString(), QTypeRevision version=QTypeRevision(), QStringList *staticModuleList=nullptr)
void processMessages(const QList< QQmlJS::DiagnosticMessage > &messages, const QQmlJS::LoggerWarningId id)
bool wasCategoryChanged(QQmlJS::LoggerWarningId id) const
void setCategoryIgnored(QQmlJS::LoggerWarningId id, bool error)
void setCategoryLevel(QQmlJS::LoggerWarningId id, QtMsgType level)
void log(const QString &message, QQmlJS::LoggerWarningId id, const QQmlJS::SourceLocation &srcLocation, bool showContext=true, bool showFileName=true, const std::optional< QQmlJSFixSuggestion > &suggestion={}, const QString overrideFileName=QString())
Tracks the types for the QmlCompiler.
void setIsInlineComponent(bool v)
void setIsComposite(bool v)
void insertJSIdentifier(const QString &name, const JavaScriptIdentifier &identifier)
bool isNameDeferred(const QString &name) const
QHash< QString, QQmlJSMetaMethod > methods() const
Returns all methods visible from this scope including those of base types and extensions.
QString defaultPropertyName() const
bool isInCustomParserParent() const
void setAnnotations(const QList< QQmlJSAnnotation > &annotation)
static QQmlJSScope::Ptr create()
const QList< QQmlJSAnnotation > & annotations() const
QQmlJSScope::Ptr parentScope()
ScopeType scopeType() const
void setInternalName(const QString &internalName)
QString baseTypeName() const
QString internalName() const
static ImportedScope< QQmlJSScope::ConstPtr > findType(const QString &name, const QQmlJS::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
void setIsSingleton(bool v)
void setScopeType(ScopeType type)
void addOwnProperty(const QQmlJSMetaProperty &prop)
static QTypeRevision resolveTypes(const Ptr &self, const QQmlJS::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
QString moduleName() const
bool isInlineComponent() const
void setOwnModuleName(const QString &moduleName)
void insertPropertyIdentifier(const QQmlJSMetaProperty &prop)
void setIsArrayScope(bool v)
QVector< QQmlJSScope::Ptr > childScopes()
void setBaseTypeName(const QString &baseTypeName)
bool isFullyResolved() const
bool hasInterface(const QString &name) const
void setSourceLocation(const QQmlJS::SourceLocation &sourceLocation)
void setInlineComponentName(const QString &inlineComponentName)
static QQmlJSScope::ConstPtr nonCompositeBaseType(const QQmlJSScope::ConstPtr &type)
static QQmlJSScope::Ptr clone(const QQmlJSScope::ConstPtr &origin)
void addOwnEnumeration(const QQmlJSMetaEnum &enumeration)
bool isArrayScope() const
QDeferredSharedPointer< const QQmlJSScope > ConstPtr
QQmlJSMetaProperty property(const QString &name) const
QQmlJSScope::ConstPtr baseType() const
void addOwnMethod(const QQmlJSMetaMethod &method)
std::optional< QString > inlineComponentName() const
QHash< QString, QQmlJSMetaProperty > ownProperties() const
void addOwnRuntimeFunctionIndex(QQmlJSMetaMethod::AbsoluteFunctionIndex index)
void setOwnDefaultPropertyName(const QString &name)
bool hasProperty(const QString &name) const
static void reparent(const QQmlJSScope::Ptr &parentScope, const QQmlJSScope::Ptr &childScope)
QMultiHash< QString, QQmlJSMetaPropertyBinding > ownPropertyBindings() const
QQmlJS::SourceLocation sourceLocation() const
QString baseTypeError() const
static void resolveGeneralizedGroup(const QQmlJSScope::Ptr &self, const QQmlJSScope::ConstPtr &baseType, const QQmlJS::ContextualTypes &contextualTypes, QSet< QString > *usedTypes=nullptr)
void setFilePath(const QString &file)
QMultiHash< QString, QQmlJSMetaMethod > ownMethods() const
void setPropertyLocallyRequired(const QString &name, bool isRequired)
bool signaturesAreEnforced() const
bool existsAnywhereInDocument(const QString &id) const
void setValueTypesAreAddressable(bool addressable)
void setComponentsAreBound(bool bound)
QString id(const QQmlJSScope::ConstPtr &scope, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options=Default) const
void setSignaturesAreEnforced(bool enforced)
QQmlJSScope::ConstPtr scope(const QString &id, const QQmlJSScope::ConstPtr &referrer, QQmlJSScopesByIdOptions options=Default) const
void insert(const QString &id, const QQmlJSScope::ConstPtr &scope)
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
ExpressionNode * expression
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
FunctionExpression * asFunctionDefinition() override
virtual SourceLocation firstSourceLocation() const =0
virtual void boundNames(BoundNames *names)
bool isVariableDeclaration() const
UiQualifiedId * qualifiedTypeNameId
UiObjectInitializer * initializer
UiObjectMemberList * members
SourceLocation firstSourceLocation() const override
SourceLocation firstSourceLocation() const override
static std::optional< QString > handlerNameToSignalName(QStringView handler)
bool remove(const T &value)
const_iterator constEnd() const noexcept
const_iterator constFind(const T &value) const
iterator insert(const T &value)
constexpr QStringView first(qsizetype n) const noexcept
QString toString() const
Returns a deep copy of this string view's data as a QString.
constexpr QChar at(qsizetype n) const noexcept
Returns the character at position n in this string view.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString & append(QChar c)
QString scheme() const
Returns the scheme of the URL.
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
static const char * s_globalNames[]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
void tryGeneratingTranslationBindingBase(QStringView base, QQmlJS::AST::ArgumentList *args, RegisterMainString registerMainString, RegisterCommentString registerCommentString, RegisterContextString registerContextString, FinalizeTranslationData finalizeTranslationData)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall * pending
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLint components
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
GLenum const GLint * param
GLsizei GLenum const void * indices
GLsizei const GLchar *const * path
GLsizei const GLchar *const * string
[0]
QT_BEGIN_NAMESPACE constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
static qreal component(const QPointF &point, unsigned int i)
static QQmlAnyBinding createBinding(const QQmlProperty &prop, const QV4::CompiledData::Binding *binding, const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit, const QQmlRefPointer< QQmlContextData > &contextData, QObject *scopeObject)
static QString internalName(const QQmlJSScope::ConstPtr &scope)
void handleTranslationBinding(QQmlJSMetaPropertyBinding &binding, QStringView base, QQmlJS::AST::ArgumentList *args)
void setScopeName(QQmlJSScope::Ptr &scope, QQmlJSScope::ScopeType type, const QString &name)
QString getScopeName(const QQmlJSScope::ConstPtr &scope, QQmlJSScope::ScopeType type)
static bool causesImplicitComponentWrapping(const QQmlJSMetaProperty &property, const QQmlJSScope::ConstPtr &assignedType)
void handlePragmaValues(QQmlJS::AST::UiPragma *pragma, F &&assign)
static void logLowerCaseImport(QStringView superType, QQmlJS::SourceLocation location, QQmlJSLogger *logger)
static bool mayBeUnresolvedGeneralizedGroupedProperty(const QQmlJSScope::ConstPtr &scope)
QQmlJSImportVisitor::UnfinishedBinding createNonUniqueScopeBinding(QQmlJSScope::Ptr &scope, const QString &name, const QQmlJS::SourceLocation &srcLocation)
QString buildName(const Node *node)
static QQmlJSAnnotation::Value bindingToVariant(QQmlJS::AST::Statement *statement)
const QQmlSA::LoggerWarningId qmlAliasCycle
const QQmlSA::LoggerWarningId qmlSignalParameters
const QQmlSA::LoggerWarningId qmlUnresolvedAlias
const QQmlSA::LoggerWarningId qmlDuplicatePropertyBinding
const QQmlSA::LoggerWarningId qmlRecursionDepthErrors
const QQmlSA::LoggerWarningId qmlSyntaxIdQuotation
const QQmlSA::LoggerWarningId qmlDuplicatedName
const QQmlSA::LoggerWarningId qmlUncreatableType
const QQmlSA::LoggerWarningId qmlMissingProperty
const QQmlSA::LoggerWarningId qmlMultilineStrings
const QQmlSA::LoggerWarningId qmlSyntaxDuplicateIds
const QQmlSA::LoggerWarningId qmlUnqualified
const QQmlSA::LoggerWarningId qmlRequired
const QQmlSA::LoggerWarningId qmlTopLevelComponent
const QQmlSA::LoggerWarningId qmlDeferredPropertyId
const QQmlSA::LoggerWarningId qmlWith
const QQmlSA::LoggerWarningId qmlUnresolvedType
const QQmlSA::LoggerWarningId qmlImport
const QQmlSA::LoggerWarningId qmlMissingType
const QQmlSA::LoggerWarningId qmlInheritanceCycle
const QQmlSA::LoggerWarningId qmlIncompatibleType
const QQmlSA::LoggerWarningId qmlUnusedImports
const QQmlSA::LoggerWarningId qmlDeprecated
const QQmlSA::LoggerWarningId qmlCompiler
const QQmlSA::LoggerWarningId qmlSyntax
const QQmlSA::LoggerWarningId qmlNonListProperty
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QUrl url("example.com")
[constructor-url-reference]
\inmodule QtCore \reentrant
bool contains(const AT &t) const noexcept
std::variant< QString, double > Value
Entry entry(const Filter &filter) const
static Filter resourceFileFilter(const QString &file)
static Filter localFileFilter(const QString &file)
static void traverseFollowingQmlIrObjectStructure(const QQmlJSScope::Ptr &root, Action act)
static std::optional< QQmlJSMetaProperty > propertyFromChangedHandler(const QQmlJSScope::ConstPtr &scope, QStringView changedHandler)
static std::optional< QQmlJSFixSuggestion > didYouMean(const QString &userInput, QStringList candidates, QQmlJS::SourceLocation location)
const QHash< QString, ImportedScope< QQmlJSScope::ConstPtr > > & types() const
void addTypes(ContextualTypes &&types)
bool isNullType(const QString &name) const
ImportedScope< QQmlJSScope::ConstPtr > type(const QString &name) const
bool hasType(const QString &name) const
QQmlJSScope::ConstPtr arrayType() const
void setType(const QString &name, const ImportedScope< QQmlJSScope::ConstPtr > &type)