Skip to content

v.gen.js.sourcemap #

fn generate_empty_map #

fn generate_empty_map() &Generator

fn new_sourcemap #

fn new_sourcemap(file string, source_root string, sources_content_inline bool) SourceMap

fn (Generator) add_map #

fn (mut g Generator) add_map(file string, source_root string, sources_content_inline bool, line_offset int, column_offset int) &SourceMap

struct SourceMap #

struct SourceMap {
pub mut:
	version                int               @[json: version]
	file                   string            @[json: file]
	source_root            string            @[json: source_root]
	sources                Sets              @[json: sources]
	sources_content        map[string]string
	names                  Sets
	mappings               Mappings
	sources_content_inline bool
}

fn (SourceMap) add_mapping #

fn (mut sm SourceMap) add_mapping(source_name string, source_position SourcePositionType, gen_line u32, gen_column u32, name string)

Add a single mapping from original source line and column to the generated source's line and column for this source map being created.

fn (SourceMap) add_mapping_list #

fn (mut sm SourceMap) add_mapping_list(source_name string, mapping_list []MappingInput) !

Add multiple mappings from the same source

fn (SourceMap) set_source_content #

fn (mut sm SourceMap) set_source_content(source_name string, source_content string)

Set the source content for a source file.

fn (SourceMap) to_json #

fn (mut sm SourceMap) to_json() SourceMapJson

create a JSON representing the sourcemap Sourcemap Specs http://sourcemaps.info/spec.html

struct SourcePosition #

struct SourcePosition {
	source_line   u32
	source_column u32
}