Skip to content

Commit 3efda63

Browse files
authored
Merge pull request #20991 from Veykril/push-rrpwmvnskstu
Merge `text-size` into rust-analyzer
2 parents 4bf516e + f12388c commit 3efda63

File tree

19 files changed

+1302
-7
lines changed

19 files changed

+1302
-7
lines changed

Cargo.lock

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
- trying
9+
10+
env:
11+
RUSTFLAGS: -D warnings
12+
RUSTUP_MAX_RETRIES: 10
13+
CARGO_NET_RETRY: 10
14+
15+
jobs:
16+
rust:
17+
name: Rust
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, windows-latest, macos-latest]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
- name: Install Rust toolchain
30+
uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
profile: minimal
34+
35+
- name: Test
36+
run: cargo test --all-features
37+
38+
rustdoc:
39+
name: Docs
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v2
45+
46+
- name: Install Rust toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
toolchain: nightly
50+
profile: minimal
51+
override: true
52+
53+
- name: Rustdoc
54+
run: cargo rustdoc --all-features -- -D warnings

lib/text-size/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
**/*.rs.bk
3+
Cargo.lock

lib/text-size/CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Changelog
2+
3+
## 1.1.0
4+
5+
* add `TextRange::ordering` method
6+
7+
## 1.0.0 :tada:
8+
9+
* the carate is renamed to `text-size` from `text_unit`
10+
11+
Transition table:
12+
- `TextUnit::of_char(c)``TextSize::of(c)`
13+
- `TextUnit::of_str(s)``TextSize::of(s)`
14+
- `TextUnit::from_usize(size)``TextSize::try_from(size).unwrap_or_else(|| panic!(_))`
15+
- `unit.to_usize()``usize::from(size)`
16+
- `TextRange::from_to(from, to)``TextRange::new(from, to)`
17+
- `TextRange::offset_len(offset, size)``TextRange::from_len(offset, size)`
18+
- `range.start()``range.start()`
19+
- `range.end()``range.end()`
20+
- `range.len()``range.len()`
21+
- `range.is_empty()``range.is_empty()`
22+
- `a.is_subrange(b)``b.contains_range(a)`
23+
- `a.intersection(b)``a.intersect(b)`
24+
- `a.extend_to(b)``a.cover(b)`
25+
- `range.contains(offset)``range.contains(point)`
26+
- `range.contains_inclusive(offset)``range.contains_inclusive(point)`

lib/text-size/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "text-size"
3+
version = "1.1.1"
4+
edition = "2018"
5+
6+
authors = [
7+
"Aleksey Kladov <aleksey.kladov@gmail.com>",
8+
"Christopher Durham (CAD97) <cad97@cad97.com>"
9+
]
10+
description = "Newtypes for text offsets"
11+
license = "MIT OR Apache-2.0"
12+
repository = "https://github.com/rust-analyzer/text-size"
13+
documentation = "https://docs.rs/text-size"
14+
15+
[dependencies]
16+
serde = { version = "1.0", optional = true, default_features = false }
17+
18+
[dev-dependencies]
19+
serde_test = "1.0"
20+
static_assertions = "1.1"
21+
22+
[[test]]
23+
name = "serde"
24+
path = "tests/serde.rs"
25+
required-features = ["serde"]

0 commit comments

Comments
 (0)