Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.2.1, Qt Creator 4.3.1
-
None
Description
Try to reformat (Tools->QML/JS->Reformat File) the following test file:
import QtQuick 2.5 Item { Keys.onPressed: { switch (event.key) { case Qt.Key_0: case Qt.Key_1: break } } }
The result is:
import QtQuick 2.5 Item { Keys.onPressed: { switch (event.key) { case Qt.Key_0: case Qt.Key_1: break } } }
As seen in some documentations about JavaScript and other languages (for example in the "Common Code Blocks" w3schools documentation), I would say the initial code shouldn't be modified to add a new line between the common cases.
Attachments
For Gerrit Dashboard: QTCREATORBUG-18515 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
204715,2 | QmlJs: better indentation for switch common cases | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |