uben0/tree-sitter-typst

Grammar not being fetched in helix

Closed this issue · 3 comments

When using the provided languages.toml config file and the pre generated grammar it looks like helix does not find the grammar. When running hx --grammar fetch it does not seem to fetch the typst grammar.

This is the grammar config: (i have the pregenerated grammar in my home directory)

[[grammar]]
name = "typst"
source = { path = "~/tree-sitter-typst" }

I added use-grammars = { only = [ "typst" ] } to the top of languages.toml to check and it shows Fetching 0 grammars when running hx --grammars fetch. Is there anything else i need to do in terms of configuration to make helix find grammars specified in languages.toml?

uben0 commented

Yes, it is because fetch only needs to be executed when the path is an URL, I fixed the installation instruction by replacing a local path to grammar by the URL of the github repo. Now it should work.

Ah thank you! That was not clear to me. I was however also unable to build the gammar using hx -g build. Everything works with the new config tho.

uben0 commented

It wans't clear for me neither. I just realized what the "fetch" step was for with your issue.