Skip to content

InvalidOperationException in integration test with LanguageClient using SemanticTokens #516

Closed
@anthony-c-martin

Description

@anthony-c-martin

I'm trying to add an integration test for semantic tokens to our codebase, but I'm hitting a cryptic exception on the semantic tokens request I make from client -> server:

Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll: 'Sequence contains no elements.'
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Bicep.LangServer.IntegrationTests.SemanticTokenTests.<Duplicate_tokens_are_not_returned>d__4.MoveNext() in /Users/ant/Code/bicep/src/Bicep.LangServer.IntegrationTests/SemanticTokenTests.cs:line 32

This is the PR I'm trying to introduce this test with: https://github.com/Azure/bicep/pull/1485/files - the test is under SemanticTokenTests.cs.

I'm not doing anything fancy to initialize the LanguageClient (init code here), and we use this same mechanism to test out various other language server features. I'm wondering if there's perhaps some mechanism to register capabilities that I'm missing?

Any pointers would be very helpful!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions