Trait SourceMapGenConfig

Source
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 { ... }
    fn ignore_list(&self, f: &FileName) -> bool { ... }
}

Required Methods§

Source

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§

Source

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

§Returns identifier starting at bpos.
Source

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

You can override this to control sourceContents.

Source

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

You can define whether to emit sourcemap with columns or not

Source

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

By default, we skip internal files.

Source

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

If true, the file will be in the ignoreList of SourceMap.

Specification for ignoreList: https://tc39.es/ecma426/#json-ignoreList

The ignoreList field is an optional list of indices of files that should be considered third party code, such as framework code or bundler-generated code. This allows developer tools to avoid code that developers likely don’t want to see or step through, without requiring developers to configure this beforehand. It refers to the sources field and lists the indices of all the known third-party sources in the source map. Some browsers may also use the deprecated x_google_ignoreList field if ignoreList is not present.

By default, we ignore anonymous files and internal files.

Implementations on Foreign Types§

Source§

impl<T> SourceMapGenConfig for &T

Source§

impl<T> SourceMapGenConfig for Box<T>

Source§

impl<T> SourceMapGenConfig for Rc<T>

Implementors§