feat!: use tree-sitter build

This commit is contained in:
Christian Clason
2024-04-22 19:56:30 +02:00
parent c17de56890
commit 214cfcf851
13 changed files with 443 additions and 898 deletions

View File

@@ -23,34 +23,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
cc: [gcc, clang]
nvim_tag: [nightly]
exclude:
- os: ubuntu-latest
cc: clang
nvim_tag: nightly
- os: macos-14
cc: gcc
nvim_tag: nightly
- os: windows-latest
cc: gcc
nvim_tag: nightly
# include:
# - os: windows-latest
# cc: cl
# nvim_tag: nightly
# - os: ubuntu-latest
# cc: gcc
# nvim_tag: nightly
name: Parser compilation
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }}
steps:
- uses: actions/checkout@v4
@@ -71,10 +48,8 @@ jobs:
~/.local/share/nvim/site/parser/
~/AppData/Local/nvim-data/site/parser/
key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles(
'./lockfile.json',
'./lua/nvim-treesitter/install.lua',
'./lua/nvim-treesitter/parsers.lua',
'./lua/nvim-treesitter/shell_command_selectors.lua') }}
'./lua/nvim-treesitter/parsers.lua') }}
- name: Compile parsers
run: $NVIM -l ./scripts/install-parsers.lua

View File

@@ -20,12 +20,9 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cc: [gcc]
name: Run tests
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v4
- uses: tree-sitter/setup-action/cli@v1
@@ -50,16 +47,13 @@ jobs:
uses: actions/cache@v4
with:
path: |
./parser/
~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/
~/.local/share/nvim/site/parser/
~/AppData/Local/nvim-data/site/parser/
key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles(
'./lockfile.json',
'./lua/nvim-treesitter/install.lua',
'./lua/nvim-treesitter/parsers.lua',
'./lua/nvim-treesitter/shell_selectors.lua') }}
'./lua/nvim-treesitter/parsers.lua') }}
- name: Compile parsers Unix like
if: ${{ runner.os != 'Windows' && steps.parsers-cache.outputs.cache-hit != 'true' }}
- name: Compile parsers
run: nvim -l ./scripts/install-parsers.lua
- name: Tests

View File

@@ -17,7 +17,7 @@
# WARNING
**This branch is a [full, incompatible, rewrite of `nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767) and [work in progress](TODO.md). This branch REQUIRES (the latest commit on) Neovim `master`.**
**This branch is a [full, incompatible, rewrite of `nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767) and [work in progress](TODO.md).** The **stable** branch is [`master`](https://github.com/nvim-treesitter/nvim-treesitter/tree/master).
The `nvim-treesitter` plugin provides
1. functions for installing, updating, and removing [**tree-sitter parsers**](SUPPORTED_LANGUAGES.md);
@@ -29,14 +29,14 @@ The `nvim-treesitter` plugin provides
- Neovim 0.10.0 or later (nightly)
- `tar` and `curl` in your path (or alternatively `git`)
- a C compiler in your path and libstdc++ installed ([Windows users please read this!](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support))
- optional: `tree-sitter` CLI and `node`
- [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) CLI (0.22.6 or later)
- a C compiler in your path (see <https://docs.rs/cc/latest/cc/#compile-time-requirements>)
## Installation
You can install `nvim-treesitter` with your favorite package manager (or using the native `package` feature of vim, see `:h packages`).
**NOTE: This plugin is only guaranteed to work with specific versions of language parsers** (as specified in the `lockfile.json`). **When upgrading the plugin, you must make sure that all installed parsers are updated to the latest version** via `:TSUpdate`.
**NOTE: This plugin is only guaranteed to work with specific versions of language parsers** (as specified in the `parser.lua` table). **When upgrading the plugin, you must make sure that all installed parsers are updated to the latest version** via `:TSUpdate`.
It is strongly recommended to automate this; e.g., using [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
@@ -195,14 +195,6 @@ vim.fn.stdpath('data') .. 'site/queries/zimbu'
Before doing anything, make sure you have the latest version of this plugin and run `:checkhealth nvim-treesitter`.
It can also help to update the parsers via `:TSUpdate`.
#### Feature `{X}` does not work for `{language}`...
1. Check the `nvim-treesitter` section of `:checkhealth` for any warning, and make sure that the query for `{X}` is listed for `{language}`.
2. Ensure that the feature is enabled as explained above.
3. Ensure Neovim is correctly identifying your language's filetype using the `:echo &filetype` command while one of your language's files is open in Neovim.
#### I get `Error detected while processing .../plugin/nvim-treesitter.vim` every time I open Neovim
This is probably due to a change in a parser's grammar or its queries.
@@ -221,30 +213,6 @@ or due to an outdated parser.
If you get more than one path, remove the ones that are outside this plugin (`nvim-treesitter` directory),
so the correct version of the parser is used.
#### I want to use Git instead of curl for downloading the parsers
In your Lua config:
```lua
require("nvim-treesitter.install").prefer_git = true
```
#### I want to use a HTTP proxy for downloading the parsers
You can either configure curl to use additional CLI arguments in your Lua config:
```lua
require("nvim-treesitter.install").command_extra_args = {
curl = { "--proxy", "<proxy url>" },
}
```
or you can configure git via `.gitconfig` and use git instead of curl
```lua
require("nvim-treesitter.install").prefer_git = true
```
#### I want to use a mirror instead of "https://github.com/"
In your Lua config:

View File

@@ -4,293 +4,296 @@ The following is a list of languages for which a parser can be installed through
Legend:
- **Tier:** _stable_, _core_, _community_, or _unsupported_
- **CLI:** `:TSInstall` requires `tree-sitter` CLI installed
- **Queries** available for **H**ighlights, **I**ndents, **F**olds, In**J**ections, **L**ocals
- **Maintainer** of queries in nvim-treesitter (may be different from parser maintainer!)
<!--This section of the README is automatically updated by a CI job-->
<!--parserinfo-->
Language | Tier | Queries | CLI | Maintainer
-------- |:----:|:-------:|:---:| ----------
[ada](https://github.com/briot/tree-sitter-ada) | community | `HF  L` | | @briot
[agda](https://github.com/tree-sitter/tree-sitter-agda) | core | `HF   ` | | @Decodetalkers
[angular](https://github.com/dlvandenberg/tree-sitter-angular) | community | `HFIJL` | | @dlvandenberg
[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  L` | | @aheber
[arduino](https://github.com/tree-sitter-grammars/tree-sitter-arduino) | core | `HFIJL` | | @ObserverOfTime
[asm](https://github.com/RubixDev/tree-sitter-asm) | community | `H  J ` | | @RubixDev
[astro](https://github.com/virchau13/tree-sitter-astro) | community | `HFIJL` | | @virchau13
[authzed](https://github.com/mleonidas/tree-sitter-authzed) | community | `H  J ` | | @mattpolzin
[awk](https://github.com/Beaglefoot/tree-sitter-awk) | unsupported | `H  J ` | |
[bash](https://github.com/tree-sitter/tree-sitter-bash) | stable | `HF JL` | | @TravonteD
[bass](https://github.com/vito/tree-sitter-bass) | community | `HFIJL` | | @amaanq
[beancount](https://github.com/polarmutex/tree-sitter-beancount) | community | `HF J ` | | @polarmutex
[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | community | `HFI  ` | | @theHamsta, @clason
[bicep](https://github.com/tree-sitter-grammars/tree-sitter-bicep) | core | `HFIJL` | | @amaanq
[bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) | core | `HFIJL` | | @amaanq
[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint) | unsupported | `H    ` | | @gabmus
[c](https://github.com/tree-sitter/tree-sitter-c) | stable | `HFIJL` | | @amaanq
[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | core | `HF JL` | | @amaanq
[cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | core | `HFIJL` | | @amaanq
[capnp](https://github.com/tree-sitter-grammars/tree-sitter-capnp) | core | `HFIJL` | | @amaanq
[chatito](https://github.com/tree-sitter-grammars/tree-sitter-chatito) | core | `HFIJL` | | @ObserverOfTime
[clojure](https://github.com/sogaiu/tree-sitter-clojure) | community | `HF JL` | | @NoahTheDuke
[cmake](https://github.com/uyha/tree-sitter-cmake) | community | `HFI  ` | | @uyha
[comment](https://github.com/stsewd/tree-sitter-comment) | community | `H    ` | | @stsewd
[commonlisp](https://github.com/tree-sitter-grammars/tree-sitter-commonlisp) | core | `HF  L` | | @theHamsta
[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | community | `H    ` | | @addcninblue
[corn](https://github.com/jakestanger/tree-sitter-corn) | community | `HFI L` | | @jakestanger
[cpon](https://github.com/tree-sitter-grammars/tree-sitter-cpon) | core | `HFIJL` | | @amaanq
[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | core | `HFIJL` | | @theHamsta
[css](https://github.com/tree-sitter/tree-sitter-css) | core | `HFIJ ` | | @TravonteD
[csv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | | @amaanq
[cuda](https://github.com/tree-sitter-grammars/tree-sitter-cuda) | core | `HFIJL` | | @theHamsta
[cue](https://github.com/eonpatapon/tree-sitter-cue) | community | `HFIJL` | | @amaanq
[d](https://github.com/gdamore/tree-sitter-d) | community | `HFIJL` | | @amaanq
[dart](https://github.com/UserNobody14/tree-sitter-dart) | community | `HFIJL` | | @akinsho
[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | community | `HFIJL` | | @jedrzejboczar
[dhall](https://github.com/jbellerb/tree-sitter-dhall) | community | `HF J ` | | @amaanq
[diff](https://github.com/the-mikedavis/tree-sitter-diff) | community | `H    ` | | @gbprod
[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | community | `H  J ` | | @ColinKennedy
[djot](https://github.com/treeman/tree-sitter-djot) | community | `HFIJL` | | @NoahTheDuke
[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | community | `H  J ` | | @camdencheek
[dot](https://github.com/rydesun/tree-sitter-dot) | community | `H IJ ` | | @rydesun
[doxygen](https://github.com/tree-sitter-grammars/tree-sitter-doxygen) | core | `H IJ ` | | @amaanq
[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | core | `HF JL` | | @ObserverOfTime
[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J ` | | @glehmann
[ebnf](https://github.com/RubixDev/ebnf) | community | `H    ` | | @RubixDev
ecma (queries only)[^ecma] | community | `HFIJL` | | @steelsojka
[eds](https://github.com/uyha/tree-sitter-eds) | community | `HF   ` | | @uyha
[eex](https://github.com/connorlay/tree-sitter-eex) | community | `H  J ` | | @connorlay
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | community | `HFIJL` | | @connorlay
[elm](https://github.com/elm-tooling/tree-sitter-elm) | community | `H  J ` | | @zweimach
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | community | `HFIJL` | | @glapa-grossklag, @amaanq
[elvish](https://github.com/elves/tree-sitter-elvish) | community | `H  J ` | | @elves
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unsupported | `H  J ` | |
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | community | `HF   ` | | @filmor
[facility](https://github.com/FacilityApi/tree-sitter-facility) | community | `HFIJ ` | | @bryankenote
[faust](https://github.com/khiner/tree-sitter-faust) | community | `H  J ` | | @khiner
[fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | community | `HF JL` | | @alexmozaidze
[fidl](https://github.com/google/tree-sitter-fidl) | community | `HF J ` | | @chaopeng
[firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | core | `HFIJL` | | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | community | `HFIJL` | | @ram02z
[foam](https://github.com/FoamScience/tree-sitter-foam) | community | `HFIJL` | | @FoamScience
[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | community | `HFIJL` | | @amaanq
[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | community | `HFI  ` | | @amaanq
[fsh](https://github.com/mgramigna/tree-sitter-fsh) | community | `H    ` | | @mgramigna
[func](https://github.com/tree-sitter-grammars/tree-sitter-func) | core | `H    ` | | @amaanq
[fusion](https://gitlab.com/jirgn/tree-sitter-fusion) | community | `HFI L` | | @jirgn
[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | community | `HFIJL` | | @PrestonKnopp
[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | community | `H  J ` | | @godofavacyn
[git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | community | `HF J ` | | @amaanq
[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | community | `H  J ` | | @gbprod
[gitattributes](https://github.com/tree-sitter-grammars/tree-sitter-gitattributes) | core | `H  JL` | | @ObserverOfTime
[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | community | `H  J ` | | @gbprod
[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | community | `H    ` | | @theHamsta
[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | community | `HFIJL` | | @amaanq
[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | community | `HFI L` | | @NullVoxPopuli
[glsl](https://github.com/tree-sitter-grammars/tree-sitter-glsl) | core | `HFIJL` | | @theHamsta
[gn](https://github.com/tree-sitter-grammars/tree-sitter-gn) | core | `HFIJL` | | @amaanq
[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | community | `H  J ` | | @dpezto
[go](https://github.com/tree-sitter/tree-sitter-go) | core | `HFIJL` | | @theHamsta, @WinWisely268
[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | community | `HF JL` | | @pierpo
[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | community | `H  J ` | | @camdencheek
[gosum](https://github.com/tree-sitter-grammars/tree-sitter-go-sum) | core | `H    ` | | @amaanq
[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | | @qvalentin
[gowork](https://github.com/omertuc/tree-sitter-go-work) | community | `H  J ` | | @omertuc
[gpg](https://github.com/tree-sitter-grammars/tree-sitter-gpg-config) | core | `H  J ` | | @ObserverOfTime
[graphql](https://github.com/bkegley/tree-sitter-graphql) | community | `H IJ ` | | @bkegley
[groovy](https://github.com/murtaza64/tree-sitter-groovy) | community | `HFIJL` | | @murtaza64
[gstlaunch](https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch) | core | `H    ` | | @theHamsta
[hack](https://github.com/slackhq/tree-sitter-hack) | unsupported | `H    ` | |
[hare](https://github.com/tree-sitter-grammars/tree-sitter-hare) | core | `HFIJL` | | @amaanq
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | core | `HF JL` | | @mrcjkb
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | community | `HF   ` | | @lykahb
[hcl](https://github.com/tree-sitter-grammars/tree-sitter-hcl) | core | `HFIJ ` | | @MichaHoffmann
[heex](https://github.com/connorlay/tree-sitter-heex) | community | `HFIJL` | | @connorlay
[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | | @qvalentin
[hjson](https://github.com/winston0410/tree-sitter-hjson) | community | `HFIJL` | | @winston0410
[hlsl](https://github.com/tree-sitter-grammars/tree-sitter-hlsl) | core | `HFIJL` | | @theHamsta
[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | community | `H  J ` | | @Freed-Wu
[hocon](https://github.com/antosha417/tree-sitter-hocon) | unsupported | `HF J ` | | @antosha417
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | community | `HF  L` | | @urbit-pilled
[html](https://github.com/tree-sitter/tree-sitter-html) | core | `HFIJL` | | @TravonteD
html_tags (queries only)[^html_tags] | community | `H IJ ` | | @TravonteD
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | community | `HFIJ ` | | @ObserverOfTime
[http](https://github.com/rest-nvim/tree-sitter-http) | community | `H  J ` | | @amaanq, @NTBBloodbath
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | @pfeiferj
[hyprlang](https://github.com/tree-sitter-grammars/tree-sitter-hyprlang) | core | `HFIJ ` | | @luckasRanarison
[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J ` | | @cathaysa
[ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF   ` | | @theHamsta
[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | | @yorickpeterse
[ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | core | `HFIJL` | | @fab4100
[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | community | `HF JL` | | @sogaiu
[java](https://github.com/tree-sitter/tree-sitter-java) | core | `HFIJL` | | @p00f
[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | core | `HFIJL` | | @steelsojka
[jq](https://github.com/flurie/tree-sitter-jq) | community | `H  JL` | | @ObserverOfTime
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | core | `H    ` | | @steelsojka
[json](https://github.com/tree-sitter/tree-sitter-json) | core | `HFI L` | | @steelsojka
[json5](https://github.com/Joakker/tree-sitter-json5) | community | `H  J ` | | @Joakker
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc) | community | `HFIJL` | | @WhyNotHugo
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | community | `HF  L` | | @nawordar
jsx (queries only)[^jsx] | community | `HFIJ ` | | @steelsojka
[julia](https://github.com/tree-sitter/tree-sitter-julia) | core | `HFIJL` | | @theHamsta
[just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJL` | | @Hubro
[kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | core | `HFIJL` | | @amaanq
[kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | core | `HFIJL` | | @amaanq
[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | community | `HF JL` | | @SalBakraa
[koto](https://github.com/koto-lang/tree-sitter-koto) | community | `HF JL` | | @irh
[kusto](https://github.com/Willem-J-an/tree-sitter-kusto) | community | `H  J ` | | @Willem-J-an
[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | community | `HF JL` | | @traxys
[latex](https://github.com/latex-lsp/tree-sitter-latex) | community | `HF J ` | ✓ | @theHamsta, @clason
[ledger](https://github.com/cbarrete/tree-sitter-ledger) | community | `HFIJ ` | | @cbarrete
[leo](https://github.com/r001/tree-sitter-leo) | community | `H IJ ` | | @r001
[linkerscript](https://github.com/tree-sitter-grammars/tree-sitter-linkerscript) | core | `HFIJL` | | @amaanq
[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | community | `H  J ` | | @hankthetank27
[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | community | `HFI L` | | @toots
[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | community | `H    ` | | @benwilliamgraham
[lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) | stable | `HFIJL` | | @muniftanjim
[luadoc](https://github.com/tree-sitter-grammars/tree-sitter-luadoc) | core | `H    ` | | @amaanq
[luap](https://github.com/tree-sitter-grammars/tree-sitter-luap)[^luap] | core | `H    ` | | @amaanq
[luau](https://github.com/tree-sitter-grammars/tree-sitter-luau) | core | `HFIJL` | | @amaanq
[m68k](https://github.com/grahambates/tree-sitter-m68k) | community | `HF JL` | | @grahambates
[make](https://github.com/alemuller/tree-sitter-make) | community | `HF J ` | | @lewis6991
[markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown] | stable | `HFIJ ` | | @MDeiml
[markdown_inline](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown_inline] | stable | `H  J ` | | @MDeiml
[matlab](https://github.com/acristoffers/tree-sitter-matlab) | community | `HFIJL` | | @acristoffers
[menhir](https://github.com/Kerl13/tree-sitter-menhir) | community | `H  J ` | | @Kerl13
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unsupported | `H    ` | |
[meson](https://github.com/tree-sitter-grammars/tree-sitter-meson) | core | `HFIJ ` | | @Decodetalkers
[mlir](https://github.com/artagnon/tree-sitter-mlir) | community | `H   L` | ✓ | @artagnon
[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | @Freed-Wu
[nasm](https://github.com/naclsn/tree-sitter-nasm) | community | `H  J ` | | @ObserverOfTime
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unsupported | `H I  ` | |
[nim](https://github.com/alaviss/tree-sitter-nim) | community | `HF JL` | | @aMOPel
[nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | community | `H  J ` | | @aMOPel
[ninja](https://github.com/alemuller/tree-sitter-ninja) | community | `HFI  ` | | @alemuller
[nix](https://github.com/cstrahan/tree-sitter-nix) | community | `HF JL` | | @leo60228
[nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | core | `HFIJL` | | @amaanq
[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | core | `HFIJL` | | @amaanq
[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J ` | | @ColinKennedy
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | core | `HFIJL` | | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | core | `HFIJL` | | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | ✓ | @undu
[odin](https://github.com/tree-sitter-grammars/tree-sitter-odin) | core | `HFIJL` | | @amaanq
[org](https://github.com/milisims/tree-sitter-org) | unsupported | `     ` | |
[pascal](https://github.com/Isopod/tree-sitter-pascal) | community | `HFIJL` | | @Isopod
[passwd](https://github.com/ath3/tree-sitter-passwd) | community | `H    ` | | @amaanq
[pem](https://github.com/tree-sitter-grammars/tree-sitter-pem) | core | `HF J ` | | @ObserverOfTime
[perl](https://github.com/tree-sitter-perl/tree-sitter-perl) | community | `HF J ` | | @RabbiVeesh, @LeoNerd
[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | core | `HFIJL` | | @tk-shirasaka
[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | core | `HFIJL` | | @tk-shirasaka
[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | community | `H    ` | | @mikehaertl
[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | community | `H  J ` | | @leo60228
[po](https://github.com/tree-sitter-grammars/tree-sitter-po) | core | `HF J ` | | @amaanq
[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | community | `H    ` | | @RabbiVeesh, @LeoNerd
[poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | core | `HFIJ ` | | @ObserverOfTime
[pony](https://github.com/tree-sitter-grammars/tree-sitter-pony) | core | `HFIJL` | | @amaanq, @mfelsche
[printf](https://github.com/tree-sitter-grammars/tree-sitter-printf) | core | `H    ` | | @ObserverOfTime
[prisma](https://github.com/victorhqc/tree-sitter-prisma) | community | `HF   ` | | @elianiva
[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | community | `H  J ` | | @MichaHoffmann
[properties](https://github.com/tree-sitter-grammars/tree-sitter-properties)[^properties] | core | `H  JL` | | @ObserverOfTime
[proto](https://github.com/treywood/tree-sitter-proto) | community | `HF   ` | | @treywood
[prql](https://github.com/PRQL/tree-sitter-prql) | community | `H  J ` | | @matthias-Q
[psv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | | @amaanq
[pug](https://github.com/zealot128/tree-sitter-pug) | community | `H  J ` | | @zealot128
[puppet](https://github.com/tree-sitter-grammars/tree-sitter-puppet) | core | `HFIJL` | | @amaanq
[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  JL` | | @postsolar
[pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | core | `H  J ` | | @ObserverOfTime
[python](https://github.com/tree-sitter/tree-sitter-python) | stable | `HFIJL` | | @stsewd, @theHamsta
[ql](https://github.com/tree-sitter/tree-sitter-ql) | core | `HFIJL` | | @pwntester
[qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | core | `H  J ` | | @amaanq
[qmljs](https://github.com/yuja/tree-sitter-qmljs) | community | `HF J ` | | @Decodetalkers
[query](https://github.com/tree-sitter-grammars/tree-sitter-query)[^query] | stable | `HFIJL` | | @steelsojka
[r](https://github.com/r-lib/tree-sitter-r) | community | `H IJL` | | @echasnovski
[racket](https://github.com/6cdh/tree-sitter-racket) | unsupported | `HF J ` | |
[rasi](https://github.com/Fymyte/tree-sitter-rasi) | community | `HFIJL` | | @Fymyte
[rbs](https://github.com/joker1007/tree-sitter-rbs) | community | `HFIJ ` | | @joker1007
[re2c](https://github.com/tree-sitter-grammars/tree-sitter-re2c) | core | `HFIJL` | | @amaanq
[readline](https://github.com/tree-sitter-grammars/tree-sitter-readline) | core | `HFIJ ` | | @ribru17
[regex](https://github.com/tree-sitter/tree-sitter-regex) | core | `H    ` | | @theHamsta
[rego](https://github.com/FallenAngel97/tree-sitter-rego) | community | `H  J ` | | @FallenAngel97
[requirements](https://github.com/tree-sitter-grammars/tree-sitter-requirements) | core | `H  J ` | | @ObserverOfTime
[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | community | `HF J ` | | @bamonroe
[robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFI  ` | | @Hubro
[roc](https://github.com/nat-418/tree-sitter-roc) | community | `H  JL` | | @nat-418
[ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | core | `HFIJL` | | @amaanq
[rst](https://github.com/stsewd/tree-sitter-rst) | community | `H  JL` | | @stsewd
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | core | `HFIJL` | | @TravonteD
[rust](https://github.com/tree-sitter/tree-sitter-rust) | core | `HFIJL` | | @amaanq
[scala](https://github.com/tree-sitter/tree-sitter-scala) | core | `HF JL` | | @stevanmilic
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H  J ` | ✓ | @WhyNotHugo
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unsupported | `HF J ` | |
[scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFI  ` | | @elianiva
[slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | core | `HFIJL` | | @theHamsta
[slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJL` | | @hunger
[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | core | `HFIJL` | | @amaanq
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | community | `H    ` | | @amaanq, @keynmol
[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | community | `HFIJL` | | @osthomas
[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | community | `HF   ` | | @amaanq
[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | | @aheber
[sosl](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | | @aheber
[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  JL` | | @Sarrus1
[sparql](https://github.com/BonaBeavis/tree-sitter-sparql) | community | `HFIJL` | | @BonaBeavis
[sql](https://github.com/derekstride/tree-sitter-sql) | community | `H IJ ` | | @derekstride
[squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | core | `HFIJL` | | @amaanq
[ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | core | `HFIJL` | | @ObserverOfTime
[starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | core | `HFIJL` | | @amaanq
[strace](https://github.com/sigmaSd/tree-sitter-strace) | community | `H  J ` | | @amaanq
[styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ ` | | @mskelton
[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | community | `HFIJL` | | @madskjeldgaard
[surface](https://github.com/connorlay/tree-sitter-surface) | community | `HFIJ ` | | @connorlay
[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | core | `HFIJL` | | @amaanq
[swift](https://github.com/alex-pinkus/tree-sitter-swift) | community | `H I L` | ✓ | @alex-pinkus
[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | community | `HF J ` | | @RaafatTurki
[systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | community | `HF JL` | | @ok-ryoko
[t32](https://gitlab.com/xasc/tree-sitter-t32) | community | `HFIJL` | | @xasc
[tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | core | `HFIJL` | | @amaanq
[tact](https://github.com/tact-lang/tree-sitter-tact) | community | `HFIJL` | | @novusnota
[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | core | `HFI  ` | | @lewis6991
[teal](https://github.com/euclidianAce/tree-sitter-teal) | community | `HFIJL` | ✓ | @euclidianAce
[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J ` | | @vrischmann
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | community | `HFIJ ` | | @MichaHoffmann
[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | community | `HFI  ` | | @Porter
[thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | core | `HFIJL` | | @amaanq, @duskmoon314
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | community | `HFIJL` | | @ambroisie
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | community | `HF JL` | | @ahelwer, @susliko
[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | community | `H  J ` | | @Freed-Wu
[todotxt](https://github.com/arnarg/tree-sitter-todotxt) | community | `H    ` | | @arnarg
[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | core | `HFIJL` | | @tk-shirasaka
[tsv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | | @amaanq
[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | core | `HFIJL` | | @steelsojka
[turtle](https://github.com/BonaBeavis/tree-sitter-turtle) | community | `HFIJL` | | @BonaBeavis
[twig](https://github.com/gbprod/tree-sitter-twig) | community | `H  J ` | | @gbprod
[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | core | `HFIJL` | | @steelsojka
[typespec](https://github.com/happenslol/tree-sitter-typespec) | community | `H IJ ` | | @happenslol
[typoscript](https://github.com/Teddytrombone/tree-sitter-typoscript) | community | `HFIJ ` | | @Teddytrombone
[typst](https://github.com/uben0/tree-sitter-typst) | community | `HFIJ ` | | @uben0, @RaafatTurki
[udev](https://github.com/tree-sitter-grammars/tree-sitter-udev) | core | `H  JL` | | @ObserverOfTime
[ungrammar](https://github.com/tree-sitter-grammars/tree-sitter-ungrammar) | core | `HFIJL` | | @Philipp-M, @amaanq
[unison](https://github.com/kylegoetz/tree-sitter-unison) | community | `H  J ` | ✓ | @tapegram
[usd](https://github.com/ColinKennedy/tree-sitter-usd) | community | `HFI L` | | @ColinKennedy
[uxntal](https://github.com/tree-sitter-grammars/tree-sitter-uxntal) | core | `HFIJL` | | @amaanq
[v](https://github.com/vlang/v-analyzer) | community | `HFIJL` | | @kkharji, @amaanq
[vala](https://github.com/vala-lang/tree-sitter-vala) | community | `HF   ` | | @Prince781
[vento](https://github.com/ventojs/tree-sitter-vento) | community | `H  J ` | | @wrapperup, @oscarotero
[verilog](https://github.com/tree-sitter/tree-sitter-verilog) | core | `HF JL` | | @zegervdv
[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | community | `H    ` | | @caarlos0
[vim](https://github.com/tree-sitter-grammars/tree-sitter-vim) | stable | `HF JL` | | @clason
[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | stable | `H  J ` | | @clason
[vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) | core | `HFIJ ` | | @WhyNotHugo, @lucario387
[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | community | `HFI  ` | | @szebniok
[wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | core | `HFI  ` | | @theHamsta
[wing](https://github.com/winglang/tree-sitter-wing) | community | `HF  L` | | @gshpychka, @MarkMcCulloh
[wit](https://github.com/liamwh/tree-sitter-wit) | community | `H  J ` | | @liamwh
[xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | core | `H  JL` | | @ObserverOfTime
[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | core | `HFIJL` | | @ObserverOfTime
[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | core | `HFIJL` | | @amaanq
[yang](https://github.com/Hubro/tree-sitter-yang) | community | `HFIJ ` | | @Hubro
[yuck](https://github.com/tree-sitter-grammars/tree-sitter-yuck) | core | `HFIJL` | | @Philipp-M, @amaanq
[zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) | community | `H  J ` | | @Freed-Wu
[zig](https://github.com/maxxnino/tree-sitter-zig) | community | `HFIJL` | | @maxxnino
Language | Tier | Queries | Maintainer
-------- |:----:|:-------:| ----------
[ada](https://github.com/briot/tree-sitter-ada) | community | `HF JL` | @briot
[agda](https://github.com/tree-sitter/tree-sitter-agda) | core | `HF J ` | @Decodetalkers
[angular](https://github.com/dlvandenberg/tree-sitter-angular) | community | `HFIJL` | @dlvandenberg
[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF JL` | @aheber
[arduino](https://github.com/tree-sitter-grammars/tree-sitter-arduino) | core | `HFIJL` | @ObserverOfTime
[asm](https://github.com/RubixDev/tree-sitter-asm) | community | `H  J ` | @RubixDev
[astro](https://github.com/virchau13/tree-sitter-astro) | community | `HFIJL` | @virchau13
[authzed](https://github.com/mleonidas/tree-sitter-authzed) | community | `H  J ` | @mattpolzin
[awk](https://github.com/Beaglefoot/tree-sitter-awk) | unsupported | `H  J ` |
[bash](https://github.com/tree-sitter/tree-sitter-bash) | stable | `HF JL` | @TravonteD
[bass](https://github.com/vito/tree-sitter-bass) | community | `HFIJL` | @amaanq
[beancount](https://github.com/polarmutex/tree-sitter-beancount) | community | `HF J ` | @polarmutex
[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | community | `HFIJ ` | @theHamsta, @clason
[bicep](https://github.com/tree-sitter-grammars/tree-sitter-bicep) | core | `HFIJL` | @amaanq
[bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) | core | `HFIJL` | @amaanq
[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint) | unsupported | `H  J ` | @gabmus
[bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | community | `HFIJL` | @ambroisie
[c](https://github.com/tree-sitter/tree-sitter-c) | stable | `HFIJL` | @amaanq
[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | core | `HF JL` | @amaanq
[cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | core | `HFIJL` | @amaanq
[capnp](https://github.com/tree-sitter-grammars/tree-sitter-capnp) | core | `HFIJL` | @amaanq
[chatito](https://github.com/tree-sitter-grammars/tree-sitter-chatito) | core | `HFIJL` | @ObserverOfTime
[clojure](https://github.com/sogaiu/tree-sitter-clojure) | community | `HF JL` | @NoahTheDuke
[cmake](https://github.com/uyha/tree-sitter-cmake) | community | `HFIJ ` | @uyha
[comment](https://github.com/stsewd/tree-sitter-comment) | community | `H    ` | @stsewd
[commonlisp](https://github.com/tree-sitter-grammars/tree-sitter-commonlisp) | core | `HF JL` | @theHamsta
[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | community | `H  J ` | @addcninblue
[corn](https://github.com/jakestanger/tree-sitter-corn) | community | `HFIJL` | @jakestanger
[cpon](https://github.com/tree-sitter-grammars/tree-sitter-cpon) | core | `HFIJL` | @amaanq
[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | core | `HFIJL` | @theHamsta
[css](https://github.com/tree-sitter/tree-sitter-css) | core | `HFIJ ` | @TravonteD
[csv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | @amaanq
[cuda](https://github.com/tree-sitter-grammars/tree-sitter-cuda) | core | `HFIJL` | @theHamsta
[cue](https://github.com/eonpatapon/tree-sitter-cue) | community | `HFIJL` | @amaanq
[d](https://github.com/gdamore/tree-sitter-d) | community | `HFIJL` | @amaanq
[dart](https://github.com/UserNobody14/tree-sitter-dart) | community | `HFIJL` | @akinsho
[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | community | `HFIJL` | @jedrzejboczar
[dhall](https://github.com/jbellerb/tree-sitter-dhall) | community | `HF J ` | @amaanq
[diff](https://github.com/the-mikedavis/tree-sitter-diff) | community | `H    ` | @gbprod
[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | community | `H  J ` | @ColinKennedy
[djot](https://github.com/treeman/tree-sitter-djot) | community | `HFIJL` | @NoahTheDuke
[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | community | `H  J ` | @camdencheek
[dot](https://github.com/rydesun/tree-sitter-dot) | community | `H IJ ` | @rydesun
[doxygen](https://github.com/tree-sitter-grammars/tree-sitter-doxygen) | core | `H IJ ` | @amaanq
[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | core | `HF JL` | @ObserverOfTime
[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J ` | @glehmann
[ebnf](https://github.com/RubixDev/ebnf) | community | `H  J ` | @RubixDev
ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka
[eds](https://github.com/uyha/tree-sitter-eds) | community | `HF   ` | @uyha
[eex](https://github.com/connorlay/tree-sitter-eex) | community | `H  J ` | @connorlay
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | community | `HFIJL` | @connorlay
[elm](https://github.com/elm-tooling/tree-sitter-elm) | community | `H  J ` | @zweimach
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | community | `HFIJL` | @glapa-grossklag, @amaanq
[elvish](https://github.com/elves/tree-sitter-elvish) | community | `H  J ` | @elves
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unsupported | `H  J ` |
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | community | `HF J ` | @filmor
[facility](https://github.com/FacilityApi/tree-sitter-facility) | community | `HFIJ ` | @bryankenote
[faust](https://github.com/khiner/tree-sitter-faust) | community | `H  J ` | @khiner
[fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | community | `HF JL` | @alexmozaidze
[fidl](https://github.com/google/tree-sitter-fidl) | community | `HF J ` | @chaopeng
[firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | core | `HFIJL` | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | community | `HFIJL` | @ram02z
[foam](https://github.com/FoamScience/tree-sitter-foam) | community | `HFIJL` | @FoamScience
[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | community | `HFIJL` | @amaanq
[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | community | `HFIJ ` | @amaanq
[fsh](https://github.com/mgramigna/tree-sitter-fsh) | community | `H  J ` | @mgramigna
[func](https://github.com/tree-sitter-grammars/tree-sitter-func) | core | `H  J ` | @amaanq
[fusion](https://gitlab.com/jirgn/tree-sitter-fusion) | community | `HFIJL` | @jirgn
[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | community | `HFIJL` | @PrestonKnopp
[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | community | `H  J ` | @godofavacyn
[git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | community | `HF J ` | @amaanq
[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | community | `H  J ` | @gbprod
[gitattributes](https://github.com/tree-sitter-grammars/tree-sitter-gitattributes) | core | `H  JL` | @ObserverOfTime
[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | community | `H  J ` | @gbprod
[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | community | `H  J ` | @theHamsta
[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | community | `HFIJL` | @amaanq
[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | community | `HFIJL` | @NullVoxPopuli
[glsl](https://github.com/tree-sitter-grammars/tree-sitter-glsl) | core | `HFIJL` | @theHamsta
[gn](https://github.com/tree-sitter-grammars/tree-sitter-gn) | core | `HFIJL` | @amaanq
[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | community | `H  J ` | @dpezto
[go](https://github.com/tree-sitter/tree-sitter-go) | core | `HFIJL` | @theHamsta, @WinWisely268
[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | community | `HF JL` | @pierpo
[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | community | `H  J ` | @camdencheek
[gosum](https://github.com/tree-sitter-grammars/tree-sitter-go-sum) | core | `H    ` | @amaanq
[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | @qvalentin
[gowork](https://github.com/omertuc/tree-sitter-go-work) | community | `H  J ` | @omertuc
[gpg](https://github.com/tree-sitter-grammars/tree-sitter-gpg-config) | core | `H  J ` | @ObserverOfTime
[graphql](https://github.com/bkegley/tree-sitter-graphql) | community | `H IJ ` | @bkegley
[groovy](https://github.com/murtaza64/tree-sitter-groovy) | community | `HFIJL` | @murtaza64
[gstlaunch](https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch) | core | `H    ` | @theHamsta
[hack](https://github.com/slackhq/tree-sitter-hack) | unsupported | `H  J ` |
[hare](https://github.com/tree-sitter-grammars/tree-sitter-hare) | core | `HFIJL` | @amaanq
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | core | `HF JL` | @mrcjkb
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | community | `HF   ` | @lykahb
[hcl](https://github.com/tree-sitter-grammars/tree-sitter-hcl) | core | `HFIJ ` | @MichaHoffmann
[heex](https://github.com/connorlay/tree-sitter-heex) | community | `HFIJL` | @connorlay
[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | @qvalentin
[hjson](https://github.com/winston0410/tree-sitter-hjson) | community | `HFIJL` | @winston0410
[hlsl](https://github.com/tree-sitter-grammars/tree-sitter-hlsl) | core | `HFIJL` | @theHamsta
[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | community | `H  J ` | @Freed-Wu
[hocon](https://github.com/antosha417/tree-sitter-hocon) | unsupported | `HF J ` | @antosha417
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | community | `HF JL` | @urbit-pilled
[html](https://github.com/tree-sitter/tree-sitter-html) | core | `HFIJL` | @TravonteD
html_tags (queries only)[^html_tags] | community | `H IJ ` | @TravonteD
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | community | `HFIJ ` | @ObserverOfTime
[http](https://github.com/rest-nvim/tree-sitter-http) | community | `H  J ` | @amaanq, @NTBBloodbath
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | @pfeiferj
[hyprlang](https://github.com/tree-sitter-grammars/tree-sitter-hyprlang) | core | `HFIJ ` | @luckasRanarison
[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J ` | @cathaysa
[ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF   ` | @theHamsta
[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | @yorickpeterse
[ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | core | `HFIJL` | @fab4100
[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | community | `HF JL` | @sogaiu
[java](https://github.com/tree-sitter/tree-sitter-java) | core | `HFIJL` | @p00f
[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | core | `HFIJL` | @steelsojka
[jq](https://github.com/flurie/tree-sitter-jq) | community | `H  JL` | @ObserverOfTime
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | core | `H    ` | @steelsojka
[json](https://github.com/tree-sitter/tree-sitter-json) | core | `HFI L` | @steelsojka
[json5](https://github.com/Joakker/tree-sitter-json5) | community | `H  J ` | @Joakker
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc) | community | `HFIJL` | @WhyNotHugo
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | community | `HF JL` | @nawordar
jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka
[julia](https://github.com/tree-sitter/tree-sitter-julia) | core | `HFIJL` | @theHamsta
[just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJL` | @Hubro
[kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | core | `HFIJL` | @amaanq
[kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | core | `HFIJL` | @amaanq
[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | community | `HF JL` | @SalBakraa
[koto](https://github.com/koto-lang/tree-sitter-koto) | community | `HF JL` | @irh
[kusto](https://github.com/Willem-J-an/tree-sitter-kusto) | community | `H  J ` | @Willem-J-an
[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | community | `HF JL` | @traxys
[latex](https://github.com/latex-lsp/tree-sitter-latex) | community | `HF J ` | @theHamsta, @clason
[ledger](https://github.com/cbarrete/tree-sitter-ledger) | community | `HFIJ ` | @cbarrete
[leo](https://github.com/r001/tree-sitter-leo) | community | `H IJ ` | @r001
[linkerscript](https://github.com/tree-sitter-grammars/tree-sitter-linkerscript) | core | `HFIJL` | @amaanq
[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | community | `H  J ` | @hankthetank27
[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | community | `HFIJL` | @toots
[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | community | `H  J ` | @benwilliamgraham
[lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) | stable | `HFIJL` | @muniftanjim
[luadoc](https://github.com/tree-sitter-grammars/tree-sitter-luadoc) | core | `H    ` | @amaanq
[luap](https://github.com/tree-sitter-grammars/tree-sitter-luap)[^luap] | core | `H    ` | @amaanq
[luau](https://github.com/tree-sitter-grammars/tree-sitter-luau) | core | `HFIJL` | @amaanq
[m68k](https://github.com/grahambates/tree-sitter-m68k) | community | `HF JL` | @grahambates
[make](https://github.com/alemuller/tree-sitter-make) | community | `HF J ` | @lewis6991
[markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown] | stable | `HFIJ ` | @MDeiml
[markdown_inline](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown_inline] | stable | `H  J ` | @MDeiml
[matlab](https://github.com/acristoffers/tree-sitter-matlab) | community | `HFIJL` | @acristoffers
[menhir](https://github.com/Kerl13/tree-sitter-menhir) | community | `H  J ` | @Kerl13
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unsupported | `H  J ` |
[meson](https://github.com/tree-sitter-grammars/tree-sitter-meson) | core | `HFIJ ` | @Decodetalkers
[mlir](https://github.com/artagnon/tree-sitter-mlir) | community | `H  JL` | @artagnon
[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | @Freed-Wu
[nasm](https://github.com/naclsn/tree-sitter-nasm) | community | `H  J ` | @ObserverOfTime
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unsupported | `H IJ ` |
[nim](https://github.com/alaviss/tree-sitter-nim) | community | `HF JL` | @aMOPel
[nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | community | `H  J ` | @aMOPel
[ninja](https://github.com/alemuller/tree-sitter-ninja) | community | `HFIJ ` | @alemuller
[nix](https://github.com/cstrahan/tree-sitter-nix) | community | `HF JL` | @leo60228
[nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | core | `HFIJL` | @amaanq
[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | core | `HFIJL` | @amaanq
[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J ` | @ColinKennedy
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | core | `HFIJL` | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | core | `HFIJL` | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | @undu
[odin](https://github.com/tree-sitter-grammars/tree-sitter-odin) | core | `HFIJL` | @amaanq
[org](https://github.com/milisims/tree-sitter-org) | unsupported | `     ` |
[pascal](https://github.com/Isopod/tree-sitter-pascal) | community | `HFIJL` | @Isopod
[passwd](https://github.com/ath3/tree-sitter-passwd) | community | `H    ` | @amaanq
[pem](https://github.com/tree-sitter-grammars/tree-sitter-pem) | core | `HF J ` | @ObserverOfTime
[perl](https://github.com/tree-sitter-perl/tree-sitter-perl) | community | `HF J ` | @RabbiVeesh, @LeoNerd
[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | core | `HFIJL` | @tk-shirasaka
[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | core | `HFIJL` | @tk-shirasaka
[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | community | `H    ` | @mikehaertl
[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | community | `H  J ` | @leo60228
[po](https://github.com/tree-sitter-grammars/tree-sitter-po) | core | `HF J ` | @amaanq
[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | community | `H    ` | @RabbiVeesh, @LeoNerd
[poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | core | `HFIJ ` | @ObserverOfTime
[pony](https://github.com/tree-sitter-grammars/tree-sitter-pony) | core | `HFIJL` | @amaanq, @mfelsche
[printf](https://github.com/tree-sitter-grammars/tree-sitter-printf) | core | `H    ` | @ObserverOfTime
[prisma](https://github.com/victorhqc/tree-sitter-prisma) | community | `HF J ` | @elianiva
[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | community | `H  J ` | @MichaHoffmann
[properties](https://github.com/tree-sitter-grammars/tree-sitter-properties)[^properties] | core | `H  JL` | @ObserverOfTime
[proto](https://github.com/treywood/tree-sitter-proto) | community | `HF J ` | @treywood
[prql](https://github.com/PRQL/tree-sitter-prql) | community | `H  J ` | @matthias-Q
[psv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | @amaanq
[pug](https://github.com/zealot128/tree-sitter-pug) | community | `H  J ` | @zealot128
[puppet](https://github.com/tree-sitter-grammars/tree-sitter-puppet) | core | `HFIJL` | @amaanq
[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  JL` | @postsolar
[pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | core | `H  J ` | @ObserverOfTime
[python](https://github.com/tree-sitter/tree-sitter-python) | stable | `HFIJL` | @stsewd, @theHamsta
[ql](https://github.com/tree-sitter/tree-sitter-ql) | core | `HFIJL` | @pwntester
[qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | core | `H  J ` | @amaanq
[qmljs](https://github.com/yuja/tree-sitter-qmljs) | community | `HF J ` | @Decodetalkers
[query](https://github.com/tree-sitter-grammars/tree-sitter-query)[^query] | stable | `HFIJL` | @steelsojka
[r](https://github.com/r-lib/tree-sitter-r) | community | `H IJL` | @echasnovski
[racket](https://github.com/6cdh/tree-sitter-racket) | unsupported | `HF J ` |
[ralph](https://github.com/alephium/tree-sitter-ralph) | community | `H  J ` | @tdroxler
[rasi](https://github.com/Fymyte/tree-sitter-rasi) | community | `HFIJL` | @Fymyte
[rbs](https://github.com/joker1007/tree-sitter-rbs) | community | `HFIJ ` | @joker1007
[re2c](https://github.com/tree-sitter-grammars/tree-sitter-re2c) | core | `HFIJL` | @amaanq
[readline](https://github.com/tree-sitter-grammars/tree-sitter-readline) | core | `HFIJ ` | @ribru17
[regex](https://github.com/tree-sitter/tree-sitter-regex) | core | `H    ` | @theHamsta
[rego](https://github.com/FallenAngel97/tree-sitter-rego) | community | `H  J ` | @FallenAngel97
[requirements](https://github.com/tree-sitter-grammars/tree-sitter-requirements) | core | `H  J ` | @ObserverOfTime
[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | community | `HF J ` | @bamonroe
[robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFIJ ` | @Hubro
[roc](https://github.com/faldor20/tree-sitter-roc) | community | `H  JL` | @nat-418
[ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | core | `HFIJL` | @amaanq
[rst](https://github.com/stsewd/tree-sitter-rst) | community | `H  JL` | @stsewd
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | core | `HFIJL` | @TravonteD
[rust](https://github.com/tree-sitter/tree-sitter-rust) | core | `HFIJL` | @amaanq
[scala](https://github.com/tree-sitter/tree-sitter-scala) | core | `HF JL` | @stevanmilic
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | unsupported | `H  J ` | @WhyNotHugo
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unsupported | `HF J ` |
[scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFIJ ` | @elianiva
[slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | core | `HFIJL` | @theHamsta
[slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJL` | @hunger
[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | core | `HFIJL` | @amaanq
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | community | `H  J ` | @amaanq, @keynmol
[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | community | `HFIJL` | @osthomas
[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | community | `HF J ` | @amaanq
[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | @aheber
[sosl](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | @aheber
[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  JL` | @Sarrus1
[sparql](https://github.com/BonaBeavis/tree-sitter-sparql) | community | `HFIJL` | @BonaBeavis
[sql](https://github.com/derekstride/tree-sitter-sql) | community | `H IJ ` | @derekstride
[squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | core | `HFIJL` | @amaanq
[ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | core | `HFIJL` | @ObserverOfTime
[starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | core | `HFIJL` | @amaanq
[strace](https://github.com/sigmaSd/tree-sitter-strace) | community | `H  J ` | @amaanq
[styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ ` | @mskelton
[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | community | `HFIJL` | @madskjeldgaard
[surface](https://github.com/connorlay/tree-sitter-surface) | community | `HFIJ ` | @connorlay
[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | core | `HFIJL` | @amaanq
[swift](https://github.com/alex-pinkus/tree-sitter-swift) | community | `H IJL` | @alex-pinkus
[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | community | `HF J ` | @RaafatTurki
[systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | community | `HF JL` | @ok-ryoko
[t32](https://gitlab.com/xasc/tree-sitter-t32) | community | `HFIJL` | @xasc
[tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | core | `HFIJL` | @amaanq
[tact](https://github.com/tact-lang/tree-sitter-tact) | community | `HFIJL` | @novusnota
[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | core | `HFIJ ` | @lewis6991
[teal](https://github.com/euclidianAce/tree-sitter-teal) | community | `HFIJL` | @euclidianAce
[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J ` | @vrischmann
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | community | `HFIJ ` | @MichaHoffmann
[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | community | `HFIJ ` | @Porter
[thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | core | `HFIJL` | @amaanq, @duskmoon314
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | community | `HFIJL` | @ambroisie
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | community | `HF JL` | @ahelwer, @susliko
[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | community | `H  J ` | @Freed-Wu
[todotxt](https://github.com/arnarg/tree-sitter-todotxt) | community | `H    ` | @arnarg
[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | core | `HFIJL` | @tk-shirasaka
[tsv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | core | `H    ` | @amaanq
[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | core | `HFIJL` | @steelsojka
[turtle](https://github.com/BonaBeavis/tree-sitter-turtle) | community | `HFIJL` | @BonaBeavis
[twig](https://github.com/gbprod/tree-sitter-twig) | community | `H  J ` | @gbprod
[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | core | `HFIJL` | @steelsojka
[typespec](https://github.com/happenslol/tree-sitter-typespec) | community | `H IJ ` | @happenslol
[typoscript](https://github.com/Teddytrombone/tree-sitter-typoscript) | community | `HFIJ ` | @Teddytrombone
[typst](https://github.com/uben0/tree-sitter-typst) | community | `HFIJ ` | @uben0, @RaafatTurki
[udev](https://github.com/tree-sitter-grammars/tree-sitter-udev) | core | `H  JL` | @ObserverOfTime
[ungrammar](https://github.com/tree-sitter-grammars/tree-sitter-ungrammar) | core | `HFIJL` | @Philipp-M, @amaanq
[unison](https://github.com/kylegoetz/tree-sitter-unison) | community | `H  J ` | @tapegram
[usd](https://github.com/ColinKennedy/tree-sitter-usd) | community | `HFIJL` | @ColinKennedy
[uxntal](https://github.com/tree-sitter-grammars/tree-sitter-uxntal) | core | `HFIJL` | @amaanq
[v](https://github.com/vlang/v-analyzer) | community | `HFIJL` | @kkharji, @amaanq
[vala](https://github.com/vala-lang/tree-sitter-vala) | community | `HF J ` | @Prince781
[vento](https://github.com/ventojs/tree-sitter-vento) | community | `H  J ` | @wrapperup, @oscarotero
[verilog](https://github.com/tree-sitter/tree-sitter-verilog) | core | `HF JL` | @zegervdv
[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | community | `H  J ` | @caarlos0
[vim](https://github.com/tree-sitter-grammars/tree-sitter-vim) | stable | `HF JL` | @clason
[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | stable | `H  J ` | @clason
[vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) | core | `HFIJ ` | @WhyNotHugo, @lucario387
[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | community | `HFIJ ` | @szebniok
[wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | core | `HFI  ` | @theHamsta
[wing](https://github.com/winglang/tree-sitter-wing) | community | `HF JL` | @gshpychka, @MarkMcCulloh
[wit](https://github.com/liamwh/tree-sitter-wit) | community | `H  J ` | @liamwh
[xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | core | `H  JL` | @ObserverOfTime
[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | core | `HFIJL` | @ObserverOfTime
[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | core | `HFIJL` | @amaanq
[yang](https://github.com/Hubro/tree-sitter-yang) | community | `HFIJ ` | @Hubro
[yuck](https://github.com/tree-sitter-grammars/tree-sitter-yuck) | core | `HFIJL` | @Philipp-M, @amaanq
[zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) | community | `H  J ` | @Freed-Wu
[zig](https://github.com/maxxnino/tree-sitter-zig) | community | `HFIJL` | @maxxnino
[^bp]: Android Blueprint
[^ecma]: queries required by javascript, typescript, tsx, qmljs
[^gdscript]: Godot
[^glimmer]: Glimmer and Ember

View File

@@ -4,12 +4,7 @@ This document lists the planned and finished changes in this rewrite towards [Nv
## TODO
- [ ] **`parsers.lua`:** include revision (serialization at home: `vim.inspect`)
- rename `parsers` to `languages`
- rename `install_info` to `parser`
- [ ] **`parsers.lua`:** allow specifying version in addition to commit hash (for Tier 1)
- [ ] **update-lockfile:** one commit per parser/tier?
- [ ] **tests:** fix, update, extend (cover all Tier 1 languages)
- [ ] **documentation:** consolidate, autogenerate?
- [ ] **documentation:** migration guide

View File

@@ -9,9 +9,6 @@ error('Cannot require a meta file')
---Commit hash of parser to download (compatible with queries)
---@field revision string
---
---Files to include when compiling (`src/parser.c` and optionally `src/scanner.c')
---@field files string[]
---
---Branch of parser repo to download (if not default branch)
---@field branch? string
---

View File

@@ -104,15 +104,6 @@ function M.get_available(tier)
languages
)
end
if vim.fn.executable('tree-sitter') == 0 then
languages = vim.tbl_filter(
--- @param p string
function(p)
return parsers[p].install_info ~= nil and not parsers[p].install_info.generate
end,
languages
)
end
return languages
end

View File

@@ -1,4 +1,3 @@
local install = require('nvim-treesitter.install')
local parsers = require('nvim-treesitter.parsers')
local config = require('nvim-treesitter.config')
local util = require('nvim-treesitter.util')
@@ -8,82 +7,80 @@ local health = vim.health
local M = {}
local NVIM_TREESITTER_MINIMUM_ABI = 13
local TREE_SITTER_MIN_VER = { 0, 22, 6 }
---@return string|nil
local function ts_cli_version()
if vim.fn.executable('tree-sitter') == 1 then
local result = assert(vim.system({ 'tree-sitter', '-V' }):wait().stdout)
return vim.split(result, '\n')[1]:match('[^tree%psitter ].*')
---@param name string
---@return table?
local function check_exe(name)
if vim.fn.executable(name) == 1 then
local path = vim.fn.exepath(name)
local out = vim.trim(vim.fn.system({ name, '--version' }))
local version = vim.version.parse(out)
return { path = path, version = version, out = out }
end
end
local function install_health()
health.start('Requirements')
if vim.fn.has('nvim-0.10') ~= 1 then
health.error('Nvim-treesitter requires Neovim Nightly')
do -- nvim check
if vim.fn.has('nvim-0.10') ~= 1 then
health.error('Nvim-treesitter requires the latest Neovim nightly')
end
if vim.treesitter.language_version then
if vim.treesitter.language_version >= NVIM_TREESITTER_MINIMUM_ABI then
health.ok(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. ' (required >='
.. NVIM_TREESITTER_MINIMUM_ABI
.. ').'
)
else
health.error(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. '.\n'
.. 'nvim-treesitter expects at least ABI version '
.. NVIM_TREESITTER_MINIMUM_ABI
.. '\n'
.. 'Please make sure that Neovim is linked against a recent tree-sitter library when building'
.. ' or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI.'
)
end
end
end
if vim.fn.executable('tree-sitter') == 0 then
health.warn(
'`tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar,'
.. ' not required for :TSInstall)'
)
else
health.ok(
'`tree-sitter` found '
.. (ts_cli_version() or '(unknown version)')
.. ' (only needed for `:TSInstallFromGrammar`)'
)
end
if vim.fn.executable('git') == 0 then
health.warn(
'`git` executable not found.',
'Install it with your package manager and check that your `$PATH` is set correctly.'
)
else
health.ok('`git` executable found.')
end
local cc = install.select_executable(install.compilers)
if not cc then
health.error('`cc` executable not found.', {
'Check that any of '
.. table.concat(install.compilers, ', ')
.. ' is in your $PATH'
.. ' or set `$CC` or `require"nvim-treesitter.install".compilers` explicitly.',
})
else
local version = assert(vim.system({ cc, cc == 'cl' and '' or '--version' }):wait().stdout)
health.ok(
'`'
.. cc
.. '` executable found, selected from: '
.. table.concat(install.compilers, ', ')
.. (version and ('\nVersion: ' .. version) or '')
)
end
if vim.treesitter.language_version then
if vim.treesitter.language_version >= NVIM_TREESITTER_MINIMUM_ABI then
health.ok(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. ' (required >='
.. NVIM_TREESITTER_MINIMUM_ABI
.. ').'
)
do -- treesitter check
local ts = check_exe('tree-sitter')
if ts then
if vim.version.ge(ts.version, TREE_SITTER_MIN_VER) then
health.ok(string.format('tree-sitter %s (%s)', ts.version, ts.path))
else
health.error(
string.format('tree-sitter CLI v%d.%d.%d is required', unpack(TREE_SITTER_MIN_VER))
)
end
else
health.error(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. '.\n'
.. 'nvim-treesitter expects at least ABI version '
.. NVIM_TREESITTER_MINIMUM_ABI
.. '\n'
.. 'Please make sure that Neovim is linked against a recent tree-sitter library when building'
.. ' or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI.'
)
health.error('tree-sitter CLI not found')
end
end
do -- curl+tar or git check
local curl = check_exe('curl')
local tar = check_exe('tar')
if curl and tar and vim.uv.os_uname().sysname ~= 'Windows_NT' then
health.ok(string.format('tar %s (%s)', tar.version, tar.path))
health.ok(string.format('curl %s (%s)\n%s', curl.version, curl.path, curl.out))
else
local git = check_exe('git')
if git then
health.ok(string.format('git %s (%s)', git.version, git.path))
else
health.error('Either curl and tar or git must be installed and on `$PATH`')
end
end
end

View File

@@ -23,19 +23,8 @@ local uv_symlink = a.wrap(uv.fs_symlink, 4)
--- @type fun(path: string): string?
local uv_unlink = a.wrap(uv.fs_unlink, 2)
local M = {}
local max_jobs = 10
local iswin = uv.os_uname().sysname == 'Windows_NT'
local ismac = uv.os_uname().sysname == 'Darwin'
--- @diagnostic disable-next-line:missing-parameter
M.compilers = { 'cc', 'gcc', 'clang', 'cl', 'zig' }
if uv.os_getenv('CC') then
table.insert(M.compilers, 1, uv.os_getenv('CC'))
end
local function system(cmd, opts)
log.trace('running job: (cwd=%s) %s', opts.cwd, table.concat(cmd, ' '))
local r = a.wrap(vim.system, 3)(cmd, opts) --[[@as vim.SystemCompleted]]
@@ -50,6 +39,10 @@ local function system(cmd, opts)
return r
end
local iswin = uv.os_uname().sysname == 'Windows_NT'
local M = {}
---
--- PARSER INFO
---
@@ -99,18 +92,6 @@ end
--- PARSER MANAGEMENT FUNCTIONS
---
local function istring(c)
return type(c) == 'string'
end
local function cc_err()
log.error(
'No C compiler found! "'
.. table.concat(vim.tbl_filter(istring, M.compilers), '", "')
.. '" are not executable.'
)
end
--- @param x string
--- @return boolean
local function executable(x)
@@ -122,10 +103,6 @@ end
--- @param compile_location string
--- @return string? err
local function do_generate(logger, repo, compile_location)
if not executable('tree-sitter') then
return logger:error('tree-sitter CLI not found: `tree-sitter` is not executable')
end
logger:info(
string.format(
'Generating parser.c from %s...',
@@ -134,7 +111,7 @@ local function do_generate(logger, repo, compile_location)
)
local r = system({
fn.exepath('tree-sitter'),
'tree-sitter',
'generate',
'--no-bindings',
'--abi',
@@ -232,10 +209,6 @@ end
---@param project_dir string
---@return string? err
local function do_download_git(logger, repo, project_name, cache_dir, revision, project_dir)
if not executable('git') then
return logger:error('git not found!')
end
logger:info('Downloading ' .. project_name .. '...')
local r = system({
@@ -266,86 +239,6 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision,
end
end
--- @type table<string,table<string,boolean>>
local cc_args_cache = vim.defaulttable()
--- @param cc string
--- @param arg string
--- @return boolean
local function test_cc_arg(cc, arg)
if cc_args_cache[cc][arg] == nil then
cc_args_cache[cc][arg] = system({ cc, '-xc', '-', arg }, {
stdin = 'int main(void) { return 0; }',
}).code == 0
end
return cc_args_cache[cc][arg]
end
---@param executables string[]
---@return string?
function M.select_executable(executables)
return vim.tbl_filter(executable, executables)[1]
end
-- Returns the compiler arguments based on the compiler and OS
---@param repo InstallInfo
---@param compiler string
---@return string[]
local function select_compiler_args(repo, compiler)
if compiler:find('cl$') or compiler:find('cl.exe$') then
return {
'/Fe:',
'parser.so',
'/Isrc',
repo.files,
'-Os',
'/utf-8',
'/LD',
}
end
if compiler:find('zig$') or compiler:find('zig.exe$') then
return {
'cc',
'-o',
'parser.so',
repo.files,
'-lc',
'-Isrc',
'-shared',
'-Os',
}
end
local args = {
'-o',
'parser.so',
'-I./src',
repo.files,
'-Os',
ismac and '-bundle' or '-shared',
}
--- @param arg string
local function add_cc_arg(arg)
if test_cc_arg(compiler, arg) then
args[#args + 1] = arg
end
end
if not iswin then
add_cc_arg('-Wall')
add_cc_arg('-Wextra')
add_cc_arg('-fPIC')
-- Make sure we don't compile in any unresolved symbols, otherwise nvim will
-- just exit (not even crash)
add_cc_arg('-Werror=implicit-function-declaration')
end
return args
end
---@param repo InstallInfo
---@return boolean
local function can_download_tar(repo)
@@ -355,21 +248,40 @@ local function can_download_tar(repo)
return can_use_tar and (is_github or is_gitlab) and not iswin
end
-- Returns the compile command based on the OS and user options
---@param logger Logger
---@param repo InstallInfo
---@param cc string
---@param compile_location string
---@return string? err
local function do_compile(logger, repo, cc, compile_location)
local args = vim.iter(select_compiler_args(repo, cc)):flatten():totable()
local cmd = vim.list_extend({ cc }, args)
local function do_compile(logger, compile_location)
logger:info(string.format('Compiling parser'))
logger:info('Compiling parser')
local r = system(cmd, { cwd = compile_location })
local r = system({
'tree-sitter',
'build',
'-o',
'parser.so',
}, { cwd = compile_location })
if r.code > 0 then
return logger:error('Error during compilation: %s', r.stderr)
return logger:error('Error during "tree-sitter build": %s', r.stderr)
end
end
---@param logger Logger
---@param compile_location string
---@param target_location string
---@return string? err
local function do_install(logger, compile_location, target_location)
logger:info(string.format('Installing parser'))
if iswin then -- why can't you just be normal?!
local tempfile = target_location .. tostring(uv.hrtime())
uv_rename(target_location, tempfile) -- parser may be in use: rename...
uv_unlink(tempfile) -- ...and mark for garbage collection
end
local err = uv_copyfile(compile_location, target_location)
a.main()
if err then
return logger:error('Error during parser installation: %s', err)
end
end
@@ -383,12 +295,6 @@ local function install_lang0(lang, cache_dir, install_dir, generate)
local repo = get_parser_install_info(lang)
if repo then
local cc = M.select_executable(M.compilers)
if not cc then
cc_err()
return
end
local project_name = 'tree-sitter-' .. lang
local revision = repo.revision
@@ -414,7 +320,7 @@ local function install_lang0(lang, cache_dir, install_dir, generate)
compile_location = fs.joinpath(compile_location, repo.location)
end
do
do -- generate parser from grammar
if repo.generate or generate then
local err = do_generate(logger, repo, compile_location)
if err then
@@ -423,24 +329,25 @@ local function install_lang0(lang, cache_dir, install_dir, generate)
end
end
do
local err = do_compile(logger, repo, cc, compile_location)
do -- compile parser
local err = do_compile(logger, compile_location)
if err then
return err
end
end
local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so'
do -- install parser
local parser_lib_name = fs.joinpath(compile_location, 'parser.so')
local install_location = fs.joinpath(install_dir, lang) .. '.so'
local err = do_install(logger, parser_lib_name, install_location)
if err then
return err
end
local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name)
a.main()
if err then
return logger:error(err)
local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision')
util.write_file(revfile, revision or '')
end
local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision')
util.write_file(revfile, revision or '')
if not repo.path then
util.delete(fs.joinpath(cache_dir, project_name))
end

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ local filetypes = {
latex = { 'tex' },
m68k = { 'asm68k' },
make = { 'automake' },
markdown = { 'pandoc', 'quarto', 'rmd' },
markdown = { 'pandoc' },
muttrc = { 'neomuttrc' },
ocaml_interface = { 'ocamlinterface' },
perl = { 'pl' },

View File

@@ -9,6 +9,7 @@ local lockfile = vim.json.decode(util.read_file(filename)) --[[@as table<string,
for k, p in pairs(parsers) do
if p.install_info then
p.install_info.revision = lockfile[k].revision
p.install_info.files = nil
end
end

View File

@@ -16,8 +16,8 @@ table.sort(sorted_parsers, function(a, b)
end)
local generated_text = [[
Language | Tier | Queries | CLI | Maintainer
-------- |:----:|:-------:|:---:| ----------
Language | Tier | Queries | Maintainer
-------- |:----:|:-------:| ----------
]]
local footnotes = ''
@@ -58,11 +58,6 @@ for _, v in ipairs(sorted_parsers) do
.. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/locals.scm') and 'L' or ' ')
.. '` | '
-- CLI
generated_text = generated_text
.. (p.install_info and p.install_info.generate and '' or '')
.. ' | '
-- Maintainer
generated_text = generated_text
.. (p.maintainers and table.concat(p.maintainers, ', ') or '')