@@ -19,6 +19,7 @@ mod parameter_list;
1919mod return_or_throw_statement;
2020mod semicolon;
2121mod switch_statement;
22+ mod template;
2223mod try_statement;
2324mod type_parameters;
2425mod utils;
@@ -56,7 +57,7 @@ use crate::{
5657 parentheses:: NeedsParentheses ,
5758 utils:: {
5859 assignment_like:: AssignmentLike ,
59- call_expression:: is_test_call_expression,
60+ call_expression:: { contains_a_test_pattern , is_test_call_expression, is_test_each_pattern } ,
6061 conditional:: ConditionalLike ,
6162 member_chain:: MemberChain ,
6263 object:: format_property_key,
@@ -259,34 +260,6 @@ impl<'a> FormatWrite<'a> for AstNode<'a, ObjectProperty<'a>> {
259260 }
260261}
261262
262- impl < ' a > FormatWrite < ' a > for AstNode < ' a , TemplateLiteral < ' a > > {
263- fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
264- write ! ( f, "`" ) ?;
265- let mut expressions = self . expressions ( ) . iter ( ) ;
266-
267- for quasi in self . quasis ( ) {
268- write ! ( f, quasi) ;
269- if let Some ( expr) = expressions. next ( ) {
270- write ! ( f, [ "${" , expr, "}" ] ) ;
271- }
272- }
273-
274- write ! ( f, "`" )
275- }
276- }
277-
278- impl < ' a > FormatWrite < ' a > for AstNode < ' a , TaggedTemplateExpression < ' a > > {
279- fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
280- write ! ( f, [ self . tag( ) , self . type_arguments( ) , self . quasi( ) ] )
281- }
282- }
283-
284- impl < ' a > FormatWrite < ' a > for AstNode < ' a , TemplateElement < ' a > > {
285- fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
286- write ! ( f, dynamic_text( self . value( ) . raw. as_str( ) ) )
287- }
288- }
289-
290263impl < ' a > FormatWrite < ' a > for AstNode < ' a , CallExpression < ' a > > {
291264 fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
292265 let callee = self . callee ( ) ;
@@ -1961,21 +1934,6 @@ impl<'a> FormatWrite<'a> for AstNode<'a, TSMappedType<'a>> {
19611934 }
19621935}
19631936
1964- impl < ' a > FormatWrite < ' a > for AstNode < ' a , TSTemplateLiteralType < ' a > > {
1965- fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
1966- write ! ( f, "`" ) ?;
1967- let mut quasis = self . quasis ( ) . iter ( ) ;
1968- let quasi = quasis. next ( ) . unwrap ( ) ;
1969- write ! ( f, dynamic_text( quasi. value( ) . raw. as_str( ) ) ) ;
1970-
1971- for ( index, ( quasi, types) ) in quasis. zip ( self . types ( ) . iter ( ) ) . enumerate ( ) {
1972- write ! ( f, [ "${" , types, "}" ] ) ?;
1973- write ! ( f, dynamic_text( quasi. value( ) . raw. as_str( ) ) ) ;
1974- }
1975- write ! ( f, "`" )
1976- }
1977- }
1978-
19791937impl < ' a > FormatWrite < ' a > for AstNode < ' a , TSAsExpression < ' a > > {
19801938 fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
19811939 write ! ( f, [ self . expression( ) , " as " , self . type_annotation( ) ] )
0 commit comments