Skip to content

Commit

Permalink
Updates after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwengier committed Dec 25, 2023
1 parent 7f258ab commit bf504f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public async Task InitializeRazorSemanticAsync()
DocumentContext = new VersionedDocumentContext(documentUri, documentSnapshot, projectContext: null, version: 1);

SemanticTokensLegend = new RazorSemanticTokensLegend(new VSInternalClientCapabilities() { SupportsVisualStudioExtensions = true });
RazorSemanticTokenService.ApplyCapabilities(new(), new VSInternalClientCapabilities() { SupportsVisualStudioExtensions = true });

var text = await DocumentSnapshot.GetTextAsync().ConfigureAwait(false);
Range = new Range
Expand Down Expand Up @@ -85,13 +86,14 @@ public async Task RazorSemanticTokensRangeScrollingAsync()
Uri = DocumentUri
};
var cancellationToken = CancellationToken.None;
var correlationId = Guid.Empty;
var documentVersion = 1;

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

var documentLineCount = Range.End.Line;

var clientConnection = RazorLanguageServer.GetRequiredService<IClientConnection>();

var lineCount = 0;
while (lineCount != documentLineCount)
{
Expand All @@ -102,11 +104,11 @@ public async Task RazorSemanticTokensRangeScrollingAsync()
End = new Position(newLineCount, 0)
};
await RazorSemanticTokenService!.GetSemanticTokensAsync(
clientConnection,
textDocumentIdentifier,
range,
DocumentContext,
SemanticTokensLegend,
correlationId,
colorBackground: false,
cancellationToken);

lineCount = newLineCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.LanguageServer.EndpointContracts;
using Microsoft.CommonLanguageServerProtocol.Framework;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.LanguageServer.Protocol;

namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic;
Expand Down

0 comments on commit bf504f3

Please sign in to comment.