extension: Add debug_adapters to extension manifest (#30676)

Also pass worktree to the get_dap_binary.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-05-20 11:01:33 +02:00 committed by GitHub
parent b1c7fa1dac
commit a092e2dc03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 147 additions and 59 deletions

View file

@ -32,15 +32,17 @@ pub enum DapStatus {
Failed { error: String },
}
#[async_trait(?Send)]
pub trait DapDelegate {
#[async_trait]
pub trait DapDelegate: Send + Sync + 'static {
fn worktree_id(&self) -> WorktreeId;
fn worktree_root_path(&self) -> &Path;
fn http_client(&self) -> Arc<dyn HttpClient>;
fn node_runtime(&self) -> NodeRuntime;
fn toolchain_store(&self) -> Arc<dyn LanguageToolchainStore>;
fn fs(&self) -> Arc<dyn Fs>;
fn output_to_console(&self, msg: String);
fn which(&self, command: &OsStr) -> Option<PathBuf>;
async fn which(&self, command: &OsStr) -> Option<PathBuf>;
async fn read_text_file(&self, path: PathBuf) -> Result<String>;
async fn shell_env(&self) -> collections::HashMap<String, String>;
}
@ -413,7 +415,7 @@ pub trait DebugAdapter: 'static + Send + Sync {
async fn get_binary(
&self,
delegate: &dyn DapDelegate,
delegate: &Arc<dyn DapDelegate>,
config: &DebugTaskDefinition,
user_installed_path: Option<PathBuf>,
cx: &mut AsyncApp,
@ -472,7 +474,7 @@ impl DebugAdapter for FakeAdapter {
async fn get_binary(
&self,
_: &dyn DapDelegate,
_: &Arc<dyn DapDelegate>,
config: &DebugTaskDefinition,
_: Option<PathBuf>,
_: &mut AsyncApp,