Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136192

qmlformat fails to write file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.9
    • 6.9
    • QML: Tooling
    • None
    • 86017b85c (dev), 8ea32b9d5 (6.9)

    Description

      Consider the following QML code:

      import QtQuick
      
      Item {
          function bla() {
              for (let i = 0, j = 1; i < j; ++i) {}
          }
      }
       

      Formatting it with 'qmlformat -i foo.qml' fails with

      qt.qmldom.writeOut: writeOut of /home/nico/foo.qml created invalid code:
      
      ----------
      
      import QtQuick
      
      
      
      Item {
      
          function bla() {
      
              for (let i = 0j = 1; i < j; ++i) {}
      
          }
      
      }
      
      
      
      ----------
      
        /home/nico/foo.qml:5:23: [Dom][QmlFile][Parsing] Error: Expected token `;' for .currentItem
      
      
      
      qt.qmldom.writeOut: failure reformatting  "foo.qml"
      
      Error while writing
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            semih.yavuz Semih Yavuz
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes