Skip to content

Commit

Permalink
Documentation and workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidawave committed Feb 10, 2024
1 parent 776fa9e commit f969b55
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set git credentials
run: |
git config user.name github-actions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
validity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -27,30 +27,30 @@ jobs:
formating:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check formatting with rustfmt
run: cargo fmt --all --check

tests:
needs: validity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run all tests
run: cargo test --workspace --all-features

clippy:
needs: validity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint code with clippy
run: cargo clippy

publish-ability:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check that it will publish to crates
run: |
cargo metadata --offline --format-version 1 --no-deps | jq -r ".workspace_members[]" | while read -r _n _v pathInfo ; do
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
[![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
Utilities for building source maps (v3), handling source location representations and source files.

## Includes

- `Span`, a structure which represents a section of a specific source
- `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
- `StringWithSourceMap`, along with the `ToString` trait makes generating string representations with and adding source markings trivial
- `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)
- `FileSystem` for storing source files and their information
- 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 example
## 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
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(clippy::useless_conversion)]
#![doc = include_str!("../README.md")]

pub mod encodings;
mod filesystem;
Expand Down

0 comments on commit f969b55

Please sign in to comment.