Skip to content

Commit cba2e98

Browse files
update lsp-types and change types (#303)
* Update lsp-types requirement from >=0.70, <0.84 to >=0.84, <0.85 * fix breaking changes * update changelog Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
1 parent b51e3a6 commit cba2e98

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

codespan-lsp/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- The error type in `codespan-lsp` is replaced with the error type in the `codespan-reporting` crate.
1313
The error type is now `codespan_reporting::file::Error`.
14-
- The `lsp-types` dependency was updated to use a version range: `>=0.70, <0.83`,
15-
which includes the latest updates in `0.82.0`.
14+
- The `lsp-types` dependency was updated to use a version range: `>=0.70, <0.85`,
15+
which includes the latest updates in `0.84.0`.
1616

1717
## [0.10.1] - 2020-08-17
1818

codespan-lsp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ codespan-reporting = { version = "0.9.5", path = "../codespan-reporting" }
1616
# will be valid for all the versions in this range. Getting this range wrong
1717
# could potentially break down-stream builds on a `cargo update`. This is an
1818
# absolute no-no, breaking much of what we enjoy about Cargo!
19-
lsp-types = ">=0.70, <0.83"
19+
lsp-types = ">=0.84, <0.85"
2020
url = "2"

codespan-lsp/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ fn location_to_position(
2727
Err(Error::InvalidCharBoundary { given })
2828
} else {
2929
let line_utf16 = line_str[..column].encode_utf16();
30-
let character = line_utf16.count() as u64;
31-
let line = line as u64;
30+
let character = line_utf16.count() as u32;
31+
let line = line as u32;
3232

3333
Ok(LspPosition { line, character })
3434
}
@@ -77,7 +77,7 @@ where
7777
})
7878
}
7979

80-
pub fn character_to_line_offset(line: &str, character: u64) -> Result<usize, Error> {
80+
pub fn character_to_line_offset(line: &str, character: u32) -> Result<usize, Error> {
8181
let line_len = line.len();
8282
let mut character_offset = 0;
8383

@@ -90,7 +90,7 @@ pub fn character_to_line_offset(line: &str, character: u64) -> Result<usize, Err
9090
return Ok(line_len - chars_off - ch_off);
9191
}
9292

93-
character_offset += ch.len_utf16() as u64;
93+
character_offset += ch.len_utf16() as u32;
9494
}
9595

9696
// Handle positions after the last character on the line

0 commit comments

Comments
 (0)