diff options
author | Dmitry Sharshakov | 2021-08-13 17:24:27 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-20 04:43:54 +0000 |
commit | 6bb653f820998a9a33db3dabf815a761b1c97bfa (patch) | |
tree | 6aa79c649558ff9b019b9a84c9b32adaa6da343b /helix-dap/examples | |
parent | 3d64cf8356044fb272fd0a93e8235f967b9da156 (diff) |
dap: move launch request argumets outside of client
Diffstat (limited to 'helix-dap/examples')
-rw-r--r-- | helix-dap/examples/dap-basic.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/helix-dap/examples/dap-basic.rs b/helix-dap/examples/dap-basic.rs index 2e4ff2b1..35664458 100644 --- a/helix-dap/examples/dap-basic.rs +++ b/helix-dap/examples/dap-basic.rs @@ -1,4 +1,12 @@ use helix_dap::{Client, Result, SourceBreakpoint}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +struct LaunchArguments { + mode: String, + program: String, +} #[tokio::main] pub async fn main() -> Result<()> { @@ -19,9 +27,15 @@ pub async fn main() -> Result<()> { println!("init: {:?}", client.initialize("go".to_owned()).await); println!("caps: {:#?}", client.capabilities()); + + let args = LaunchArguments { + mode: "exec".to_owned(), + program: "/tmp/godebug/main".to_owned(), + }; + println!( "launch: {:?}", - client.launch("/tmp/godebug/main".to_owned()).await + client.launch(serde_json::to_value(args)?).await ); println!( |