Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-123171

QmlFormat Semicolon is missing at the end of some default exports

    XMLWordPrintable

Details

    • 8b7551264 (dev)

    Description

      After formatting of the following statements (most likely the whole class of statements where BinaryExpression of FunctionExpression or something(undiscovered yet) is taking place)

       

      1) export default 1 + 1 //BinaryExpression
      2) export default(x,y) => x + 2 //FunctionExpression

      semicolon is missing. Maybe it's not needed, however "js prettier" adds it.

       

      This task can be treated as an acknowledgement and documentation of this fact.

      If the fix is needed, the starting debugging / implementation points could be

      https://codereview.qt-project.org/c/qt/qtdeclarative/+/538083/15/tests/auto/qmldom/reformatter/tst_reformatter.h#564

      bool ScriptFormatter::visit(FunctionExpression *ast) {
      ....
          if (ast->body) { <one line body> }
      }
      

       

       

       

      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
            dima.a Dmitrii Akshintsev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes