@@ -37,7 +37,7 @@ import ShowInformationMessage from '../shared/observers/utils/showInformationMes
3737import * as RoslynProtocol from './roslynProtocol' ;
3838import { CSharpDevKitExports } from '../csharpDevKitExports' ;
3939import { SolutionSnapshotId } from './services/ISolutionSnapshotProvider' ;
40- import { ServerStateChange } from './serverStateChange' ;
40+ import { ServerState } from './serverStateChange' ;
4141import TelemetryReporter from '@vscode/extension-telemetry' ;
4242import CSharpIntelliCodeExports from '../csharpIntelliCodeExports' ;
4343import { csharpDevkitExtensionId , csharpDevkitIntelliCodeExtensionId , getCSharpDevKit } from '../utils/getCSharpDevKit' ;
@@ -158,18 +158,20 @@ export class RoslynLanguageServer {
158158 await this . openDefaultSolutionOrProjects ( ) ;
159159 }
160160 await this . sendOrSubscribeForServiceBrokerConnection ( ) ;
161- this . _languageServerEvents . onServerStateChangeEmitter . fire ( ServerStateChange . Started ) ;
161+ this . _languageServerEvents . onServerStateChangeEmitter . fire ( {
162+ state : ServerState . Started ,
163+ workspaceLabel : this . workspaceDisplayName ( ) ,
164+ } ) ;
162165 }
163166 } ) ;
164167 }
165168
166169 private registerProjectInitialization ( ) {
167- this . _languageClient . onNotification ( RoslynProtocol . ProjectInitializationStartedNotification . type , ( ) => {
168- this . _languageServerEvents . onServerStateChangeEmitter . fire ( ServerStateChange . ProjectInitializationStarted ) ;
169- } ) ;
170-
171170 this . _languageClient . onNotification ( RoslynProtocol . ProjectInitializationCompleteNotification . type , ( ) => {
172- this . _languageServerEvents . onServerStateChangeEmitter . fire ( ServerStateChange . ProjectInitializationComplete ) ;
171+ this . _languageServerEvents . onServerStateChangeEmitter . fire ( {
172+ state : ServerState . ProjectInitializationComplete ,
173+ workspaceLabel : this . workspaceDisplayName ( ) ,
174+ } ) ;
173175 } ) ;
174176 }
175177
@@ -394,16 +396,20 @@ export class RoslynLanguageServer {
394396 await this . _languageClient . sendNotification ( RoslynProtocol . OpenSolutionNotification . type , {
395397 solution : protocolUri ,
396398 } ) ;
397- }
398-
399- if ( this . _projectFiles . length > 0 ) {
399+ } else if ( this . _projectFiles . length > 0 ) {
400400 const projectProtocolUris = this . _projectFiles . map ( ( uri ) =>
401401 this . _languageClient . clientOptions . uriConverters ! . code2Protocol ( uri )
402402 ) ;
403403 await this . _languageClient . sendNotification ( RoslynProtocol . OpenProjectNotification . type , {
404404 projects : projectProtocolUris ,
405405 } ) ;
406+ } else {
407+ return ;
406408 }
409+ this . _languageServerEvents . onServerStateChangeEmitter . fire ( {
410+ state : ServerState . ProjectInitializationStarted ,
411+ workspaceLabel : this . workspaceDisplayName ( ) ,
412+ } ) ;
407413 }
408414 }
409415
0 commit comments