zed-industries/zed · error · anyhow::Error

`dap_config_to_scenario` not available prior to v0.6.0

Error message

`dap_config_to_scenario` not available prior to v0.6.0

What it means

call_dap_config_to_scenario converts a Zed debug config into a DebugScenario inside the extension, an export available only from WIT v0.6.0. Extensions on v0.0.1 through v0.5.0 reach the bail arm of this dispatch.

Source

Thrown at crates/extension_host/src/wasm_host/wit.rs:1175

            Extension::V0_6_0(ext) => {
                let config: latest::DebugConfig = config.into();
                let dap_binary = ext
                    .call_dap_config_to_scenario(store, &config.into())
                    .await?
                    .map_err(|e| anyhow!("{e:?}"))?;

                let dap_binary: latest::DebugScenario = dap_binary.into();
                Ok(Ok(dap_binary.try_into()?))
            }
            Extension::V0_5_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_1_0(_)
            | Extension::V0_0_6(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_1(_) => {
                anyhow::bail!("`dap_config_to_scenario` not available prior to v0.6.0");
            }
        }
    }

    pub async fn call_dap_locator_create_scenario(
        &self,
        store: &mut Store<WasmState>,
        locator_name: String,
        build_config_template: TaskTemplate,
        resolved_label: String,
        debug_adapter_name: String,
    ) -> Result<Option<DebugScenario>> {
        match self {
            Extension::V0_8_0(ext) => {
                let build_config_template = build_config_template.into();
                let dap_binary = ext
                    .call_dap_locator_create_scenario(
                        store,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Raise zed_extension_api to >= 0.6.0, rebuild, and republish/reinstall the extension.
  2. Use the adapter's latest published release.
  3. As a stopgap, define the debug scenario manually in the user's Zed settings.

Example fix

# before (extension Cargo.toml)
[dependencies]
zed_extension_api = "0.4.0"

# after
[dependencies]
zed_extension_api = "0.6.0"
Defensive patterns

Strategy: validation

Validate before calling

let api_version = extension_host::parse_wasm_extension_version(extension_id, &wasm_bytes)?;
if api_version < semver::Version::new(0, 6, 0) {
    // cannot convert config to scenario in-extension; build the scenario from user settings
    return scenario_from_user_settings(config);
}

Type guard

fn supports_dap_config_to_scenario(ext: &Extension) -> bool {
    !matches!(
        ext,
        Extension::V0_0_1(_)
            | Extension::V0_0_4(_)
            | Extension::V0_0_6(_)
            | Extension::V0_1_0(_)
            | Extension::V0_2_0(_)
            | Extension::V0_3_0(_)
            | Extension::V0_4_0(_)
            | Extension::V0_5_0(_)
    )
}

Prevention

When it happens

Trigger: Zed converts a debug configuration for an adapter provided by an extension built with zed_extension_api < 0.6.0.

Common situations: Debug-adapter extensions predating the v0.6.0 interface; users with auto-updated Zed but manually-managed old extensions.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/7bf0734568a172e4. Report an issue: GitHub.