#Tree Sitter Typst

42 messages · Page 1 of 1 (latest)

storm pebble
#

Here is a list of all the tree-sitter-typst repo on github (I confess i did not search on other plateforms):

GitHub

A TreeSitter parser for the Typst File Format . Contribute to SeniorMars/tree-sitter-typst development by creating an account on GitHub.

GitHub

A tree-sitter grammar for the typst typesetting language with a focus on correctness - GitHub - frozolotl/tree-sitter-typst: A tree-sitter grammar for the typst typesetting language with a focus on...

GitHub

Contribute to jooooscha/tree-sitter-typst development by creating an account on GitHub.

#

if someone has a working elix setup, please share, i have no syntax highlighting i want to die

fresh citrus
#

can you share your issue with my grammar?

raw dock
fresh citrus
#

…once I manage to correctly parse functions

cedar canopy
fresh citrus
#

hmm, that is interesting

#

which helix version are you using?

cedar canopy
#

lemme update it

storm pebble
cedar canopy
fresh citrus
#

nice!

cedar canopy
fresh citrus
#

what happens if you just enter test *bold* _italic_?

#

because sadly I have not yet fully implemented highlighting of code

#

just math and markup (well, excluding lists/enums/terms) are complete

storm pebble
#

@fresh citrus got this

#

pretty good

fresh citrus
#

looks about right

storm pebble
# fresh citrus looks about right

in the second half of june, i will have some time to spend on typst tooling (i am learning rust rn). How could I help with your grammar ?

#

it is in C right ?

fresh citrus
#

four things I guess:

  • first (and most important), implement parsing for the remaining syntax elements
  • then, implementing the remaining queries would be nice (for indentation, selection, etc.)
  • I'd like to have tests for syntax highlighting, not just for parsing
  • if these things are done, maybe some improvements to the grammar would be nice, but most of it is already pretty good imo
#

it is implemented in JS and C++

#

these are the most important files

storm pebble
#

then, implementing the remaining queries would be nice (for indentation, selection, etc.)
thoses are treesitter queries right ?

fresh citrus
storm pebble
#

ok I'll look into it

kind furnace
#

has anyone got it working in neovim?

fresh citrus
#

maybe this issue helps

kind furnace
#

got a similar issue as the commenter, seemingly works but no colors

#

not sure how to fix it

fresh citrus
celest hill
#

Hi, I am a user of Neovim and nvim-treesitter, and I found a great repository, frozolotl/tree-sitter-typst.
The capture names in queries/highlights.scm don't match Neovim conventions, and just applying it doesn't seem to color well in Neovim.
For example, Neovim uses @text.emphasis instead of @markup.italic.

https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights

I will make highlights.scm for Neovim and if there is demand, I will make it public.
Thank you for nice work!

GitHub

Nvim Treesitter configurations and abstraction layer - nvim-treesitter/CONTRIBUTING.md at master · nvim-treesitter/nvim-treesitter

fresh citrus
storm pebble
celest hill
fresh citrus