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

tree-sitter as a syntax highlighting backend #19

Open
wingyplus opened this issue Oct 6, 2022 · 3 comments
Open

tree-sitter as a syntax highlighting backend #19

wingyplus opened this issue Oct 6, 2022 · 3 comments

Comments

@wingyplus
Copy link
Collaborator

I start thinking for along time about having tree-sitter for earthlyfile, but i dont have time to tackle this.

The benefit of it is we can unify syntax highlighting across editors (vim, emacs, helix, etc.) and can play some nice feature around it such as code folding, etc.

@alexcb
Copy link

alexcb commented Apr 17, 2024

there's a new repo that implements this: https://github.com/glehmann/tree-sitter-earthfile

@Konubinix
Copy link

IIUC, emacs does not support parsing the .scm files, making the tree-sitter project not that useful by default.

Nonetheless, @glehmann also created https://github.com/glehmann/earthlyls, using the work on https://github.com/glehmann/tree-sitter-earthfile to provide the AST that the LSP uses.

I added the built-in support for earthlyls in lsp-mode, so you should only need to run (lsp) in earthly-mode. The installation command I put in here needs the rust toolchain though.

I've been using earhlyls for a few weeks and it works very well now. Also, @glehmann is eager to get improvement suggestions. I encourage you to try it out.

@Konubinix
Copy link

One thing to note is that with the support of tree sitter, we can have bash commands highlighted in bash.

this

image

instead of this

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants