Skip to content

Commit 6c59bad

Browse files
authored
fix: update jsonc-parser to 0.26 (#7)
1 parent 92c39fd commit 6c59bad

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ wasm = ["dprint-core/wasm"]
2626
[dependencies]
2727
anyhow = "1.0.51"
2828
dprint-core = { version = "0.66.1", features = ["formatting"] }
29-
jsonc-parser = "0.23.0"
29+
jsonc-parser = "0.26.0"
3030
serde = { version = "1.0.108", features = ["derive"] }
3131
serde_json = "1.0"
3232

src/format_text.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::text_changes::apply_text_changes;
66
use crate::text_changes::TextChange;
77
use anyhow::Result;
88
use jsonc_parser::CollectOptions;
9+
use jsonc_parser::CommentCollectionStrategy;
910
use jsonc_parser::ParseOptions;
1011

1112
pub fn format_text(
@@ -29,7 +30,7 @@ fn format_inner(
2930
let parse_result = jsonc_parser::parse_to_ast(
3031
input_text,
3132
&CollectOptions {
32-
comments: false,
33+
comments: CommentCollectionStrategy::Off,
3334
tokens: false,
3435
},
3536
&ParseOptions {
@@ -77,10 +78,11 @@ fn format_root(
7778
#[cfg(debug_assertions)]
7879
fn validate_output_json(text: &str) -> Result<()> {
7980
// ensures the output is correct in debug mode
81+
8082
let result = jsonc_parser::parse_to_ast(
8183
text,
8284
&CollectOptions {
83-
comments: false,
85+
comments: CommentCollectionStrategy::Off,
8486
tokens: false,
8587
},
8688
&ParseOptions {

0 commit comments

Comments
 (0)