dap.wit

 1interface dap {
 2    use common.{env-vars};
 3
 4    /// Resolves a specified TcpArgumentsTemplate into TcpArguments
 5    resolve-tcp-template: func(template: tcp-arguments-template) -> result<tcp-arguments, string>;
 6
 7    record launch-request {
 8        program: string,
 9        cwd: option<string>,
10        args: list<string>,
11        envs: env-vars,
12    }
13
14    record attach-request {
15        process-id: option<u32>,
16    }
17
18    variant debug-request {
19        launch(launch-request),
20        attach(attach-request)
21    }
22
23    record tcp-arguments {
24        port: u16,
25        host: u32,
26        timeout: option<u64>,
27    }
28
29    record tcp-arguments-template {
30        port: option<u16>,
31        host: option<u32>,
32        timeout: option<u64>,
33    }
34
35    record debug-task-definition {
36        label: string,
37        adapter: string,
38        request: debug-request,
39        initialize-args: option<string>,
40        stop-on-entry: option<bool>,
41        tcp-connection: option<tcp-arguments-template>,
42    }
43
44    enum start-debugging-request-arguments-request {
45        launch,
46        attach,
47    }
48
49    record start-debugging-request-arguments {
50        configuration: string,
51        request: start-debugging-request-arguments-request,
52    }
53
54    record debug-adapter-binary {
55        command: string,
56        arguments: list<string>,
57        envs: env-vars,
58        cwd: option<string>,
59        connection: option<tcp-arguments>,
60        request-args: start-debugging-request-arguments
61    }
62}