Skip to content
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 sync over async blocking in workspace #76491

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner December 18, 2024 16:43
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 18, 2024
@CyrusNajmabadi
Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi merged commit a4324e6 into dotnet:main Dec 18, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the removeBlockingWait branch December 18, 2024 19:09
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 18, 2024
@@ -456,17 +462,18 @@ public async Task<IEnumerable<TextChange>> GetTextChangesAsync(Document oldDocum
// get changes by diffing the trees
if (this.SupportsSyntaxTree)
{
var tree = (await this.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false))!;
var oldTree = await oldDocument.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
var tree = this.GetSyntaxTreeSynchronously(cancellationToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CyrusNajmabadi Not sure I understand this bit unless you had some other data for it -- GetSyntaxTreeSynchronously will block threads if we have to read the tree from disk. That's considered acceptable in the UI thread case (since the thread is blocked either way), but this could create problems if we we're calling it on a bunch of threads all at once since we might block up the thread pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants