From e981485b7686a624fb135facb13ceb25d03178db Mon Sep 17 00:00:00 2001 From: kjeremy Date: Tue, 24 Nov 2020 08:52:24 -0500 Subject: New lsp-types to fix versioning Fixes #6603 --- crates/rust-analyzer/Cargo.toml | 2 +- crates/rust-analyzer/src/to_proto.rs | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 56c51486f..436f5041b 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -21,7 +21,7 @@ env_logger = { version = "0.8.1", default-features = false } itertools = "0.9.0" jod-thread = "0.1.0" log = "0.4.8" -lsp-types = { version = "0.83.1", features = ["proposed"] } +lsp-types = { version = "0.84.0", features = ["proposed"] } parking_lot = "0.11.0" pico-args = "0.3.1" oorandom = "11.1.2" diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 2f35425bb..2052b800c 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -629,12 +629,21 @@ pub(crate) fn resource_op( match file_system_edit { FileSystemEdit::CreateFile { anchor, dst } => { let uri = snap.anchored_path(anchor, &dst); - lsp_types::ResourceOp::Create(lsp_types::CreateFile { uri, options: None }) + lsp_types::ResourceOp::Create(lsp_types::CreateFile { + uri, + options: None, + annotation: None, + }) } FileSystemEdit::MoveFile { src, anchor, dst } => { let old_uri = snap.file_id_to_url(src); let new_uri = snap.anchored_path(anchor, &dst); - lsp_types::ResourceOp::Rename(lsp_types::RenameFile { old_uri, new_uri, options: None }) + lsp_types::ResourceOp::Rename(lsp_types::RenameFile { + old_uri, + new_uri, + options: None, + annotation: None, + }) } } } @@ -684,9 +693,11 @@ impl From for lsp_types::WorkspaceEdit { edits: edit .edits .into_iter() - .map(|edit| lsp_types::TextEdit { - range: edit.range, - new_text: edit.new_text, + .map(|edit| { + lsp_types::OneOf::Left(lsp_types::TextEdit { + range: edit.range, + new_text: edit.new_text, + }) }) .collect(), }, -- cgit v1.2.3