logoalt Hacker News

tetris11today at 3:27 PM7 repliesview on HN

I love tree-sitter+eglot but a few of the languages/schemes I work in, simply don't have parsers:

    > pacman -Ssq tree-sitter
    tree-sitter
    tree-sitter-bash
    tree-sitter-c
    tree-sitter-cli
    tree-sitter-javascript
    tree-sitter-lua
    tree-sitter-markdown
    tree-sitter-python
    tree-sitter-query
    tree-sitter-rust
    tree-sitter-vim
    tree-sitter-vimdoc

Where's R, YAML, Golang, and several others?

Replies

jasonjmcgheetoday at 3:47 PM

Most of them are in the language pack (https://github.com/Goldziher/tree-sitter-language-pack)

For others, this is a sub optimal answer, but I’ve played with generating grammars with latest llms and they are surprisingly good at doing this (in a few shots).

That being said, if you’re doing something more serious than syntax highlighting or shipping it in a product, you’ll want to spend more time on it.

johanvtstoday at 3:35 PM

Go is here: https://github.com/tree-sitter/tree-sitter-go Try google, the others are probably out there as well.

matthew-craigtoday at 3:34 PM

In my emacs configuration, I have the following parsers installed:

awk bash bibtex blueprint c c-sharp clojure cmake commonlisp cpp css dart dockerfile elixir glsl gleam go gomod heex html janet java javascript json julia kotlin latex lua magik make markdown nix nu org perl proto python r ruby rust scala sql surface toml tsx typescript typst verilog vhdl vue wast wat wgsl yaml

codethieftoday at 3:32 PM

Uhh… The fact that there's no Archlinux package for a given language doesn't imply there's no tree-sitter support (official or 3rd-party) for that language? See e.g. the very long list of languages on https://github.com/Goldziher/tree-sitter-language-pack , which does include R, YAML, Golang, and many more.

show 1 reply
woodruffwtoday at 3:34 PM

tree-sitter-yaml definitely exists[1]. Presumably nobody has packaged it for Arch yet; that seems like a thing you could contribute.

[1]: https://github.com/tree-sitter-grammars/tree-sitter-yaml

show 1 reply
taerictoday at 3:30 PM

Odd, yaml-ts-mode exists? Did they change how it gets its parser?