We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9f974c commit 0004c47Copy full SHA for 0004c47
src/PowerShellEditorServices.Transport.Stdio/Request/OpenFileRequest.cs
@@ -26,8 +26,14 @@ public override void ProcessMessage(
26
EditorSession editorSession,
27
MessageWriter messageWriter)
28
{
29
- // Open the file in the current session
30
- editorSession.Workspace.OpenFile(this.Arguments.File);
+ ScriptFile scriptFile = null;
+
31
+ // Only load the file if it isn't loaded already
32
+ if (!editorSession.Workspace.TryGetFile(this.Arguments.File, out scriptFile))
33
+ {
34
+ // Open the file in the current session
35
+ editorSession.Workspace.OpenFile(this.Arguments.File);
36
+ }
37
}
38
39
0 commit comments