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

`dap_locator_create_scenario` not available prior to v0.6.0

Error message

`dap_locator_create_scenario` not available prior to v0.6.0

What it means

call_dap_locator_create_scenario lets a debug locator extension turn a resolved build task into a DebugScenario; the export exists only from WIT v0.6.0. Dispatching against an extension on v0.0.1 through v0.5.0 bails.

Source

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

                        &build_config_template.into(),
                        &resolved_label,
                        &debug_adapter_name,
                    )
                    .await?;

                Ok(dap_binary
                    .map(|s| latest::DebugScenario::from(s).try_into())
                    .transpose()?)
            }
            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_locator_create_scenario` not available prior to v0.6.0");
            }
        }
    }

    pub async fn call_run_dap_locator(
        &self,
        store: &mut Store<WasmState>,
        locator_name: String,
        resolved_build_task: SpawnInTerminal,
    ) -> Result<Result<DebugRequest, String>> {
        match self {
            Extension::V0_8_0(ext) => {
                let build_config_template = resolved_build_task.try_into()?;
                let dap_request = ext
                    .call_run_dap_locator(store, &locator_name, &build_config_template)
                    .await?
                    .map_err(|e| anyhow!("{e:?}"))?;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Bump zed_extension_api to >= 0.6.0 in the extension, rebuild, and reinstall/republish.
  2. Update the installed locator extension to its newest version.
  3. Remove the [debug_locators] manifest entry if the extension cannot be rebuilt yet, so the host stops dispatching it.

Example fix

# before (extension Cargo.toml)
[dependencies]
zed_extension_api = "0.5.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) {
    // locator unsupported; do not surface the entry point
    return Ok(None);
}

Type guard

fn supports_dap_locator_create_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: A debug-locator entry point is invoked on an extension compiled with zed_extension_api < 0.6.0 (declared via [debug_locators] in its manifest).

Common situations: Build-task-to-debug-session flows (e.g. 'debug this build task') with an outdated locator extension; extension templates pinned to old API versions.

Related errors


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