Skip to content

Commit

Permalink
Fix getting semantic diags for a crate (#172)
Browse files Browse the repository at this point in the history
* Fix getting semantic diags for a crate

* Fix clippy
  • Loading branch information
wawel37 authored Dec 20, 2024
1 parent 349e370 commit e602fdc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/cairo-lint-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +33,7 @@ use scarb_metadata::{MetadataCommand, PackageMetadata, TargetMetadata};
use scarb_ui::args::{PackagesFilter, VerbositySpec};
use scarb_ui::components::Status;
use scarb_ui::{OutputFormat, Ui};
use smol_str::{SmolStr, ToSmolStr};
use smol_str::SmolStr;

#[derive(Parser, Debug)]
struct Args {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e602fdc

Please sign in to comment.