Skip to content
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 @@ -151,7 +151,7 @@ public class DebugAdapterWebSocketConnection : EditorServiceWebSocketConnection
{
public DebugAdapterWebSocketConnection()
{
Server = new DebugAdapter(null, null, Channel);
Server = new DebugAdapter(null, null, Channel, null);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/PowerShellEditorServices.Host/EditorServicesHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ public void StartDebugService(int debugServicePort, ProfilePaths profilePaths)
new DebugAdapter(
hostDetails,
profilePaths,
new TcpSocketServerChannel(debugServicePort));
new TcpSocketServerChannel(debugServicePort),
this.languageServer?.EditorOperations);

this.debugAdapter.SessionEnded +=
(obj, args) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public static readonly

public class AttachRequestArguments
{
public string Address { get; set; }
public string ComputerName { get; set; }

public int Port { get; set; }
public int ProcessId { get; set; }

public int RunspaceId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
public class ContinuedEvent
{
public static readonly
EventType<ContinuedEvent> Type =
EventType<ContinuedEvent>.Create("continued");

public int ThreadId { get; set; }

public bool AllThreadsContinued { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class TerminatedEvent
{
public static readonly
EventType<object> Type =
EventType<object>.Create("terminated");
EventType<TerminatedEvent> Type =
EventType<TerminatedEvent>.Create("terminated");

public bool Restart { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ public static readonly
RequestType<string, EditorCommandResponse>.Create("editor/openFile");
}

public class CloseFileRequest
{
public static readonly
RequestType<string, EditorCommandResponse> Type =
RequestType<string, EditorCommandResponse>.Create("editor/closeFile");
}

public class ShowInformationMessageRequest
{
public static readonly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
public class PowerShellVersionRequest
{
public static readonly
RequestType<object, PowerShellVersionResponse> Type =
RequestType<object, PowerShellVersionResponse>.Create("powerShell/getVersion");
RequestType<object, PowerShellVersion> Type =
RequestType<object, PowerShellVersion>.Create("powerShell/getVersion");
}

public class PowerShellVersionResponse
public class PowerShellVersion
{
public string Version { get; set; }

Expand All @@ -25,11 +25,11 @@ public class PowerShellVersionResponse

public string Architecture { get; set; }

public PowerShellVersionResponse()
public PowerShellVersion()
{
}

public PowerShellVersionResponse(PowerShellVersionDetails versionDetails)
public PowerShellVersion(PowerShellVersionDetails versionDetails)
{
this.Version = versionDetails.VersionString;
this.DisplayVersion = $"{versionDetails.Version.Major}.{versionDetails.Version.Minor}";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using Microsoft.PowerShell.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class RunspaceChangedEvent
{
public static readonly
EventType<RunspaceDetails> Type =
EventType<RunspaceDetails>.Create("powerShell/runspaceChanged");
}

public class RunspaceDetails
{
public PowerShellVersion PowerShellVersion { get; set; }

public RunspaceLocation RunspaceType { get; set; }

public string ConnectionString { get; set; }

public RunspaceDetails()
{
}

public RunspaceDetails(Session.RunspaceDetails eventArgs)
{
this.PowerShellVersion = new PowerShellVersion(eventArgs.PowerShellVersion);
this.RunspaceType = eventArgs.Location;
this.ConnectionString = eventArgs.ConnectionString;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected override void Shutdown()
{
if (this.tcpListener != null)
{
this.networkStream.Dispose();
this.tcpListener.Stop();
this.tcpListener = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void Stop()
{
this.messageLoopCancellationToken.Cancel();
this.messageLoopThread.Stop();
SynchronizationContext.SetSynchronizationContext(null);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ private void MessageDispatcher_UnhandledException(object sender, Exception e)
{
this.endpointExitedTask.SetException(e);
}

else if (this.originalSynchronizationContext != null)
{
this.originalSynchronizationContext.Post(o => { throw e; }, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<Compile Include="DebugAdapter\AttachRequest.cs" />
<Compile Include="DebugAdapter\Breakpoint.cs" />
<Compile Include="DebugAdapter\ConfigurationDoneRequest.cs" />
<Compile Include="DebugAdapter\ContinuedEvent.cs" />
<Compile Include="DebugAdapter\ContinueRequest.cs" />
<Compile Include="DebugAdapter\SetFunctionBreakpointsRequest.cs" />
<Compile Include="DebugAdapter\SetVariableRequest.cs" />
Expand All @@ -61,6 +62,7 @@
<Compile Include="LanguageServer\FindModuleRequest.cs" />
<Compile Include="LanguageServer\InstallModuleRequest.cs" />
<Compile Include="LanguageServer\PowerShellVersionRequest.cs" />
<Compile Include="LanguageServer\RunspaceChanged.cs" />
<Compile Include="LanguageServer\SetPSSARulesRequest.cs" />
<Compile Include="LanguageServer\ProjectTemplate.cs" />
<Compile Include="MessageProtocol\Channel\NamedPipeClientChannel.cs" />
Expand Down
Loading