Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Rearrange the state machine

Mikayla Maki89af803565bf
diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs
index e51cad8e509..f5aa0f94307 100644
--- a/crates/copilot/src/copilot.rs
+++ b/crates/copilot/src/copilot.rs
@@ -461,14 +461,12 @@ impl Copilot {
pub fn sign_in(&mut self, cx: &mut ModelContext<Self>) -> Task<Result<()>> {
if let CopilotServer::Running(server) = &mut self.server {
let task = match &server.sign_in_status {
- SignInStatus::Authorized { .. } | SignInStatus::Unauthorized { .. } => {
- Task::ready(Ok(())).shared()
- }
+ SignInStatus::Authorized { .. } => Task::ready(Ok(())).shared(),
SignInStatus::SigningIn { task, .. } => {
cx.notify();
task.clone()
}
- SignInStatus::SignedOut => {
+ SignInStatus::SignedOut | SignInStatus::Unauthorized { .. } => {
let lsp = server.lsp.clone();
let task = cx
.spawn(|this, mut cx| async move {