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 Teal language #12081

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

barsoosayque
Copy link

Add basic support for Teal language.

The compiler for Teal, a typed dialect of Lua

Queries and grammar are from euclidianAce/tree-sitter-teal. Language server is tl/teal-language-server. I couldn't find a proper formatter.

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Nov 18, 2024
@@ -1276,6 +1277,22 @@ language-servers = [ "lua-language-server" ]
name = "lua"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-lua", rev = "88e446476a1e97a8724dff7a23e2d709855077f2" }

[[grammar]]
name = "teal"
source = { git = "https://github.com/euclidianAce/tree-sitter-teal", rev = "485fbdc00d811b01b2090dff4d0469fd1d0350f5" }
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the tree-sitter-teal repo doesn't have a LICENSE yet. Could you propose adding one and update the commit here once one is merged?

Copy link
Author

Choose a reason for hiding this comment

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

Issue filed: euclidianAce/tree-sitter-teal#36. Though, I'm not sure how active is the maintainer, I hope it will be resolved soon.

languages.toml Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

The captures in this file will need to be updated to use our capture names: https://docs.helix-editor.com/master/themes.html#syntax-highlighting

For example @boolean should become @constant.character.boolean, @parameter should become @variable.parameter

Copy link
Member

Choose a reason for hiding this comment

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

For the locals file we follow tree-sitter https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables

So only @local.definition, @local.reference and @local.scope are allowed

@barsoosayque
Copy link
Author

I've updated highlights.scm and locals.scm to the best of my abilities to match the required syntax; never worked with tree-sitter before. Highlighting in helix looks alright for my teal scripts, nothing seems to be broken

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants