@@ -84,11 +84,15 @@ export function activate(context: ExtensionContext) {
8484 context . subscriptions . push ( client . start ( ) ) ;
8585
8686 client . onReady ( ) . then ( ( ) => {
87- commands . registerCommand ( "apollographql/showStatus" , ( ) => {
88- client . sendNotification ( "apollographql/getStatus" ) ;
87+ commands . registerCommand ( "apollographql/showStats" , ( ) => {
88+ client . sendNotification ( "apollographql/getStats" , {
89+ uri : window . activeTextEditor
90+ ? window . activeTextEditor . document . uri . toString ( )
91+ : null
92+ } ) ;
8993 } ) ;
9094
91- client . onNotification ( "apollographql/statusLoaded " , params => {
95+ client . onNotification ( "apollographql/statsLoaded " , params => {
9296 const timeSince = ( date : number ) => {
9397 const seconds = Math . floor ( ( + new Date ( ) - date ) / 1000 ) ;
9498 let interval = Math . floor ( seconds / 86400 ) ;
@@ -103,6 +107,12 @@ export function activate(context: ExtensionContext) {
103107 return `${ Math . floor ( seconds ) } s` ;
104108 } ;
105109
110+ // we don't support logging of stats for service projects currently
111+ if ( params . type === "service" ) {
112+ client . outputChannel . show ( ) ;
113+ return ;
114+ }
115+
106116 if ( ! params . loaded ) {
107117 client . outputChannel . appendLine (
108118 "Service not loaded. See above errors if any are printed"
0 commit comments