@@ -13,6 +13,7 @@ import { IFileSystem } from '../common/platform/types';
13
13
import { IDisposable , IExperimentService , IInterpreterPathService , Resource } from '../common/types' ;
14
14
import { Deferred } from '../common/utils/async' ;
15
15
import { IInterpreterAutoSelectionService } from '../interpreter/autoSelection/types' ;
16
+ import { IInterpreterActivationService , IInterpreterSingleActivationService } from '../interpreter/contracts' ;
16
17
import { traceDecoratorError } from '../logging' ;
17
18
import { sendActivationTelemetry } from '../telemetry/envFileTelemetry' ;
18
19
import {
@@ -45,6 +46,10 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
45
46
@inject ( IExperimentService ) private readonly experiments : IExperimentService ,
46
47
@inject ( IInterpreterPathService ) private readonly interpreterPathService : IInterpreterPathService ,
47
48
@inject ( ILanguageServerActivation ) private readonly languageServerActivation : ILanguageServerActivation ,
49
+ @multiInject ( IInterpreterActivationService )
50
+ private readonly interpreterActivationServices : IInterpreterActivationService [ ] ,
51
+ @multiInject ( IInterpreterSingleActivationService )
52
+ private readonly interpreterSingleActivationServices : IInterpreterSingleActivationService [ ] ,
48
53
) { }
49
54
50
55
public dispose ( ) : void {
@@ -63,14 +68,14 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
63
68
64
69
// Activate all activation services together.
65
70
66
- if ( this . workspaceService . isVirtualWorkspace ) {
67
- await this . activateWorkspace ( this . activeResourceService . getActiveResource ( ) ) ;
68
- } else {
69
- await Promise . all ( [
70
- ... this . singleActivationServices . map ( ( item ) => item . activate ( ) ) ,
71
- this . activateWorkspace ( this . activeResourceService . getActiveResource ( ) ) ,
72
- ] ) ;
73
- }
71
+ const singleActivationServices = this . workspaceService . isVirtualWorkspace
72
+ ? this . interpreterSingleActivationServices
73
+ : this . singleActivationServices ;
74
+
75
+ await Promise . all ( [
76
+ ... singleActivationServices . map ( ( item ) => item . activate ( ) ) ,
77
+ this . activateWorkspace ( this . activeResourceService . getActiveResource ( ) ) ,
78
+ ] ) ;
74
79
}
75
80
76
81
@traceDecoratorError ( 'Failed to activate a workspace' )
@@ -83,16 +88,17 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
83
88
84
89
await sendActivationTelemetry ( this . fileSystem , this . workspaceService , resource ) ;
85
90
91
+ if ( this . experiments . inExperimentSync ( DeprecatePythonPath . experiment ) ) {
92
+ await this . interpreterPathService . copyOldInterpreterStorageValuesToNew ( resource ) ;
93
+ }
94
+ await this . autoSelection . autoSelectInterpreter ( resource ) ;
86
95
if ( this . workspaceService . isVirtualWorkspace ) {
87
96
await this . languageServerActivation . activate ( resource ) ;
97
+ await Promise . all ( this . interpreterActivationServices . map ( ( item ) => item . activate ( resource ) ) ) ;
88
98
} else {
89
- if ( this . experiments . inExperimentSync ( DeprecatePythonPath . experiment ) ) {
90
- await this . interpreterPathService . copyOldInterpreterStorageValuesToNew ( resource ) ;
91
- }
92
- await this . autoSelection . autoSelectInterpreter ( resource ) ;
93
99
await Promise . all ( this . activationServices . map ( ( item ) => item . activate ( resource ) ) ) ;
94
- await this . appDiagnostics . performPreStartupHealthCheck ( resource ) ;
95
100
}
101
+ await this . appDiagnostics . performPreStartupHealthCheck ( resource ) ;
96
102
}
97
103
98
104
public async initialize ( ) : Promise < void > {
0 commit comments