Skip to content

Commit 15df83a

Browse files
authored
Convert assert to a log message (#10317)
Seems like timing changes in the system have resulted in us recieving generated C# for miscellaneous project files, so we're hitting this assert more often now. Removing it doesn't seem to have any noticable effects, we get the right C# content for the right projects soon after, as the server loads information.
2 parents b8fa0bc + 227acd6 commit 15df83a

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)