Clear Copilot suggestions when it gets disabled from the settings

This commit is contained in:
Antonio Scandurra 2023-04-04 10:45:56 +02:00
parent abf158a9e4
commit 79d5bb45dc
5 changed files with 26 additions and 35 deletions

View file

@ -176,13 +176,6 @@ impl Entity for Copilot {
}
impl Copilot {
pub fn starting_task(&self) -> Option<Shared<Task<()>>> {
match self.server {
CopilotServer::Starting { ref task } => Some(task.clone()),
_ => None,
}
}
pub fn global(cx: &AppContext) -> Option<ModelHandle<Self>> {
if cx.has_global::<ModelHandle<Self>>() {
Some(cx.global::<ModelHandle<Self>>().clone())