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

QML/JS reformat breaks JavaScript lamda usage

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.11.1
    • Quick / QML Support
    • None
    • Linux/X11

    Description

      Let's have a code:

      Ugly code with lambda
      QtObject{
                              property string text: qsTr("Destroy the code")
                              property var action: () => oh.no()
                          }
      

      Execute Tools->QML/JS->Reformat File
      And we end up with broken code:

      After Reformat
              QtObject {
                  property string text: qsTr("Destroy the code")
                  property var action: function  oh
                  oh oh.no()
                  )
              }
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              travnick MikoĊ‚aj
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes