-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Version Used: 2.11.0-beta2-63527-06
Steps to Reproduce:
I'm hitting a Contract.Fail inside some Roslyn types in the unit tests for Razor Find All References. This is sporadic and doesn't have a consistent repro but I've hit it enough by now that it's becoming troublesome.
Example of a test that can sometimes fail: https://github.com/aspnet/Razor/blob/6c1bee1940e94387d96b03ed03837ad232a82099/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/RazorExcerptServiceTest.cs#L507
Stack Trace:
at Microsoft.CodeAnalysis.DocumentState.GetSyntaxTreeAsync(CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Solution/DocumentState.cs:line 631
at Microsoft.CodeAnalysis.Document.GetSyntaxRootAsync(CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Solution/Document.cs:line 204
at Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetSemanticModelForSpanAsync(Document document, TextSpan span, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Shared/Extensions/DocumentExtensions.cs:line 58
at Microsoft.CodeAnalysis.Classification.Classifier.GetClassifiedSpansAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Classification/Classifier.cs:line 23
at Microsoft.CodeAnalysis.Razor.RazorDocumentExcerptService.ClassifyPreviewAsync(SourceText primaryText, TextSpan excerptSpan, Document secondaryDocument, IReadOnlyList`1 mappings, CancellationToken cancellationToken) in /_/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorDocumentExcerptService.cs:line 175
at Microsoft.CodeAnalysis.Razor.RazorDocumentExcerptService.TryGetExcerptInternalAsync(Document document, TextSpan span, ExcerptModeInternal mode, CancellationToken cancellationToken) in /_/src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorDocumentExcerptService.cs:line 81
at Microsoft.CodeAnalysis.Razor.RazorExcerptServiceTest.TryGetExcerptInternalAsync_MultiLine_Boundaries_CanClassifyCSharp() in /_/src/Razor/test/Microsoft.CodeAnalysis.Razor.Workspaces.Test/RazorExcerptServiceTest.cs:line 408
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----
at Microsoft.CodeAnalysis.Host.RecoverableWeakValueSource`1.GetValueAsync(CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Utilities/ValuesSources/RecoverableWeakValueSource.cs:line 105
at Microsoft.CodeAnalysis.RecoverableTextAndVersion.GetValueAsync(CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Solution/RecoverableTextAndVersion.cs:line 98
at Microsoft.CodeAnalysis.DocumentState.FullyParseTreeAsync(ValueSource`1 newTextSource, ProjectId cacheKey, String filePath, ParseOptions options, HostLanguageServices languageServices, SolutionServices solutionServices, PreservationMode mode, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Solution/DocumentState.cs:line 130
----- Inner Stack Trace -----
at Roslyn.Utilities.Contract.Fail(String message) in /_/src/Workspaces/Core/Portable/Utilities/Contract.cs:line 52
at Roslyn.Utilities.Contract.ThrowIfNull[T](T value, String message) in /_/src/Workspaces/Core/Portable/Utilities/Contract.cs:line 21
at Microsoft.CodeAnalysis.RecoverableTextAndVersion.RecoverableText.RecoverAsync(CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/Workspace/Solution/RecoverableTextAndVersion.cs:line 129
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented