diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs index fed19c7791..8896aa5ea2 100644 --- a/crates/copilot/src/copilot.rs +++ b/crates/copilot/src/copilot.rs @@ -654,6 +654,10 @@ impl Copilot { anyhow::Ok(()) }) } + CopilotServer::Disabled => cx.background_spawn(async { + clear_copilot_config_dir().await; + anyhow::Ok(()) + }), _ => Task::ready(Err(anyhow!("copilot hasn't started yet"))), } } @@ -1047,6 +1051,10 @@ async fn clear_copilot_dir() { remove_matching(paths::copilot_dir(), |_| true).await } +async fn clear_copilot_config_dir() { + remove_matching(copilot_chat::copilot_chat_config_dir(), |_| true).await +} + async fn get_copilot_lsp(http: Arc) -> anyhow::Result { const SERVER_PATH: &str = "dist/language-server.js";