Skip to content

Commit 20d9941

Browse files
Skip plugin dependencies in scarb-doc (#2033)
## Changes * `scarb-doc` properly analyzes the component dependencies obtained from metadata
1 parent a39db50 commit 20d9941

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

extensions/scarb-doc/src/metadata/compilation.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,24 @@ fn get_crate_settings_for_component(
144144
.as_ref()
145145
.expect("dependencies are expected to exist")
146146
.iter()
147-
.map(|CompilationUnitComponentDependencyMetadata { id, .. }| {
147+
.filter_map(|CompilationUnitComponentDependencyMetadata { id, .. }| {
148+
// Skip the plugin dependencies.
149+
if unit.cairo_plugins
150+
.iter()
151+
.any(|plugin_metadata| plugin_metadata.component_dependency_id.as_ref() == Some(id))
152+
{
153+
return None
154+
}
155+
148156
let dependency_component = unit.components.iter()
149157
.find(|component| component.id.as_ref().expect("component is expected to have an id") == id)
150158
.expect("dependency of a component is guaranteed to exist in compilation unit components");
151-
(
159+
Some((
152160
dependency_component.name.clone(),
153161
DependencySettings {
154162
discriminator: dependency_component.discriminator.as_ref().map(ToSmolStr::to_smolstr)
155163
},
156-
)
164+
))
157165
})
158166
.collect();
159167

0 commit comments

Comments
 (0)