Skip to content

Commit

Permalink
suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 committed Aug 27, 2024
1 parent 592489e commit 6c32093
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/cairo-lang-language-server/src/project/scarb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ pub fn update_crate_roots(metadata: &Metadata, db: &mut AnalysisDatabase) {
// We instead find a package that specifies the target of the compilation unit
// and later use it to extract edition and experimental features.
if package.is_none() && compilation_unit.package == component.package {
package =
metadata.packages.iter().find(|p| p.targets.contains(&compilation_unit.target));
package = metadata
.packages
.iter()
.find(|p| p.targets.iter().any(|t| t.name == compilation_unit.target.name));
}

if package.is_none() {
Expand Down

0 comments on commit 6c32093

Please sign in to comment.