Skip to content

Commit

Permalink
fix: export DynamicTemplatePart
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Nov 29, 2023
1 parent bf083f4 commit 0f30363
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ impl DependencyDescriptor {
Self::Dynamic(d) => Some(d),
}
}

pub fn leading_comments(&self) -> &Vec<Comment> {
match self {
DependencyDescriptor::Static(d) => &d.leading_comments,
DependencyDescriptor::Dynamic(d) => &d.leading_comments,
}
}

pub fn import_attributes(&self) -> &ImportAttributes {
match self {
DependencyDescriptor::Static(d) => &d.import_attributes,
DependencyDescriptor::Dynamic(d) => &d.import_attributes,
}
}

pub fn range(&self) -> &PositionRange {
match self {
DependencyDescriptor::Static(d) => &d.range,
DependencyDescriptor::Dynamic(d) => &d.range,
}
}
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub use analyzer::Comment;
pub use analyzer::DependencyDescriptor;
pub use analyzer::DynamicArgument;
pub use analyzer::DynamicDependencyDescriptor;
pub use analyzer::DynamicTemplatePart;
pub use analyzer::ModuleAnalyzer;
pub use analyzer::ModuleInfo;
pub use analyzer::PositionRange;
Expand Down

0 comments on commit 0f30363

Please sign in to comment.