@@ -81,13 +81,13 @@ class ExtensionMemento implements IExtensionMemento {
8181
8282class ExtensionStoragePath {
8383
84- private readonly _workspace : IStaticWorkspaceData ;
84+ private readonly _workspace ? : IStaticWorkspaceData ;
8585 private readonly _environment : IEnvironment ;
8686
87- private readonly _ready : Promise < string > ;
88- private _value : string ;
87+ private readonly _ready : Promise < string | undefined > ;
88+ private _value ? : string ;
8989
90- constructor ( workspace : IStaticWorkspaceData , environment : IEnvironment ) {
90+ constructor ( workspace : IStaticWorkspaceData | undefined , environment : IEnvironment ) {
9191 this . _workspace = workspace ;
9292 this . _environment = environment ;
9393 this . _ready = this . _getOrCreateWorkspaceStoragePath ( ) . then ( value => this . _value = value ) ;
@@ -97,7 +97,7 @@ class ExtensionStoragePath {
9797 return this . _ready ;
9898 }
9999
100- workspaceValue ( extension : IExtensionDescription ) : string {
100+ workspaceValue ( extension : IExtensionDescription ) : string | undefined {
101101 if ( this . _value ) {
102102 return path . join ( this . _value , extension . identifier . value ) ;
103103 }
@@ -108,7 +108,7 @@ class ExtensionStoragePath {
108108 return path . join ( this . _environment . globalStorageHome . fsPath , extension . identifier . value . toLowerCase ( ) ) ;
109109 }
110110
111- private async _getOrCreateWorkspaceStoragePath ( ) : Promise < string > {
111+ private async _getOrCreateWorkspaceStoragePath ( ) : Promise < string | undefined > {
112112 if ( ! this . _workspace ) {
113113 return Promise . resolve ( undefined ) ;
114114 }
@@ -493,7 +493,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
493493 return this . _handleWorkspaceContainsEagerExtensions ( workspaceProvider . workspace ) ;
494494 }
495495
496- private _handleWorkspaceContainsEagerExtensions ( workspace : IWorkspace ) : Promise < void > {
496+ private _handleWorkspaceContainsEagerExtensions ( workspace : IWorkspace | undefined ) : Promise < void > {
497497 if ( ! workspace || workspace . folders . length === 0 ) {
498498 return Promise . resolve ( undefined ) ;
499499 }
@@ -567,7 +567,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
567567 . then ( undefined , err => console . error ( err ) ) ;
568568 } , ExtHostExtensionService . WORKSPACE_CONTAINS_TIMEOUT ) ;
569569
570- let exists : boolean ;
570+ let exists : boolean = false ;
571571 try {
572572 exists = await searchP ;
573573 } catch ( err ) {
@@ -608,8 +608,8 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
608608 }
609609
610610 // Require the test runner via node require from the provided path
611- let testRunner : ITestRunner ;
612- let requireError : Error ;
611+ let testRunner : ITestRunner | undefined ;
612+ let requireError : Error | undefined ;
613613 try {
614614 testRunner = < any > require . __$__nodeRequire ( this . _initData . environment . extensionTestsPath ) ;
615615 } catch ( error ) {
@@ -619,7 +619,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
619619 // Execute the runner if it follows our spec
620620 if ( testRunner && typeof testRunner . run === 'function' ) {
621621 return new Promise < void > ( ( c , e ) => {
622- testRunner . run ( this . _initData . environment . extensionTestsPath , ( error , failures ) => {
622+ testRunner ! . run ( this . _initData . environment . extensionTestsPath , ( error , failures ) => {
623623 if ( error ) {
624624 e ( error . toString ( ) ) ;
625625 } else {
0 commit comments