public async Task RazorSemanticTokensRangeAsync()
        {
            var textDocumentIdentifier = new TextDocumentIdentifier(DocumentUri);
            var cancellationToken      = CancellationToken.None;
            var documentVersion        = 1;

            await UpdateDocumentAsync(documentVersion, DocumentSnapshot).ConfigureAwait(false);

            await RazorSemanticTokenService.GetSemanticTokensAsync(
                textDocumentIdentifier, Range, DocumentSnapshot, documentVersion, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 2
0
        public async Task RazorSemanticTokensEditAsync()
        {
            var textDocumentIdentifier = new TextDocumentIdentifier(DocumentUri);
            var cancellationToken      = CancellationToken.None;
            var firstVersion           = 1;

            await UpdateDocumentAsync(firstVersion, DocumentSnapshot).ConfigureAwait(false);

            var fullResult = await RazorSemanticTokenService.GetSemanticTokensAsync(textDocumentIdentifier, DocumentSnapshot, firstVersion, range : null, cancellationToken).ConfigureAwait(false);

            var secondVersion = 2;

            await UpdateDocumentAsync(secondVersion, UpdatedDocumentSnapshot).ConfigureAwait(false);

            var editResult = await RazorSemanticTokenService.GetSemanticTokensEditsAsync(UpdatedDocumentSnapshot, secondVersion, textDocumentIdentifier, fullResult.ResultId, cancellationToken).ConfigureAwait(false);
        }