Skip to content

Commit 5bd7adf

Browse files
committed
Add log message and assert to identify PRISM bug
1 parent 77b30be commit 5bd7adf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentSynchronization/DocumentDidChangeEndpoint.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.Diagnostics;
67
using System.Threading;
78
using System.Threading.Tasks;
89
using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts;
@@ -51,7 +52,9 @@ public async Task HandleNotificationAsync(DidChangeTextDocumentParams request, R
5152
var documentContext = requestContext.DocumentContext;
5253
if (documentContext is null)
5354
{
54-
throw new InvalidOperationException($"Could not find a document context for didChange on '{request.TextDocument.Uri}'"); ;
55+
_logger.LogError($"Could not find a document context for didChange on '{request.TextDocument.Uri}'");
56+
Debug.Fail($"Could not find a document context for didChange on '{request.TextDocument.Uri}'");
57+
throw new InvalidOperationException($"Could not find a document context for didChange on '{request.TextDocument.Uri}'");
5558
}
5659

5760
var sourceText = await documentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)