-
Notifications
You must be signed in to change notification settings - Fork 4k
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] Modify semanticTokens isFinalized
logic
#60484
Changes from 5 commits
c6d83aa
2f569b8
eae6fa3
1828ce3
20cf491
4740f18
8606db0
fe6307f
ef16c05
d3274e2
3af6c20
f96cf89
fb287ff
9bc049f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,13 @@ public SemanticTokensRangeHandler(IGlobalOptionService globalOptions) | |
|
||
var options = _globalOptions.GetClassificationOptions(context.Document.Project.Language); | ||
|
||
// If the project's compilation isn't yet available, kick off a task in the background to | ||
// hopefully make it available faster since we'll need it later to compute tokens. | ||
if (!context.Document.Project.TryGetCompilation(out _)) | ||
{ | ||
_ = context.Document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is supposed to be handled by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was an issue in Razor where cc @CyrusNajmabadi is this the correct way to handle things? |
||
|
||
// The results from the range handler should not be cached since we don't want to cache | ||
// partial token results. In addition, a range request is only ever called with a whole | ||
// document request, so caching range results is unnecessary since the whole document | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ Do we want to use frozen partial semantics with
isFinalized
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I wouldn't think so? I believe we want to call
TryGetCompilation
on the complete document. The only other place the frozen document would be used withisFinalized
is when retrieving the WorkspaceStatusService, and unless I'm mistaken it doesn't seem like frozen partial semantics would be useful for that.