Skip to content

Commit 0c2b8d3

Browse files
authored
Merge pull request #297 from rkeithhill/rkeithhill/change-launch-json-program
PSES half of program -> script launch prop change.
2 parents dba6515 + aff18ec commit 0c2b8d3

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task LaunchScript(string scriptFilePath)
2222
await this.SendRequest(
2323
LaunchRequest.Type,
2424
new LaunchRequestArguments {
25-
Program = scriptFilePath
25+
Script = scriptFilePath
2626
});
2727

2828
await this.SendRequest(ConfigurationDoneRequest.Type, null);

src/PowerShellEditorServices.Protocol/DebugAdapter/LaunchRequest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
//
55

6+
using System;
67
using System.Collections.Generic;
78
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
89

@@ -20,8 +21,14 @@ public class LaunchRequestArguments
2021
/// <summary>
2122
/// Gets or sets the absolute path to the program to debug.
2223
/// </summary>
24+
[Obsolete("This property has been deprecated in favor of the Script property.")]
2325
public string Program { get; set; }
2426

27+
/// <summary>
28+
/// Gets or sets the absolute path to the script to debug.
29+
/// </summary>
30+
public string Script { get; set; }
31+
2532
/// <summary>
2633
/// Gets or sets a boolean value that indicates whether the script should be
2734
/// run with (false) or without (true) debugging support.

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected async Task HandleLaunchRequest(
130130
// Set the working directory for the PowerShell runspace to the cwd passed in via launch.json.
131131
// In case that is null, use the the folder of the script to be executed. If the resulting
132132
// working dir path is a file path then extract the directory and use that.
133-
string workingDir = launchParams.Cwd ?? launchParams.Program;
133+
string workingDir = launchParams.Cwd ?? launchParams.Script ?? launchParams.Program;
134134
workingDir = PowerShellContext.UnescapePath(workingDir);
135135
try
136136
{
@@ -167,7 +167,7 @@ protected async Task HandleLaunchRequest(
167167
// params so that the subsequent configurationDone request handler
168168
// can launch the script.
169169
this.noDebug = launchParams.NoDebug;
170-
this.scriptPathToLaunch = launchParams.Program;
170+
this.scriptPathToLaunch = launchParams.Script ?? launchParams.Program;
171171
this.arguments = arguments;
172172

173173
// The order of debug protocol messages apparently isn't as guaranteed as we might like.

0 commit comments

Comments
 (0)