source-map

Crates.iosource-map
lib.rssource-map
version0.15.0
sourcesrc
created_at2021-05-06 10:25:39.183325
updated_at2024-05-21 17:04:08.060041
descriptionUtilities for building source maps (v3) for a compiler
homepage
repositoryhttps://github.com/kaleidawave/source-map
max_upload_size
id393778
size66,815
Ben (kaleidawave)

documentation

README

Source map

crates.io badge docs.rs badge

Utilities for building source maps (v3), handling source location representations and source files.

Includes

  • SpanWithSource, a structure which represents a section of a specific source
  • SpanWithoutSource, a structure which represents a general section without a specific source
  • SourceId, a identifier for a source file
  • StringWithOptionalSourceMap, along with the ToString trait makes generating string representations with and adding source markings trivial
  • A lsp-types-morphisms feature which allows conversion of position type to lsp-types
  • The MapFileStore struct and the FileSystem trait 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.map

View pairings generated by uploading LICENSE.map to evan w's source map visualizer

Commit count: 66

cargo fmt