swc_core::ecma::utils::swc_common::source_map

Trait SourceMapGenConfig

pub trait SourceMapGenConfig {
    // Required method
    fn file_name_to_source(&self, f: &FileName) -> String;

    // Provided methods
    fn name_for_bytepos(&self, _bpos: BytePos) -> Option<&str> { ... }
    fn inline_sources_content(&self, f: &FileName) -> bool { ... }
    fn emit_columns(&self, _f: &FileName) -> bool { ... }
    fn skip(&self, f: &FileName) -> bool { ... }
}
Available on crate features __ecma and __utils only.

Required Methods§

fn file_name_to_source(&self, f: &FileName) -> String

§Returns

File path to used in SourceMap.sources.

This should not return content of the file.

Provided Methods§

fn name_for_bytepos(&self, _bpos: BytePos) -> Option<&str>

§Returns identifier starting at bpos.

fn inline_sources_content(&self, f: &FileName) -> bool

You can override this to control sourceContents.

fn emit_columns(&self, _f: &FileName) -> bool

You can define whether to emit sourcemap with columns or not

fn skip(&self, f: &FileName) -> bool

By default, we skip internal files.

Implementations on Foreign Types§

§

impl<T> SourceMapGenConfig for &T

§

impl<T> SourceMapGenConfig for Box<T>

§

impl<T> SourceMapGenConfig for Rc<T>

Implementors§