@@ -52,6 +52,7 @@ namespace ServerState {
5252
5353 export class Running {
5454 readonly type = Type . Running ;
55+
5556 constructor (
5657 public readonly server : ITypeScriptServer ,
5758
@@ -68,6 +69,14 @@ namespace ServerState {
6869 ) { }
6970
7071 public readonly toCancelOnResourceChange = new Set < ToCancelOnResourceChanged > ( ) ;
72+
73+ updateTsserverVersion ( tsserverVersion : string ) {
74+ this . tsserverVersion = tsserverVersion ;
75+ }
76+
77+ updateLangaugeServiceEnabled ( enabled : boolean ) {
78+ this . langaugeServiceEnabled = enabled ;
79+ }
7180 }
7281
7382 export class Errored {
@@ -173,7 +182,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
173182 return this . serverState . tsserverVersion ;
174183 }
175184 }
176- return this . apiVersion . version ;
185+ return this . apiVersion . fullVersionString ;
177186 } ) ) ;
178187
179188 this . typescriptServerSpawner = new TypeScriptServerSpawner ( this . versionProvider , this . logDirectoryProvider , this . pluginPathsProvider , this . logger , this . telemetryReporter , this . tracer ) ;
@@ -705,7 +714,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
705714 return this . bufferSyncSupport . interuptGetErr ( f ) ;
706715 }
707716
708- private fatalError ( command : string , error : Error ) : void {
717+ private fatalError ( command : string , error : unknown ) : void {
718+ if ( ! ( error instanceof TypeScriptServerError ) ) {
719+ console . log ( 'fdasfasdf' ) ;
720+ }
709721 /* __GDPR__
710722 "fatalError" : {
711723 "${include}": [
@@ -759,10 +771,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
759771 {
760772 const body = ( event as Proto . ProjectLanguageServiceStateEvent ) . body ! ;
761773 if ( this . serverState . type === ServerState . Type . Running ) {
762- this . serverState = {
763- ...this . serverState ,
764- langaugeServiceEnabled : body . languageServiceEnabled ,
765- } ;
774+ this . serverState . updateLangaugeServiceEnabled ( body . languageServiceEnabled ) ;
766775 }
767776 this . _onProjectLanguageServiceStateChanged . fire ( body ) ;
768777 break ;
@@ -831,10 +840,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
831840 }
832841 if ( telemetryData . telemetryEventName === 'projectInfo' ) {
833842 if ( this . serverState . type === ServerState . Type . Running ) {
834- this . serverState = {
835- ...this . serverState ,
836- tsserverVersion : properties [ 'version' ]
837- } ;
843+ this . serverState . updateTsserverVersion ( properties [ 'version' ] ) ;
838844 }
839845 }
840846
0 commit comments