Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37a47b7

Browse files
authored
Allow razor to use SolutionChecksumUpdater (#79373)
* Allow razor to use SolutionChecksumUpdaterSolutionChecksumUpdater allows incremental updates of sourcetexts in the server process, but was previously limited to just documents in the solution. Instead, by loosening this to allow TextDocuments, razor editing can have incremental updates of the primary razor document when cohosting is turned on.* use is/or instead of ==/||
1 parent4fab744 commit37a47b7

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

‎src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
usingSystem;
6+
usingSystem.Diagnostics;
67
usingSystem.Threading;
78
usingSystem.Threading.Tasks;
89
usingMicrosoft.CodeAnalysis.ErrorReporting;
@@ -102,11 +103,24 @@ private void OnWorkspaceChanged(WorkspaceChangeEventArgs _)
102103

103104
privatevoidOnWorkspaceChangedImmediate(WorkspaceChangeEventArgse)
104105
{
105-
if(e.Kind==WorkspaceChangeKind.DocumentChanged)
106+
if(e.KindisWorkspaceChangeKind.DocumentChanged orWorkspaceChangeKind.AdditionalDocumentChanged)
106107
{
107108
vardocumentId=e.DocumentId!;
108-
varoldDocument=e.OldSolution.GetRequiredDocument(documentId);
109-
varnewDocument=e.NewSolution.GetRequiredDocument(documentId);
109+
TextDocumentoldDocument;
110+
TextDocumentnewDocument;
111+
112+
if(e.Kind==WorkspaceChangeKind.DocumentChanged)
113+
{
114+
oldDocument=e.OldSolution.GetRequiredDocument(documentId);
115+
newDocument=e.NewSolution.GetRequiredDocument(documentId);
116+
}
117+
else
118+
{
119+
Debug.Assert(e.Kind==WorkspaceChangeKind.AdditionalDocumentChanged);
120+
121+
oldDocument=e.OldSolution.GetRequiredAdditionalDocument(documentId);
122+
newDocument=e.NewSolution.GetRequiredAdditionalDocument(documentId);
123+
}
110124

111125
// Fire-and-forget to dispatch notification of this document change event to the remote side
112126
// and return to the caller as quickly as possible.
@@ -157,8 +171,8 @@ await client.TryInvokeAsync<IRemoteAssetSynchronizationService>(
157171
}
158172

159173
privateasyncTaskDispatchSynchronizeTextChangesAsync(
160-
DocumentoldDocument,
161-
DocumentnewDocument)
174+
TextDocumentoldDocument,
175+
TextDocumentnewDocument)
162176
{
163177
// Explicitly force a yield point here to ensure this method returns to the caller immediately and that
164178
// all work is done off the calling thread.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp