-
-
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 syntax definition / highlight for Groovy, specifically Jenkinsfiles #4211
Comments
Hey! I'd be happy to give this issue a shot. @the-mikedavis May I get some advice as to which files/directories I should be looking at? Thank you! |
Take a look at the adding languages guide https://docs.helix-editor.com/guides/adding_languages.html and recent PRs that added languages https://github.com/helix-editor/helix/pulls?q=is%3Apr+is%3Amerged+add+language |
Any updates on this? |
If it helps anyone else, parsing it as Java works OK (definitely not perfect, but better than no highlighting at all). I've put this in my [[language]]
name = "java"
file-types = ["java", "groovy", "Jenkinsfile", "jenkinsfile"] |
According to the Helix documentation Language Config, adding the following to the languages.toml in your helix config location should provide syntax highlighting. [[language]]
name = "groovy"
scope = "source.groovy"
injection-regex = "groovy"
file-types = ["groovy", "Jenkinsfile"]
roots = []
[[grammar]]
name = "groovy"
source = { git = "https://github.com/Decodetalkers/tree-sitter-groovy", rev = "gh-pages" } If I'm not wrong, the only missing part is adding queries in runtime/queries/ if I have time later this week, I'll do this and look at opening a PR cause I would like syntax highlighting for Jenkinsfiles. |
@Lonestar137 did you have some time to prepare a PR? |
@britter No, I just added the nvim treesitter queries and moved on, I haven't had time to learn treesitter. The highlighting isn't perfect but it's good enough for me. You can either use the changes from the pull request above or use my helix config if you need a reference on how to set it up https://github.com/Lonestar137/helix-config/tree/main You need the query files under runtime/ and the config mentioned in my prior post. Don't forget to build the grammars afterward. |
Currently, no syntax highlighting exists for Jenkinsfiles, which are written in Groovy.
The text was updated successfully, but these errors were encountered: