mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Merge #6619
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:
commit
08a3f8f7f0
3 changed files with 19 additions and 8 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -865,9 +865,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lsp-types"
|
name = "lsp-types"
|
||||||
version = "0.83.1"
|
version = "0.84.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4e79f39834b97271f9f5ecec573e42c7d9c5bdbd2620b30a851054ece6aab6d"
|
checksum = "3b95be71fe205e44de754185bcf86447b65813ce1ceb298f8d3793ade5fff08d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
|
@ -21,7 +21,7 @@ env_logger = { version = "0.8.1", default-features = false }
|
||||||
itertools = "0.9.0"
|
itertools = "0.9.0"
|
||||||
jod-thread = "0.1.0"
|
jod-thread = "0.1.0"
|
||||||
log = "0.4.8"
|
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"
|
parking_lot = "0.11.0"
|
||||||
pico-args = "0.3.1"
|
pico-args = "0.3.1"
|
||||||
oorandom = "11.1.2"
|
oorandom = "11.1.2"
|
||||||
|
|
|
@ -629,12 +629,21 @@ pub(crate) fn resource_op(
|
||||||
match file_system_edit {
|
match file_system_edit {
|
||||||
FileSystemEdit::CreateFile { anchor, dst } => {
|
FileSystemEdit::CreateFile { anchor, dst } => {
|
||||||
let uri = snap.anchored_path(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 } => {
|
FileSystemEdit::MoveFile { src, anchor, dst } => {
|
||||||
let old_uri = snap.file_id_to_url(src);
|
let old_uri = snap.file_id_to_url(src);
|
||||||
let new_uri = snap.anchored_path(anchor, &dst);
|
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<lsp_ext::SnippetWorkspaceEdit> for lsp_types::WorkspaceEdit {
|
||||||
edits: edit
|
edits: edit
|
||||||
.edits
|
.edits
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|edit| lsp_types::TextEdit {
|
.map(|edit| {
|
||||||
range: edit.range,
|
lsp_types::OneOf::Left(lsp_types::TextEdit {
|
||||||
new_text: edit.new_text,
|
range: edit.range,
|
||||||
|
new_text: edit.new_text,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue