Skip to content

Commit 4483c37

Browse files
rjmholtandyleejordan
authored andcommitted
Fix ThreadsHandler to use singular pipeline thread
1 parent 1cd0bb6 commit 4483c37

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/Handlers/ThreadsHandler.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,26 @@
77
using System.Threading.Tasks;
88
using OmniSharp.Extensions.DebugAdapter.Protocol.Models;
99
using OmniSharp.Extensions.DebugAdapter.Protocol.Requests;
10+
using Thread = OmniSharp.Extensions.DebugAdapter.Protocol.Models.Thread;
1011

1112
namespace Microsoft.PowerShell.EditorServices.Handlers
1213
{
1314
internal class ThreadsHandler : IThreadsHandler
1415
{
16+
internal static Thread PipelineThread { get; } =
17+
new Thread { Id = 1, Name = "PowerShell Pipeline Thread" };
18+
1519
public Task<ThreadsResponse> Handle(ThreadsArguments request, CancellationToken cancellationToken)
1620
{
1721
return Task.FromResult(new ThreadsResponse
1822
{
19-
// TODO: This is an empty container of threads...do we need to make a thread?
20-
Threads = new Container<System.Threading.Thread>()
23+
// TODO: OmniSharp supports multithreaded debugging (where
24+
// multiple threads can be debugged at once), but we don't. This
25+
// means we always need to set AllThreadsStoppped and
26+
// AllThreadsContinued in our events. But if we one day support
27+
// multithreaded debugging, we'd need a way to associate
28+
// debugged runspaces with .NET threads in a consistent way.
29+
Threads = new Container<Thread>(PipelineThread)
2130
});
2231
}
2332
}

0 commit comments

Comments
 (0)