Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions src/EditorFeatures/Core/Remote/SolutionChecksumUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
Expand Down Expand Up @@ -102,11 +103,24 @@ private void OnWorkspaceChanged(WorkspaceChangeEventArgs _)

private void OnWorkspaceChangedImmediate(WorkspaceChangeEventArgs e)
{
if (e.Kind == WorkspaceChangeKind.DocumentChanged)
if (e.Kind == WorkspaceChangeKind.DocumentChanged || e.Kind == WorkspaceChangeKind.AdditionalDocumentChanged)
{
var documentId = e.DocumentId!;
var oldDocument = e.OldSolution.GetRequiredDocument(documentId);
var newDocument = e.NewSolution.GetRequiredDocument(documentId);
TextDocument oldDocument;
TextDocument newDocument;

if (e.Kind == WorkspaceChangeKind.DocumentChanged)
{
oldDocument = e.OldSolution.GetRequiredDocument(documentId);
newDocument = e.NewSolution.GetRequiredDocument(documentId);
}
else
{
Debug.Assert(e.Kind == WorkspaceChangeKind.AdditionalDocumentChanged);

oldDocument = e.OldSolution.GetRequiredAdditionalDocument(documentId);
newDocument = e.NewSolution.GetRequiredAdditionalDocument(documentId);
}
Copy link
Member

Choose a reason for hiding this comment

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

i wonder if we need GetRequiredAnalyzerConfigDocument...


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

private async Task DispatchSynchronizeTextChangesAsync(
Document oldDocument,
Document newDocument)
TextDocument oldDocument,
TextDocument newDocument)
{
// Explicitly force a yield point here to ensure this method returns to the caller immediately and that
// all work is done off the calling thread.
Expand Down
Loading