Dear all,
no mention here https://tree-sitter.github.io/tree-sitter/ and searching for treesitter on the Wiki gives no match?
Many texteditors have treesitter support builtin so having a ConTeXt grammar would be nice.
TIA juh
Am 04.07.24 um 21:22 schrieb juh+ntg-context--- via ntg-context:
no mention here https://tree-sitter.github.io/tree-sitter/ and searching for treesitter on the Wiki gives no match?
Many texteditors have treesitter support builtin so having a ConTeXt grammar would be nice.
https://github.com/pmazaitis/tree-sitter-context_en
Now, if you could explain me how to install this in Pulsar?
Hraban
Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
Thanks a lot.
Now, if you could explain me how to install this in Pulsar?
I am struggling with emacs and neovim.
Ciao! juh
Am 04.07.24 um 22:31 schrieb juh+ntg-context--- via ntg-context:
Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
Thanks a lot.
Now, if you could explain me how to install this in Pulsar?
I am struggling with emacs and neovim.
If you get it working, please document how.
Hraban
Hello,
All tree-sitter projects look like this I think. For Neovim, all you have to do is clone the project to a place in your path and generate a parser using the command 'tree-sitter generate'. Then you open Neovim to install it with 'TSInstall <language-name> (the name of the grammar without '-tree-sitter' in Vim command mode). Have a look at the official Neovim tree-sitter website ( https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#adding...). I am afraid I don't know much about Emacs.
I don't know if this particular one works though.
Jethro
On Thu, Jul 4, 2024 at 9:06 PM Henning Hraban Ramm texml@fiee.net wrote:
Am 04.07.24 um 22:31 schrieb juh+ntg-context--- via ntg-context:
Am 04.07.24 um 21:39 schrieb Henning Hraban Ramm:
Thanks a lot.
Now, if you could explain me how to install this in Pulsar?
I am struggling with emacs and neovim.
If you get it working, please document how.
Hraban
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
Hi,
I tried to write one some time ago but it seems my knowledge of ConTeXt was insufficient. I gave up. I also think it would be nice.
If I can recall, one of the first problems I ran into concerned how ConTeXt environments work (among other things I cannot recall). In LaTeX, you have something like: \begin{theorem} When you are writing the grammar, you can clearly separate the tokens into '', 'begin', '{' and '}'. So you get a consistent object that the tree-sitter library can work with. But with ConTeXt, you have something like this: \startTheorem We know that it is actually made up of '', 'start' and 'Theorem'. But there is nothing separating the latter two so I couldn't find a way to make it general enough across board because of how configurable ConTeXt is (we have very few pre-defined environments). So I went with \start[theorem]. I am very sure it was my skill but just some thoughts from someone who tried in the past.
Maybe we could benefit from pre-converting the source file to an XML-like tree before applying the grammar? At which point you are venturing into LSP territory...
Jethro
On Thu, Jul 4, 2024 at 7:36 PM juh+ntg-context--- via ntg-context < ntg-context@ntg.nl> wrote:
Dear all,
no mention here https://tree-sitter.github.io/tree-sitter/ and searching for treesitter on the Wiki gives no match?
Many texteditors have treesitter support builtin so having a ConTeXt grammar would be nice.
TIA juh
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net
Am 05.07.24 um 12:33 schrieb Jethro Djan:
Hi,
I tried to write one some time ago but it seems my knowledge of ConTeXt was insufficient. I gave up. I also think it would be nice.
Well, obviously, Paul managed to do it: https://github.com/pmazaitis/tree-sitter-context
Maybe we could benefit from pre-converting the source file to an XML-like tree before applying the grammar? At which point you are venturing into LSP territory...
You know about the XML interface files? See texmf-context/tex/context/interface/mkiv/
Hraban