diff --git a/Cargo.lock b/Cargo.lock index edadd10576..27bf16c3b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -865,9 +865,9 @@ dependencies = [ [[package]] name = "lsp-types" -version = "0.83.1" +version = "0.84.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e79f39834b97271f9f5ecec573e42c7d9c5bdbd2620b30a851054ece6aab6d" +checksum = "3b95be71fe205e44de754185bcf86447b65813ce1ceb298f8d3793ade5fff08d" dependencies = [ "base64", "bitflags", diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 56c51486f2..436f5041bc 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 2f35425bbc..2052b800cc 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(), },