Skip to content
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

Merged
merged 5 commits into from
May 15, 2024
Merged

Add support for Mojo #10743

merged 5 commits into from
May 15, 2024

Conversation

dmitry-salin
Copy link
Contributor

Previous PR has not been updated for a long time: #8657

In this PR, I use the most up-to-date Mojo grammar.

@woojiq
Copy link
Contributor

woojiq commented May 13, 2024

file-types = ["mojo", "🔥"]

Xd, didn't know about that. Does helix supports emoji as a file type, have you tried it?

@dmitry-salin
Copy link
Contributor Author

file-types = ["mojo", "🔥"]

Xd, didn't know about that. Does helix supports emoji as a file type, have you tried it?

Yes, everything just works.

@@ -0,0 +1,152 @@
(attribute attribute: (identifier) @property)
Copy link
Member

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.

Copy link
Contributor Author

@dmitry-salin dmitry-salin May 14, 2024

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.

Copy link
Member

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

Copy link
Contributor Author

@dmitry-salin dmitry-salin May 14, 2024

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?

Copy link
Member

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

Copy link
Contributor Author

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.

@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels May 13, 2024
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 15, 2024
@pascalkuthe pascalkuthe merged commit 889bbef into helix-editor:master May 15, 2024
6 checks passed
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
* Add support for Mojo

* Update grammar

* Fix queries

* Fix docs

* Use inheritance for some files
Chirikumbrah pushed a commit to Chirikumbrah/helix that referenced this pull request Jun 15, 2024
* Add support for Mojo

* Update grammar

* Fix queries

* Fix docs

* Use inheritance for some files
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Add support for Mojo

* Update grammar

* Fix queries

* Fix docs

* Use inheritance for some files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants