Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18515

QML Reformat - switch and common cases

    XMLWordPrintable

Details

    Description

      Try to reformat (Tools->QML/JS->Reformat File) the following test file:

      import QtQuick 2.5
      
      Item {
          Keys.onPressed: {
              switch (event.key) {
              case Qt.Key_0:
              case Qt.Key_1:
                  break
              }
          }
      }
      

      The result is:

      import QtQuick 2.5
      
      Item {
          Keys.onPressed: {
              switch (event.key) {
              case Qt.Key_0:
      
              case Qt.Key_1:
                  break
              }
          }
      }
      

      As seen in some documentations about JavaScript and other languages (for example in the "Common Code Blocks" w3schools documentation), I would say the initial code shouldn't be modified to add a new line between the common cases.
       

       

      Attachments

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

        Activity

          People

            mabenell Marco Benelli
            ju Julien Deramond
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes