@@ -53,6 +53,7 @@ export class SessionManager implements Middleware {
53
53
private languageServerClient : LanguageClient = undefined ;
54
54
private sessionSettings : Settings . ISettings = undefined ;
55
55
private sessionDetails : utils . IEditorServicesSessionDetails ;
56
+ private bundledModulesPath : string ;
56
57
57
58
// When in development mode, VS Code's session ID is a fake
58
59
// value of "someValue.machineId". Use that to detect dev
@@ -144,18 +145,17 @@ export class SessionManager implements Middleware {
144
145
145
146
if ( this . powerShellExePath ) {
146
147
147
- let bundledModulesPath = path . resolve ( __dirname , "../../modules" ) ;
148
+ this . bundledModulesPath = path . resolve ( __dirname , this . sessionSettings . bundledModulesPath ) ;
148
149
149
150
if ( this . inDevelopmentMode ) {
150
151
const devBundledModulesPath =
151
152
path . resolve (
152
153
__dirname ,
153
- this . sessionSettings . developer . bundledModulesPath ||
154
- "../../../PowerShellEditorServices/module" ) ;
154
+ this . sessionSettings . developer . bundledModulesPath ) ;
155
155
156
156
// Make sure the module's bin path exists
157
157
if ( fs . existsSync ( path . join ( devBundledModulesPath , "PowerShellEditorServices/bin" ) ) ) {
158
- bundledModulesPath = devBundledModulesPath ;
158
+ this . bundledModulesPath = devBundledModulesPath ;
159
159
} else {
160
160
this . log . write (
161
161
"\nWARNING: In development mode but PowerShellEditorServices dev module path cannot be " +
@@ -169,7 +169,7 @@ export class SessionManager implements Middleware {
169
169
"-HostProfileId 'Microsoft.VSCode' " +
170
170
"-HostVersion '" + this . hostVersion + "' " +
171
171
"-AdditionalModules @('PowerShellEditorServices.VSCode') " +
172
- "-BundledModulesPath '" + bundledModulesPath + "' " +
172
+ "-BundledModulesPath '" + this . bundledModulesPath + "' " +
173
173
"-EnableConsoleRepl " ;
174
174
175
175
if ( this . sessionSettings . developer . editorServicesWaitForDebugger ) {
@@ -179,11 +179,7 @@ export class SessionManager implements Middleware {
179
179
this . editorServicesArgs += "-LogLevel '" + this . sessionSettings . developer . editorServicesLogLevel + "' " ;
180
180
}
181
181
182
- this . startPowerShell (
183
- this . powerShellExePath ,
184
- this . sessionSettings . developer . powerShellExeIsWindowsDevBuild ,
185
- bundledModulesPath ,
186
- this . editorServicesArgs ) ;
182
+ this . startPowerShell ( ) ;
187
183
} else {
188
184
this . setSessionFailure ( "PowerShell could not be started, click 'Show Logs' for more details." ) ;
189
185
}
@@ -235,6 +231,7 @@ export class SessionManager implements Middleware {
235
231
this . debugSessionProcess =
236
232
new PowerShellProcess (
237
233
this . powerShellExePath ,
234
+ this . bundledModulesPath ,
238
235
"[TEMP] PowerShell Integrated Console" ,
239
236
this . log ,
240
237
this . editorServicesArgs + "-DebugServiceOnly " ,
@@ -444,11 +441,7 @@ export class SessionManager implements Middleware {
444
441
] ;
445
442
}
446
443
447
- private startPowerShell (
448
- powerShellExePath : string ,
449
- isWindowsDevBuild : boolean ,
450
- bundledModulesPath : string ,
451
- startArgs : string ) {
444
+ private startPowerShell ( ) {
452
445
453
446
this . setSessionStatus (
454
447
"Starting PowerShell..." ,
@@ -461,9 +454,10 @@ export class SessionManager implements Middleware {
461
454
this . languageServerProcess =
462
455
new PowerShellProcess (
463
456
this . powerShellExePath ,
457
+ this . bundledModulesPath ,
464
458
"PowerShell Integrated Console" ,
465
459
this . log ,
466
- startArgs ,
460
+ this . editorServicesArgs ,
467
461
sessionFilePath ,
468
462
this . sessionSettings ) ;
469
463
0 commit comments