mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
line-index: Update README.md with suggestions
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
This commit is contained in:
parent
747fa7dd6e
commit
0f69276e60
1 changed files with 6 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
||||||
# line-index
|
# 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
|
## Installation
|
||||||
|
|
||||||
|
@ -10,7 +10,9 @@ To add this crate to a project simply run `cargo add line-index`.
|
||||||
|
|
||||||
## Usage
|
## 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
|
### Example
|
||||||
|
|
||||||
|
@ -25,4 +27,4 @@ line_index.offset(LineCol { line: 2, col: 3 }); // Some (24)
|
||||||
|
|
||||||
## SemVer
|
## SemVer
|
||||||
|
|
||||||
This crate follows [semver principles]([url](https://semver.org/)https://semver.org/).
|
This crate uses [semver](https://semver.org/) versioning.
|
||||||
|
|
Loading…
Reference in a new issue