@@ -30,6 +30,7 @@ import { DeviceSelectionService } from "./service/deviceSelectionService";
30
30
import { FileSelectionService } from "./service/fileSelectionService" ;
31
31
import { MessagingService } from "./service/messagingService" ;
32
32
import { PopupService } from "./service/PopupService" ;
33
+ import { SetupService } from "./service/SetupService" ;
33
34
import { SimulatorDebugConfigurationProvider } from "./simulatorDebugConfigurationProvider" ;
34
35
import getPackageInfo from "./telemetry/getPackageInfo" ;
35
36
import TelemetryAI from "./telemetry/telemetryAI" ;
@@ -44,6 +45,7 @@ let inDebugMode: boolean = false;
44
45
let firstTimeClosed : boolean = true ;
45
46
let shouldShowRunCodePopup : boolean = true ;
46
47
48
+ let setupService : SetupService ;
47
49
const deviceSelectionService = new DeviceSelectionService ( ) ;
48
50
const messagingService = new MessagingService ( deviceSelectionService ) ;
49
51
const debuggerCommunicationService = new DebuggerCommunicationService ( ) ;
@@ -72,6 +74,7 @@ export async function activate(context: vscode.ExtensionContext) {
72
74
console . info ( CONSTANTS . INFO . EXTENSION_ACTIVATED ) ;
73
75
74
76
telemetryAI = new TelemetryAI ( context ) ;
77
+ setupService = new SetupService ( telemetryAI ) ;
75
78
let currentPanel : vscode . WebviewPanel | undefined ;
76
79
let childProcess : cp . ChildProcess | undefined ;
77
80
let messageListener : vscode . Disposable ;
@@ -84,7 +87,7 @@ export async function activate(context: vscode.ExtensionContext) {
84
87
// doesn't trigger lint errors
85
88
updatePylintArgs ( context ) ;
86
89
87
- pythonExecutablePath = await utils . setupEnv ( context ) ;
90
+ pythonExecutablePath = await setupService . setupEnv ( context ) ;
88
91
89
92
try {
90
93
utils . generateCPXConfig ( ) ;
@@ -433,7 +436,7 @@ export async function activate(context: vscode.ExtensionContext) {
433
436
const installDependencies : vscode . Disposable = vscode . commands . registerCommand (
434
437
"deviceSimulatorExpress.common.installDependencies" ,
435
438
async ( ) => {
436
- pythonExecutablePath = await utils . setupEnv ( context , true ) ;
439
+ pythonExecutablePath = await setupService . setupEnv ( context , true ) ;
437
440
telemetryAI . trackFeatureUsage (
438
441
TelemetryEventName . COMMAND_INSTALL_EXTENSION_DEPENDENCIES
439
442
) ;
@@ -1020,7 +1023,7 @@ export async function activate(context: vscode.ExtensionContext) {
1020
1023
const configsChanged = vscode . workspace . onDidChangeConfiguration (
1021
1024
async ( ) => {
1022
1025
if ( utils . checkConfig ( CONFIG . CONFIG_ENV_ON_SWITCH ) ) {
1023
- pythonExecutablePath = await utils . setupEnv ( context ) ;
1026
+ pythonExecutablePath = await setupService . setupEnv ( context ) ;
1024
1027
}
1025
1028
}
1026
1029
) ;
0 commit comments