Skip to content

Commit

Permalink
line-index: Update README.md with suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Laurențiu Nicola <[email protected]>
  • Loading branch information
homersimpsons and lnicola authored Jan 7, 2024
1 parent 747fa7d commit 0f69276
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/line-index/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# line-index

This crate is developped as part of `rust-analyzer`.
This crate is developed as part of `rust-analyzer`.

line-index is a library to convert between text offset and its corresponding line/column.
line-index is a library to convert between text offsets and corresponding line/column coordinates.

## Installation

To add this crate to a project simply run `cargo add line-index`.

## Usage

The main structure is `LineIndex`. It is constructed with an utf-8 text then various utility functions can be used on it.
The main structure is `LineIndex`.

It is constructed with an UTF-8 string, but also supports UTF-16 and UTF-32 offsets.

### Example

Expand All @@ -25,4 +27,4 @@ line_index.offset(LineCol { line: 2, col: 3 }); // Some (24)

## SemVer

This crate follows [semver principles]([url](https://semver.org/)https://semver.org/).
This crate uses [semver](https://semver.org/) versioning.

0 comments on commit 0f69276

Please sign in to comment.