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

Wrong reformat qml when using JavaScript string interpolation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 4.12.1
    • Quick / QML Support
    • None
    • Linux/X11

    Description

       

      When using string interpolation (that exists since ES6), the auto-format of Qt Creator clear all the string expression.

       

      For example:

      import QtQuick 2.14
      import QtQuick.Window 2.14
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Component.onCompleted: {
              var string = "world";
              console.log(`Hello ${string}`)
          }
      }
      
      

       

       

      After auto-format the string becomes empty:

       

      import QtQuick 2.14
      import QtQuick.Window 2.14Window {
          visible: true
          width: 640
          height: 480    
      
          Component.onCompleted: {
              var string = "world"
              console.log()
          }
      }
      
      

       

       

      Attachments

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

        Activity

          People

            tjenssen Tim Jenssen
            lucianosantos Luciano Santos
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes