From 7f0ee3f1f4536391f0902949e31caedf08cb5fe5 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Sat, 5 Jul 2025 17:58:03 -0400 Subject: [PATCH] go --- crates/dap_adapters/schemas/Delve.json | 398 ++++++++++++++++++++++ crates/dap_adapters/src/dap_adapters.rs | 2 +- crates/dap_adapters/src/go.rs | 317 ++++------------- crates/dap_adapters/src/update_schemas.rs | 11 +- 4 files changed, 472 insertions(+), 256 deletions(-) create mode 100644 crates/dap_adapters/schemas/Delve.json diff --git a/crates/dap_adapters/schemas/Delve.json b/crates/dap_adapters/schemas/Delve.json new file mode 100644 index 0000000000000000000000000000000000000000..5606c73d07e9fdc5b4d1b5d3be88488dba153da5 --- /dev/null +++ b/crates/dap_adapters/schemas/Delve.json @@ -0,0 +1,398 @@ +{ + "allOf": [ + { + "if": { "properties": { "request": { "const": "launch" } }, "required": ["request"] }, + "then": { + "required": [], + "properties": { + "debugAdapter": { + "enum": ["legacy", "dlv-dap"], + "description": "Select which debug adapter to use with this launch configuration.", + "default": "dlv-dap" + }, + "program": { + "type": "string", + "description": "Path to the program folder (or any go file within that folder) when in `debug` or `test` mode, and to the pre-built binary file to debug in `exec` mode. If it is not an absolute path, the extension interprets it as a workspace relative path.", + "default": "${ZED_WORKTREE_ROOT}" + }, + "mode": { + "enum": ["auto", "debug", "test", "exec", "replay", "core"], + "description": "One of `auto`, `debug`, `test`, `exec`, `replay`, `core`. In `auto` mode, the extension will choose either `debug` or `test` depending on active editor window.", + "default": "auto" + }, + "traceDirPath": { + "type": "string", + "description": "Directory in which the record trace is located or to be created for a new output trace. For use on 'replay' mode only", + "default": "" + }, + "coreFilePath": { + "type": "string", + "description": "Path to the core dump file to open. For use on 'core' mode only", + "default": "" + }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically stop program after launch.", + "default": false + }, + "args": { + "type": ["array", "string"], + "description": "Command line arguments passed to the debugged program.", + "items": { "type": "string" }, + "default": [] + }, + "showLog": { + "type": "boolean", + "description": "Show log output from the delve debugger. Maps to dlv's `--log` flag.", + "default": false + }, + "cwd": { + "type": "string", + "description": "Workspace relative or absolute path to the working directory of the program being debugged if a non-empty value is specified. The `program` folder is used as the working directory if `cwd` is omitted or empty.", + "default": "" + }, + "env": { + "type": "object", + "description": "Environment variables passed to the launched debuggee program. Format as string key:value pairs. Merged with `envFile` and `go.toolsEnvVars` with precedence `env` > `envFile` > `go.toolsEnvVars`.", + "default": {} + }, + "substitutePath": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "The absolute local path to be replaced when passing paths to the debugger.", + "default": "" + }, + "to": { + "type": "string", + "description": "The absolute remote path to be replaced when passing paths back to the client.", + "default": "" + } + } + }, + "description": "An array of mappings from a local path (editor) to the remote path (debugee). This setting is useful when working in a file system with symbolic links, running remote debugging, or debugging an executable compiled externally. The debug adapter will replace the local path with the remote path in all of the calls.", + "default": [] + }, + "buildFlags": { + "type": ["string", "array"], + "items": { "type": "string" }, + "description": "Build flags, to be passed to the Go compiler. Maps to dlv's `--build-flags` flag.", + "default": [] + }, + "dlvFlags": { + "type": "array", + "description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.", + "items": { "type": "string" }, + "default": [] + }, + "port": { + "type": "number", + "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=:\" server started externally. In dlv-dap mode this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=:\" to ask it to launch/attach to the target process.", + "default": 2345 + }, + "host": { + "type": "string", + "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=:\" server started externally. In dlv-dap mode this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=:\" to ask it to launch/attach to the target process.", + "default": "127.0.0.1" + }, + "trace": { + "type": "string", + "enum": ["verbose", "trace", "log", "info", "warn", "error"], + "default": "error", + "description": "Various levels of logging shown in the debug console & 'Go Debug' output channel. When using the `legacy` debug adapter, the logs will also be written to a file if it is set to a value other than `error`." + }, + "envFile": { + "type": ["string", "array"], + "items": { "type": "string" }, + "description": "Absolute path to a file containing environment variable definitions, formatted as string key=value pairs. Multiple files can be specified by provided an array of absolute paths. Merged with `env` and `go.toolsEnvVars` with precedence `env` > `envFile` > `go.toolsEnvVars`. ", + "default": "" + }, + "backend": { + "type": "string", + "enum": ["default", "native", "lldb", "rr"], + "description": "Backend used by delve. Maps to `dlv`'s `--backend` flag." + }, + "output": { + "type": "string", + "description": "Output path for the binary of the debugee.", + "default": "debug" + }, + "logOutput": { + "type": "string", + "enum": ["debugger", "gdbwire", "lldbout", "debuglineerr", "rpc", "dap"], + "description": "Comma separated list of components that should produce debug output. Maps to dlv's `--log-output` flag. Check `dlv log` for details.", + "default": "debugger" + }, + "logDest": { + "type": "string", + "description": "dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode, and on Linux and Mac OS." + }, + "dlvLoadConfig": { + "type": "object", + "properties": { + "followPointers": { + "type": "boolean", + "description": "FollowPointers requests pointers to be automatically dereferenced.", + "default": true + }, + "maxVariableRecurse": { + "type": "number", + "description": "MaxVariableRecurse is how far to recurse when evaluating nested types.", + "default": 1 + }, + "maxStringLen": { + "type": "number", + "description": "MaxStringLen is the maximum number of bytes read from a string.", + "default": 64 + }, + "maxArrayValues": { + "type": "number", + "description": "MaxArrayValues is the maximum number of elements read from an array, a slice or a map.", + "default": 64 + }, + "maxStructFields": { + "type": "number", + "description": "MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields.", + "default": -1 + } + }, + "description": "LoadConfig describes to delve, how to load values from target's memory. Not applicable when using `dlv-dap` mode.", + "default": { + "followPointers": true, + "maxVariableRecurse": 1, + "maxStringLen": 64, + "maxArrayValues": 64, + "maxStructFields": -1 + } + }, + "apiVersion": { + "type": "number", + "enum": [1, 2], + "description": "Delve Api Version to use. Default value is 2. Maps to dlv's `--api-version` flag. Not applicable when using `dlv-dap` mode.", + "default": 2 + }, + "stackTraceDepth": { + "type": "number", + "description": "Maximum depth of stack trace collected from Delve.", + "default": 50 + }, + "showGlobalVariables": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not." + }, + "showRegisters": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether register variables should be shown in the variables pane or not." + }, + "hideSystemGoroutines": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether system goroutines should be hidden from call stack view." + }, + "console": { + "default": "internalConsole", + "description": "(Experimental) Where to launch the debugger and the debug target: internal console, integrated terminal, or external terminal. It is ignored in remote debugging.", + "enum": ["internalConsole", "integratedTerminal", "externalTerminal"] + }, + "asRoot": { + "default": false, + "description": "(Experimental) Debug with elevated permissions (on Unix). It requires `integrated` or `external` console modes and is ignored in remote debugging.", + "type": "boolean" + } + } + } + }, + { + "if": { "properties": { "request": { "const": "attach" } }, "required": ["request"] }, + "then": { + "required": [], + "properties": { + "debugAdapter": { + "enum": ["legacy", "dlv-dap"], + "description": "Select which debug adapter to use with this launch configuration.", + "default": "dlv-dap" + }, + "processId": { + "anyOf": [ + { + "enum": ["${command:pickProcess}", "${command:pickGoProcess}"], + "description": "Use process picker to select a process to attach, or Process ID as integer." + }, + { + "type": "string", + "description": "Attach to a process by name. If more than one process matches the name, use the process picker to select a process." + }, + { + "type": "number", + "description": "The numeric ID of the process to be debugged. If 0, use the process picker to select a process." + } + ], + "default": 0 + }, + "mode": { + "enum": ["local", "remote"], + "description": "Indicates local or remote debugging. Local is similar to the `dlv attach` command, remote - to `dlv connect`", + "default": "local" + }, + "stopOnEntry": { + "type": "boolean", + "description": "Automatically stop program after attach.", + "default": false + }, + "dlvFlags": { + "type": "array", + "description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.", + "items": { "type": "string" }, + "default": [] + }, + "showLog": { + "type": "boolean", + "description": "Show log output from the delve debugger. Maps to dlv's `--log` flag.", + "default": false + }, + "cwd": { + "type": "string", + "description": "Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.", + "default": "${ZED_WORKTREE_ROOT}" + }, + "remotePath": { + "type": "string", + "description": "The path to the source code on the remote machine, when the remote path is different from the local machine. If specified, becomes the first entry in substitutePath. Not supported with `dlv-dap`.", + "markdownDeprecationMessage": "Use `substitutePath` instead.", + "default": "" + }, + "port": { + "type": "number", + "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=:\" server started externally. In dlv-dap mode, this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=:\" to ask it to launch/attach to the target process.", + "default": 2345 + }, + "host": { + "type": "string", + "description": "When applied to remote-attach configurations, will look for \"dlv ... --headless --listen=:\" server started externally. In dlv-dap mode, this will apply to all other configurations as well. The extension will try to connect to an external server started with \"dlv dap --listen=:\" to ask it to launch/attach to the target process.", + "default": "127.0.0.1" + }, + "substitutePath": { + "type": "array", + "items": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "The absolute local path to be replaced when passing paths to the debugger.", + "default": "" + }, + "to": { + "type": "string", + "description": "The absolute remote path to be replaced when passing paths back to the client.", + "default": "" + } + } + }, + "description": "An array of mappings from a local path (editor) to the remote path (debugee). This setting is useful when working in a file system with symbolic links, running remote debugging, or debugging an executable compiled externally. The debug adapter will replace the local path with the remote path in all of the calls. Overridden by `remotePath`.", + "default": [] + }, + "trace": { + "type": "string", + "enum": ["verbose", "trace", "log", "info", "warn", "error"], + "default": "error", + "description": "Various levels of logging shown in the debug console & 'Go Debug' output channel. When using the `legacy` debug adapter, the logs will also be written to a file if it is set to a value other than `error`." + }, + "backend": { + "type": "string", + "enum": ["default", "native", "lldb", "rr"], + "description": "Backend used by delve. Maps to `dlv`'s `--backend` flag." + }, + "logOutput": { + "type": "string", + "enum": ["debugger", "gdbwire", "lldbout", "debuglineerr", "rpc", "dap"], + "description": "Comma separated list of components that should produce debug output. Maps to dlv's `--log-output` flag. Check `dlv log` for details.", + "default": "debugger" + }, + "logDest": { + "type": "string", + "description": "dlv's `--log-dest` flag. See `dlv log` for details. Number argument is not allowed. Supported only in `dlv-dap` mode and on Linux and Mac OS." + }, + "dlvLoadConfig": { + "type": "object", + "properties": { + "followPointers": { + "type": "boolean", + "description": "FollowPointers requests pointers to be automatically dereferenced", + "default": true + }, + "maxVariableRecurse": { + "type": "number", + "description": "MaxVariableRecurse is how far to recurse when evaluating nested types", + "default": 1 + }, + "maxStringLen": { + "type": "number", + "description": "MaxStringLen is the maximum number of bytes read from a string", + "default": 64 + }, + "maxArrayValues": { + "type": "number", + "description": "MaxArrayValues is the maximum number of elements read from an array, a slice or a map", + "default": 64 + }, + "maxStructFields": { + "type": "number", + "description": "MaxStructFields is the maximum number of fields read from a struct, -1 will read all fields", + "default": -1 + } + }, + "description": "LoadConfig describes to delve, how to load values from target's memory. Not applicable when using `dlv-dap` mode.", + "default": { + "followPointers": true, + "maxVariableRecurse": 1, + "maxStringLen": 64, + "maxArrayValues": 64, + "maxStructFields": -1 + } + }, + "apiVersion": { + "type": "number", + "enum": [1, 2], + "description": "Delve Api Version to use. Default value is 2. Not applicable when using `dlv-dap` mode.", + "default": 2 + }, + "stackTraceDepth": { + "type": "number", + "description": "Maximum depth of stack trace collected from Delve.", + "default": 50 + }, + "showGlobalVariables": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether global package variables should be shown in the variables pane or not." + }, + "showRegisters": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether register variables should be shown in the variables pane or not." + }, + "hideSystemGoroutines": { + "type": "boolean", + "default": false, + "description": "Boolean value to indicate whether system goroutines should be hidden from call stack view." + }, + "console": { + "default": "internalConsole", + "description": "(Experimental) Where to launch the debugger: internal console, integrated terminal, or external terminal. This does not affect tty of the running program. It is ignored in remote debugging.", + "enum": ["internalConsole", "integratedTerminal", "externalTerminal"] + }, + "asRoot": { + "default": false, + "description": "(Experimental) Debug with elevated permissions (on Unix). This requires `integrated` or `external` console modes and is ignored in remote debugging.", + "type": "boolean" + } + } + } + } + ] +} diff --git a/crates/dap_adapters/src/dap_adapters.rs b/crates/dap_adapters/src/dap_adapters.rs index 5a3331212b12314574c0ce647972dda9f759a8da..68d2f7f5f5ad6af732a847f753c467c5132d2849 100644 --- a/crates/dap_adapters/src/dap_adapters.rs +++ b/crates/dap_adapters/src/dap_adapters.rs @@ -21,7 +21,7 @@ use dap::{ }; use fs::Fs as _; use gdb::GdbDebugAdapter; -use go::GoDebugAdapter; +pub use go::GoDebugAdapter; use gpui::{App, BorrowAppContext, http_client::github::GithubRelease}; pub use javascript::JsDebugAdapter; use php::PhpDebugAdapter; diff --git a/crates/dap_adapters/src/go.rs b/crates/dap_adapters/src/go.rs index 6bc6910e2aef0119e2d9e15044a73ad434162e00..877ca3b896ae99e6a3c50735c10fa9caff6125f9 100644 --- a/crates/dap_adapters/src/go.rs +++ b/crates/dap_adapters/src/go.rs @@ -21,7 +21,7 @@ use std::{ ffi::OsStr, path::{Path, PathBuf}, str::FromStr, - sync::OnceLock, + sync::{LazyLock, OnceLock}, }; use crate::*; @@ -32,7 +32,7 @@ pub struct GoDebugAdapter { } impl GoDebugAdapter { - const ADAPTER_NAME: &'static str = "Delve"; + pub const ADAPTER_NAME: &'static str = "Delve"; async fn fetch_latest_adapter_version( delegate: &Arc, ) -> Result { @@ -97,6 +97,63 @@ impl GoDebugAdapter { } } +#[cfg(feature = "update-schemas")] +impl GoDebugAdapter { + pub fn get_schema( + temp_dir: &TempDir, + delegate: UpdateSchemasDapDelegate, + ) -> anyhow::Result { + let (package_json, package_nls_json) = get_vsix_package_json( + temp_dir, + "golang/vscode-go", + |version| { + let version = version + .tag_name + .strip_prefix("v") + .context("parse tag name")?; + Ok(format!("go-{version}.vsix")) + }, + delegate, + )?; + let package_json = parse_package_json(package_json, package_nls_json)?; + + let [debugger] = + <[_; 1]>::try_from(package_json.contributes.debuggers).map_err(|debuggers| { + anyhow::anyhow!("unexpected number of go debuggers: {}", debuggers.len()) + })?; + + let configuration_attributes = debugger.configuration_attributes; + let conjuncts = configuration_attributes + .launch + .map(|schema| ("launch", schema)) + .into_iter() + .chain( + configuration_attributes + .attach + .map(|schema| ("attach", schema)), + ) + .map(|(request, schema)| { + json!({ + "if": { + "properties": { + "request": { + "const": request + } + }, + "required": ["request"] + }, + "then": schema + }) + }) + .collect::>(); + + let schema = json!({ + "allOf": conjuncts + }); + Ok(schema) + } +} + #[async_trait(?Send)] impl DebugAdapter for GoDebugAdapter { fn name(&self) -> DebugAdapterName { @@ -108,259 +165,11 @@ impl DebugAdapter for GoDebugAdapter { } fn dap_schema(&self) -> Cow<'static, serde_json::Value> { - // Create common properties shared between launch and attach - let common_properties = json!({ - "debugAdapter": { - "enum": ["legacy", "dlv-dap"], - "description": "Select which debug adapter to use with this configuration.", - "default": "dlv-dap" - }, - "stopOnEntry": { - "type": "boolean", - "description": "Automatically stop program after launch or attach.", - "default": false - }, - "showLog": { - "type": "boolean", - "description": "Show log output from the delve debugger. Maps to dlv's `--log` flag.", - "default": false - }, - "cwd": { - "type": "string", - "description": "Workspace relative or absolute path to the working directory of the program being debugged.", - "default": "${ZED_WORKTREE_ROOT}" - }, - "dlvFlags": { - "type": "array", - "description": "Extra flags for `dlv`. See `dlv help` for the full list of supported flags.", - "items": { - "type": "string" - }, - "default": [] - }, - "port": { - "type": "number", - "description": "Debug server port. For remote configurations, this is where to connect.", - "default": 2345 - }, - "host": { - "type": "string", - "description": "Debug server host. For remote configurations, this is where to connect.", - "default": "127.0.0.1" - }, - "substitutePath": { - "type": "array", - "items": { - "type": "object", - "properties": { - "from": { - "type": "string", - "description": "The absolute local path to be replaced." - }, - "to": { - "type": "string", - "description": "The absolute remote path to replace with." - } - } - }, - "description": "Mappings from local to remote paths for debugging.", - "default": [] - }, - "trace": { - "type": "string", - "enum": ["verbose", "trace", "log", "info", "warn", "error"], - "default": "error", - "description": "Debug logging level." - }, - "backend": { - "type": "string", - "enum": ["default", "native", "lldb", "rr"], - "description": "Backend used by delve. Maps to `dlv`'s `--backend` flag." - }, - "logOutput": { - "type": "string", - "enum": ["debugger", "gdbwire", "lldbout", "debuglineerr", "rpc", "dap"], - "description": "Components that should produce debug output.", - "default": "debugger" - }, - "logDest": { - "type": "string", - "description": "Log destination for delve." - }, - "stackTraceDepth": { - "type": "number", - "description": "Maximum depth of stack traces.", - "default": 50 - }, - "showGlobalVariables": { - "type": "boolean", - "default": false, - "description": "Show global package variables in variables pane." - }, - "showRegisters": { - "type": "boolean", - "default": false, - "description": "Show register variables in variables pane." - }, - "hideSystemGoroutines": { - "type": "boolean", - "default": false, - "description": "Hide system goroutines from call stack view." - }, - "console": { - "default": "internalConsole", - "description": "Where to launch the debugger.", - "enum": ["internalConsole", "integratedTerminal"] - }, - "asRoot": { - "default": false, - "description": "Debug with elevated permissions (on Unix).", - "type": "boolean" - } - }); - - // Create launch-specific properties - let launch_properties = json!({ - "program": { - "type": "string", - "description": "Path to the program folder or file to debug.", - "default": "${ZED_WORKTREE_ROOT}" - }, - "args": { - "type": ["array", "string"], - "description": "Command line arguments for the program.", - "items": { - "type": "string" - }, - "default": [] - }, - "env": { - "type": "object", - "description": "Environment variables for the debugged program.", - "default": {} - }, - "envFile": { - "type": ["string", "array"], - "items": { - "type": "string" - }, - "description": "Path(s) to files with environment variables.", - "default": "" - }, - "buildFlags": { - "type": ["string", "array"], - "items": { - "type": "string" - }, - "description": "Flags for the Go compiler.", - "default": [] - }, - "output": { - "type": "string", - "description": "Output path for the binary.", - "default": "debug" - }, - "mode": { - "enum": [ "debug", "test", "exec", "replay", "core"], - "description": "Debug mode for launch configuration.", - }, - "traceDirPath": { - "type": "string", - "description": "Directory for record trace (for 'replay' mode).", - "default": "" - }, - "coreFilePath": { - "type": "string", - "description": "Path to core dump file (for 'core' mode).", - "default": "" - } + static SCHEMA: LazyLock = LazyLock::new(|| { + const RAW_SCHEMA: &str = include_str!("../schemas/Delve.json"); + serde_json::from_str(RAW_SCHEMA).unwrap() }); - - // Create attach-specific properties - let attach_properties = json!({ - "processId": { - "anyOf": [ - { - "enum": ["${command:pickProcess}", "${command:pickGoProcess}"], - "description": "Use process picker to select a process." - }, - { - "type": "string", - "description": "Process name to attach to." - }, - { - "type": "number", - "description": "Process ID to attach to." - } - ], - "default": 0 - }, - "mode": { - "enum": ["local", "remote"], - "description": "Local or remote debugging.", - "default": "local" - }, - "remotePath": { - "type": "string", - "description": "Path to source on remote machine.", - "markdownDeprecationMessage": "Use `substitutePath` instead.", - "default": "" - } - }); - - // Create the final schema - Cow::Owned(json!({ - "oneOf": [ - { - "allOf": [ - { - "type": "object", - "required": ["request"], - "properties": { - "request": { - "type": "string", - "enum": ["launch"], - "description": "Request to launch a new process" - } - } - }, - { - "type": "object", - "properties": common_properties - }, - { - "type": "object", - "required": ["program", "mode"], - "properties": launch_properties - } - ] - }, - { - "allOf": [ - { - "type": "object", - "required": ["request"], - "properties": { - "request": { - "type": "string", - "enum": ["attach"], - "description": "Request to attach to an existing process" - } - } - }, - { - "type": "object", - "properties": common_properties - }, - { - "type": "object", - "required": ["mode"], - "properties": attach_properties - } - ] - } - ] - })) + Cow::Borrowed(&*SCHEMA) } async fn config_from_zed_format(&self, zed_scenario: ZedDebugConfig) -> Result { diff --git a/crates/dap_adapters/src/update_schemas.rs b/crates/dap_adapters/src/update_schemas.rs index ea5ff20efcb362906b19cc21ad5e6bb3e373ab07..b59ff359f20e7f5d6882aba8ca2c98c13d76d7a8 100644 --- a/crates/dap_adapters/src/update_schemas.rs +++ b/crates/dap_adapters/src/update_schemas.rs @@ -1,6 +1,6 @@ use std::{path::Path, process::Command}; -use dap_adapters::{JsDebugAdapter, PythonDebugAdapter, UpdateSchemasDapDelegate}; +use dap_adapters::{GoDebugAdapter, JsDebugAdapter, PythonDebugAdapter, UpdateSchemasDapDelegate}; use tempfile::TempDir; fn main() -> anyhow::Result<()> { @@ -15,6 +15,7 @@ fn main() -> anyhow::Result<()> { .with_extension("json"), serde_json::to_string(&schema)?, )?; + let schema = PythonDebugAdapter::get_schema(&temp_dir, delegate.clone())?; std::fs::write( &output_dir @@ -23,6 +24,14 @@ fn main() -> anyhow::Result<()> { serde_json::to_string(&schema)?, )?; + let schema = GoDebugAdapter::get_schema(&temp_dir, delegate.clone())?; + std::fs::write( + &output_dir + .join(GoDebugAdapter::ADAPTER_NAME) + .with_extension("json"), + serde_json::to_string(&schema)?, + )?; + Command::new("npx") .arg("prettier") .arg("--write")