-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Implement LSP debug test commands #69267
Conversation
@@ -120,12 +120,24 @@ | |||
<data name="Aborted" xml:space="preserve"> | |||
<value>Aborted!</value> | |||
</data> | |||
<data name="Attaching_debugger_to_process" xml:space="preserve"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like should be called
Attaching_debugger_to_process_0
if (attachDebugger) | ||
{ | ||
// When we want to debug tests we need to use a custom test launcher so that we get called back with the process to attach to. | ||
vsTestConsoleWrapper.RunTestsWithCustomTestHost(testCases, runSettings: null, handler, new DebugTestHostLauncher(progress, clientLanguageServerManager)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to check, O# also doesn't support runSettings
, is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O# does, but I haven't implemented it yet here. That will be my next followup.
// Send an explicit request to the client to tell it to attach to the debugger and wait for the response. | ||
// We want to wait for the attach to complete before we continue. | ||
var task = Task.Run(async () => await AttachDebuggerAsync(processId, cancellationToken), cancellationToken); | ||
return task.WaitAndGetResult_CanCallOnBackground(cancellationToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the client-side PR. But it feels like
the client-side debug test command is waiting for the server debug test, and the server then waits for the client to attach the debugger to the process. 🤔 Are the 'debugger attaching' work lives in a separate thread?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just feel this looks like a deadlock, maybe it's fine as long as you test that works😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure on the question - but yes the client is not fully blocked waiting for the run tests command to complete. It needs to be able to handle the partial results (e.g. the logging) and this debug attach request while its waiting for the overall request to complete.
A few minor questions and I will sign this off after they get answer :) |
Implements server side of test debugging. Part of dotnet/vscode-csharp#5719
See the client PR for a gif - dotnet/vscode-csharp#5965