Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
6.6
-
None
-
3aa4c00c5 (dev), a44f21f19 (dev), 81b333679 (dev), 71d1d94a7 (dev)
Description
Inside a Dom::Binding, you will see that the name is "SomeAttachedType.attachedProperty" or "someId.SomeAttachedType.attachedProperty" in case of attached properties. The same also happens for grouped properties, which is annoying because these property names might require some type resolution to be able to be used. See for example https://doc.qt.io/qt-6.4/qtqml-syntax-objectattributes.html#attached-properties-and-attached-signal-handlers that you might need to resolve first and id, than an attached type and finally the property of the attached type before knowing the type of the property you are binding to.
Because of the string, you cannot use helpers like QQmlLSUtils::resolveExpressionType() to do the type resolution.
Instead, change QQmlDomAstCreator::visit(AST::UiScriptBinding *el) to construct a FieldMemberExpression for the dotted name, in the same way as QQmlDomAstCreator::endVisit(AST::FieldMemberExpression *expression) does it. If there is no dot, you can just construct a ScriptIdentifierExpression.
Note that attached or grouped properties binding name can have a lot of '.'.
Attachments
Issue Links
- is required for
-
QTBUG-116899 qmlls: code completion inside of scriptexpressions
- Closed
-
QTBUG-117306 qmlls: find usages of group properties
- Closed
- resulted in
-
QTBUG-123619 qmlls: bindingIdentifiers for all(!) bindings
- Closed