Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaleidawave/source-map
Utilities for building source maps (v3) for a compiler
https://github.com/kaleidawave/source-map
compiler rust source-maps
Last synced: 24 days ago
JSON representation
Utilities for building source maps (v3) for a compiler
- Host: GitHub
- URL: https://github.com/kaleidawave/source-map
- Owner: kaleidawave
- License: mit
- Created: 2021-05-05T19:50:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T17:04:13.000Z (6 months ago)
- Last Synced: 2024-08-09T15:49:08.118Z (3 months ago)
- Topics: compiler, rust, source-maps
- Language: Rust
- Homepage:
- Size: 151 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Source map
[![crates.io badge](https://img.shields.io/crates/v/source-map?style=flat-square)](https://crates.io/crates/source-map)
[![docs.rs badge](https://img.shields.io/docsrs/source-map?style=flat-square)](https://docs.rs/source-map/latest)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](https://docs.rs/crate/lsp-types/latest)
- 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](https://github.com/kaleidawave/source-map/actions/workflows/example.yml).
```shell
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](https://evanw.github.io/source-map-visualization/)