Skip to content

Commit 1cb621d

Browse files
svc-secopsrenovate[bot]goto-bus-stop
authored
chore(deps): update rust crate ariadne to 0.5.0 (#924)
* chore(deps): update rust crate ariadne to 0.5.0 * Update ariadne API usage * use ariadne::Config::new --------- Co-authored-by: renovate[bot] <[email protected]> Co-authored-by: Renée Kooi <[email protected]> Co-authored-by: Renée <[email protected]>
1 parent b4a6a93 commit 1cb621d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

crates/apollo-compiler/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ autotests = false # Most tests/*.rs files are modules of tests/main.rs
2020
[dependencies]
2121
ahash = "0.8.11"
2222
apollo-parser = { path = "../apollo-parser", version = "0.8.0" }
23-
ariadne = { version = "0.4.1", features = ["auto-color"] }
23+
ariadne = { version = "0.5.0", features = ["auto-color"] }
2424
indexmap = "2.0.0"
2525
rowan = "0.15.5"
2626
serde = { version = "1.0", features = ["derive"] }

crates/apollo-compiler/src/diagnostic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ impl<'s> CliReport<'s> {
204204
main_location: Option<SourceSpan>,
205205
color: Color,
206206
) -> Self {
207-
let (file_id, range) = main_location
207+
let span = main_location
208208
.and_then(to_span)
209209
.unwrap_or((FileId::NONE, 0..0));
210-
let report = ariadne::Report::build(ReportKind::Error, file_id, range.start);
210+
let report = ariadne::Report::build(ReportKind::Error, span);
211211
let enable_color = match color {
212212
Color::Never => false,
213213
// Rely on ariadne's `auto-color` feature, which uses `concolor` to enable colors
214214
// only if stderr is a terminal.
215215
Color::StderrIsTerminal => true,
216216
};
217-
let config = ariadne::Config::default()
217+
let config = ariadne::Config::new()
218218
.with_index_type(ariadne::IndexType::Byte)
219219
.with_color(enable_color);
220220
Self {

crates/apollo-parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rowan = "0.15.5"
2222
thiserror = "1.0.30"
2323

2424
[dev-dependencies]
25-
ariadne = "0.4.0"
25+
ariadne = "0.5.0"
2626
indexmap = "2.0.0"
2727
anyhow = "1.0.66"
2828
pretty_assertions = "1.3.0"

crates/apollo-parser/examples/ariadne.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn parse_schema() -> cst::Document {
3131
// slice can have many errors.
3232
let start = err.index();
3333
let end = start + err.data().len();
34-
Report::build(ReportKind::Error, file_name, start)
34+
Report::build(ReportKind::Error, (file_name, start..end))
3535
.with_message(err.message())
3636
.with_label(Label::new((file_name, start..end)).with_message(err.message()))
3737
.finish()

0 commit comments

Comments
 (0)