diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-01 09:41:16 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-07 08:48:11 +0200 |
commit | 209209e6fddce1b8f8a1837a2e9f40b81f540158 (patch) | |
tree | 08019accc871a01fb411f52d21a53d10b8cc61db /tools | |
parent | dcaa66e2fc93a2d98ea2b5475b8d90f899cf1888 (diff) |
qmlformat: Fix formatting of for...of loops using array variables
Fixes: QTBUG-86980
Change-Id: Id27350821051709894c7645a362cfdf7ce0d279c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9cfda79202c9c7955a1100861ed2135506302921)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlformat/dumpastvisitor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qmlformat/dumpastvisitor.cpp b/tools/qmlformat/dumpastvisitor.cpp index f45ddd5e46..15777984d2 100644 --- a/tools/qmlformat/dumpastvisitor.cpp +++ b/tools/qmlformat/dumpastvisitor.cpp @@ -236,7 +236,10 @@ QString DumpAstVisitor::parsePatternElement(PatternElement *element, bool scope) } } - result += element->bindingIdentifier.toString(); + if (element->bindingIdentifier.isEmpty()) + result += parseExpression(element->bindingTarget); + else + result += element->bindingIdentifier.toString(); if (element->typeAnnotation != nullptr) result += ": " + parseType(element->typeAnnotation->type); |