From 619ca7fd0ea188976837c60baee4ce3b802dc9db Mon Sep 17 00:00:00 2001 From: Mateusz Kowalski Date: Thu, 19 Dec 2024 13:31:35 +0100 Subject: [PATCH] Fix getting semantic diags for a crate --- crates/cairo-lint-cli/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/cairo-lint-cli/src/main.rs b/crates/cairo-lint-cli/src/main.rs index e4b7017..cadde02 100644 --- a/crates/cairo-lint-cli/src/main.rs +++ b/crates/cairo-lint-cli/src/main.rs @@ -10,7 +10,9 @@ use cairo_lang_compiler::db::RootDatabase; use cairo_lang_compiler::project::update_crate_roots_from_project_config; use cairo_lang_defs::db::DefsGroup; use cairo_lang_diagnostics::{DiagnosticEntry, Maybe}; -use cairo_lang_filesystem::db::{init_dev_corelib, FilesGroup, CORELIB_CRATE_NAME}; +use cairo_lang_filesystem::db::{ + init_dev_corelib, CrateIdentifier, FilesGroup, CORELIB_CRATE_NAME, +}; use cairo_lang_filesystem::ids::{CrateLongId, FileId}; use cairo_lang_semantic::db::SemanticGroup; use cairo_lang_semantic::diagnostic::SemanticDiagnosticKind; @@ -159,10 +161,7 @@ fn main_inner(ui: &Ui, args: Args) -> Result<()> { update_crate_roots_from_project_config(&mut db, &config); let crate_id = db.intern_crate(CrateLongId::Real { name: SmolStr::new(&compilation_unit.target.name), - discriminator: main_component - .discriminator - .as_ref() - .map(ToSmolStr::to_smolstr), + discriminator: Some(CrateIdentifier::from(&main_component.name).clone().into()), }); // Get all the diagnostics let mut diags = Vec::new();