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

"Reformat File" command replaces the "of" keyword to "in" when it appears in for loops.

    XMLWordPrintable

Details

    • macOS, Windows
    • cd73f8c6b (master)

    Description

      Whenever the Reformat File command is executed (also on save, when the Enable auto format on file save is enabled) in a QML file having a for loop with the of keyword, the of will change to in.
      ie the following code:

      for (var i of ["one", "two", "free"])
         console.debug(i)
      

      will become:

      for (var i in ["one", "two", "free"])
         console.debug(i)
      

      This initiative changes the program's behavior!

      Application's output before format:

      qml: one
      qml: two
      qml: free
      

       and after:

      qml: 0
      qml: 1
      qml: 2
      

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-29123
        # Subject Branch Project Status CR V

        Activity

          People

            semih.yavuz Semih Yavuz
            tavlarides Tassos Tavlarides
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes