Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP: Support textDocument/semanticTokens/full and textDocument/semanticTokens/full/delta #70536

Open
AnhQuanTrl opened this issue Oct 24, 2023 · 0 comments
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@AnhQuanTrl
Copy link

AnhQuanTrl commented Oct 24, 2023

Summary

The new LSP only have support for the textDocument/semanticTokens/range due to performance reason. As quoted in one of the comment in the code:

// Using only range handling has shown to be more performant than using a combination of full/edits/range
// handling, especially for larger files. With range handling, we only need to compute tokens for whatever
// is in view, while with full/edits handling we need to compute tokens for the entire file and then
// potentially run a diff between the old and new tokens.

It would be awesome if the LSP can support other types of semanticTokens requests as well.

Background and Motivation

Other editors such as Neovim or Emac that want to integrate with the new LSP might not be able to utilize the semantic token support because those clients have not implement the range request. It would be great if the the LSP should support all of these capabilities and let's the client decide if they want to improve performance by using the range request. If clients chose to use the full alternative, they must live with the performance hit.
Before making this issue, I understand that the priority of supporting other editors is low, nor semanticTokens is a deal breaker for the coding experience. Just want to note down something that we can improve upon.

Proposed Feature

The LSP should support either textDocument/semanticTokens/full or textDocument/semanticTokens/full/delta or both

Alternative Designs

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Oct 24, 2023
@deepakrathore33 deepakrathore33 added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Oct 23, 2024
@deepakrathore33 deepakrathore33 added this to the Backlog milestone Oct 23, 2024
@deepakrathore33 deepakrathore33 removed the untriaged Issues and PRs which have not yet been triaged by a lead label Oct 23, 2024
dibarbet added a commit that referenced this issue Mar 19, 2025
Solves #70536 (apart from delta). Some editors, such as neovim, don't
support textDocument/semanticTokens/range, which means that you
currently don't get semantic highlighting for .NET in these editors.
Getting semantic tokens for the entire document is of course slower, but
the editor can decide what to do anyway.

Tested and working with neovim.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

No branches or pull requests

2 participants