Skip to content

Commit

Permalink
Instantiate only plugins requested by the compilation unit
Browse files Browse the repository at this point in the history
fix #91

commit-id:95915cc6
  • Loading branch information
mkaput committed May 18, 2023
1 parent a998edd commit 6889806
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scarb/src/compiler/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ pub(crate) fn build_scarb_root_database(
b.with_project_config(build_project_config(unit)?);
b.with_cfg(unit.cfg_set.clone());

// TODO(mkaput): Pull only plugins that are dependencies of this compilation unit.
for plugin in ws.config().cairo_plugins().iter() {
for plugin_info in &unit.cairo_plugins {
let package_id = plugin_info.package.id;
let plugin = ws.config().cairo_plugins().fetch(package_id)?;
let instance = plugin.instantiate()?;
for semantic_plugin in instance.semantic_plugins() {
b.with_semantic_plugin(semantic_plugin);
Expand Down

0 comments on commit 6889806

Please sign in to comment.