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

QML Reformat - Multiline comment and line break

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 4.10.0-rc1, Qt Creator 4.11.0-beta1
    • Quick / QML Support
    • None
    • macOS

    Description

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

      import QtQuick 2.0
      
      Item {
          function a(p1, p2) {
              console.log(p1 + ':' + p2)
          }
      
          Component.onCompleted: {
              a(1 /* a */, 2)
          }
      }
      

      The result is the following:

      import QtQuick 2.0
      
      Item {
          function a(p1, p2) {
              console.log(p1 + ':' + p2)
          }
      
          Component.onCompleted: {
              a(1 /* a */
                , 2)
          }
      }
      

      I don't know if this can be considered as a bug since the reformatted file still works, but the line-break after the multiline comment seemed to me a little weird.

      Attachments

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

        Activity

          People

            tjenssen Tim Jenssen
            julien-deramond Julien Deramond
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes