From cc650c7f4f7e63d9417ceb3a0f302a575297dd98 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sat, 14 Aug 2021 11:01:23 +0300 Subject: [PATCH] types: capitalize ID in names Part of LLDB integration --- helix-dap/src/client.rs | 50 +++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index a12238ae7..a2b8a4e30 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -35,21 +35,23 @@ pub struct DebuggerCapabilities { #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] struct InitializeArguments { - client_id: String, - client_name: String, + #[serde(rename = "clientID")] + client_id: Option, + client_name: Option, + #[serde(rename = "adapterID")] adapter_id: String, - locale: String, + locale: Option, #[serde(rename = "linesStartAt1")] - lines_start_at_one: bool, + lines_start_at_one: Option, #[serde(rename = "columnsStartAt1")] - columns_start_at_one: bool, - path_format: String, - supports_variable_type: bool, - supports_variable_paging: bool, - supports_run_in_terminal_request: bool, - supports_memory_references: bool, - supports_progress_reporting: bool, - supports_invalidated_event: bool, + columns_start_at_one: Option, + path_format: Option, + supports_variable_type: Option, + supports_variable_paging: Option, + supports_run_in_terminal_request: Option, + supports_memory_references: Option, + supports_progress_reporting: Option, + supports_invalidated_event: Option, } #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] @@ -415,19 +417,19 @@ impl Client { pub async fn initialize(&mut self, adapter_id: String) -> Result<()> { let args = InitializeArguments { - client_id: "hx".to_owned(), - client_name: "helix".to_owned(), + client_id: Some("hx".to_owned()), + client_name: Some("helix".to_owned()), adapter_id, - locale: "en-us".to_owned(), - lines_start_at_one: true, - columns_start_at_one: true, - path_format: "path".to_owned(), - supports_variable_type: false, - supports_variable_paging: false, - supports_run_in_terminal_request: false, - supports_memory_references: false, - supports_progress_reporting: true, - supports_invalidated_event: true, + locale: Some("en-us".to_owned()), + lines_start_at_one: Some(true), + columns_start_at_one: Some(true), + path_format: Some("path".to_owned()), + supports_variable_type: Some(false), + supports_variable_paging: Some(false), + supports_run_in_terminal_request: Some(false), + supports_memory_references: Some(false), + supports_progress_reporting: Some(true), + supports_invalidated_event: Some(true), }; let response = self