diff options
| author | Semih Yavuz <semih.yavuz@qt.io> | 2023-07-31 15:12:01 +0200 |
|---|---|---|
| committer | Semih Yavuz <semih.yavuz@qt.io> | 2023-08-01 14:06:18 +0200 |
| commit | 115916f217b0dc299b8df298f5c9c30369f561f8 (patch) | |
| tree | 532480f530550042c2aa3ee1ce8022af564a7346 /src/qml/compiler/qv4codegen.cpp | |
| parent | 26bc3ab5b0c0b3d43a3d8e43fb84e248b25401f2 (diff) | |
qmlformat: fix formatting of object destructuring
The following issues are fixed:
- [1]Incorrect detection of the property name as a string literal and
thus writing out them with quotation marks
- [2] Duplication of property name when a scoped variable is used as
property key
- [3] Writing out additional brackets during deconstruction
- [4] Incorrect formatting when a default is assigned to a lhs variable
like [a = 24, b] = array
- [5] Automatic addition of "" characters into the object keys
- [6] Automatic addition of assignment operator, instead only add it
when there is a pending initializer
Also, add the colon token location which was missing in the pattern
property rules. Remove it from a couple of rules that was giving
incorrect result. We require the location information of the colon token
to be correct when formatting.
A few of tst_qmlformat and tst_reformatter tests are adapted to the
above mentioned changes [1], [2], [5].
[ChangeLog][qmlformat][Important Behavior Changes] qmlformat will no
longer add "" characters automatically in the object keys unless the
object key is actually a string literal. Also, using a scoped variable
as the property key will no longer result in the duplication of the
property name.
Pick-to: 6.6
Fixes: QTBUG-108275
Fixes: QTBUG-114839
Change-Id: I272d41d13df34ff5877f3efebe43c80255dd7c2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
0 files changed, 0 insertions, 0 deletions
