tree-sitter-mojo
I had half an hour today, and Mojo is close enough to Python, so I forked the Python Tree Sitter grammar and got it working for mojo.
![No description](https://cdn.answeroverflow.com/1238985624976101406/image.png)
49 Replies
GitHub
GitHub - lsh/tree-sitter-mojo: Mojo grammar for tree-sitter
Mojo grammar for tree-sitter. Contribute to lsh/tree-sitter-mojo development by creating an account on GitHub.
Nice, I will try to use your variant with Helix editor. You can also look at https://github.com/garam-kim1/tree-sitter-mojo The idea is to automatically update using GitHub Actions.
GitHub
GitHub - garam-kim1/tree-sitter-mojo: mojo grammar for tree-sitter
mojo grammar for tree-sitter. Contribute to garam-kim1/tree-sitter-mojo development by creating an account on GitHub.
Oh if I had seen that maybe I would have just used that lol
I haven't looked into the details, but perhaps your mojo part of the grammar is more relevant.
But without automation it will be difficult to maintain such a fork. https://github.com/garam-kim1/tree-sitter-mojo/blob/master/.github/workflows/tree_sitter_maker.yml
Epic thanks both helix works now!
![No description](https://cdn.answeroverflow.com/1239010684835201044/image.png)
Whoops I forgot to add alias, should do that now
It would be nice to push Helix PR forward at some point. https://github.com/helix-editor/helix/pull/8657
GitHub
feat: adds mojo language support by mabasic · Pull Request #8657 · ...
The same as: #8583
removed tags.scm
removed commented line from language.toml
applied suggested changes
If you raise a PR from your repo @Dmitry Salin it might avoid that test failure?
It's not mine, but it could definitely be used in PR and then maybe the build and tests will be ok.
It seems better to create a new PR. The current one is already the second 🙂
Congrats @Dmitry Salin, you just advanced to level 1!
FWIW this is my helix config and it works for me
This is what I get while trying to compile the parser in Neovim
Edit: I just failed to include scanner.c, it is compiled now.
![No description](https://cdn.answeroverflow.com/1239114608694919188/Screen_Shot_2024-05-12_at_08.16.31.png)
Only thing stopping me from using Helix as my main editor is it still doesn't have persistent undo history. I tried building this but doesn't work on mac: https://github.com/helix-editor/helix/pull/9154
Just pushed better support for parameter functions and decorators. Also wrote a Zed extension
Awesome cheers @lukas!