Skip to content

Commit

Permalink
chore: update to reporting 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
azjezz committed Jan 7, 2023
1 parent de08a1c commit 5d44762
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 136 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "bin/snapshot.rs"

[dependencies]
ara_source = { version = "0.2.0" }
ara_reporting = { version = "0.4.2" }
ara_reporting = { version = "0.5.0" }
schemars = { version = "0.8.11" }
serde = { version = "1.0.149", features = ["derive"] }
serde_json = { version = "1.0.89" }
Expand Down
4 changes: 2 additions & 2 deletions bin/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::io;
use std::path::PathBuf;

use ara_parser::parser;
use ara_reporting::builder::Charset;
use ara_reporting::builder::CharSet;
use ara_reporting::builder::ColorChoice;
use ara_reporting::builder::ReportBuilder;
use ara_source::loader::FileSourceLoader;
Expand Down Expand Up @@ -51,7 +51,7 @@ fn main() -> io::Result<()> {
}
Err(report) => {
let builder = ReportBuilder::new(&source_map, *report)
.with_charset(Charset::Ascii)
.with_charset(CharSet::Ascii)
.with_colors(ColorChoice::Never);

let error = builder.as_string().unwrap();
Expand Down
22 changes: 14 additions & 8 deletions examples/linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ara_parser::tree::definition::function::FunctionLikeParameterDefinition;
use ara_parser::tree::downcast;
use ara_parser::tree::Node;
use ara_reporting::annotation::Annotation;
use ara_reporting::builder::Charset;
use ara_reporting::builder::CharSet;
use ara_reporting::builder::ColorChoice;
use ara_reporting::builder::ReportBuilder;
use ara_reporting::error::Error;
Expand All @@ -34,7 +34,7 @@ impl NodeVisitor<Issue> for NoVariadicParameterRuleVisitor {
position,
position + 3,
)
.with_annotation(Annotation::new(
.with_annotation(Annotation::secondary(
source,
parameter.initial_position(),
parameter.final_position(),
Expand Down Expand Up @@ -63,17 +63,23 @@ fn main() -> Result<(), Error> {
match traverser.traverse(&tree_map) {
Ok(_) => {}
Err(report) => {
ReportBuilder::new(&source_map, Report { issues: report })
.with_charset(Charset::Unicode)
.with_colors(ColorChoice::Always)
.print()
.unwrap();
ReportBuilder::new(
&source_map,
Report {
issues: report,
footer: None,
},
)
.with_charset(CharSet::Unicode)
.with_colors(ColorChoice::Always)
.print()
.unwrap();
}
}
}
Err(report) => {
ReportBuilder::new(&source_map, *report)
.with_charset(Charset::Unicode)
.with_charset(CharSet::Unicode)
.with_colors(ColorChoice::Always)
.print()?;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/parser.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;

use ara_parser::parser;
use ara_reporting::builder::Charset;
use ara_reporting::builder::CharSet;
use ara_reporting::builder::ColorChoice;
use ara_reporting::builder::ReportBuilder;
use ara_reporting::error::Error;
Expand All @@ -18,7 +18,7 @@ fn main() -> Result<(), Error> {
}),
Err(report) => {
ReportBuilder::new(&source_map, *report)
.with_charset(Charset::Unicode)
.with_charset(CharSet::Unicode)
.with_colors(ColorChoice::Always)
.print()?;
}
Expand Down
Loading

0 comments on commit 5d44762

Please sign in to comment.