Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSharpTestEmbeddedLanguageClassifier crashes with index out of range #76575

Closed
jnm2 opened this issue Dec 28, 2024 · 0 comments · Fixed by #76576
Closed

CSharpTestEmbeddedLanguageClassifier crashes with index out of range #76575

jnm2 opened this issue Dec 28, 2024 · 0 comments · Fixed by #76576
Labels

Comments

@jnm2
Copy link
Contributor

jnm2 commented Dec 28, 2024

Version Used: 17.13.0 Preview 2.1

This is when using [StringSyntax(PredefinedEmbeddedLanguageNames.CSharpTest)] in tests in Roslyn.sln.

StreamJsonRpc.RemoteInvocationException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__156`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__20`1.MoveNext()
RPC server exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
      at Microsoft.CodeAnalysis.Collections.Internal.ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessException()
      at Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars.VirtualCharSequence.ImmutableSegmentedListChunk.get_Item(Int32 index)
      at Microsoft.CodeAnalysis.CSharp.Features.EmbeddedLanguages.CSharpTestEmbeddedLanguageClassifier.RegisterClassifications(EmbeddedLanguageClassificationContext context)
      at Microsoft.CodeAnalysis.Classification.AbstractEmbeddedLanguageClassificationService.Worker.ClassifyToken(SyntaxToken token)
      at Microsoft.CodeAnalysis.Classification.AbstractEmbeddedLanguageClassificationService.Worker.VisitTokens(SyntaxNode node)
      at Microsoft.CodeAnalysis.Classification.AbstractEmbeddedLanguageClassificationService.AddEmbeddedLanguageClassifications(SolutionServices services, Project project, SemanticModel semanticModel, ImmutableArray`1 textSpans, ClassificationOptions options, SegmentedList`1 result, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Classification.AbstractEmbeddedLanguageClassificationService.AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray`1 textSpans, ClassificationOptions options, SegmentedList`1 result, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Classification.AbstractClassificationService.AddClassificationsInCurrentProcessAsync(Document document, ImmutableArray`1 textSpans, ClassificationType type, ClassificationOptions options, SegmentedList`1 result, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Classification.AbstractClassificationService.AddClassificationsAsync(Document document, ImmutableArray`1 textSpans, ClassificationOptions options, ClassificationType type, SegmentedList`1 result, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteSemanticClassificationService.<>c__DisplayClass20_0.<<GetClassificationsAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
   --- End of stack trace from previous location ---
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunServiceImplAsync[T](Func`2 implementation, CancellationToken cancellationToken)
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 28, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant