-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
C# highlighting improvements #1795
C# highlighting improvements #1795
Conversation
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.
I haven't dug into this fully yet but it's looking like a great improvement! There are some highlights I've seen that I think would be good to include here as well if you like them:
; this list already exists and we should be able to just add "static" in
[
; ..
"static"
; ..
] @keyword
highlights a block like so:
using Status = Google.Rpc.Status;
using static EventStore.Client.Streams.BatchAppendReq.Types;
using static EventStore.Client.Streams.BatchAppendReq.Types.Options;
using OperationResult = EventStore.Core.Messages.OperationResult;
((identifier) @comment.unused
(#eq? @comment.unused "_"))
we've used in other languages that support pattern matching to mark it as an unused pattern.
For example in an expression like so:
Task.Delay(timeout, cancellationToken).ContinueWith(_ => onTimeout(), cancellationToken);
af3b264
to
4a01edb
Compare
Thanks for the input, I've adapted your changes |
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.
one more highlight I found looking at some example code:
[
; .. L148
">"
">="
] @operator
With that I think this will be ready to merge 👍
4a01edb
to
724ead1
Compare
I missed that there were operators that aren't covered yet, I checked this: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/#operator-precedence And I think I covered now every operator in one way or the other (something like "?." was not possible because it's already covered by "." and "?" I guess?) |
It's a bit confusing what can be written in strings with the query DSL: you can only write literal tokens that show up also as strings in the grammar (for example, these tokens). I don't see |
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.
Great work! This is a big improvement 💪
Adds more queries for better highlighting:
before:
after: