-
Notifications
You must be signed in to change notification settings - Fork 199
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
Fix C# background color bug when using tab indentation #9257
Conversation
@@ -70,6 +70,10 @@ internal class RazorSemanticTokensInfoService : IRazorSemanticTokensInfoService | |||
{ | |||
csharpSemanticRanges = await GetCSharpSemanticRangesAsync(codeDocument, textDocumentIdentifier, range, razorSemanticTokensLegend, documentContext.Version, correlationId, cancellationToken).ConfigureAwait(false); | |||
} | |||
catch (OperationCanceledException) |
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.
Noticed in the logs we were reporting this as an issue, when its totally normal, and in fact it should probably happen a little more than it does now!
// Weren't able to re-invoke C# semantic tokens but we have to indicate it's due to out of sync by providing the old version | ||
return new ProvideSemanticTokensResponse(tokens: null, hostDocumentSyncVersion: csharpDoc.HostDocumentSyncVersion ?? -1); | ||
} | ||
|
||
_logger?.LogDebug("Made {count} semantic tokens requests to Roslyn", semanticTokensParams.Ranges.Length); |
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.
Snuck this one in too, so we can see what is going on with our new feature flag.
@@ -230,7 +230,7 @@ private static bool ContainsOnlySpacesOrTabs(SourceText razorSource, int startIn | |||
var end = startIndex + count; | |||
for (var i = startIndex; i < end; i++) | |||
{ | |||
if (razorSource[i] is not ' ' or '\t') | |||
if (razorSource[i] is not (' ' or '\t')) |
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.
This is subtle, nice catch!
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.
Would have been nicer to catch it when I wrote the code in the first place. Not the first time I've made this mistake either 🤦🏼♂️
Noticed while testing with a customer solution.
Commit-at-a-time to make the difference in the test baseline visible with the bug fix.