google / go-dap

Go implementation of the Debug Adapter Protocol
Apache License 2.0
126 stars 25 forks source link

Protocol Server via stdio? #59

Open pcj opened 3 years ago

pcj commented 3 years ago

It appears straightforward to use this as a vscode.DebugAdapterServer (e.g localhost:4711), but also looking to use this for a vscode.DebugAdapterExecutable that uses stdin/stdout for the protocol communication. Is is supported? Example?

polinasok commented 3 years ago

This repo offers a way decode DAP-encoded bytes into Go types and back. The io library operates on bufio.Reader and io.Writer interface, which don't specify where the bytes are coming from (network connection, stdin/out, etc). Unfortunately, we currently only have a server connection example, but we would welcome a PR with a stdin/stdout example. For example, you could use bufio.NewReader(os.Stdin).