extension_host: Add DAP methods dispatch for v0.8.0#48777
extension_host: Add DAP methods dispatch for v0.8.0#48777MrSubidubi merged 1 commit intozed-industries:mainfrom
Conversation
|
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'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
MrSubidubi
left a comment
There was a problem hiding this comment.
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?
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.
e64936d to
5d0b907
Compare
Hiya @MrSubidubi , no problem at all. |
MrSubidubi
left a comment
There was a problem hiding this comment.
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"); |
…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.
Summary
When the v0.8.0 extension API was forked in #44025, the five DAP dispatcher methods in
wit.rswere not updated to handleExtension::V0_8_0. BecauseV0_8_0is listed beforeV0_6_0in 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_binarycall_dap_request_kindcall_dap_config_to_scenariocall_dap_locator_create_scenariocall_run_dap_locatorThis follows the same pattern used by every other method in the
Extensionimpl block, which already handles bothV0_8_0andV0_6_0.Test plan
zed_extension_apiv0.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: