mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Merge #5375
5375: Use more explicit type for save registration r=matklad a=kjeremy This was introduced in the latest lsp-types Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
408b5fafc5
2 changed files with 25 additions and 21 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -712,9 +712,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lsp-types"
|
name = "lsp-types"
|
||||||
version = "0.76.0"
|
version = "0.76.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af5586f0631c7f7826c3ea39377c326d7b4623138be7ab1204dab22e47717449"
|
checksum = "55cfa1593e04985972e018890b2e1a9ed25c71efc800067fbf0990a9432421c8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
|
@ -122,7 +122,9 @@ impl GlobalState {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
let registration_options = lsp_types::TextDocumentRegistrationOptions {
|
let save_registration_options = lsp_types::TextDocumentSaveRegistrationOptions {
|
||||||
|
include_text: Some(false),
|
||||||
|
text_document_registration_options: lsp_types::TextDocumentRegistrationOptions {
|
||||||
document_selector: Some(vec![
|
document_selector: Some(vec![
|
||||||
lsp_types::DocumentFilter {
|
lsp_types::DocumentFilter {
|
||||||
language: None,
|
language: None,
|
||||||
|
@ -140,11 +142,13 @@ impl GlobalState {
|
||||||
pattern: Some("**/Cargo.lock".into()),
|
pattern: Some("**/Cargo.lock".into()),
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let registration = lsp_types::Registration {
|
let registration = lsp_types::Registration {
|
||||||
id: "textDocument/didSave".to_string(),
|
id: "textDocument/didSave".to_string(),
|
||||||
method: "textDocument/didSave".to_string(),
|
method: "textDocument/didSave".to_string(),
|
||||||
register_options: Some(serde_json::to_value(registration_options).unwrap()),
|
register_options: Some(serde_json::to_value(save_registration_options).unwrap()),
|
||||||
};
|
};
|
||||||
self.send_request::<lsp_types::request::RegisterCapability>(
|
self.send_request::<lsp_types::request::RegisterCapability>(
|
||||||
lsp_types::RegistrationParams { registrations: vec![registration] },
|
lsp_types::RegistrationParams { registrations: vec![registration] },
|
||||||
|
|
Loading…
Reference in a new issue