@@ -19,6 +19,7 @@ mod parameter_list;
19
19
mod return_or_throw_statement;
20
20
mod semicolon;
21
21
mod switch_statement;
22
+ mod template;
22
23
mod try_statement;
23
24
mod type_parameters;
24
25
mod utils;
@@ -56,7 +57,7 @@ use crate::{
56
57
parentheses:: NeedsParentheses ,
57
58
utils:: {
58
59
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 } ,
60
61
conditional:: ConditionalLike ,
61
62
member_chain:: MemberChain ,
62
63
object:: format_property_key,
@@ -259,34 +260,6 @@ impl<'a> FormatWrite<'a> for AstNode<'a, ObjectProperty<'a>> {
259
260
}
260
261
}
261
262
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
-
290
263
impl < ' a > FormatWrite < ' a > for AstNode < ' a , CallExpression < ' a > > {
291
264
fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
292
265
let callee = self . callee ( ) ;
@@ -1961,21 +1934,6 @@ impl<'a> FormatWrite<'a> for AstNode<'a, TSMappedType<'a>> {
1961
1934
}
1962
1935
}
1963
1936
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
-
1979
1937
impl < ' a > FormatWrite < ' a > for AstNode < ' a , TSAsExpression < ' a > > {
1980
1938
fn write ( & self , f : & mut Formatter < ' _ , ' a > ) -> FormatResult < ( ) > {
1981
1939
write ! ( f, [ self . expression( ) , " as " , self . type_annotation( ) ] )
0 commit comments