swc_core::ecma::utils::swc_ecma_ast

Trait SourceMapperExt

pub trait SourceMapperExt {
    // Required method
    fn get_code_map(&self) -> &dyn SourceMapper;

    // Provided methods
    fn is_on_same_line(&self, _lo: BytePos, _hi: BytePos) -> bool { ... }
    fn should_write_separating_line_terminator(
        &self,
        prev: Option<Span>,
        next: Option<Span>,
        format: ListFormat,
    ) -> bool { ... }
    fn should_write_leading_line_terminator(
        &self,
        parent_node: Span,
        first_child: Option<Span>,
        format: ListFormat,
    ) -> bool { ... }
    fn should_write_closing_line_terminator(
        &self,
        parent_node: Span,
        last_child: Option<Span>,
        format: ListFormat,
    ) -> bool { ... }
}
Available on crate features __ecma and __utils only.

Required Methods§

fn get_code_map(&self) -> &dyn SourceMapper

Provided Methods§

fn is_on_same_line(&self, _lo: BytePos, _hi: BytePos) -> bool

fn should_write_separating_line_terminator( &self, prev: Option<Span>, next: Option<Span>, format: ListFormat, ) -> bool

fn should_write_leading_line_terminator( &self, parent_node: Span, first_child: Option<Span>, format: ListFormat, ) -> bool

fn should_write_closing_line_terminator( &self, parent_node: Span, last_child: Option<Span>, format: ListFormat, ) -> bool

Implementations on Foreign Types§

§

impl SourceMapperExt for Rc<SourceMap>

§

fn get_code_map(&self) -> &dyn SourceMapper

§

impl SourceMapperExt for Rc<dyn SourceMapper>

§

fn get_code_map(&self) -> &dyn SourceMapper

Implementors§