forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial debug adapter protocol implementation
- Loading branch information
Showing
7 changed files
with
739 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "helix-dap" | ||
version = "0.3.0" | ||
authors = ["Blaž Hrastnik <blaz@mxxn.io>"] | ||
edition = "2018" | ||
license = "MPL-2.0" | ||
description = "DAP client implementation for Helix project" | ||
categories = ["editor"] | ||
repository = "https://github.com/helix-editor/helix" | ||
homepage = "https://helix-editor.com" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
log = "0.4" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = "1.0" | ||
thiserror = "1.0" | ||
tokio = { version = "1.9", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use helix_dap::{Client, Result, SourceBreakpoint}; | ||
|
||
#[tokio::main] | ||
pub async fn main() -> Result<()> { | ||
let mut client = Client::start("nc", vec!["127.0.0.1", "7777"], 0)?; | ||
|
||
println!("init: {:?}", client.initialize().await); | ||
println!("caps: {:?}", client.capabilities()); | ||
println!( | ||
"launch: {:?}", | ||
client.launch("/tmp/godebug/main".to_owned()).await | ||
); | ||
|
||
println!( | ||
"breakpoints: {:?}", | ||
client | ||
.set_breakpoints( | ||
"/tmp/godebug/main.go".to_owned(), | ||
vec![SourceBreakpoint { | ||
line: 6, | ||
column: Some(2), | ||
}] | ||
) | ||
.await | ||
); | ||
|
||
let mut _in = String::new(); | ||
std::io::stdin() | ||
.read_line(&mut _in) | ||
.expect("Failed to read line"); | ||
|
||
println!("configurationDone: {:?}", client.configuration_done().await); | ||
println!("stopped: {:?}", client.wait_for_stopped().await); | ||
println!("stack trace: {:?}", client.stack_trace(1).await); | ||
|
||
let mut _in = String::new(); | ||
std::io::stdin() | ||
.read_line(&mut _in) | ||
.expect("Failed to read line"); | ||
|
||
println!("continued: {:?}", client.continue_thread(0).await); | ||
|
||
let mut _in = String::new(); | ||
std::io::stdin() | ||
.read_line(&mut _in) | ||
.expect("Failed to read line"); | ||
|
||
println!("disconnect: {:?}", client.disconnect().await); | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.