forked from qt-creator/qt-creator
QmlJs: Fix reformatter for template strings
Change-Id: Ie0b7909d634d1e2e735377b053f7a1c1c2518f78 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
@@ -802,6 +802,13 @@ protected:
|
|||||||
bool visit(StringLiteralPropertyName *ast) override { out(ast->id.toString()); return true; }
|
bool visit(StringLiteralPropertyName *ast) override { out(ast->id.toString()); return true; }
|
||||||
bool visit(NumericLiteralPropertyName *ast) override { out(QString::number(ast->id)); return true; }
|
bool visit(NumericLiteralPropertyName *ast) override { out(QString::number(ast->id)); return true; }
|
||||||
|
|
||||||
|
bool visit(TemplateLiteral *ast) override
|
||||||
|
{
|
||||||
|
out(ast->literalToken);
|
||||||
|
accept(ast->expression);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool visit(ArrayMemberExpression *ast) override
|
bool visit(ArrayMemberExpression *ast) override
|
||||||
{
|
{
|
||||||
accept(ast->base);
|
accept(ast->base);
|
||||||
|
@@ -21,6 +21,11 @@ const func4 = (x, y) => {
|
|||||||
return x + y
|
return x + y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const s1 = `test`
|
||||||
|
const s2 = `${42 * 1}`
|
||||||
|
const s3 = `test ${s2}`
|
||||||
|
const s4 = `${s2}${s3}test`
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
for (var a = 1; a < 5; ++a) {
|
for (var a = 1; a < 5; ++a) {
|
||||||
switch (a) {
|
switch (a) {
|
||||||
|
Reference in New Issue
Block a user