-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fixed ECMAScript private member highlighting #10554
Fixed ECMAScript private member highlighting #10554
Conversation
I have no idea what that test failure is about. Running it on my own mac I can't repro it and it's complaining about the Rust grammar, which I haven't touched. |
Github CI switched their macOS runners to ARM. We cleared the cache yesterday so the tests should pass now |
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.
Could you add the new keys to the docs? https://github.com/helix-editor/helix/blob/master/book/src/themes.md#syntax-highlighting
I would drop |
76748e3
to
bb668cf
Compare
@the-mikedavis Done @cotneit I've made them child keys so that they can just be ignored, but my preference is to keep them because it allows colouring the private fields/methods slightly differently if you wish - eg in my custom theme I have private members the same colours with the saturation turned down a bit to make them distinct. |
It's bugged me that private members haven't been highlighted in editor I've used so far, so I've added the queries to allow actually restyling. Currently, they're targeted as a
.private
child undervariable.other.member
andfunction.method
so that they automatically take on the existing highlighting properly while being individually style-able. This was a personal preference, since it would match other langs which don't colour public & private methods/field differently while allowing the unique syntax of JS to be taken advantage of, however there's 2 other options that could also work:.private
parts and match other langs exactlyvariable.other.private-member
) to preserve the current lack of stylingExample code that shows what syntax it now highlights:
Funnily enough, even GitHub doesn't handle private props properly. Not sure if that's an oversight or a stylistic choice, but it bugs the hell out of me.