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
Add highlights.scm query for Solidity #2619
Add highlights.scm query for Solidity #2619
Conversation
- Use more specific/appropriate captures; change invalid captures - Don't highlight punctuations in type names (e.g., the brackets in 'bytes32[]')
@theHamsta Thanks for the quick review, I have made the following changes: |
queries/solidity/highlights.scm
Outdated
"memory" | ||
"storage" | ||
"calldata" | ||
"function" |
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.
@keyword.function
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.
Noted, thanks 🙏
queries/solidity/highlights.scm
Outdated
"else" | ||
"try" | ||
"catch" | ||
"return" |
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.
@keyword.return
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.
Noted, thanks 🙏
"contract" | ||
"interface" | ||
"library" | ||
"is" |
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.
maybe @keyword.operator
. Not sure, don't know the language.
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.
is
is used for defining inheritance relationship, so I don't think it is an operator like in python.
- Instead of @Keyword, use @conditional, @exception, @return, @function as appropriate - Standardize to using @field (instead of @Property)for struct members
@theHamsta Thanks again for the quick review. Apologies the missing out on the various captures (I had originally wanted to keep the highlights.scm query file more-or-less similar to upstream). I have went through the various available captures in the Contributing page and updated the file accordingly. Do have a look when you have time 🙏 |
Everything should be fine now. Thank you a lot! |
I noticed the original issue has been inactive for quite some time, and thought I might take a stab at adding basic highlighting support for Solidity.
Here's a preview of the highlighting:
Also managed to add the test and got the
./scripts/run_tests.sh query
passing for Solidity:Do let me know if this is alright 🙇♂️