Skip to content

Fixes #164 - adds capabilities response to initialize request. #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class InitializeRequest
{
public static readonly
RequestType<InitializeRequestArguments, object> Type =
RequestType<InitializeRequestArguments, object>.Create("initialize");
RequestType<InitializeRequestArguments, InitializeResponseBody> Type =
RequestType<InitializeRequestArguments, InitializeResponseBody>.Create("initialize");
}

public class InitializeRequestArguments
Expand All @@ -26,4 +26,31 @@ public class InitializeRequestArguments

public string GeneratedCodeDirectory { get; set; }
}

public class InitializeResponseBody
{
/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports the configurationDoneRequest.
/// </summary>
public bool SupportsConfigurationDoneRequest { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports functionBreakpoints.
/// </summary>
public bool SupportsFunctionBreakpoints { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports conditionalBreakpoints.
/// </summary>
public bool SupportsConditionalBreakpoints { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports a (side effect free) evaluate request for data hovers.
/// </summary>
public bool SupportsEvaluateForHovers { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using System.Collections.Generic;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
Expand All @@ -17,25 +17,43 @@ public static readonly

public class LaunchRequestArguments
{
// /** An absolute path to the program to debug. */
/// <summary>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing those!

/// Gets or sets the absolute path to the program to debug.
/// </summary>
public string Program { get; set; }

// /** Automatically stop target after launch. If not specified, target does not stop. */
/// <summary>
/// Gets or sets a boolean value that determines whether to automatically stop
/// target after launch. If not specified, target does not stop.
/// </summary>
public bool StopOnEntry { get; set; }

// /** Optional arguments passed to the debuggee. */
/// <summary>
/// Gets or sets optional arguments passed to the debuggee.
/// </summary>
public string[] Args { get; set; }

// /** Launch the debuggee in this working directory (specified as an absolute path). If omitted the debuggee is lauched in its own directory. */
/// <summary>
/// Gets or sets the working directory of the launched debuggee (specified as an absolute path).
/// If omitted the debuggee is lauched in its own directory.
/// </summary>
public string Cwd { get; set; }

// /** Absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. */
/// <summary>
/// Gets or sets the absolute path to the runtime executable to be used.
/// Default is the runtime executable on the PATH.
/// </summary>
public string RuntimeExecutable { get; set; }

// /** Optional arguments passed to the runtime executable. */
/// <summary>
/// Gets or sets the optional arguments passed to the runtime executable.
/// </summary>
public string[] RuntimeArgs { get; set; }

// /** Optional environment variables to pass to the debuggee. The string valued properties of the 'environmentVariables' are used as key/value pairs. */
/// <summary>
/// Gets or sets optional environment variables to pass to the debuggee. The string valued
/// properties of the 'environmentVariables' are used as key/value pairs.
/// </summary>
public Dictionary<string, string> Env { get; set; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
// /** SetExceptionBreakpoints request; value of command field is "setExceptionBreakpoints".
// Enable that the debuggee stops on exceptions with a StoppedEvent (event type 'exception').
// */
/// <summary>
/// SetExceptionBreakpoints request; value of command field is "setExceptionBreakpoints".
/// Enable that the debuggee stops on exceptions with a StoppedEvent (event type 'exception').
/// </summary>
public class SetExceptionBreakpointsRequest
{
public static readonly
RequestType<SetExceptionBreakpointsRequestArguments, object> Type =
RequestType<SetExceptionBreakpointsRequestArguments, object>.Create("setExceptionBreakpoints");
}

/// <summary>
/// Arguments for "setExceptionBreakpoints" request.
/// </summary>
public class SetExceptionBreakpointsRequestArguments
{
// /** Arguments for "setExceptionBreakpoints" request. */
// export interface SetExceptionBreakpointsArguments {
// /** Names of enabled exception breakpoints. */
// filters: string[];
// }
/// <summary>
/// Gets or sets the names of enabled exception breakpoints.
/// </summary>
public string[] Filters { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public static readonly

public class SourceRequestArguments
{
// /** The reference to the source. This is the value received in Source.reference. */
/// <summary>
/// Gets or sets the reference to the source. This is the value received in Source.reference.
/// </summary>
public int SourceReference { get; set; }
}

Expand All @@ -25,4 +27,3 @@ public class SourceResponseBody
public string Content { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ public class StackTraceRequestArguments
{
public int ThreadId { get; private set; }

// /** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. */
/// <summary>
/// Gets the maximum number of frames to return. If levels is not specified or 0, all frames are returned.
/// </summary>
public int Levels { get; private set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ protected override Task OnStop()

private async Task HandleInitializeRequest(
object shutdownParams,
RequestContext<object> requestContext)
RequestContext<InitializeResponseBody> requestContext)
{
// Send the Initialized event first so that we get breakpoints
await requestContext.SendEvent(
InitializedEvent.Type,
null);

// Now send the Initialize response to continue setup
await requestContext.SendResult(new object());
await requestContext.SendResult(new InitializeResponseBody());
}
}
}
Expand Down