Fixing autocompletion in case object does not exist.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adsooi 2022-10-21 15:40:01 +02:00
parent 86656fe46c
commit d969661b33
Signed by: Ad5001
GPG key ID: 7251B1AF90B960F9

View file

@ -328,7 +328,7 @@ Item {
id: objectPropertiesList
category: qsTr("Object Properties")
visbilityCondition: isEnteringProperty
visbilityCondition: doesObjectExist
itemStartIndex: 0
itemSelected: parent.itemSelected
property bool isEnteringProperty: (
@ -339,7 +339,8 @@ Item {
property string objectName: isEnteringProperty ?
(parent.currentToken.dot ? parent.previousToken.value : parent.previousToken2.value)
: ""
property var objectProperties: isEnteringProperty ?
property bool doesObjectExist: isEnteringProperty && objectName in Objects.currentObjectsByName
property var objectProperties: doesObjectExist ?
Objects.currentObjectsByName[objectName].constructor.properties() :
{}
categoryItems: Object.keys(objectProperties)