aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-10-01 09:41:16 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2020-10-06 09:02:50 +0200
commit9cfda79202c9c7955a1100861ed2135506302921 (patch)
tree40320d5ec59d15e8d7ff44f69709c26b11514141 /tools
parent2b8ec2eacbf96340ce95a2648450fde07bf3b5c3 (diff)
qmlformat: Fix formatting of for...of loops using array variables
Fixes: QTBUG-86980 Pick-to: 5.15 Change-Id: Id27350821051709894c7645a362cfdf7ce0d279c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlformat/dumpastvisitor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qmlformat/dumpastvisitor.cpp b/tools/qmlformat/dumpastvisitor.cpp
index 008f10ae17..aea4d78d36 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);