Skip to content

Commit

Permalink
fix: update jsonc-parser to 0.26 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Oct 21, 2024
1 parent 92c39fd commit 6c59bad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ wasm = ["dprint-core/wasm"]
[dependencies]
anyhow = "1.0.51"
dprint-core = { version = "0.66.1", features = ["formatting"] }
jsonc-parser = "0.23.0"
jsonc-parser = "0.26.0"
serde = { version = "1.0.108", features = ["derive"] }
serde_json = "1.0"

Expand Down
6 changes: 4 additions & 2 deletions src/format_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::text_changes::apply_text_changes;
use crate::text_changes::TextChange;
use anyhow::Result;
use jsonc_parser::CollectOptions;
use jsonc_parser::CommentCollectionStrategy;
use jsonc_parser::ParseOptions;

pub fn format_text(
Expand All @@ -29,7 +30,7 @@ fn format_inner(
let parse_result = jsonc_parser::parse_to_ast(
input_text,
&CollectOptions {
comments: false,
comments: CommentCollectionStrategy::Off,
tokens: false,
},
&ParseOptions {
Expand Down Expand Up @@ -77,10 +78,11 @@ fn format_root(
#[cfg(debug_assertions)]
fn validate_output_json(text: &str) -> Result<()> {
// ensures the output is correct in debug mode

let result = jsonc_parser::parse_to_ast(
text,
&CollectOptions {
comments: false,
comments: CommentCollectionStrategy::Off,
tokens: false,
},
&ParseOptions {
Expand Down

0 comments on commit 6c59bad

Please sign in to comment.