Skip to content

[LSP] Initial semantic tokens should be computed against frozen compilation  #55637

@dibarbet

Description

@dibarbet

The tagger path for semantic classification has an optimization that computes semantic classifications against a partial compilation, see https://github.com/dotnet/roslyn/pull/51704/files#diff-ddf5793d3c96527cf4835c68a8ad16718cec4df3b8c4e7aa2d6b1c979340e4f4R50

It also listens to compilation events and once available, triggers an update to get the real classifications.

This needs to be brought over to LSP to prevent large delays in classification on initial open.

  1. Compute semantic classifications using WithFrozenPartialSemantics as in the PR above.

  2. Implement the semantic tokens refresh notification from server to client once the full compilation is available. This will tell the client to re-ask us for updated semantic tokens. Note that this is blocked on https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1374375

    a. It may be possible to just implement 1). Since the client polls the server for semantic tokens, at most we would wait 10seconds for a new client request to recolor. Note that this is a VS client implementation detail, so 2) is the preferred solution.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions