@@ -27,7 +27,7 @@ public class DebugAdapter : DebugAdapterBase
27
27
28
28
private bool noDebug ;
29
29
private bool waitingForAttach ;
30
- private string scriptPathToLaunch ;
30
+ private string scriptToLaunch ;
31
31
private string arguments ;
32
32
33
33
public DebugAdapter ( HostDetails hostDetails , ProfilePaths profilePaths )
@@ -83,7 +83,7 @@ protected override void Initialize()
83
83
protected Task LaunchScript ( RequestContext < object > requestContext )
84
84
{
85
85
return editorSession . PowerShellContext
86
- . ExecuteScriptAtPath ( this . scriptPathToLaunch , this . arguments )
86
+ . ExecuteScriptWithArgs ( this . scriptToLaunch , this . arguments )
87
87
. ContinueWith (
88
88
async ( t ) => {
89
89
Logger . Write ( LogLevel . Verbose , "Execution completed, flushing output then terminating..." ) ;
@@ -120,7 +120,7 @@ protected async Task HandleConfigurationDoneRequest(
120
120
object args ,
121
121
RequestContext < object > requestContext )
122
122
{
123
- if ( ! string . IsNullOrEmpty ( this . scriptPathToLaunch ) )
123
+ if ( ! string . IsNullOrEmpty ( this . scriptToLaunch ) )
124
124
{
125
125
if ( this . editorSession . PowerShellContext . SessionState == PowerShellContextState . Ready )
126
126
{
@@ -144,8 +144,8 @@ protected async Task HandleLaunchRequest(
144
144
LaunchRequestArguments launchParams ,
145
145
RequestContext < object > requestContext )
146
146
{
147
- // Set the working directory for the PowerShell runspace to the cwd passed in via launch.json.
148
- // In case that is null, use the the folder of the script to be executed. If the resulting
147
+ // Set the working directory for the PowerShell runspace to the cwd passed in via launch.json.
148
+ // In case that is null, use the the folder of the script to be executed. If the resulting
149
149
// working dir path is a file path then extract the directory and use that.
150
150
string workingDir =
151
151
launchParams . Cwd ??
@@ -195,15 +195,15 @@ protected async Task HandleLaunchRequest(
195
195
// Store the launch parameters so that they can be used later
196
196
this . noDebug = launchParams . NoDebug ;
197
197
#pragma warning disable 618
198
- this . scriptPathToLaunch = launchParams . Script ?? launchParams . Program ;
198
+ this . scriptToLaunch = launchParams . Script ?? launchParams . Program ;
199
199
#pragma warning restore 618
200
200
this . arguments = arguments ;
201
201
202
202
await requestContext . SendResult ( null ) ;
203
203
204
204
// If no script is being launched, execute an empty script to
205
205
// cause the prompt string to be evaluated and displayed
206
- if ( string . IsNullOrEmpty ( this . scriptPathToLaunch ) )
206
+ if ( string . IsNullOrEmpty ( this . scriptToLaunch ) )
207
207
{
208
208
await this . editorSession . PowerShellContext . ExecuteScriptString (
209
209
"" , false , true ) ;
@@ -222,7 +222,7 @@ protected async Task HandleAttachRequest(
222
222
{
223
223
// If there are no host processes to attach to or the user cancels selection, we get a null for the process id.
224
224
// This is not an error, just a request to stop the original "attach to" request.
225
- // Testing against "undefined" is a HACK because I don't know how to make "Cancel" on quick pick loading
225
+ // Testing against "undefined" is a HACK because I don't know how to make "Cancel" on quick pick loading
226
226
// to cancel on the VSCode side without sending an attachRequest with processId set to "undefined".
227
227
if ( string . IsNullOrEmpty ( attachParams . ProcessId ) || ( attachParams . ProcessId == "undefined" ) )
228
228
{
@@ -364,7 +364,7 @@ protected async Task HandleSetBreakpointsRequest(
364
364
catch ( Exception e ) when ( e is FileNotFoundException || e is DirectoryNotFoundException )
365
365
{
366
366
Logger . Write (
367
- LogLevel . Warning ,
367
+ LogLevel . Warning ,
368
368
$ "Attempted to set breakpoints on a non-existing file: { setBreakpointsParams . Source . Path } ") ;
369
369
370
370
string message = this . noDebug ? string . Empty : "Source does not exist, breakpoint not set." ;
@@ -387,9 +387,9 @@ await requestContext.SendResult(
387
387
{
388
388
SourceBreakpoint srcBreakpoint = setBreakpointsParams . Breakpoints [ i ] ;
389
389
breakpointDetails [ i ] = BreakpointDetails . Create (
390
- scriptFile . FilePath ,
391
- srcBreakpoint . Line ,
392
- srcBreakpoint . Column ,
390
+ scriptFile . FilePath ,
391
+ srcBreakpoint . Line ,
392
+ srcBreakpoint . Column ,
393
393
srcBreakpoint . Condition ,
394
394
srcBreakpoint . HitCondition ) ;
395
395
}
@@ -541,7 +541,7 @@ protected async Task HandleStackTraceRequest(
541
541
// be referenced back to the current list of stack frames
542
542
newStackFrames . Add (
543
543
StackFrame . Create (
544
- stackFrames [ i ] ,
544
+ stackFrames [ i ] ,
545
545
i ) ) ;
546
546
}
547
547
@@ -712,9 +712,9 @@ async void DebugService_DebuggerStopped(object sender, DebuggerStoppedEventArgs
712
712
713
713
// Provide the reason for why the debugger has stopped script execution.
714
714
// See https://github.com/Microsoft/vscode/issues/3648
715
- // The reason is displayed in the breakpoints viewlet. Some recommended reasons are:
715
+ // The reason is displayed in the breakpoints viewlet. Some recommended reasons are:
716
716
// "step", "breakpoint", "function breakpoint", "exception" and "pause".
717
- // We don't support exception breakpoints and for "pause", we can't distinguish
717
+ // We don't support exception breakpoints and for "pause", we can't distinguish
718
718
// between stepping and the user pressing the pause/break button in the debug toolbar.
719
719
string debuggerStoppedReason = "step" ;
720
720
if ( e . OriginalEvent . Breakpoints . Count > 0 )
0 commit comments