@@ -23,7 +23,7 @@ use language::{
23
23
use lsp:: { LanguageServer , LanguageServerBinary , LanguageServerId , LanguageServerName } ;
24
24
use node_runtime:: NodeRuntime ;
25
25
use parking_lot:: Mutex ;
26
- use request:: StatusNotification ;
26
+ use request:: { DidChangeStatus , WindowShowMessageRequest } ;
27
27
use settings:: SettingsStore ;
28
28
use sign_in:: { reinstall_and_sign_in_within_workspace, sign_out_within_workspace} ;
29
29
use std:: {
@@ -500,7 +500,41 @@ impl Copilot {
500
500
) ?;
501
501
502
502
server
503
- . on_notification :: < StatusNotification , _ > ( |_, _| { /* Silence the notification */ } )
503
+ . on_notification :: < DidChangeStatus , _ > ( {
504
+ let this = this. clone ( ) ;
505
+ move |params, cx| {
506
+ // Convert didChangeStatus to appropriate SignInStatus and update
507
+ let sign_in_status = match params. kind . as_str ( ) {
508
+ "Error" => Some ( request:: SignInStatus :: NotAuthorized {
509
+ user : String :: new ( ) ,
510
+ } ) ,
511
+ "Normal" => Some ( request:: SignInStatus :: AlreadySignedIn {
512
+ user : String :: new ( ) ,
513
+ } ) ,
514
+ "Inactive" | "Warning" => None , // Don't change auth status for these
515
+ _ => None ,
516
+ } ;
517
+
518
+ if let Some ( status) = sign_in_status {
519
+ this. update ( cx, |this, cx| {
520
+ this. update_sign_in_status ( status, cx) ;
521
+ } )
522
+ . ok ( ) ;
523
+ }
524
+ }
525
+ } )
526
+ . detach ( ) ;
527
+
528
+ server
529
+ . on_notification :: < WindowShowMessageRequest , _ > ( {
530
+ let this = this. clone ( ) ;
531
+ move |params, cx| {
532
+ // TODO: Display the message in Zed's UI
533
+
534
+ // Log the message
535
+ log:: info!( "Copilot {}: {}" , params. type_. as_str( ) , params. message) ;
536
+ }
537
+ } )
504
538
. detach ( ) ;
505
539
506
540
let configuration = lsp:: DidChangeConfigurationParams {
0 commit comments