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

feat: add mojo language support #8583

Closed
wants to merge 0 commits into from
Closed

Conversation

mabasic
Copy link

@mabasic mabasic commented Oct 21, 2023

Adds support for mojo programming language:
https://www.modular.com/mojo

Things that work:

  • lsp
  • grammar (tree-sitter)
  • highlight queries
  • textobject queries
  • indent queries
  • formatting

syntax highlighting does not work for some reason.

There are two tree sitter that I have found:

I don't know which one is better, but I have went with the one that has more recent commits.

I have noticed that there is a difference in languages.toml file between master and 23.05 version, so for 23.05 here is the config:

[[language]]
name = "mojo"
scope = "source.mojo"
roots = []
injection-regex = "mojo"
file-types = ["mojo", "🔥"]
comment-token = "#"
indent = { tab-width = 4, unit = "    " }
language-server = { command = "mojo-lsp-server" }

# Rembeber to add runtime/queries for mojo to ~/.config/helix/runtime/queries/mojo/

[[grammar]]
name = "mojo"
source = { git = "https://github.com/realprogrammersusevim/tree-sitter-mojo", rev = "f241530d0197c0ddfc0372c60be39221693f9196" }

# [[grammar]]
# name = "mojo"
# source = { git = "https://github.com/HerringtonDarkholme/tree-sitter-mojo", rev = "99fe918e69f087f910ef3b11eba31eb0d7e54edf" }

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the scanner has some compilation errors on Windows

languages.toml Outdated Show resolved Hide resolved
runtime/queries/mojo/highlights.scm Outdated Show resolved Hide resolved
runtime/queries/mojo/highlights.scm Outdated Show resolved Hide resolved
runtime/queries/mojo/highlights.scm Outdated Show resolved Hide resolved
runtime/queries/mojo/tags.scm Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis changed the title feat: adds mojo language support feat: add mojo language support Oct 26, 2023
@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 Oct 26, 2023
@mabasic mabasic closed this Oct 29, 2023
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-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants