Remove isFinalized semantic tokens logic #6194
Closed
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
isFinalized
property, 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
isFinalized
property continually returning false on document open roslyn#59777