-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: Improve existing syntax highlighting #3
Conversation
280e4af
to
d523087
Compare
1. Differentiate function names and variable names 2. Add highlights for more keywords 3. Modularize some of the rules such as params 4. Re-order the patterns so specific rules will take precedence
d523087
to
40fdc9f
Compare
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 just stumbled across this pull request and found some things i would do slightly different. Also (I didn't comment this in the code) i was asking myself, what might has been the reason for you to remove the includes of "source.python" and "source.shell". I think using them could make it easier to write the code, while being sure that the code inside functions gets highlighted properly. But maybe I am wrong with that?
1. Add more keywords 2. Handle highlights within parens and braces 3. Handle nested patterns such as content within a pair of curly braces
1. Highlight numeric values 2. Highlight parenthesis 3. Highlight @ sign with ${} 4. Highlight boolean values
Thanks for the feedback, I pushed some new changes before I saw your comments. The new one should have fixed most of the issues you mentioned. As for |
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.
Looks quite good. Just a bunch of corner cases I found:
# python should be colored as a variable
python = "test"
# inherit should be colored as a function name
python inherit () {}
# 'then' should be same color as 'if'
if [ somecondition ] ; then
# no idea what should happen, but this is weird
TEST = python inherit () {}
# This one too is weird
inherit from export inherit from test inherit test from inherit
That being said, don't hesitate to just merge and look at it later.
I would also suggest to use a json prettifier to set the indentation to 2 spaces so we can track the changes better.
1. Apply python-style highlighting on text within [] 2. Improve highlighting on boolean values
Improve existing syntax highlighting