public async Task Should_Gather_Static_Registrations() { var(client, server) = await Initialize( new ConfigureClient().Configure, options => { new ConfigureServer().Configure(options); var semanticRegistrationOptions = new SemanticTokensRegistrationOptions { Id = Guid.NewGuid().ToString(), Legend = new SemanticTokensLegend(), Full = new SemanticTokensCapabilityRequestFull { Delta = true }, Range = new SemanticTokensCapabilityRequestRange(), DocumentSelector = DocumentSelector.ForLanguage("csharp") }; // Our server only statically registers when it detects a server that does not support dynamic capabilities // This forces it to do that. options.OnInitialized( (server, request, response, token) => { response.Capabilities.SemanticTokensProvider = SemanticTokensOptions.Of( semanticRegistrationOptions, Enumerable.Empty <ILspHandlerDescriptor>() ); response.Capabilities.SemanticTokensProvider.Id = semanticRegistrationOptions.Id; return(Task.CompletedTask); } ); } ); client.RegistrationManager.CurrentRegistrations.Should().Contain(x => x.Method == TextDocumentNames.SemanticTokensFull); }
public RegistrationExtensionResult GetRegistration() { var semanticTokensOptions = new SemanticTokensOptions { DocumentProvider = new SemanticTokensDocumentProviderOptions { Edits = false, }, Legend = SemanticTokensLegend.Instance, RangeProvider = false, }; return(new RegistrationExtensionResult(LanguageServerConstants.SemanticTokensProviderName, semanticTokensOptions)); }
public RegistrationExtensionResult GetRegistration() { var semanticTokensOptions = new SemanticTokensOptions { DocumentProvider = new SemanticTokensDocumentProviderOptions { Edits = true, }, Legend = SemanticTokensLegend.Instance, RangeProvider = true, }; return(new RegistrationExtensionResult(SemanticCapability, semanticTokensOptions)); }