Skip to content

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Mar 6, 2024

In order to work in cohosting, and hence OOP, its a lot easier with a couple of relatively simple changes to the semantic tokens service:

  1. Use MS.CA.Text types instead of LSP protocol types
  2. Extract C# tokens requests to a separate service

This PR does both of those things, and also:

  1. Move telemetry reporting out of the service, up into the endpoint

This is targeting the "regress cohosting" branch because it turns out this new design is impossible in cohosting right now 🤦‍♂️

Part of #9519

@davidwengier davidwengier requested a review from a team as a code owner March 6, 2024 04:04

namespace Microsoft.AspNetCore.Razor.LanguageServer.Semantic;

internal class LSPCSharpSemanticTokensProvider(IClientConnection clientConnection, IRazorLoggerFactory loggerFactory) : ICSharpSemanticTokensProvider
Copy link
Member Author

@davidwengier davidwengier Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a direct move from the sematic tokens service (and change to use LinePositionSpan). The idea is the OOP will have a different implementation of this service (that doesn't use LSP)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll trust you this and won't be reviewing this file :)

@davidwengier davidwengier force-pushed the SemanticTokensService branch from 166c9e1 to 8a5839e Compare March 6, 2024 04:19
@davidwengier davidwengier force-pushed the SemanticTokensService branch from 8a5839e to e7bf11b Compare March 6, 2024 04:22
@davidwengier davidwengier changed the base branch from RegressCohost to main March 6, 2024 09:45
@davidwengier davidwengier force-pushed the SemanticTokensService branch from e7bf11b to 23c1c88 Compare March 6, 2024 09:48
options.HtmlVirtualDocumentSuffix == "__virtual.html",
MockBehavior.Strict);

var cSharpSemanticTokensProvider = new LSPCSharpSemanticTokensProvider(_clientConnection.Object, LoggerFactory);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cShar

super-nit :) funky capitalization, seems like we use "csharpXXX" elsewhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100%! I was chasing the code fixes for a bunch of these, but I guess I missed a few. Thanks!

Copy link
Contributor

@alexgav alexgav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@davidwengier davidwengier enabled auto-merge March 7, 2024 06:17
@davidwengier davidwengier merged commit 9a18d3d into main Mar 7, 2024
@davidwengier davidwengier deleted the SemanticTokensService branch March 7, 2024 06:39
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 7, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants