Skip to content

Semantic tokens refresh notification has no effect when server only implements range support #1672

@dibarbet

Description

@dibarbet

In VSCode, when the server implements only range requests for semantic tokens, sending workspace/semanticTokens/refresh appears to generally have no effect on the active editor. Semantic tokens are only updated when the editor changes or is scrolled.

Related to dotnet/vscode-csharp#6884

Repro steps

  1. Implement only range requests for semantic tokens
  2. Invoke workspace/semanticTokens/refresh from the server

Actual Behavior:
Editor does not refresh tokens in the active editor. In the sample extension, I created a range only server and a command to explicitly trigger the refresh. After executing the command, tokens are not refreshed until the active editor is scrolled. Repro code is here - dibarbet/vscode-extension-samples@8389281

Image

Expected Behavior:
When the server sends an explicit refresh request, tokens in the viewport should be refreshed if the server only implements range requests.

This is important for the C# server as semantic tokens will be very incorrect while the project is loading. We send a refresh request when complete to ensure that the tokens are updated. We do not support full semantic tokens requests due to computation cost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions