Remove isFinalized semantic tokens logic#6194
Closed
allisonchou wants to merge 1 commit into
Closed
Conversation
ryanbrandenburg
approved these changes
Mar 22, 2022
ryanbrandenburg
left a comment
There was a problem hiding this comment.
Seems good from our end. I'm curious about the Removal of the Frozen Semantic stuff, is that something that's just going to be turned off for the LSP or is it getting removed entirely?
Author
Just turned off for Razor LSP since the |
Author
|
Superseded by dotnet/roslyn#60484 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the changes
This is unfortunate, but after talking with Cyrus, it turns out Roslyn doesn't have an accurate way to tell if frozen partial semantics have been finalized. Occasionally, this issue results in C# continually returning false for the
isFinalizedproperty, which in turn means we never cache tokens.Currently, the only options here are to (1) remove frozen partial semantics or (2) don't use caching. This PR opts for (1), since frozen partial semantics are most valuable at document open, while caching should be valuable throughout the use the document. (1) also means that we don't have to ask the C# server for tokens every time the LSP server sends us a request.
I tested and besides for the initial colorization potentially seeming a bit more delayed, there don't seem to be other noticeable drawbacks.
There will also be a Roslyn side PR that will have to be dual inserted with this one: [to-do: add link]
Fixes:
[LSP] Semantic tokens
isFinalizedproperty continually returning false on document open roslyn#59777