qmljsreformatter: don't default foreach type to "in"

Fixes: QTCREATORBUG-29123
Change-Id: I4d3a611c359946c4483388cbf18a0b6f16d0a8d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Semih Yavuz
2023-05-05 19:44:56 +02:00
parent a65637be5c
commit cd73f8c6b8
2 changed files with 13 additions and 1 deletions

View File

@@ -1088,7 +1088,10 @@ protected:
out(" ");
out(ast->lparenToken);
accept(ast->lhs);
if (ast->type == ForEachType::In)
out(" in ");
else
out(" of ");
accept(ast->expression);
out(ast->rparenToken);
acceptBlockOrIndented(ast->statement);

View File

@@ -0,0 +1,9 @@
import QtQml
QtObject {
Component.onCompleted: {
for (var i of ["one", "two", "free"]) {
console.debug(i)
}
}
}