-
-
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
Add support for Mojo #10743
Add support for Mojo #10743
Conversation
Xd, didn't know about that. Does helix supports emoji as a file type, have you tried it? |
Yes, everything just works. |
runtime/queries/mojo/highlights.scm
Outdated
@@ -0,0 +1,152 @@ | |||
(attribute attribute: (identifier) @property) |
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.
The highlights need to be updated to use Helix-specific capture names: https://docs.helix-editor.com/master/themes.html#syntax-highlighting
For example @property
should become @variable.other.member
, (true)
and (false)
should be captured as @constant.builtin.boolean
, escape sequences as @constant.character.escape
, etc.
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've updated the queries to be a superset of the current Python queries.
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.
If it's a superset you can use a comment in the query files ; inherits: python
which will do the same thing as copy/pasting in the python query for that file
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 think that for now it's OK to use inheritance. If I understand correctly, later if there are any additions, I will need to delete the comment and make a full modified version?
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.
If the python queries start using a new node that isn't in the mojo grammar then we will need to replace the ; inherits: python
. But if you just want to add onto the python queries you can place patterns before or after the inherits comment. The ones before are higher precedence and the ones after lower
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.
At the moment, the differences are mainly related to modifying queries rather than adding new ones. So, I think I'm done with the changes, further improvements depend on the tree-sitter repository.
* Add support for Mojo * Update grammar * Fix queries * Fix docs * Use inheritance for some files
* Add support for Mojo * Update grammar * Fix queries * Fix docs * Use inheritance for some files
* Add support for Mojo * Update grammar * Fix queries * Fix docs * Use inheritance for some files
Previous PR has not been updated for a long time: #8657
In this PR, I use the most up-to-date Mojo grammar.