Skip to content

Commit

Permalink
Revert "Adjust diagnostics reporter closure argument (#1175)"
Browse files Browse the repository at this point in the history
This reverts commit 886fc40.
  • Loading branch information
maciektr committed Mar 8, 2024
1 parent 7cb6bed commit f8f699b
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 70 deletions.
99 changes: 58 additions & 41 deletions Cargo.lock

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

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ assert_fs = "1"
async-trait = "0.1"
axum = { version = "0.6", features = ["http2"] }
cairo-felt = "0.9.1"
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "8e47925be7c91e7500bc5827c9e8f7f401985f3e", features = ["env_logger"] }
cairo-lang-casm = "2.6.0"
cairo-lang-compiler = "2.6.0"
cairo-lang-debug = "2.6.0"
cairo-lang-defs = "2.6.0"
cairo-lang-diagnostics = "2.6.0"
cairo-lang-filesystem = "2.6.0"
cairo-lang-formatter = "2.6.0"
cairo-lang-language-server = "2.6.0"
cairo-lang-lowering = "2.6.0"
cairo-lang-project = "2.6.0"
cairo-lang-runner = "2.6.0"
cairo-lang-semantic = "2.6.0"
cairo-lang-sierra = "2.6.0"
cairo-lang-sierra-generator = "2.6.0"
cairo-lang-sierra-to-casm = "2.6.0"
cairo-lang-sierra-type-size = "2.6.0"
cairo-lang-starknet = "2.6.0"
cairo-lang-starknet-classes = "2.6.0"
cairo-lang-syntax = "2.6.0"
cairo-lang-test-plugin = "2.6.0"
cairo-lang-test-runner = "2.6.0"
cairo-lang-utils = { version = "2.6.0", features = ["env_logger"] }
camino = { version = "1", features = ["serde1"] }
cargo_metadata = ">=0.18"
clap = { version = "4", features = ["derive", "env", "string"] }
Expand Down
12 changes: 5 additions & 7 deletions scarb/src/compiler/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::{Context, Result};
use cairo_lang_compiler::db::RootDatabase;
use cairo_lang_compiler::diagnostics::DiagnosticsReporter;
use cairo_lang_compiler::CompilerConfig;
use cairo_lang_diagnostics::{FormattedDiagnosticEntry, Severity};
use cairo_lang_diagnostics::Severity;
use cairo_lang_filesystem::db::FilesGroup;
use cairo_lang_filesystem::ids::{CrateId, CrateLongId};
use serde::Serialize;
Expand All @@ -21,12 +21,10 @@ pub fn build_compiler_config<'c>(
let diagnostics_reporter = DiagnosticsReporter::callback({
let config = ws.config();

|entry: FormattedDiagnosticEntry| {
let msg = entry
.message()
.strip_suffix('\n')
.unwrap_or(entry.message());
match entry.severity() {
|severity: Severity, diagnostic: String| {
let msg = diagnostic.clone();
let msg = msg.strip_suffix('\n').unwrap_or(diagnostic.as_str());
match severity {
Severity::Error => config.ui().error(msg),
Severity::Warning => config.ui().warn(msg),
};
Expand Down

0 comments on commit f8f699b

Please sign in to comment.