6619: New lsp-types to fix versioning r=kjeremy a=kjeremy

Fixes #6603

Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
bors[bot] 2020-11-24 13:53:38 +00:00 committed by GitHub
commit 08a3f8f7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 8 deletions

4
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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,10 +693,12 @@ impl From<lsp_ext::SnippetWorkspaceEdit> for lsp_types::WorkspaceEdit {
edits: edit
.edits
.into_iter()
.map(|edit| lsp_types::TextEdit {
.map(|edit| {
lsp_types::OneOf::Left(lsp_types::TextEdit {
range: edit.range,
new_text: edit.new_text,
})
})
.collect(),
},
)