@@ -16,10 +16,10 @@ import { IInterpreterAutoSelectionService } from '../interpreter/autoSelection/t
16
16
import { traceDecoratorError } from '../logging' ;
17
17
import { sendActivationTelemetry } from '../telemetry/envFileTelemetry' ;
18
18
import {
19
+ ComponentId ,
19
20
IExtensionActivationManager ,
20
21
IExtensionActivationService ,
21
22
IExtensionSingleActivationService ,
22
- ILanguageServerActivation ,
23
23
} from './types' ;
24
24
25
25
@injectable ( )
@@ -44,7 +44,6 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
44
44
@inject ( IActiveResourceService ) private readonly activeResourceService : IActiveResourceService ,
45
45
@inject ( IExperimentService ) private readonly experiments : IExperimentService ,
46
46
@inject ( IInterpreterPathService ) private readonly interpreterPathService : IInterpreterPathService ,
47
- @inject ( ILanguageServerActivation ) private readonly languageServerActivation : ILanguageServerActivation ,
48
47
) { }
49
48
50
49
public dispose ( ) : void {
@@ -63,14 +62,14 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
63
62
64
63
// Activate all activation services together.
65
64
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
- }
65
+ const singleActivationServices = this . workspaceService . isVirtualWorkspace
66
+ ? this . singleActivationServices . filter ( ( s ) => s . componentId === ComponentId . interpreter )
67
+ : this . singleActivationServices ;
68
+
69
+ await Promise . all ( [
70
+ ... singleActivationServices . map ( ( item ) => item . activate ( ) ) ,
71
+ this . activateWorkspace ( this . activeResourceService . getActiveResource ( ) ) ,
72
+ ] ) ;
74
73
}
75
74
76
75
@traceDecoratorError ( 'Failed to activate a workspace' )
@@ -81,18 +80,20 @@ export class ExtensionActivationManager implements IExtensionActivationManager {
81
80
}
82
81
this . activatedWorkspaces . add ( key ) ;
83
82
83
+ if ( this . experiments . inExperimentSync ( DeprecatePythonPath . experiment ) ) {
84
+ await this . interpreterPathService . copyOldInterpreterStorageValuesToNew ( resource ) ;
85
+ }
86
+
84
87
await sendActivationTelemetry ( this . fileSystem , this . workspaceService , resource ) ;
85
88
86
- if ( this . workspaceService . isVirtualWorkspace ) {
87
- await this . languageServerActivation . activate ( resource ) ;
88
- } else {
89
- if ( this . experiments . inExperimentSync ( DeprecatePythonPath . experiment ) ) {
90
- await this . interpreterPathService . copyOldInterpreterStorageValuesToNew ( resource ) ;
91
- }
92
- await this . autoSelection . autoSelectInterpreter ( resource ) ;
93
- await Promise . all ( this . activationServices . map ( ( item ) => item . activate ( resource ) ) ) ;
94
- await this . appDiagnostics . performPreStartupHealthCheck ( resource ) ;
95
- }
89
+ await this . autoSelection . autoSelectInterpreter ( resource ) ;
90
+ const activationServices = this . workspaceService . isVirtualWorkspace
91
+ ? this . activationServices . filter (
92
+ ( s ) => s . componentId === ComponentId . interpreter || s . componentId === ComponentId . languageServer ,
93
+ )
94
+ : this . activationServices ;
95
+ await Promise . all ( activationServices . map ( ( item ) => item . activate ( resource ) ) ) ;
96
+ await this . appDiagnostics . performPreStartupHealthCheck ( resource ) ;
96
97
}
97
98
98
99
public async initialize ( ) : Promise < void > {
0 commit comments