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

Tools > QML/JS > Reformat File doesn't format pragma correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • Qt Creator 14.0.2
    • Quick / QML Support
    • None
    • Linux/X11

    Description

      If I have a QML file 

      // Copyright (C) 2021 The Qt Company Ltd.
      // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
      
      import QtQuick
      import QtQuick.Shapes
      
      pragma ComponentBehavior: Bound
      
      Rectangle {
      

      after doing Tools > QML/JS > Reformat File this becames

      // Copyright (C) 2021 The Qt Company Ltd.
      // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
      import QtQuick
      import QtQuick.Shapes
      pragma ComponentBehavior
      Rectangle {
      

      -> pragma and QML file are now broken.

      If I run the same code through qmlformat tool (from Qt 6.7), it handles the pragma without issues.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            jannej Janne Juntunen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes