Skip to content

extension_host: Add DAP methods dispatch for v0.8.0#48777

Merged
MrSubidubi merged 1 commit intozed-industries:mainfrom
Brad-Fullwood:fix/dap-v0_8_0-dispatch
Feb 9, 2026
Merged

extension_host: Add DAP methods dispatch for v0.8.0#48777
MrSubidubi merged 1 commit intozed-industries:mainfrom
Brad-Fullwood:fix/dap-v0_8_0-dispatch

Conversation

@Brad-Fullwood
Copy link
Contributor

Summary

When the v0.8.0 extension API was forked in #44025, the five DAP dispatcher methods in wit.rs were not updated to handle Extension::V0_8_0. Because V0_8_0 is listed before V0_6_0 in the enum, the wildcard _ => catch-all fires first, causing all DAP calls to bail with "not available prior to v0.6.0" for any extension targeting the v0.8.0 API.

The DAP WIT interface is identical between v0.6.0 and v0.8.0, so the handler code is the same — this just adds the missing match arms for:

  • call_get_dap_binary
  • call_dap_request_kind
  • call_dap_config_to_scenario
  • call_dap_locator_create_scenario
  • call_run_dap_locator

This follows the same pattern used by every other method in the Extension impl block, which already handles both V0_8_0 and V0_6_0.

Test plan

  • Verified that an extension targeting zed_extension_api v0.8.0 with DAP support can successfully start a debug session (previously failed with "dap_request_kind not available prior to v0.6.0")

Release Notes:

  • Fixed DAP (Debug Adapter Protocol) methods failing for extensions targeting the v0.8.0 extension API.

@cla-bot
Copy link

cla-bot bot commented Feb 9, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @Brad-Fullwood on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 9, 2026
@Brad-Fullwood
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 9, 2026
@cla-bot
Copy link

cla-bot bot commented Feb 9, 2026

The cla-bot has been summoned, and re-checked this pull request!

@Brad-Fullwood Brad-Fullwood marked this pull request as ready for review February 9, 2026 11:32
Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very very nice catch and thank you for opening the PR here.

To prevent this from happening in the future, could you please make the matches exhaustive and remove the wildcard patterns everywhere?

@MrSubidubi MrSubidubi self-assigned this Feb 9, 2026
@MrSubidubi MrSubidubi changed the title extension_host: Add V0_8_0 dispatch for DAP methods extension_host: Add dispatch for DAP methods for v0.8.0 Feb 9, 2026
When the v0.8.0 extension API was forked in #44025, the five DAP
dispatcher methods in `wit.rs` were not updated to handle
`Extension::V0_8_0`. Because `V0_8_0` is listed before `V0_6_0` in
the enum, the wildcard `_ =>` catch-all fires first, causing all DAP
calls to bail with "not available prior to v0.6.0" for any extension
targeting the v0.8.0 API.

The DAP WIT interface is identical between v0.6.0 and v0.8.0, so the
handler code is the same — this adds the missing match arms and
replaces the wildcard patterns with exhaustive matches to prevent
this from happening again when future API versions are added.

Affected methods:
- `call_get_dap_binary`
- `call_dap_request_kind`
- `call_dap_config_to_scenario`
- `call_dap_locator_create_scenario`
- `call_run_dap_locator`

Release Notes:

- Fixed DAP (Debug Adapter Protocol) methods failing for extensions
  targeting the v0.8.0 extension API.
@Brad-Fullwood Brad-Fullwood force-pushed the fix/dap-v0_8_0-dispatch branch from e64936d to 5d0b907 Compare February 9, 2026 11:40
@Brad-Fullwood
Copy link
Contributor Author

Very very nice catch and thank you for opening the PR here.

To prevent this from happening in the future, could you please make the matches exhaustive and remove the wildcard patterns everywhere?

Hiya @MrSubidubi , no problem at all.
Updated, built and tested with the requested change.

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the quick follow-up!

Thank you so much for this PR and congratulations to such an awesome first contribution! 🎉

| Extension::V0_0_6(_)
| Extension::V0_0_4(_)
| Extension::V0_0_1(_) => {
anyhow::bail!("`run_dap_locator` not available prior to v0.6.0");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice additional catch 🙂

@MrSubidubi MrSubidubi enabled auto-merge (squash) February 9, 2026 11:45
@MrSubidubi MrSubidubi changed the title extension_host: Add dispatch for DAP methods for v0.8.0 extension_host: Add DAP methods dispatch for v0.8.0 Feb 9, 2026
@MrSubidubi MrSubidubi disabled auto-merge February 9, 2026 11:45
@MrSubidubi MrSubidubi enabled auto-merge (squash) February 9, 2026 11:45
@MrSubidubi MrSubidubi merged commit 44364eb into zed-industries:main Feb 9, 2026
28 checks passed
melocene pushed a commit to melocene/zed that referenced this pull request Feb 16, 2026
…8777)

## Summary

When the v0.8.0 extension API was forked in zed-industries#44025, the five DAP
dispatcher methods in `wit.rs` were not updated to handle
`Extension::V0_8_0`. Because `V0_8_0` is listed before `V0_6_0` in the
enum, the wildcard `_ =>` catch-all fires first, causing all DAP calls
to bail with `"not available prior to v0.6.0"` for any extension
targeting the v0.8.0 API.

The DAP WIT interface is identical between v0.6.0 and v0.8.0, so the
handler code is the same — this just adds the missing match arms for:

- `call_get_dap_binary`
- `call_dap_request_kind`
- `call_dap_config_to_scenario`
- `call_dap_locator_create_scenario`
- `call_run_dap_locator`

This follows the same pattern used by every other method in the
`Extension` impl block, which already handles both `V0_8_0` and
`V0_6_0`.

## Test plan

- Verified that an extension targeting `zed_extension_api` v0.8.0 with
DAP support can successfully start a debug session (previously failed
with `"dap_request_kind not available prior to v0.6.0"`)

Release Notes:

- Fixed DAP (Debug Adapter Protocol) methods failing for extensions
targeting the v0.8.0 extension API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants