Use ConfigureAwait(true) when in a blocking JTF run call#79456
Merged
CyrusNajmabadi merged 6 commits intodotnet:mainfrom Jul 18, 2025
Merged
Use ConfigureAwait(true) when in a blocking JTF run call#79456CyrusNajmabadi merged 6 commits intodotnet:mainfrom
CyrusNajmabadi merged 6 commits intodotnet:mainfrom
Conversation
src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
Outdated
Show resolved
Hide resolved
ToddGrun
reviewed
Jul 18, 2025
src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
Outdated
Show resolved
Hide resolved
jasonmalinowski
approved these changes
Jul 18, 2025
Member
jasonmalinowski
left a comment
There was a problem hiding this comment.
Perf tweak to use GetTextSynchronously could be a follow up.
…ice`2.VsLanguageDebugInfo.cs Co-authored-by: Jason Malinowski <jason@jason-m.com>
Contributor
Author
|
Made the tweaks. |
Contributor
Author
|
Agreed. Made that change as well.
…On Thu, Jul 17, 2025 at 5:23 PM Todd Grunke ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
src/VisualStudio/Core/Def/LanguageService/AbstractLanguageService`2.VsLanguageDebugInfo.cs
<#79456 (comment)>:
> - span = mappedSpan.Value;
-
- return new VsDebugName(breakpoint.LocationNameOpt, filePath!, span);
+ async ValueTask<IVsDebugName> CreateDebugNameAsync(
+ BreakpointResolutionResult breakpoint, CancellationToken cancellationToken)
+ {
+ // We're in a blocking jtf run. So CA(true) all calls to ensure we're coming bac
+ // and using the blocked thread whenever possible.
+
+ var document = breakpoint.Document;
+ var filePath = _languageService.Workspace.GetFilePath(document.Id);
+ var text = await document.GetValueTextAsync(cancellationToken).ConfigureAwait(true);
+ var span = text.GetVsTextSpanForSpan(breakpoint.TextSpan);
+ // If we're inside an Venus code nugget, we need to map the span to the surface buffer.
+ // Otherwise, we'll just use the original span.
+ var mappedSpan = await span.MapSpanFromSecondaryBufferToPrimaryBufferAsync(
MapSpanFromSecondaryBufferToPrimaryBufferAsync
<http://example.com/codeflow?start=44&length=46>
It looks like the only reason
MapSpanFromSecondaryBufferToPrimaryBufferAsync is async is to ensure we're
on the main thread. Should we just use a sync version of that method
instead?
—
Reply to this email directly, view it on GitHub
<#79456 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABC2MY2KVV432FPJB5VFLO33JA473AVCNFSM6AAAAACBZHHKHOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTAMZRGM4DINBXGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2521664