From cba2e98b039bca9d863fde6f1ca95d88e0faf121 Mon Sep 17 00:00:00 2001 From: Johann150 <20990607+Johann150@users.noreply.github.com> Date: Sun, 29 Nov 2020 14:41:54 +0100 Subject: [PATCH] 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> --- codespan-lsp/CHANGELOG.md | 4 ++-- codespan-lsp/Cargo.toml | 2 +- codespan-lsp/src/lib.rs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/codespan-lsp/CHANGELOG.md b/codespan-lsp/CHANGELOG.md index 45dd67d1..394e5911 100644 --- a/codespan-lsp/CHANGELOG.md +++ b/codespan-lsp/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The error type in `codespan-lsp` is replaced with the error type in the `codespan-reporting` crate. The error type is now `codespan_reporting::file::Error`. -- The `lsp-types` dependency was updated to use a version range: `>=0.70, <0.83`, - which includes the latest updates in `0.82.0`. +- The `lsp-types` dependency was updated to use a version range: `>=0.70, <0.85`, + which includes the latest updates in `0.84.0`. ## [0.10.1] - 2020-08-17 diff --git a/codespan-lsp/Cargo.toml b/codespan-lsp/Cargo.toml index b9c060ba..775aaa6e 100644 --- a/codespan-lsp/Cargo.toml +++ b/codespan-lsp/Cargo.toml @@ -16,5 +16,5 @@ codespan-reporting = { version = "0.9.5", path = "../codespan-reporting" } # will be valid for all the versions in this range. Getting this range wrong # could potentially break down-stream builds on a `cargo update`. This is an # absolute no-no, breaking much of what we enjoy about Cargo! -lsp-types = ">=0.70, <0.83" +lsp-types = ">=0.84, <0.85" url = "2" diff --git a/codespan-lsp/src/lib.rs b/codespan-lsp/src/lib.rs index 99b9a006..f49f27be 100644 --- a/codespan-lsp/src/lib.rs +++ b/codespan-lsp/src/lib.rs @@ -27,8 +27,8 @@ fn location_to_position( Err(Error::InvalidCharBoundary { given }) } else { let line_utf16 = line_str[..column].encode_utf16(); - let character = line_utf16.count() as u64; - let line = line as u64; + let character = line_utf16.count() as u32; + let line = line as u32; Ok(LspPosition { line, character }) } @@ -77,7 +77,7 @@ where }) } -pub fn character_to_line_offset(line: &str, character: u64) -> Result { +pub fn character_to_line_offset(line: &str, character: u32) -> Result { let line_len = line.len(); let mut character_offset = 0; @@ -90,7 +90,7 @@ pub fn character_to_line_offset(line: &str, character: u64) -> Result