File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
PowerShellEditorServices.Protocol/Server
PowerShellEditorServices/Session Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ protected async Task HandleLaunchRequest(
273273 // TODO: What's the right approach here?
274274 if ( this . editorSession . PowerShellContext . CurrentRunspace . Location == RunspaceLocation . Local )
275275 {
276- editorSession . PowerShellContext . SetWorkingDirectory ( workingDir ) ;
276+ await editorSession . PowerShellContext . SetWorkingDirectory ( workingDir ) ;
277277 Logger . Write ( LogLevel . Verbose , "Working dir set to: " + workingDir ) ;
278278 }
279279
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ protected async Task HandleInitializeRequest(
183183 // Set the working directory of the PowerShell session to the workspace path
184184 if ( editorSession . Workspace . WorkspacePath != null )
185185 {
186- editorSession . PowerShellContext . SetWorkingDirectory (
186+ await editorSession . PowerShellContext . SetWorkingDirectory (
187187 editorSession . Workspace . WorkspacePath ) ;
188188 }
189189
Original file line number Diff line number Diff line change @@ -1048,9 +1048,12 @@ internal void ReleaseRunspaceHandle(RunspaceHandle runspaceHandle)
10481048 /// unescaped before calling this method.
10491049 /// </summary>
10501050 /// <param name="path"></param>
1051- public void SetWorkingDirectory ( string path )
1051+ public async Task SetWorkingDirectory ( string path )
10521052 {
1053- this . CurrentRunspace . Runspace . SessionStateProxy . Path . SetLocation ( path ) ;
1053+ using ( RunspaceHandle runspaceHandle = await this . GetRunspaceHandle ( ) )
1054+ {
1055+ runspaceHandle . Runspace . SessionStateProxy . Path . SetLocation ( path ) ;
1056+ }
10541057 }
10551058
10561059 /// <summary>
You can’t perform that action at this time.
0 commit comments