Skip to content

Commit 227acd6

Browse files
committed
Convert assert to a log message
1 parent 77b30be commit 227acd6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/LanguageClient/Endpoints/RazorCustomMessageTarget_UpdateCSharpBuffer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ request.ProjectKeyId is not null &&
9393

9494
if (virtualDocuments.Length > 1)
9595
{
96-
// If the particular document supports multiple virtual documents, we don't want to try to update a single one
97-
// TODO: Remove this eventually, as it is a possibly valid state (see comment below) but this assert will help track
98-
// down bugs for now.
99-
Debug.Fail("Multiple virtual documents seem to be supported, but none were updated, which is not impossible, but surprising.");
96+
// If the particular document supports multiple virtual documents, we don't want to try to update a single one. The server could
97+
// be sending C# for a Misc Files file, but once the server knows about the real project, it will start sending C# for that, and
98+
// that needs to be a brand new buffer.
99+
_logger.LogDebug($"""
100+
Was looking for {request.ProjectKeyId} but found only:
101+
{string.Join(Environment.NewLine, virtualDocuments.Select(d => $"[{d.ProjectKey}] {d.Uri}"))}
102+
""");
100103
}
101104

102105
_logger?.LogDebug($"UpdateCSharpBuffer couldn't find any virtual docs for {request.HostDocumentVersion} of {hostDocumentUri}");

0 commit comments

Comments
 (0)