-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove cancellation token from tagging context object. #57167
Remove cancellation token from tagging context object. #57167
Conversation
this.ThreadingContext.JoinableTaskFactory.Run( | ||
() => ProduceTagsAsync(context, new DocumentSnapshotSpan(document, spanToTag), _owner._typeMap)); | ||
() => ProduceTagsAsync(context, new DocumentSnapshotSpan(document, spanToTag), _owner._typeMap, 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.
cancellationToken
will be captured for this lambda even on code paths where canReuseCache
is true. I didn't evaluate how common this is, but if this method normally doesn't use this code path and normally doesn't allocate (or limited allocations) and is called frequently, this could be observable in perf.
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.
we capture everything else passed along here. i'm not sure why this woudl matter.
similary, this codepaths runs once per Copy operation. it doesn't seem like any change here would be relevant.
/// <summary> | ||
/// Remove once TypeScript finishes https://github.com/dotnet/roslyn/issues/57180. | ||
/// </summary> | ||
protected virtual Task ProduceTagsAsync(TaggerContext<TTag> context, DocumentSnapshotSpan snapshotSpan, int? caretPosition) |
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.
once this merged in, i'll make the requisite changes on the TS side @DanielRosenwasser @amcasey @minestarks
note: there is no ABI or functionality change in my PR. just the introduction of a preferred method to use instead. once i move TS over to using it, i'll remove the now-legacy ABI stubs.
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.
No description provided.