Struct sourcemap::SourceMapBuilder [] [src]

pub struct SourceMapBuilder { /* fields omitted */ }

Helper for sourcemap generation

This helper exists because generating and modifying SourceMap objects is generally not very comfortable. As a general aid this type can help.

Methods

impl SourceMapBuilder
[src]

Creates a new source map builder and sets the file.

Sets the file for the sourcemap (optional)

Returns the currently set file.

Registers a new source with the builder and returns the source ID.

Changes the source name for an already set source.

Looks up a source name for an ID.

Sets the source contents for an already existing source.

Returns the current source contents for a source.

Checks if a given source ID has source contents available.

Loads source contents from locally accessible files if referenced accordingly. Returns the number of loaded source contents

Registers a name with the builder and returns the name ID.

Adds a new mapping to the builder.

Shortcut for adding a new mapping based of an already existing token, optionally removing the name.

Converts the builder into a sourcemap.