Expand description
§Source map
Utilities for building source maps (v3), handling source location representations and source files.
§Includes
SpanWithSource, a structure which represents a section of a specific sourceSpanWithoutSource, a structure which represents a general section without a specific sourceSourceId, a identifier for a source fileStringWithOptionalSourceMap, along with theToStringtrait makes generating string representations with and adding source markings trivial- A
lsp-types-morphismsfeature which allows conversion of position type to lsp-types - The
MapFileStorestruct and theFileSystemtrait for storing source files and other information - Utilities for turning byte indices into line and column information
§Source map generation example
See generated example on GitHub actions.
git clone https://github.com/kaleidawave/source-map
cd source-map
cargo run -F inline-source-map --example source_map_creation -- LICENSE LICENSE.mapView pairings generated by uploading LICENSE.map to evan w’s source map visualizer
Modules§
Structs§
- Base
Span - A start and end. Also contains trace of original source (depending on
T) - Counter
- Counts text until a limit. Used for telling whether the text is greater than some threshold
- End
- The byte start
- Line
Column Position - Zero based
- Line
Column Span - Zero based
- Line
Starts - Contains the byte indexes of when line starts
- MapFile
Store - NoPath
Map - Position
- A scalar/singular byte wise position. Zero based
- Source
- Source
Id - A identifier for a crate::Source
- Source
Map - Source
MapBuilder - Struct for building a source map (v3)
- Start
- The byte start
- String
With Optional Source Map - Building a source along with its source map
- With
Path Map - Writable
Traits§
- File
System - Nullable
- PathMap
- ToString
- A trait for defining behavior of adding content to a buffer. As well as register markers for source maps