diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/caps.rs | 3 | ||||
-rw-r--r-- | crates/rust-analyzer/src/diagnostics/to_proto.rs | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 2 | ||||
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 11 |
5 files changed, 19 insertions, 3 deletions
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 975b24aaf..d25c4bf83 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 } | |||
21 | itertools = "0.9.0" | 21 | itertools = "0.9.0" |
22 | jod-thread = "0.1.0" | 22 | jod-thread = "0.1.0" |
23 | log = "0.4.8" | 23 | log = "0.4.8" |
24 | lsp-types = { version = "0.82.0", features = ["proposed"] } | 24 | lsp-types = { version = "0.83.0", features = ["proposed"] } |
25 | parking_lot = "0.11.0" | 25 | parking_lot = "0.11.0" |
26 | pico-args = "0.3.1" | 26 | pico-args = "0.3.1" |
27 | oorandom = "11.1.2" | 27 | oorandom = "11.1.2" |
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs index c589afeaf..ff1ae9575 100644 --- a/crates/rust-analyzer/src/caps.rs +++ b/crates/rust-analyzer/src/caps.rs | |||
@@ -48,7 +48,7 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti | |||
48 | references_provider: Some(OneOf::Left(true)), | 48 | references_provider: Some(OneOf::Left(true)), |
49 | document_highlight_provider: Some(OneOf::Left(true)), | 49 | document_highlight_provider: Some(OneOf::Left(true)), |
50 | document_symbol_provider: Some(OneOf::Left(true)), | 50 | document_symbol_provider: Some(OneOf::Left(true)), |
51 | workspace_symbol_provider: Some(true), | 51 | workspace_symbol_provider: Some(OneOf::Left(true)), |
52 | code_action_provider: Some(code_action_provider), | 52 | code_action_provider: Some(code_action_provider), |
53 | code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }), | 53 | code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }), |
54 | document_formatting_provider: Some(OneOf::Left(true)), | 54 | document_formatting_provider: Some(OneOf::Left(true)), |
@@ -113,6 +113,7 @@ fn code_action_capabilities(client_caps: &ClientCapabilities) -> CodeActionProvi | |||
113 | CodeActionKind::REFACTOR_INLINE, | 113 | CodeActionKind::REFACTOR_INLINE, |
114 | CodeActionKind::REFACTOR_REWRITE, | 114 | CodeActionKind::REFACTOR_REWRITE, |
115 | ]), | 115 | ]), |
116 | resolve_provider: None, | ||
116 | work_done_progress_options: Default::default(), | 117 | work_done_progress_options: Default::default(), |
117 | }) | 118 | }) |
118 | }) | 119 | }) |
diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index 33606edda..b949577c1 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs | |||
@@ -248,10 +248,12 @@ pub(crate) fn map_rust_diagnostic_to_lsp( | |||
248 | range: in_macro_location.range, | 248 | range: in_macro_location.range, |
249 | severity, | 249 | severity, |
250 | code: code.clone().map(lsp_types::NumberOrString::String), | 250 | code: code.clone().map(lsp_types::NumberOrString::String), |
251 | code_description: None, | ||
251 | source: Some(source.clone()), | 252 | source: Some(source.clone()), |
252 | message: message.clone(), | 253 | message: message.clone(), |
253 | related_information: Some(information_for_additional_diagnostic), | 254 | related_information: Some(information_for_additional_diagnostic), |
254 | tags: if tags.is_empty() { None } else { Some(tags.clone()) }, | 255 | tags: if tags.is_empty() { None } else { Some(tags.clone()) }, |
256 | data: None, | ||
255 | }; | 257 | }; |
256 | 258 | ||
257 | Some(MappedRustDiagnostic { | 259 | Some(MappedRustDiagnostic { |
@@ -267,6 +269,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp( | |||
267 | range: location.range, | 269 | range: location.range, |
268 | severity, | 270 | severity, |
269 | code: code.clone().map(lsp_types::NumberOrString::String), | 271 | code: code.clone().map(lsp_types::NumberOrString::String), |
272 | code_description: None, | ||
270 | source: Some(source.clone()), | 273 | source: Some(source.clone()), |
271 | message, | 274 | message, |
272 | related_information: if related_information.is_empty() { | 275 | related_information: if related_information.is_empty() { |
@@ -275,6 +278,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp( | |||
275 | Some(related_information.clone()) | 278 | Some(related_information.clone()) |
276 | }, | 279 | }, |
277 | tags: if tags.is_empty() { None } else { Some(tags.clone()) }, | 280 | tags: if tags.is_empty() { None } else { Some(tags.clone()) }, |
281 | data: None, | ||
278 | }; | 282 | }; |
279 | 283 | ||
280 | let main_diagnostic = | 284 | let main_diagnostic = |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 2680e5f08..049c583a4 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -1121,10 +1121,12 @@ pub(crate) fn publish_diagnostics( | |||
1121 | range: to_proto::range(&line_index, d.range), | 1121 | range: to_proto::range(&line_index, d.range), |
1122 | severity: Some(to_proto::diagnostic_severity(d.severity)), | 1122 | severity: Some(to_proto::diagnostic_severity(d.severity)), |
1123 | code: None, | 1123 | code: None, |
1124 | code_description: None, | ||
1124 | source: Some("rust-analyzer".to_string()), | 1125 | source: Some("rust-analyzer".to_string()), |
1125 | message: d.message, | 1126 | message: d.message, |
1126 | related_information: None, | 1127 | related_information: None, |
1127 | tags: if d.unused { Some(vec![DiagnosticTag::Unnecessary]) } else { None }, | 1128 | tags: if d.unused { Some(vec![DiagnosticTag::Unnecessary]) } else { None }, |
1129 | data: None, | ||
1128 | }) | 1130 | }) |
1129 | .collect(); | 1131 | .collect(); |
1130 | Ok(diagnostics) | 1132 | Ok(diagnostics) |
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 24a658fc6..92b7c7b68 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -709,7 +709,16 @@ pub(crate) fn call_hierarchy_item( | |||
709 | let detail = target.description.clone(); | 709 | let detail = target.description.clone(); |
710 | let kind = symbol_kind(target.kind); | 710 | let kind = symbol_kind(target.kind); |
711 | let (uri, range, selection_range) = location_info(snap, target)?; | 711 | let (uri, range, selection_range) = location_info(snap, target)?; |
712 | Ok(lsp_types::CallHierarchyItem { name, kind, tags: None, detail, uri, range, selection_range }) | 712 | Ok(lsp_types::CallHierarchyItem { |
713 | name, | ||
714 | kind, | ||
715 | tags: None, | ||
716 | detail, | ||
717 | uri, | ||
718 | range, | ||
719 | selection_range, | ||
720 | data: None, | ||
721 | }) | ||
713 | } | 722 | } |
714 | 723 | ||
715 | pub(crate) fn code_action_kind(kind: AssistKind) -> lsp_types::CodeActionKind { | 724 | pub(crate) fn code_action_kind(kind: AssistKind) -> lsp_types::CodeActionKind { |