debugger: Add locator for Python tasks (#31533)

Closes #ISSUE

Release Notes:

- debugger: Python tests/main functions can now we debugged from the
gutter.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Piotr Osiewicz 2025-05-28 12:27:12 +02:00 committed by GitHub
parent 15d59fcda9
commit c0a5ace8b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 3 deletions

View file

@ -101,7 +101,9 @@ impl DapStore {
pub fn init(client: &AnyProtoClient, cx: &mut App) {
static ADD_LOCATORS: Once = Once::new();
ADD_LOCATORS.call_once(|| {
DapRegistry::global(cx).add_locator(Arc::new(locators::cargo::CargoLocator {}))
let registry = DapRegistry::global(cx);
registry.add_locator(Arc::new(locators::cargo::CargoLocator {}));
registry.add_locator(Arc::new(locators::python::PythonLocator));
});
client.add_entity_request_handler(Self::handle_run_debug_locator);
client.add_entity_request_handler(Self::handle_get_debug_adapter_binary);
@ -412,7 +414,6 @@ impl DapStore {
this.get_debug_adapter_binary(definition.clone(), session_id, console, cx)
})?
.await?;
session
.update(cx, |session, cx| {
session.boot(binary, worktree, dap_store, cx)