Details
-
Epic
-
Resolution: Unresolved
-
P2: Important
-
None
Description
What is the benefit? Why is this valuable?
Use essentials QML tooling in Qt Creator
What are common use cases?
- Run qmlformat for a single file
- Run qmlformat for a selected section of a file ("Edit" > "Advanced" > "Auto-format Selection"/"Auto-indent Selection")
- Run qmlformat for the whole project
Technical information
There are a few place that formatting can be triggered in QtC.
Full document formatting:
Tools -> Qml/JS -> Reformat
Preferences -> QtQuick -> Qml/Js Editing -> Enable auto format on file save
Range formatting:
RightClick on qml editor -> Auto indent selection
Edit -> Advanced -> Auto indent selection
- As a first step, replace the embedded formatter with QML tooling for these actions. When enabled, use qmlls otherwise use standalone qmlformat tool.
- For range formatting, first implement the auto-indent functionality in qmlformat (this is already in for qmlls but not for standalone qmlformat. See QTBUG-127306). Regarding "Auto-format Selection", it should be done as follow-up feature to this as full formatting of ranges is not supported in the embedded formatter, too.
- Add a new action in the menu to trigger qmlformat for all the qmlfiles in the project.
- Respect the tabs and indentation policy in the Pref -> QtQuick -> CodeStyle
Attachments
Issue Links
- depends on
-
QTBUG-119967 qmlformat: reach feature parity with QtC built-in formatter
-
- Reported
-
-
QTBUG-127306 qmlformat: Support formatting a subsection of a file
-
- Reported
-
- is duplicated by
-
QTCREATORBUG-31684 Built in QML/JS Formatting breaks JS classes
-
- Closed
-
- is required for
-
QTCREATORBUG-29138 QML auto format rewrites computed property names
-
- Reported
-
-
QTCREATORBUG-29383 QML/JS Reformat File will remove Bound in pragma ComponentBehavior: Bound
-
- Closed
-
-
QTCREATORBUG-28192 QtCreator QML formatting vs. qmlformat.exe
-
- Closed
-
- relates to
-
QTCREATORBUG-17224 Integration of QML Lint in Qt Creator
-
- Closed
-
-
QTCREATORBUG-32009 pragma ValueTypeBehavior: Addressable is truncated into pragma ValueTypeBehavior
-
- Closed
-
- replaces
-
QTCREATORBUG-29487 QML/JS formatting should not format string bloc
-
- Closed
-
- resulted in
-
QTBUG-116139 Add full formatting capabilities to selected range formatting
-
- Reported
-
- mentioned in
-
Page Loading...
1.
|
Add settings widget in the QtC Preferences |
![]() |
In Progress | Semih Yavuz |
2.
|
Add tests for formatting module in QtC |
![]() |
Reported | Semih Yavuz |
Gerrit Reviews
For Gerrit Dashboard: QTCREATORBUG-26602 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
611598,3 | qmljseditor: refactor | master | qt-creator/qt-creator | Status: NEW | +2 | 0 |
611599,5 | reformatter: qmlformat integration | master | qt-creator/qt-creator | Status: NEW | 0 | 0 |
611600,5 | languageclientformatter: prepare for supporting full document formatting | master | qt-creator/qt-creator | Status: NEW | 0 | 0 |
624098,6 | qmlformatsettings: introduce qmlformat process wrapper | master | qt-creator/qt-creator | Status: NEW | 0 | +1 |
624099,6 | qmlformat configuration | master | qt-creator/qt-creator | Status: NEW | 0 | 0 |
626255,2 | qmlformat integration: update reformatByQmlFormat | master | qt-creator/qt-creator | Status: NEW | 0 | +1 |
627529,1 | wip: add qmlformat integration tests | master | qt-creator/qt-creator | Status: NEW | -2 | +1 |