Skip to content

Commit 1d1d3ee

Browse files
committed
Fix #237: Set session's current directory to the workspace path
1 parent 29617f8 commit 1d1d3ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ protected async Task HandleInitializeRequest(
141141
// Grab the workspace path from the parameters
142142
editorSession.Workspace.WorkspacePath = initializeParams.RootPath;
143143

144+
// Set the working directory of the PowerShell session to the workspace path
145+
if (editorSession.Workspace.WorkspacePath != null)
146+
{
147+
editorSession.PowerShellContext.SetWorkingDirectory(
148+
editorSession.Workspace.WorkspacePath);
149+
}
150+
144151
await requestContext.SendResult(
145152
new InitializeResult
146153
{

0 commit comments

Comments
 (0)