Apply changes directly to text buffer#62337
Merged
tmat merged 1 commit intodotnet:mainfrom Jul 7, 2022
Merged
Conversation
Member
Author
|
@CyrusNajmabadi PTAL |
| subjectBuffer.ApplyChanges(formattedChanges); | ||
|
|
||
| workspace.ApplyDocumentChanges(formattedDocument, cancellationToken); | ||
| transaction.Complete(); |
Contributor
There was a problem hiding this comment.
this is the part i'm least comfortable with. can you smoke test this otu a bit?
CyrusNajmabadi
approved these changes
Jul 6, 2022
Member
I don't understand this part though, how to apply changes via |
genlu
approved these changes
Jul 6, 2022
Member
Author
|
@genlu We have an extension method that does that: I should have perhaps said a combination of GetTextChangesAsync, UpdateDocument and TryApplyChanges. Workspace.TryApplyChanges actually also runs async task and waits for it :-/ |
Member
|
Thanks for the explanation, looks like we'd see UI delay improvement in completion commit action for sure with this change👍 |
Member
Author
|
That's the hope :) |
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Jul 7, 2022
* upstream/main: (62 commits) Prevent assert from being hit (dotnet#62366) Don't offer '??=' for pointer types (dotnet#62476) Integrate generator times into /reportAnalyzer (dotnet#61661) Switch to a callback for cleaning up resources instead of passing in an explicit IDisposable. (dotnet#62373) Filter trees to only those containing global-usings or attributes prior to analyzing them. (dotnet#62444) Update PublishData.json Complete 'file' support for `SyntaxGenerator` (dotnet#62413) Apply changes directly to text buffer (dotnet#62337) Remove LangVer check from extended nameof binding (dotnet#62339) Fixed shared project file error (dotnet#62466) Handle new error codes Use MSBuid generated property for package path Exclude BCL libraries from Roslyn vsix Bump the integration test timeouts a bit Skip the balanced switch dispatch optimization for patterns on floating-point inputs (dotnet#62322) Test helpers shouldn't escape quotes by default (dotnet#62321) Reuse prior TableEntry values in the increment NodeTable builder if possible. (dotnet#62320) Install 3.1 runtime for SBOM tool Generate VS SBOM during official build. Minor refactoring in 'required' handling for override completion (dotnet#62422) ...
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Jul 13, 2022
tmat
added a commit
that referenced
this pull request
Jul 13, 2022
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Jul 13, 2022
…dotnet#62589)" This reverts commit 0a39dcf.
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Jul 13, 2022
…dotnet#62589)" This reverts commit 0a39dcf.
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Jul 14, 2022
…dotnet#62589)" This reverts commit 0a39dcf.
tmat
added a commit
to tmat/roslyn
that referenced
this pull request
Jul 14, 2022
…dotnet#62589)" This reverts commit 0a39dcf.
tmat
added a commit
that referenced
this pull request
Jul 18, 2022
adamperlin
pushed a commit
to adamperlin/roslyn
that referenced
this pull request
Jul 19, 2022
adamperlin
pushed a commit
to adamperlin/roslyn
that referenced
this pull request
Jul 19, 2022
* Revert "Revert "Apply changes directly to text buffer (dotnet#62337)" (dotnet#62589)" This reverts commit 0a39dcf. * Apply changes to ContainedDocument subject buffer
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.
Some command handlers apply changes to workspace via
GetTextChangesAsync, which may block the UI thread until a background task is complete. This change updates these handlers to apply the changes directly to the editor buffer.Contributes to #57554
Validation PR: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/409315