nvim-treesitter / nvim-treesitter

Nvim Treesitter configurations and abstraction layer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tracking issue: language support requests

clason opened this issue · comments

This is a tracking issue collecting requests for new languages to add to nvim-treesitter. If you would like to add a language to the list, comment on this issue with the following information:

  • name of the language
  • link to an existing tree-sitter parser (if available)
  • link to a repository containing queries (if available)
  • language grammar description, vim syntax plugin etc. if none of the above exist.

Note: having a language on this list does not mean a maintainer will do the work for adding it; rather this list is meant as guidance for community contributions.


Languages needing a PR

(Parsers and simple queries exist already and just need to be included in our list and tested.)

Languages needing queries

(A parser exists, but queries for highlights, indent, injections, folds, and/or locals are still missing. Some guidance for writing these can be found in CONTRIBUTING.md and the tree-sitter documentation.)

Languages needing parsers

(Not even a parser exists yet; if you are familiar with the language and tree-sitter, consider contributing one. You can also help by searching for new parsers in case someone has created by now.)

  • luadoc (comments with emmyLua annotations; similar to jsdoc/phpdoc)
  • htmldjango/jinja2
  • ASCIIdoc (#2263)
  • zsh (#655)

Hello, great thanks for maintaining this repo! I’d like to promote a new language grammar that is battle-tested enough to this repo, so that programmers who use ReScript can just :TSInstall rescript if they would like to get its support without extra plugin dependencies.

I’m the maintainer of the nvim-treesitter-rescript repo, and would kindly apply any necessary changes to be applied for nvim-treesitter upstream.

Hi @nkrkv! Do you want to create PR?

Also indents tests might be useful (but not required). Maybe take a look at earlier PRs adding parsers.

(Fair warning: I'll hide and/or delete the comments in the near future to keep this tracking issue tidy.)

Hello, by working with Kubernetes and Helm templates, I would like to request support for the templates used in the workflow.
There is already some implementation of it, all praise to ngalaiko for creating it.

it looks like the sql pr linked at the top of this issue is closed and outdated. This repo https://github.com/m-novikov/tree-sitter-sql is the language parser shown for SQL on the official treesitter website https://tree-sitter.github.io/tree-sitter/ (at least I think this is the official site). What would it take to integrate this parser into nvim-treesitter?

@andykais not much. A small addition to lua/parsers.lua and an adaption of https://github.com/m-novikov/tree-sitter-sql/blob/main/queries/highlights.scm to according to our CONTRIBUTING.md

@theHamsta is this sufficient? #2511

Elsa

The syntax specification is a little informal, so let me know if any more information is needed. :)

Haxe also has a tree-sitter implementation here:
https://github.com/vantreeseba/tree-sitter-haxe

FSharp

EDIT: @baronfel 's parser is now archived, points to this one instead
Current Parser
It doesn't appear that anyone has done any queries
Language spec's

I would love to contribute, but frankly all of this is WAAAAY over my head.

Jenkinsfile

In addition to groovy's syntax, there are additional keywords added by jenkins that would be common on a Jenkinsfile:
https://github.com/martinda/Jenkinsfile-vim-syntax

OpenSCAD

My parser for this seems to be feature complete: https://github.com/bollian/tree-sitter-openscad

I'm willing to maintain support for my parser. Currently I'm looking for guidance on how to write the queries and modules for supporting highlighting, folding, and indentation.

QML

I found a plugin for it here https://github.com/peterhoeg/vim-qml

However having it in treesitter would be nice

Edit: Found this pr in treesitter repo: tree-sitter/tree-sitter@38ff9e3

That links to this https://github.com/yuja/tree-sitter-qmljs

LUAP

Parser for lua patterns.
This improved readability of patterns a lot in my opinion.
https://github.com/vhyrro/tree-sitter-luap

Mesonbuild

Parse for mesonbuild
I think we need the highlight for meson build also..
https://mesonbuild.com/
No gammer so far

Ansible

This exists for VSCode: https://github.com/ansible/ansible-language-server
This exists as a CoC extension for vim/nvim: https://github.com/yaegassy/coc-ansible

I think however that a lot of work needs to be done to convert this into treesitter syntax. I would like to help, but need some guidance.

I have now seen the light (and the errors of my ways). Note that Nvim tree is just a parser of a filetype, meaning that a Ansible LSP can use the YAML backend written by Treesitter. Hence, my comment was not really interesting.

Still a Jinja parser has my vote.

Move

There's a plugin for VSCode: https://github.com/damirka/vscode-move-syntax

But there may be considerable work involved in producing what treesitter requires. I'm happy to help since I'd like to use treesitter on move programs, but like the fellow above, I'd need a bit of guidance for getting started.

XQuery

I built, maintain and use this tree-sitter-xquery
which can be seen in web tree-sitter playground

  • has highlight query scm
  • tests for grammar.
  • loads of XQuery examples which don't error

Stylus

Less

CoffeeScript

LiveScript

qmake

Inno Setup Script

PlantUML

✓ NASM

Crystal

✓ Smali

✓ Groovy

✓ jq

Nim lang

Maybe this,no test: https://github.com/haxscramper/tree-sitter-nim Neovim plugin: https://github.com/alaviss/nim.nvim

@tomasky These treesitter projects for Nim exist as well, and looks like they may be may be slightly more mature:

gitignore

Was looking for this and couldn't find it except in this issue, which referenced a repo with a grammar/some patterns.

@andy2mrqz do you want to create a PR? I think you can create highlights similar to regex

EDIT: I will try an attempt at this...

@ElDifinitivo I Tried to add https://github.com/nushell/nushell.git but it failed to parse a simple test file without errors

@ElDifinitivo I Tried to add https://github.com/nushell/nushell.git but it failed to parse a simple test file without errors

Maybe because that isn't a tree-sitter parser? The parser grammar is here.

@enderger I meant to link https://github.com/LhKipp/tree-sitter-nu . https://github.com/LhKipp/tree-sitter-nu didn't work well for me

Ah, alright. We seem to have got it working using the latest version rather than the one used by the Neovim plugin, if it helps.

Mesonbuild

Parse for mesonbuild I think we need the highlight for meson build also.. https://mesonbuild.com/ No gammer so far

Now I create one, can it be used?
https://github.com/Decodetalkers/tree-sitter-meson

make a PR for it

awk

Queries and existing parser can be found here: https://github.com/Beaglefoot/tree-sitter-awk

Powershell

Official existing parser can be found here: https://github.com/powershell/tree-sitter-powershell
TODO list is huge, though, so I searched for a few materials, hope It helps:

I don't really know how parsers work so I have troubles adding it to nvim-treesitter. However, I have written some custom queries so feel free to mention me in a PR, I will try to help with improving them.

Dhall

Homepage: https://dhall-lang.org/
Vim syntax plugin: https://github.com/vmchale/dhall-vim

There is no parser nor queries yet AFAIK.

Apache Velocity Template Language (VTL)

Homepage: https://velocity.apache.org/engine/1.7/user-guide.html
Vim syntax plugin:

There is no parser nor queries yet AFAIK. FYI This templating language is not bind only to HTML as it's used by AWS with JSON: https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-programming-guide.html.

What is preventing the rescript tree-sitter grammar to be integrated?

What is preventing the rescript tree-sitter grammar to be integrated?

Somebody making a PR.

commented

git-commit

Helix uses a treesitter parser also for git-commit filetype.

Grammar: https://github.com/the-mikedavis/tree-sitter-git-commit

It is somewhat complete but needs testing and highlight queries.

Luckily, Helix has already implemented some queries: https://github.com/helix-editor/helix/tree/master/runtime/queries/git-commit

git-commit

Helix uses a treesitter parser also for git-commit filetype.

Grammar: https://github.com/the-mikedavis/tree-sitter-git-commit

It is somewhat complete but needs testing and highlight queries.

Luckily, Helix has already implemented some queries: https://github.com/helix-editor/helix/tree/master/runtime/queries/git-commit

I've looked at this parser in order to add this in nvim-treesitter but I have a mixed opinion. I'm french and I use git in french and this parser doesn't works at all in this case, I've notice this to the author the-mikedavis/tree-sitter-git-commit#4 and I don't think he will fix that.

So, I'm thinking about implementing myself a gitcommit parser that will works with all languages (I hope)...

Yuck

Yuck is used to configure Elkowar's Wacky Widgets (EWW).

I don't know how to write TS grammars, so I'm unsure how much I can actually help here, but any work on this is appreciated!

T32

TRACE32 is a debugger for embedded software development. PRACTICE is its scripting language.

Parser & Queries: https://codeberg.org/xasc/tree-sitter-t32
Pull request: #3779

It would be great if this parser could be supported by nvim-treesitter.

commented

git-commit

Helix uses a treesitter parser also for git-commit filetype.
Grammar: https://github.com/the-mikedavis/tree-sitter-git-commit
It is somewhat complete but needs testing and highlight queries.
Luckily, Helix has already implemented some queries: https://github.com/helix-editor/helix/tree/master/runtime/queries/git-commit

I've looked at this parser in order to add this in nvim-treesitter but I have a mixed opinion. I'm french and I use git in french and this parser doesn't works at all in this case, I've notice this to the author the-mikedavis/tree-sitter-git-commit#4 and I don't think he will fix that.

So, I'm thinking about implementing myself a gitcommit parser that will works with all languages (I hope)...

I'm working on this parser here and I'm looking for testers (and maybe reviewers) gbprod/tree-sitter-gitcommit#1 before submiting a PR here. 🙏

Bitbake

User manual for bitbake: [OUTDATED URL]

I also desire support for BitBake files (.bb and .bbappend), used by the Yocto Project (https://www.yoctoproject.org/) and OpenEmbedded (http://www.openembedded.org/) for building Linux distributions. However, the initial request from @Fildo7525 above referenced a very old version of its documentation. The current documentation is: https://docs.yoctoproject.org/bitbake/ . In particular, this section describes the syntax in good detail: https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html

commented

D2 – Declarative Diagramming

D2 is a diagram scripting language that turns text to diagrams, similar to PlantUML or Mermaid.js

csv and tsv

See #4102

nginx

nginx is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev. (Taken from their About page)

Moonscript

MoonScript is a language that compiles into Lua.

Moonscript

MoonScript is a language that compiles into Lua.

want to work on this with me @PhosCity?

want to work on this with me @PhosCity?

Unfortunately, I have absolutely no knowledge of treesitter grammar. I'd not be of much help to you.

commented

QMLDIr

qmldir is the config for qmlproject, and I write one

It may not used much, and I think maybe just regex can handle such highlight, but I still write one, if one of you need it ..

Prolog

Couldn't find much due to prolog's preference for emacs, but I found an (unmaintained) vim syntax plugin

https://github.com/mxw/vim-prolog

Common implementation is SWI-Prolog and GNU Prolog. Specified by ISO standard https://www.iso.org/standard/21413.html along with supporting standards and a separate "modules" standard from 2000.

commented

Robotframework

TS: tree-sitter-robot

I'm working on a parser for Vespa schemas. It's still a work in progress, but sharing here in case anyone CTRL+F's Vespa here :-) https://github.com/bartek/tree-sitter-vespa

Starlark

A configuration dialect of Python, used mainly for Bazel build system.

Grammar: https://github.com/gramic/tree-sitter-bazel

commented

Expect

Expect is a superset of TCL.

A standalone Treesitter for TCL which it could be built upon already exists: https://github.com/lewis6991/tree-sitter-tcl

rmarkdown https://rmarkdown.rstudio.com/

That just uses the markdown grammar. Same as here.

ConTeXt

ConTeXt is a macro system for TeX, similar to LaTeX.

@amaanq I think your list of languages from Helix misses gotmpl: https://github.com/helix-editor/helix/tree/master/runtime/queries/gotmpl. The parser is here: https://github.com/dannylongeuay/tree-sitter-go-template. I did try it for a few Go templates, but since my theme, Nord, uses the same color for Normal and @punctuation.bracket they don't look distinguishable.

tfvars can be removed, as it is just HCL but limited to <key> = <value> only.

Odin

Thanks to @ap29600 for the work.
tree-sitter-odin

FSharp

EDIT: @baronfel 's parser is now archived, points to this one instead Current Parser It doesn't appear that anyone has done any queries Language spec's

I would love to contribute, but frankly all of this is WAAAAY over my head.

any update?
If you need an extra pair of hands, count me in.

@kumkee

there aren't any queries yet, so that would be great if you have any experience writing those :)

commented

Groovy dsl

Not groovy, just a simple one for android project
https://docs.gradle.org/current/userguide/groovy_build_script_primer.html

parse is here: https://github.com/Decodetalkers/tree-sitter-groovyscript

Hope will be of help

update: Now is renamed to tree-sittrr-groovy, now support groovy both

Papyrus

Papyrus is an entirely new scripting system created specifically for the Creation Kit.
Official documentation: https://www.creationkit.com/index.php?title=Category:Papyrus
Vim plugin: https://github.com/sirtaj/vim-papyrus
VSCode Extension: https://github.com/joelday/papyrus-lang
Notepad++ syntax: https://www.nexusmods.com/skyrimspecialedition/mods/32375?tab=files
Sublime Text Package: https://github.com/Kapiainen/SublimePapyrus

commented

@ObserverOfTime

Plantuml

link: https://github.com/Decodetalkers/tree_sitter_plantuml

it is almost finished. but there is something to improve

image

Typst

Typst: Typst Docs
Parser: tree-sitter-parser
Grammar can be found in the readme of the parser

Don't know if there's a repository containing queries

EDIT from @theHamsta:

commented

SurrealDB


The parser handles highlighting only at the moment.


Official Site: https://surrealdb.com

Puppet

The only treesitter parser available at the moment that I could find:


UPDATE:

Puppet language support was added within nvim-treesitter: #4715

Formatting and diagnostics have nothing to do with treesitter.

Nextflow

Nextflow is a workflow management system used heavily in bioinformatics, and is an extension of Groovy. A request for Groovy is also in this list of language requests, which includes a parser at Decodetalkers/tree-sitter-groovy.

nushell

it is already in the list of helix queries above but now we have nushell/nu-treesitter and a start on some queries 🥳

i was wondering if it's as simple as putting these queries into queries/nu/ and updating them regularly 😮 😋

Fountain

A screenplay markup-inspired syntax format. See the wikipedia entry for history and the Fountain Project for spec and known implementations.

I just finished my MATLAB parser. I would like you to consider replacing the existing one, since mine implements more of the grammar (all of it?) and has queries for highlights, folds, tags, context, textobjects and locals. As I say in the README, I work with MATLAB on a daily basis (research) and it's my personal interest to maintain and improve it.

@acristoffers if the new parser is demonstrably better, just open a PR with that information. (This issue is about adding new languages.)