AndreOneti / qml-formatter

Formatter, definition and autocomplete for QML language
MIT License
17 stars 2 forks source link

Fix formatting for field assigned declaration #23

Closed SytheZN closed 2 years ago

SytheZN commented 2 years ago

This change fixes an issue with assignments declaring complex types.

The included sample would previously format as below and the rest of the file indentation would be off.

  globalDrawer: Kirigami.GlobalDrawer {
  title: i18n("Window")
  titleIcon: "applications-graphics"
  isMenu: !root.isMobile
  actions: [
    Kirigami.Action {
      text: i18n("Plus One")
      icon.name: "list-add"
      onTriggered: {
        counter += 1
      }
    },
    Kirigami.Action {
      text: i18n("About Window")
      icon.name: "help-about"
      onTriggered: pageStack.layers.push('qrc: About.qml')
    },
    Kirigami.Action {
      text: i18n("Quit")
      icon.name: "application-exit"
      onTriggered: Qt.quit()
    }
  ]
}