Skip to content

Commit a8450ed

Browse files
committed
chore: Upgrade dprint-swc-ecma-ast-view
1 parent b7faeaa commit a8450ed

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "dprint-plugin-typescript"
33
description = "TypeScript and JavaScript code formatter."
44
keywords = ["formatting", "formatter", "typescript", "javascript"]
5-
version = "0.39.0"
5+
version = "0.39.1"
66
authors = ["David Sherret <[email protected]>"]
77
edition = "2018"
88
license = "MIT"
@@ -28,7 +28,7 @@ dprint-core = { version = "0.35.1", features = ["formatting"] }
2828
fnv = "1.0.3"
2929
swc_common = "0.10.9"
3030
swc_ecmascript = { version = "0.18.8", features = ["parser"] }
31-
swc_ast_view = { version = "0.5.0", package = "dprint-swc-ecma-ast-view" }
31+
swc_ast_view = { version = "0.6.0", package = "dprint-swc-ecma-ast-view" }
3232
serde = { version = "1.0.118", features = ["derive"] }
3333
serde_json = { version = "1.0", optional = true }
3434

src/parsing/parser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use super::swc::{get_flattened_bin_expr};
1212
use super::*;
1313

1414
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 {
1616
module: &source_file.module,
1717
source_file: Some(&source_file.info),
1818
tokens: Some(&source_file.tokens),
1919
comments: Some(&source_file.comments),
2020
};
2121

22-
swc_ast_view::with_ast_view(source_file_info, |module| {
22+
swc_ast_view::with_ast_view_for_module(source_file_info, |module| {
2323
let module_node = Node::Module(module);
2424
let mut context = Context::new(
2525
config,
@@ -1326,7 +1326,7 @@ fn parse_arrow_func_expr<'a>(node: &'a ArrowExpr, context: &mut Context<'a>) ->
13261326
}
13271327
}
13281328

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 {
13301330
let requires_parens = node.params.len() != 1 || node.return_type.is_some() || is_first_param_not_identifier_or_has_type_annotation(&node.params);
13311331

13321332
return if requires_parens {
@@ -1348,7 +1348,7 @@ fn parse_arrow_func_expr<'a>(node: &'a ArrowExpr, context: &mut Context<'a>) ->
13481348
}
13491349
}
13501350

1351-
fn has_parens(node: &ArrowExpr, context: &mut Context) -> bool {
1351+
fn has_parens<'a>(node: &'a ArrowExpr, context: &mut Context<'a>) -> bool {
13521352
if node.params.len() != 1 {
13531353
true
13541354
} else {

0 commit comments

Comments
 (0)