Open EriKWDev opened 1 month ago
I tried this a few days ago, I did get the LSP to work, but syntax highlighting I did not get working.
[language-server.jails]
command = "jails"
[[language]]
name = "jai"
scope = "source.jai"
injection-regex = "jai"
file-types = ["jai"]
comment-tokens = "//"
language-servers = [ "jails" ]
[[grammar]]
name = "jai"
source = { git = "https://github.com/St0wy/tree-sitter-jai", rev = "35c0d66c772900eae3d36b996672884960e35477" }
with this LSP works, (it does still output the same error for me, but jump to definition etc still works) just the [[grammar]] bit does not work as mentioned.
I had just read on the odin tree sitter page that tree sitter stuff needs to be defined at compile time and a helix rebuild is required. Is that true, or is that perhaps an outdated information?
I tried your config with the different tree-sitter implementation and indeed I get rudimentary highlighting and goto definition working!
I copied https://raw.githubusercontent.com/St0wy/tree-sitter-jai/refs/heads/main/queries/highlights.scm and putting it in runtime/queries/jai
I also get some very basic highlighting though it seems to fall apart pretty quickly on multi-line comments and confusing some number-literals for types.
Don't know if this is just the state of the project or what to expect
I did try to recompile as you said but not with my modified odin stuff so don't know if that did anything in particular or not
The issue is the capital J in Jai here: https://github.com/SogoCZE/tree-sitter-jai/blob/dd2d38d44bf71a0db95c7e745f86b06c3aa7e4d6/grammar.js#L2
That needs to be lowercase to match name = "jai"
in the [[grammar]]
section. It might work (I haven't tested this) to use name = "Jai"
in languages.toml
instead but the convention with all other tree-sitter grammars is to use lowercase for the name so I would recommend suggesting this change upstream
I've tried adding language support for
jai
using the lsp https://github.com/SogoCZE/Jails and tree-sitter grammar at https://github.com/SogoCZE/tree-sitter-jai, but I can't get it to work. Nothing gets highlighted in the editor, and this is the error messages in the helix logI have added the following to the
languages.toml
And without knowing much about the setup I did minimal modifications to the
runtime/queries/odin
stuff and put into aruntime/queries/jai
folder. grammars have been fetched and built and seem to be identified correctly, just don't work