@@ -53,6 +53,7 @@ export class SessionManager implements Middleware {
5353 private languageServerClient : LanguageClient = undefined ;
5454 private sessionSettings : Settings . ISettings = undefined ;
5555 private sessionDetails : utils . IEditorServicesSessionDetails ;
56+ private bundledModulesPath : string ;
5657
5758 // When in development mode, VS Code's session ID is a fake
5859 // value of "someValue.machineId". Use that to detect dev
@@ -144,18 +145,17 @@ export class SessionManager implements Middleware {
144145
145146 if ( this . powerShellExePath ) {
146147
147- let bundledModulesPath = path . resolve ( __dirname , "../../modules" ) ;
148+ this . bundledModulesPath = path . resolve ( __dirname , this . sessionSettings . bundledModulesPath ) ;
148149
149150 if ( this . inDevelopmentMode ) {
150151 const devBundledModulesPath =
151152 path . resolve (
152153 __dirname ,
153- this . sessionSettings . developer . bundledModulesPath ||
154- "../../../PowerShellEditorServices/module" ) ;
154+ this . sessionSettings . developer . bundledModulesPath ) ;
155155
156156 // Make sure the module's bin path exists
157157 if ( fs . existsSync ( path . join ( devBundledModulesPath , "PowerShellEditorServices/bin" ) ) ) {
158- bundledModulesPath = devBundledModulesPath ;
158+ this . bundledModulesPath = devBundledModulesPath ;
159159 } else {
160160 this . log . write (
161161 "\nWARNING: In development mode but PowerShellEditorServices dev module path cannot be " +
@@ -169,7 +169,7 @@ export class SessionManager implements Middleware {
169169 "-HostProfileId 'Microsoft.VSCode' " +
170170 "-HostVersion '" + this . hostVersion + "' " +
171171 "-AdditionalModules @('PowerShellEditorServices.VSCode') " +
172- "-BundledModulesPath '" + bundledModulesPath + "' " +
172+ "-BundledModulesPath '" + this . bundledModulesPath + "' " +
173173 "-EnableConsoleRepl " ;
174174
175175 if ( this . sessionSettings . developer . editorServicesWaitForDebugger ) {
@@ -179,11 +179,7 @@ export class SessionManager implements Middleware {
179179 this . editorServicesArgs += "-LogLevel '" + this . sessionSettings . developer . editorServicesLogLevel + "' " ;
180180 }
181181
182- this . startPowerShell (
183- this . powerShellExePath ,
184- this . sessionSettings . developer . powerShellExeIsWindowsDevBuild ,
185- bundledModulesPath ,
186- this . editorServicesArgs ) ;
182+ this . startPowerShell ( ) ;
187183 } else {
188184 this . setSessionFailure ( "PowerShell could not be started, click 'Show Logs' for more details." ) ;
189185 }
@@ -235,6 +231,7 @@ export class SessionManager implements Middleware {
235231 this . debugSessionProcess =
236232 new PowerShellProcess (
237233 this . powerShellExePath ,
234+ this . bundledModulesPath ,
238235 "[TEMP] PowerShell Integrated Console" ,
239236 this . log ,
240237 this . editorServicesArgs + "-DebugServiceOnly " ,
@@ -444,11 +441,7 @@ export class SessionManager implements Middleware {
444441 ] ;
445442 }
446443
447- private startPowerShell (
448- powerShellExePath : string ,
449- isWindowsDevBuild : boolean ,
450- bundledModulesPath : string ,
451- startArgs : string ) {
444+ private startPowerShell ( ) {
452445
453446 this . setSessionStatus (
454447 "Starting PowerShell..." ,
@@ -461,9 +454,10 @@ export class SessionManager implements Middleware {
461454 this . languageServerProcess =
462455 new PowerShellProcess (
463456 this . powerShellExePath ,
457+ this . bundledModulesPath ,
464458 "PowerShell Integrated Console" ,
465459 this . log ,
466- startArgs ,
460+ this . editorServicesArgs ,
467461 sessionFilePath ,
468462 this . sessionSettings ) ;
469463
0 commit comments