@@ -12,14 +12,14 @@ use super::swc::{get_flattened_bin_expr};
12
12
use super :: * ;
13
13
14
14
pub fn parse < ' a > ( source_file : & ' a ParsedSourceFile , config : & Configuration ) -> PrintItems {
15
- let source_file_info = swc_ast_view:: SourceFileInfo {
15
+ let source_file_info = swc_ast_view:: ModuleInfo {
16
16
module : & source_file. module ,
17
17
source_file : Some ( & source_file. info ) ,
18
18
tokens : Some ( & source_file. tokens ) ,
19
19
comments : Some ( & source_file. comments ) ,
20
20
} ;
21
21
22
- swc_ast_view:: with_ast_view ( source_file_info, |module| {
22
+ swc_ast_view:: with_ast_view_for_module ( source_file_info, |module| {
23
23
let module_node = Node :: Module ( module) ;
24
24
let mut context = Context :: new (
25
25
config,
@@ -1326,7 +1326,7 @@ fn parse_arrow_func_expr<'a>(node: &'a ArrowExpr, context: &mut Context<'a>) ->
1326
1326
}
1327
1327
}
1328
1328
1329
- fn get_should_use_parens ( node : & ArrowExpr , context : & mut Context ) -> bool {
1329
+ fn get_should_use_parens < ' a > ( node : & ' a ArrowExpr , context : & mut Context < ' a > ) -> bool {
1330
1330
let requires_parens = node. params . len ( ) != 1 || node. return_type . is_some ( ) || is_first_param_not_identifier_or_has_type_annotation ( & node. params ) ;
1331
1331
1332
1332
return if requires_parens {
@@ -1348,7 +1348,7 @@ fn parse_arrow_func_expr<'a>(node: &'a ArrowExpr, context: &mut Context<'a>) ->
1348
1348
}
1349
1349
}
1350
1350
1351
- fn has_parens ( node : & ArrowExpr , context : & mut Context ) -> bool {
1351
+ fn has_parens < ' a > ( node : & ' a ArrowExpr , context : & mut Context < ' a > ) -> bool {
1352
1352
if node. params . len ( ) != 1 {
1353
1353
true
1354
1354
} else {
0 commit comments