pub trait SourceRangedForSpanned {
Show 18 methods fn start(&self) -> SourcePos; fn end(&self) -> SourcePos; fn range(&self) -> SourceRange<SourcePos> { ... } fn byte_width(&self) -> usize { ... } fn start_line_fast(&self, source: &dyn SourceTextInfoProvider<'_>) -> usize { ... } fn end_line_fast(&self, source: &dyn SourceTextInfoProvider<'_>) -> usize { ... } fn start_column_fast(&self, source: &dyn SourceTextInfoProvider<'_>) -> usize { ... } fn end_column_fast(&self, source: &dyn SourceTextInfoProvider<'_>) -> usize { ... } fn column_at_pos(
        &self,
        source: &dyn SourceTextInfoProvider<'_>,
        pos: SourcePos
    ) -> usize { ... } fn char_width_fast(&self, source: &dyn SourceTextInfoProvider<'_>) -> usize { ... } fn text_fast(&self, source: &dyn SourceTextInfoProvider<'a>) -> &'a str { ... } fn tokens_fast(&self, program: &dyn RootNode<'a>) -> &'a [TokenAndSpan] { ... } fn leading_comments_fast(
        &self,
        program: &dyn RootNode<'a>
    ) -> CommentsIterator<'a>Notable traits for CommentsIterator<'a>impl<'a> Iterator for CommentsIterator<'a> type Item = &'a Comment; { ... } fn trailing_comments_fast(
        &self,
        program: &dyn RootNode<'a>
    ) -> CommentsIterator<'a>Notable traits for CommentsIterator<'a>impl<'a> Iterator for CommentsIterator<'a> type Item = &'a Comment; { ... } fn previous_token_fast(
        &self,
        program: &dyn RootNode<'a>
    ) -> Option<&'a TokenAndSpan> { ... } fn next_token_fast(
        &self,
        program: &dyn RootNode<'a>
    ) -> Option<&'a TokenAndSpan> { ... } fn previous_tokens_fast(
        &self,
        program: &dyn RootNode<'a>
    ) -> &'a [TokenAndSpan] { ... } fn next_tokens_fast(&self, program: &dyn RootNode<'a>) -> &'a [TokenAndSpan] { ... }
}
Expand description

Adds source position helper methods for swc types that implement swc_common::Spanned.

There were conflicts with implementing SourceRanged for &SourceRanged with swc’s Spanned implementation, so this needed to be a separate trait unfortunately and I couldn’t figure out how to combine it with SourceRanged

Required Methods

Provided Methods

Implementors