uben0 / tree-sitter-typst

Tree Sitter grammar for Typst
MIT License
110 stars 9 forks source link

Grammar not being fetched in helix #5

Closed FuryFiber closed 10 months ago

FuryFiber commented 10 months ago

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 10 months ago

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.

FuryFiber commented 10 months ago

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 10 months ago

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