diff --git a/CHANGELOG.md b/CHANGELOG.md index 08969b3430..606dda82d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ #### :bug: Bug fix +- Fix printing of tagged template literals. https://github.com/rescript-lang/rescript/pull/8018 + #### :memo: Documentation #### :nail_care: Polish diff --git a/compiler/syntax/src/res_parsetree_viewer.ml b/compiler/syntax/src/res_parsetree_viewer.ml index b4fb22572b..8c2b6c3051 100644 --- a/compiler/syntax/src/res_parsetree_viewer.ml +++ b/compiler/syntax/src/res_parsetree_viewer.ml @@ -534,7 +534,8 @@ let is_printable_attribute attr = | ( { Location.txt = ( "res.iflet" | "res.braces" | "ns.braces" | "JSX" | "res.await" - | "res.template" | "res.ternary" | "res.inlineRecordDefinition" ); + | "res.template" | "res.taggedTemplate" | "res.ternary" + | "res.inlineRecordDefinition" ); }, _ ) -> false diff --git a/tests/syntax_tests/data/printer/expr/expected/templateLiteral.res.txt b/tests/syntax_tests/data/printer/expr/expected/templateLiteral.res.txt index f0085b2d1d..7bd465733c 100644 --- a/tests/syntax_tests/data/printer/expr/expected/templateLiteral.res.txt +++ b/tests/syntax_tests/data/printer/expr/expected/templateLiteral.res.txt @@ -119,3 +119,7 @@ let box = css` } } `) + +sql +->SQL.query`INSERT INTO my_table (a, b, c) VALUES ${a}, ${b}, ${c}` +->Promise.thenResolve(Console.log) diff --git a/tests/syntax_tests/data/printer/expr/templateLiteral.res b/tests/syntax_tests/data/printer/expr/templateLiteral.res index 5829bee872..d5089f8b88 100644 --- a/tests/syntax_tests/data/printer/expr/templateLiteral.res +++ b/tests/syntax_tests/data/printer/expr/templateLiteral.res @@ -119,3 +119,7 @@ let box = css` } } `) + +sql +->SQL.query`INSERT INTO my_table (a, b, c) VALUES ${a}, ${b}, ${c}` +->Promise.thenResolve(Console.log)