feat!: refactor locals.lua into standalone

This commit is contained in:
Christian Clason 2023-05-20 17:29:03 +02:00
parent 2c8f2f2fad
commit fdafc019bb
6 changed files with 294 additions and 447 deletions

View file

@ -119,6 +119,10 @@ vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
Injections are used for multi-language documents, see `:h treesitter-language-injections`. No setup is needed.
## Locals
These queries can be used to look up definitions and references to identifiers in a given scope. They are used, e.g., by the `nvim-treesitter-refactor` plugin.
# Advanced setup
## Adding parsers

View file

@ -6,229 +6,229 @@ Legend:
- **Tier:** _core_, _stable_, _community_, or _unstable_
- **CLI:** `:TSInstall` requires `tree-sitter` CLI installed
- **NPM:** `:TSInstallFromGrammar` requires `node` installed
- **Queries** available for **H**ighlights, **I**ndents, **F**olds, In**J**ections
- **Queries** available for **H**ighlights, **I**ndents, **F**olds, In**J**ections, **L**ocals
<!--This section of the README is automatically updated by a CI job-->
<!--parserinfo-->
Language | Tier | Queries | CLI | NPM | Maintainer
-------- |:----:|:-------:|:---:|:---:| ----------
[ada](https://github.com/briot/tree-sitter-ada) | | `HF  ` | | | @briot
[agda](https://github.com/AusCyberman/tree-sitter-agda) | | `HF  ` | | | @Decodetalkers
[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJ` | | | @ObserverOfTime
[astro](https://github.com/virchau13/tree-sitter-astro) | | `HFIJ` | | | @virchau13
[awk](https://github.com/Beaglefoot/tree-sitter-awk) | | `H  J` | | |
[bash](https://github.com/tree-sitter/tree-sitter-bash) | | `HF J` | | | @TravonteD
[bass](https://github.com/amaanq/tree-sitter-bass) | | `HFIJ` | | | @amaanq
[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF  ` | | | @polarmutex
[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | community | `HFI ` | | | @theHamsta, @clason
[bicep](https://github.com/amaanq/tree-sitter-bicep) | | `HFIJ` | | | @amaanq
[bitbake](https://github.com/amaanq/tree-sitter-bitbake) | stable | `HFIJ` | | | @amaanq
[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) | unstable | `H   ` | | | @gabmus
[c](https://github.com/tree-sitter/tree-sitter-c) | core | `HFIJ` | | | @amaanq
[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | | `HF J` | | | @Luxed
[cairo](https://github.com/amaanq/tree-sitter-cairo) | stable | `HFIJ` | | | @amaanq
[capnp](https://github.com/amaanq/tree-sitter-capnp) | | `HFIJ` | | | @amaanq
[chatito](https://github.com/ObserverOfTime/tree-sitter-chatito) | | `HFIJ` | | | @ObserverOfTime
[clojure](https://github.com/sogaiu/tree-sitter-clojure) | | `HF J` | | | @sogaiu
[cmake](https://github.com/uyha/tree-sitter-cmake) | | `HFI ` | | | @uyha
[comment](https://github.com/stsewd/tree-sitter-comment) | stable | `H   ` | | | @stsewd
[commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) | | `HF  ` | | ✓ | @theHamsta
[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | | `H   ` | | | @addcninblue
[corn](https://github.com/jakestanger/tree-sitter-corn) | community | `HFI ` | | | @jakestanger
[cpon](https://github.com/amaanq/tree-sitter-cpon) | | `HFIJ` | | | @amaanq
[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | | `HFIJ` | | ✓ | @theHamsta
[css](https://github.com/tree-sitter/tree-sitter-css) | | `HFIJ` | | | @TravonteD
[csv](https://github.com/amaanq/tree-sitter-csv) | stable | `H   ` | | | @amaanq
[cuda](https://github.com/theHamsta/tree-sitter-cuda) | | `HFIJ` | | ✓ | @theHamsta
[cue](https://github.com/eonpatapon/tree-sitter-cue) | | `HFIJ` | | | @amaanq
[d](https://github.com/CyberShadow/tree-sitter-d) | unstable | `HFIJ` | ✓ | | @nawordar
[dart](https://github.com/UserNobody14/tree-sitter-dart) | | `HFIJ` | | | @akinsho
[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | | `HFIJ` | | | @jedrzejboczar
[dhall](https://github.com/jbellerb/tree-sitter-dhall) | | `HF J` | | | @amaanq
[diff](https://github.com/the-mikedavis/tree-sitter-diff) | | `H   ` | | | @gbprod
[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | | `H  J` | | | @camdencheek
[dot](https://github.com/rydesun/tree-sitter-dot) | | `H  J` | | | @rydesun
[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ` | | | @amaanq
[dtd](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HF J` | | | @ObserverOfTime
[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H   ` | | | @RubixDev
[eex](https://github.com/connorlay/tree-sitter-eex) | | `H  J` | | | @connorlay
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | | `HFIJ` | | | @connorlay
[elm](https://github.com/elm-tooling/tree-sitter-elm) | | `H  J` | | | @zweimach
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | | `HFIJ` | | | @glapa-grossklag, @amaanq
[elvish](https://github.com/elves/tree-sitter-elvish) | | `H  J` | | | @elves
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | | `H  J` | | |
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `HF  ` | | | @filmor
[fennel](https://github.com/travonted/tree-sitter-fennel) | | `HF J` | | | @TravonteD
[firrtl](https://github.com/amaanq/tree-sitter-firrtl) | | `HFIJ` | | | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | | `HFIJ` | | | @ram02z
[foam](https://github.com/FoamScience/tree-sitter-foam) | unstable | `HFIJ` | | | @FoamScience
[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | stable | `HFIJ` | | | @amaanq
[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | | `HFI ` | | | @amaanq
[fsh](https://github.com/mgramigna/tree-sitter-fsh) | | `H   ` | | | @mgramigna
[func](https://github.com/amaanq/tree-sitter-func) | | `H   ` | | | @amaanq
[fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) | | `HFI ` | | | @jirgn
[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | | `HFIJ` | | | @PrestonKnopp
[git_config](https://github.com/the-mikedavis/tree-sitter-git-config)[^git_config] | | `HF  ` | | | @amaanq
[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | | `H  J` | | | @gbprod
[gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) | | `H  J` | | | @ObserverOfTime
[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | | `H  J` | | | @gbprod
[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | | `H   ` | | | @theHamsta
[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | | `HFIJ` | | | @amaanq
[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | | `HFI ` | | | @NullVoxPopuli
[glsl](https://github.com/theHamsta/tree-sitter-glsl) | | `HFIJ` | | ✓ | @theHamsta
[go](https://github.com/tree-sitter/tree-sitter-go) | | `HFIJ` | | | @theHamsta, @WinWisely268
[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | | `HF  ` | | | @pierpo
[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J` | | | @camdencheek
[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H   ` | | | @amaanq
[gowork](https://github.com/omertuc/tree-sitter-go-work) | | `H  J` | | | @omertuc
[gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) | stable | `H  J` | | | @ObserverOfTime
[graphql](https://github.com/bkegley/tree-sitter-graphql) | | `H IJ` | | | @bkegley
[groovy](https://github.com/Decodetalkers/tree-sitter-groovy) | community | `H  J` | | | @Decodetalkers
[hack](https://github.com/slackhq/tree-sitter-hack) | | `H   ` | | |
[hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJ` | | | @amaanq
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | | `HF J` | | |
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | | `HF  ` | | | @lykahb
[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ` | | | @MichaHoffmann
[heex](https://github.com/connorlay/tree-sitter-heex) | | `HFIJ` | | | @connorlay
[hjson](https://github.com/winston0410/tree-sitter-hjson) | | `HFIJ` | | ✓ | @winston0410
[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJ` | | ✓ | @theHamsta
[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `H  J` | | ✓ | @antosha417
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF  ` | | | @urbit-pilled
[html](https://github.com/tree-sitter/tree-sitter-html) | | `HFIJ` | | | @TravonteD
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ` | | | @ObserverOfTime
[http](https://github.com/rest-nvim/tree-sitter-http) | | `H  J` | | ✓ | @amaanq
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ` | | | @pfeiferj
[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF  ` | | | @theHamsta
[ispc](https://github.com/fab4100/tree-sitter-ispc) | | `HFIJ` | | ✓ | @fab4100
[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | | `HF J` | | | @sogaiu
[java](https://github.com/tree-sitter/tree-sitter-java) | | `HFIJ` | | | @p00f
[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | | `HFIJ` | | | @steelsojka
[jq](https://github.com/flurie/tree-sitter-jq) | | `H  J` | | | @ObserverOfTime
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | | `H   ` | | | @steelsojka
[json](https://github.com/tree-sitter/tree-sitter-json) | | `HFI ` | | | @steelsojka
[json5](https://github.com/Joakker/tree-sitter-json5) | | `H  J` | | | @Joakker
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git)[^jsonc] | | `HFIJ` | | ✓ | @WhyNotHugo
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF  ` | | | @nawordar
[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJ` | | | @theHamsta
[kconfig](https://github.com/amaanq/tree-sitter-kconfig) | stable | `HFIJ` | | | @amaanq
[kdl](https://github.com/amaanq/tree-sitter-kdl) | | `HFIJ` | | | @amaanq
[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | | `HF J` | | | @SalBakraa
[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | | `H  J` | | | @traxys
[latex](https://github.com/latex-lsp/tree-sitter-latex) | community | `HF J` | | | @theHamsta, @clason
[ledger](https://github.com/cbarrete/tree-sitter-ledger) | | `HFIJ` | | | @cbarrete
[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | | `H   ` | | | @benwilliamgraham
[lua](https://github.com/MunifTanjim/tree-sitter-lua) | core | `HFIJ` | | | @muniftanjim
[luadoc](https://github.com/amaanq/tree-sitter-luadoc) | | `H   ` | | | @amaanq
[luap](https://github.com/amaanq/tree-sitter-luap)[^luap] | | `H   ` | | | @amaanq
[luau](https://github.com/amaanq/tree-sitter-luau) | | `HFIJ` | | | @amaanq
[m68k](https://github.com/grahambates/tree-sitter-m68k) | | `HF J` | | | @grahambates
[make](https://github.com/alemuller/tree-sitter-make) | | `HF J` | | | @lewis6991
[markdown](https://github.com/MDeiml/tree-sitter-markdown)[^markdown] | core | `HFIJ` | | | @MDeiml
[markdown_inline](https://github.com/MDeiml/tree-sitter-markdown)[^markdown_inline] | core | `H  J` | | | @MDeiml
[matlab](https://github.com/acristoffers/tree-sitter-matlab) | | `HFIJ` | | | @acristoffers
[menhir](https://github.com/Kerl13/tree-sitter-menhir) | | `H  J` | | | @Kerl13
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `H   ` | | |
[meson](https://github.com/Decodetalkers/tree-sitter-meson) | | `HF J` | | | @Decodetalkers
[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   ` | ✓ | | @artagnon
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I ` | | |
[ninja](https://github.com/alemuller/tree-sitter-ninja) | | `HFI ` | | | @alemuller
[nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF J` | | | @leo60228
[norg](https://github.com/nvim-neorg/tree-sitter-norg) | unstable | `    ` | | | @JoeyGrajciar, @vhyrro
[nqc](https://github.com/amaanq/tree-sitter-nqc) | stable | `HFIJ` | | | @amaanq
[objc](https://github.com/amaanq/tree-sitter-objc) | | `HFIJ` | | | @amaanq
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJ` | | | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJ` | | | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | | `H  J` | ✓ | | @undu
[odin](https://github.com/amaanq/tree-sitter-odin) | | `HFIJ` | | | @amaanq
[org](https://github.com/milisims/tree-sitter-org) | | `    ` | | |
[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | | `HFIJ` | | | @Isopod
[passwd](https://github.com/ath3/tree-sitter-passwd) | | `H   ` | | | @amaanq
[pem](https://github.com/ObserverOfTime/tree-sitter-pem) | stable | `HF J` | | | @ObserverOfTime
[perl](https://github.com/ganezdragon/tree-sitter-perl) | | `HF J` | | | @lcrownover
[php](https://github.com/tree-sitter/tree-sitter-php) | | `HFIJ` | | | @tk-shirasaka
[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unstable | `H   ` | | ✓ | @mikehaertl
[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | | `H  J` | | | @leo60228
[po](https://github.com/erasin/tree-sitter-po) | | `HF J` | | | @amaanq
[poe_filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ` | | | @ObserverOfTime
[pony](https://github.com/amaanq/tree-sitter-pony) | | `HFIJ` | | | @amaanq, @mfelsche
[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `H   ` | | | @elianiva
[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J` | | | @MichaHoffmann
[proto](https://github.com/treywood/tree-sitter-proto) | | `HF  ` | | | @treywood
[prql](https://github.com/PRQL/tree-sitter-prql) | | `H  J` | | | @matthias-Q
[psv](https://github.com/amaanq/tree-sitter-csv) | stable | `H   ` | | | @amaanq
[pug](https://github.com/zealot128/tree-sitter-pug) | unstable | `H  J` | | | @zealot128
[puppet](https://github.com/amaanq/tree-sitter-puppet) | | `HFIJ` | | | @amaanq
[pymanifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) | stable | `H  J` | | | @ObserverOfTime
[python](https://github.com/tree-sitter/tree-sitter-python) | | `HFIJ` | | | @stsewd, @theHamsta
[ql](https://github.com/tree-sitter/tree-sitter-ql) | | `HFIJ` | | | @pwntester
[qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) | | `H  J` | | | @amaanq
[qmljs](https://github.com/yuja/tree-sitter-qmljs) | | `HF  ` | | | @Decodetalkers
[query](https://github.com/nvim-treesitter/tree-sitter-query)[^query] | core | `HFIJ` | | | @steelsojka
[r](https://github.com/r-lib/tree-sitter-r) | | `H IJ` | | | @echasnovski
[racket](https://github.com/6cdh/tree-sitter-racket) | unstable | `HF J` | | |
[rasi](https://github.com/Fymyte/tree-sitter-rasi) | | `HFI ` | | | @Fymyte
[re2c](https://github.com/amaanq/tree-sitter-re2c) | stable | `HFIJ` | | | @amaanq
[regex](https://github.com/tree-sitter/tree-sitter-regex) | | `H   ` | | | @theHamsta
[rego](https://github.com/FallenAngel97/tree-sitter-rego) | | `H  J` | | | @FallenAngel97
[requirements](https://github.com/ObserverOfTime/tree-sitter-requirements) | stable | `H  J` | | | @ObserverOfTime
[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | | `HF J` | | | @bamonroe
[robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFI ` | | | @Hubro
[ron](https://github.com/amaanq/tree-sitter-ron) | | `HFIJ` | | | @amaanq
[rst](https://github.com/stsewd/tree-sitter-rst) | | `H  J` | | | @stsewd
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | | `HFIJ` | | | @TravonteD
[rust](https://github.com/tree-sitter/tree-sitter-rust) | | `HFIJ` | | | @amaanq
[scala](https://github.com/tree-sitter/tree-sitter-scala) | | `HF J` | | | @stevanmilic
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H  J` | ✓ | | @WhyNotHugo
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J` | | |
[scss](https://github.com/serenadeai/tree-sitter-scss) | | `HFI ` | | | @elianiva
[slint](https://github.com/jrmoulton/tree-sitter-slint) | unstable | `H I ` | | | @jrmoulton
[smali](https://git.sr.ht/~yotam/tree-sitter-smali) | | `HFIJ` | | | @amaanq
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H   ` | | | @amaanq, @keynmol
[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `H   ` | | | @amaanq
[sparql](https://github.com/BonaBeavis/tree-sitter-sparql) | | `HFIJ` | | | @BonaBeavis
[sql](https://github.com/derekstride/tree-sitter-sql) | | `H IJ` | | | @derekstride
[squirrel](https://github.com/amaanq/tree-sitter-squirrel) | | `HFIJ` | | | @amaanq
[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJ` | | | @amaanq
[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J` | | | @amaanq
[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJ` | | | @madskjeldgaard
[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ` | | | @connorlay
[svelte](https://github.com/Himujjal/tree-sitter-svelte) | | `HFIJ` | | | @elianiva
[swift](https://github.com/alex-pinkus/tree-sitter-swift) | | `H I ` | ✓ | | @alex-pinkus
[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | | `HF J` | | | @RaafatTurki
[systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | community | `HF J` | | | @ok-ryoko
[t32](https://gitlab.com/xasc/tree-sitter-t32.git) | community | `HFIJ` | | | @xasc
[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | | `HFIJ` | | | @amaanq
[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJ` | ✓ | | @euclidianAce
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ` | | | @MichaHoffmann
[thrift](https://github.com/duskmoon314/tree-sitter-thrift) | | `HFIJ` | | | @amaanq, @duskmoon314
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | | `HFIJ` | | | @ambroisie
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | | `HF J` | | | @ahelwer, @susliko
[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unstable | `H   ` | | | @arnarg
[toml](https://github.com/ikatyang/tree-sitter-toml) | | `HFIJ` | | ✓ | @tk-shirasaka
[tsv](https://github.com/amaanq/tree-sitter-csv) | stable | `H   ` | | | @amaanq
[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | | `HFIJ` | | ✓ | @steelsojka
[turtle](https://github.com/BonaBeavis/tree-sitter-turtle) | | `HFIJ` | | | @BonaBeavis
[twig](https://github.com/gbprod/tree-sitter-twig) | | `H  J` | | | @gbprod
[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | | `HFIJ` | | ✓ | @steelsojka
[ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) | | `HFIJ` | | | @Philipp-M, @amaanq
[unison](https://github.com/kylegoetz/tree-sitter-unison) | unstable | `H  J` | ✓ | | @tapegram
[usd](https://github.com/ColinKennedy/tree-sitter-usd) | | `HFI ` | | | @ColinKennedy
[uxntal](https://github.com/amaanq/tree-sitter-uxntal)[^uxntal] | | `HFIJ` | | | @amaanq
[v](https://github.com/v-analyzer/v-analyzer) | | `HFIJ` | | | @kkharji, @amaanq
[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF  ` | | | @Prince781
[verilog](https://github.com/tree-sitter/tree-sitter-verilog) | | `HF J` | | | @zegervdv
[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | | `H   ` | | | @caarlos0
[vim](https://github.com/neovim/tree-sitter-vim) | core | `HF J` | | | @clason
[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | core | `H  J` | | | @clason
[vue](https://github.com/ikatyang/tree-sitter-vue) | | `HFIJ` | | | @WhyNotHugo
[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | | `HFI ` | | | @szebniok
[wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) | | `HFI ` | | ✓ | @theHamsta
[wing](https://github.com/winglang/wing) | unstable | `HF  ` | ✓ | | @gshpychka
[xml](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HFIJ` | | | @ObserverOfTime
[yaml](https://github.com/ikatyang/tree-sitter-yaml) | | `HFIJ` | | | @stsewd
[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ` | | | @Hubro
[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJ` | | | @Philipp-M, @amaanq
[zig](https://github.com/maxxnino/tree-sitter-zig) | | `HFIJ` | | | @maxxnino
[ada](https://github.com/briot/tree-sitter-ada) | | `HF  L` | | | @briot
[agda](https://github.com/AusCyberman/tree-sitter-agda) | | `HF   ` | | | @Decodetalkers
[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJL` | | | @ObserverOfTime
[astro](https://github.com/virchau13/tree-sitter-astro) | | `HFIJL` | | | @virchau13
[awk](https://github.com/Beaglefoot/tree-sitter-awk) | | `H  J ` | | |
[bash](https://github.com/tree-sitter/tree-sitter-bash) | | `HF JL` | | | @TravonteD
[bass](https://github.com/amaanq/tree-sitter-bass) | | `HFIJL` | | | @amaanq
[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF   ` | | | @polarmutex
[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | community | `HFI  ` | | | @theHamsta, @clason
[bicep](https://github.com/amaanq/tree-sitter-bicep) | | `HFIJL` | | | @amaanq
[bitbake](https://github.com/amaanq/tree-sitter-bitbake) | stable | `HFIJL` | | | @amaanq
[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) | unstable | `H    ` | | | @gabmus
[c](https://github.com/tree-sitter/tree-sitter-c) | core | `HFIJL` | | | @amaanq
[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | | `HF JL` | | | @Luxed
[cairo](https://github.com/amaanq/tree-sitter-cairo) | stable | `HFIJL` | | | @amaanq
[capnp](https://github.com/amaanq/tree-sitter-capnp) | | `HFIJL` | | | @amaanq
[chatito](https://github.com/ObserverOfTime/tree-sitter-chatito) | | `HFIJL` | | | @ObserverOfTime
[clojure](https://github.com/sogaiu/tree-sitter-clojure) | | `HF JL` | | | @sogaiu
[cmake](https://github.com/uyha/tree-sitter-cmake) | | `HFI  ` | | | @uyha
[comment](https://github.com/stsewd/tree-sitter-comment) | stable | `H    ` | | | @stsewd
[commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) | | `HF  L` | | ✓ | @theHamsta
[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | | `H    ` | | | @addcninblue
[corn](https://github.com/jakestanger/tree-sitter-corn) | community | `HFI L` | | | @jakestanger
[cpon](https://github.com/amaanq/tree-sitter-cpon) | | `HFIJL` | | | @amaanq
[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | | `HFIJL` | | ✓ | @theHamsta
[css](https://github.com/tree-sitter/tree-sitter-css) | | `HFIJ ` | | | @TravonteD
[csv](https://github.com/amaanq/tree-sitter-csv) | stable | `H    ` | | | @amaanq
[cuda](https://github.com/theHamsta/tree-sitter-cuda) | | `HFIJL` | | ✓ | @theHamsta
[cue](https://github.com/eonpatapon/tree-sitter-cue) | | `HFIJL` | | | @amaanq
[d](https://github.com/CyberShadow/tree-sitter-d) | unstable | `HFIJ ` | ✓ | | @nawordar
[dart](https://github.com/UserNobody14/tree-sitter-dart) | | `HFIJL` | | | @akinsho
[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | | `HFIJL` | | | @jedrzejboczar
[dhall](https://github.com/jbellerb/tree-sitter-dhall) | | `HF J ` | | | @amaanq
[diff](https://github.com/the-mikedavis/tree-sitter-diff) | | `H    ` | | | @gbprod
[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | | `H  J ` | | | @camdencheek
[dot](https://github.com/rydesun/tree-sitter-dot) | | `H  J ` | | | @rydesun
[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ ` | | | @amaanq
[dtd](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HF J ` | | | @ObserverOfTime
[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H    ` | | | @RubixDev
[eex](https://github.com/connorlay/tree-sitter-eex) | | `H  J ` | | | @connorlay
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | | `HFIJL` | | | @connorlay
[elm](https://github.com/elm-tooling/tree-sitter-elm) | | `H  J ` | | | @zweimach
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | | `HFIJL` | | | @glapa-grossklag, @amaanq
[elvish](https://github.com/elves/tree-sitter-elvish) | | `H  J ` | | | @elves
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | | `H  J ` | | |
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `HF   ` | | | @filmor
[fennel](https://github.com/travonted/tree-sitter-fennel) | | `HF JL` | | | @TravonteD
[firrtl](https://github.com/amaanq/tree-sitter-firrtl) | | `HFIJL` | | | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | | `HFIJL` | | | @ram02z
[foam](https://github.com/FoamScience/tree-sitter-foam) | unstable | `HFIJL` | | | @FoamScience
[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | stable | `HFIJL` | | | @amaanq
[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | | `HFI  ` | | | @amaanq
[fsh](https://github.com/mgramigna/tree-sitter-fsh) | | `H    ` | | | @mgramigna
[func](https://github.com/amaanq/tree-sitter-func) | | `H    ` | | | @amaanq
[fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) | | `HFI L` | | | @jirgn
[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | | `HFIJL` | | | @PrestonKnopp
[git_config](https://github.com/the-mikedavis/tree-sitter-git-config)[^git_config] | | `HF   ` | | | @amaanq
[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | | `H  J ` | | | @gbprod
[gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) | | `H  J ` | | | @ObserverOfTime
[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | | `H  J ` | | | @gbprod
[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | | `H    ` | | | @theHamsta
[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | | `HFIJL` | | | @amaanq
[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | | `HFI L` | | | @NullVoxPopuli
[glsl](https://github.com/theHamsta/tree-sitter-glsl) | | `HFIJL` | | ✓ | @theHamsta
[go](https://github.com/tree-sitter/tree-sitter-go) | | `HFIJL` | | | @theHamsta, @WinWisely268
[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | | `HF  L` | | | @pierpo
[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J ` | | | @camdencheek
[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H    ` | | | @amaanq
[gowork](https://github.com/omertuc/tree-sitter-go-work) | | `H  J ` | | | @omertuc
[gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) | stable | `H  J ` | | | @ObserverOfTime
[graphql](https://github.com/bkegley/tree-sitter-graphql) | | `H IJ ` | | | @bkegley
[groovy](https://github.com/Decodetalkers/tree-sitter-groovy) | community | `H  J ` | | | @Decodetalkers
[hack](https://github.com/slackhq/tree-sitter-hack) | | `H    ` | | |
[hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJL` | | | @amaanq
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | | `HF J ` | | |
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | | `HF   ` | | | @lykahb
[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann
[heex](https://github.com/connorlay/tree-sitter-heex) | | `HFIJL` | | | @connorlay
[hjson](https://github.com/winston0410/tree-sitter-hjson) | | `HFIJL` | | ✓ | @winston0410
[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJL` | | ✓ | @theHamsta
[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `H  J ` | | ✓ | @antosha417
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF  L` | | | @urbit-pilled
[html](https://github.com/tree-sitter/tree-sitter-html) | | `HFIJL` | | | @TravonteD
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | | | @ObserverOfTime
[http](https://github.com/rest-nvim/tree-sitter-http) | | `H  J ` | | ✓ | @amaanq
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj
[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF   ` | | | @theHamsta
[ispc](https://github.com/fab4100/tree-sitter-ispc) | | `HFIJL` | | ✓ | @fab4100
[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | | `HF JL` | | | @sogaiu
[java](https://github.com/tree-sitter/tree-sitter-java) | | `HFIJL` | | | @p00f
[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | | `HFIJL` | | | @steelsojka
[jq](https://github.com/flurie/tree-sitter-jq) | | `H  J ` | | | @ObserverOfTime
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | | `H    ` | | | @steelsojka
[json](https://github.com/tree-sitter/tree-sitter-json) | | `HFI L` | | | @steelsojka
[json5](https://github.com/Joakker/tree-sitter-json5) | | `H  J ` | | | @Joakker
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git)[^jsonc] | | `HFIJL` | | ✓ | @WhyNotHugo
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF  L` | | | @nawordar
[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | | | @theHamsta
[kconfig](https://github.com/amaanq/tree-sitter-kconfig) | stable | `HFIJL` | | | @amaanq
[kdl](https://github.com/amaanq/tree-sitter-kdl) | | `HFIJL` | | | @amaanq
[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | | `HF JL` | | | @SalBakraa
[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | | `H  JL` | | | @traxys
[latex](https://github.com/latex-lsp/tree-sitter-latex) | community | `HF J ` | | | @theHamsta, @clason
[ledger](https://github.com/cbarrete/tree-sitter-ledger) | | `HFIJ ` | | | @cbarrete
[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | | `H    ` | | | @benwilliamgraham
[lua](https://github.com/MunifTanjim/tree-sitter-lua) | core | `HFIJL` | | | @muniftanjim
[luadoc](https://github.com/amaanq/tree-sitter-luadoc) | | `H    ` | | | @amaanq
[luap](https://github.com/amaanq/tree-sitter-luap)[^luap] | | `H    ` | | | @amaanq
[luau](https://github.com/amaanq/tree-sitter-luau) | | `HFIJL` | | | @amaanq
[m68k](https://github.com/grahambates/tree-sitter-m68k) | | `HF JL` | | | @grahambates
[make](https://github.com/alemuller/tree-sitter-make) | | `HF J ` | | | @lewis6991
[markdown](https://github.com/MDeiml/tree-sitter-markdown)[^markdown] | core | `HFIJ ` | | | @MDeiml
[markdown_inline](https://github.com/MDeiml/tree-sitter-markdown)[^markdown_inline] | core | `H  J ` | | | @MDeiml
[matlab](https://github.com/acristoffers/tree-sitter-matlab) | | `HFIJL` | | | @acristoffers
[menhir](https://github.com/Kerl13/tree-sitter-menhir) | | `H  J ` | | | @Kerl13
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `H    ` | | |
[meson](https://github.com/Decodetalkers/tree-sitter-meson) | | `HF J ` | | | @Decodetalkers
[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   L` | ✓ | | @artagnon
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I  ` | | |
[ninja](https://github.com/alemuller/tree-sitter-ninja) | | `HFI  ` | | | @alemuller
[nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF JL` | | | @leo60228
[norg](https://github.com/nvim-neorg/tree-sitter-norg) | unstable | `     ` | | | @JoeyGrajciar, @vhyrro
[nqc](https://github.com/amaanq/tree-sitter-nqc) | stable | `HFIJL` | | | @amaanq
[objc](https://github.com/amaanq/tree-sitter-objc) | | `HFIJL` | | | @amaanq
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJL` | | | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJL` | | | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | | `H  J ` | ✓ | | @undu
[odin](https://github.com/amaanq/tree-sitter-odin) | | `HFIJL` | | | @amaanq
[org](https://github.com/milisims/tree-sitter-org) | | `     ` | | |
[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | | `HFIJL` | | | @Isopod
[passwd](https://github.com/ath3/tree-sitter-passwd) | | `H    ` | | | @amaanq
[pem](https://github.com/ObserverOfTime/tree-sitter-pem) | stable | `HF J ` | | | @ObserverOfTime
[perl](https://github.com/ganezdragon/tree-sitter-perl) | | `HF J ` | | | @lcrownover
[php](https://github.com/tree-sitter/tree-sitter-php) | | `HFIJL` | | | @tk-shirasaka
[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unstable | `H    ` | | ✓ | @mikehaertl
[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | | `H  J ` | | | @leo60228
[po](https://github.com/erasin/tree-sitter-po) | | `HF J ` | | | @amaanq
[poe_filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | | | @ObserverOfTime
[pony](https://github.com/amaanq/tree-sitter-pony) | | `HFIJL` | | | @amaanq, @mfelsche
[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `H    ` | | | @elianiva
[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J ` | | | @MichaHoffmann
[proto](https://github.com/treywood/tree-sitter-proto) | | `HF   ` | | | @treywood
[prql](https://github.com/PRQL/tree-sitter-prql) | | `H  J ` | | | @matthias-Q
[psv](https://github.com/amaanq/tree-sitter-csv) | stable | `H    ` | | | @amaanq
[pug](https://github.com/zealot128/tree-sitter-pug) | unstable | `H  J ` | | | @zealot128
[puppet](https://github.com/amaanq/tree-sitter-puppet) | | `HFIJL` | | | @amaanq
[pymanifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) | stable | `H  J ` | | | @ObserverOfTime
[python](https://github.com/tree-sitter/tree-sitter-python) | | `HFIJL` | | | @stsewd, @theHamsta
[ql](https://github.com/tree-sitter/tree-sitter-ql) | | `HFIJL` | | | @pwntester
[qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) | | `H  J ` | | | @amaanq
[qmljs](https://github.com/yuja/tree-sitter-qmljs) | | `HF   ` | | | @Decodetalkers
[query](https://github.com/nvim-treesitter/tree-sitter-query)[^query] | core | `HFIJL` | | | @steelsojka
[r](https://github.com/r-lib/tree-sitter-r) | | `H IJL` | | | @echasnovski
[racket](https://github.com/6cdh/tree-sitter-racket) | unstable | `HF J ` | | |
[rasi](https://github.com/Fymyte/tree-sitter-rasi) | | `HFI L` | | | @Fymyte
[re2c](https://github.com/amaanq/tree-sitter-re2c) | stable | `HFIJL` | | | @amaanq
[regex](https://github.com/tree-sitter/tree-sitter-regex) | | `H    ` | | | @theHamsta
[rego](https://github.com/FallenAngel97/tree-sitter-rego) | | `H  J ` | | | @FallenAngel97
[requirements](https://github.com/ObserverOfTime/tree-sitter-requirements) | stable | `H  J ` | | | @ObserverOfTime
[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | | `HF J ` | | | @bamonroe
[robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFI  ` | | | @Hubro
[ron](https://github.com/amaanq/tree-sitter-ron) | | `HFIJL` | | | @amaanq
[rst](https://github.com/stsewd/tree-sitter-rst) | | `H  JL` | | | @stsewd
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | | `HFIJL` | | | @TravonteD
[rust](https://github.com/tree-sitter/tree-sitter-rust) | | `HFIJL` | | | @amaanq
[scala](https://github.com/tree-sitter/tree-sitter-scala) | | `HF JL` | | | @stevanmilic
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H  J ` | ✓ | | @WhyNotHugo
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J ` | | |
[scss](https://github.com/serenadeai/tree-sitter-scss) | | `HFI  ` | | | @elianiva
[slint](https://github.com/jrmoulton/tree-sitter-slint) | unstable | `H I  ` | | | @jrmoulton
[smali](https://git.sr.ht/~yotam/tree-sitter-smali) | | `HFIJL` | | | @amaanq
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H    ` | | | @amaanq, @keynmol
[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `H    ` | | | @amaanq
[sparql](https://github.com/BonaBeavis/tree-sitter-sparql) | | `HFIJL` | | | @BonaBeavis
[sql](https://github.com/derekstride/tree-sitter-sql) | | `H IJ ` | | | @derekstride
[squirrel](https://github.com/amaanq/tree-sitter-squirrel) | | `HFIJL` | | | @amaanq
[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJL` | | | @amaanq
[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J ` | | | @amaanq
[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJL` | | | @madskjeldgaard
[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ ` | | | @connorlay
[svelte](https://github.com/Himujjal/tree-sitter-svelte) | | `HFIJ ` | | | @elianiva
[swift](https://github.com/alex-pinkus/tree-sitter-swift) | | `H I L` | ✓ | | @alex-pinkus
[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | | `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.git) | community | `HFIJL` | | | @xasc
[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | | `HFIJL` | | | @amaanq
[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann
[thrift](https://github.com/duskmoon314/tree-sitter-thrift) | | `HFIJL` | | | @amaanq, @duskmoon314
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | | `HFIJL` | | | @ambroisie
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | | `HF JL` | | | @ahelwer, @susliko
[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unstable | `H    ` | | | @arnarg
[toml](https://github.com/ikatyang/tree-sitter-toml) | | `HFIJL` | | ✓ | @tk-shirasaka
[tsv](https://github.com/amaanq/tree-sitter-csv) | stable | `H    ` | | | @amaanq
[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | | `HFIJL` | | ✓ | @steelsojka
[turtle](https://github.com/BonaBeavis/tree-sitter-turtle) | | `HFIJL` | | | @BonaBeavis
[twig](https://github.com/gbprod/tree-sitter-twig) | | `H  J ` | | | @gbprod
[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | | `HFIJL` | | ✓ | @steelsojka
[ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) | | `HFIJL` | | | @Philipp-M, @amaanq
[unison](https://github.com/kylegoetz/tree-sitter-unison) | unstable | `H  J ` | ✓ | | @tapegram
[usd](https://github.com/ColinKennedy/tree-sitter-usd) | | `HFI L` | | | @ColinKennedy
[uxntal](https://github.com/amaanq/tree-sitter-uxntal)[^uxntal] | | `HFIJL` | | | @amaanq
[v](https://github.com/v-analyzer/v-analyzer) | | `HFIJL` | | | @kkharji, @amaanq
[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF   ` | | | @Prince781
[verilog](https://github.com/tree-sitter/tree-sitter-verilog) | | `HF JL` | | | @zegervdv
[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | | `H    ` | | | @caarlos0
[vim](https://github.com/neovim/tree-sitter-vim) | core | `HF JL` | | | @clason
[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | core | `H  J ` | | | @clason
[vue](https://github.com/ikatyang/tree-sitter-vue) | | `HFIJ ` | | | @WhyNotHugo
[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | | `HFI  ` | | | @szebniok
[wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) | | `HFI  ` | | ✓ | @theHamsta
[wing](https://github.com/winglang/wing) | unstable | `HF  L` | ✓ | | @gshpychka
[xml](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HFIJ ` | | | @ObserverOfTime
[yaml](https://github.com/ikatyang/tree-sitter-yaml) | | `HFIJL` | | | @stsewd
[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ ` | | | @Hubro
[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJL` | | | @Philipp-M, @amaanq
[zig](https://github.com/maxxnino/tree-sitter-zig) | | `HFIJL` | | | @maxxnino
[^gdscript]: Godot
[^git_config]: git_config
[^glimmer]: Glimmer and Ember

View file

@ -13,7 +13,7 @@ This document lists the planned and finished changes in this rewrite towards [Nv
- provide `install.compile_command` for overriding (function that takes files, ...?)
- allow using repo makefile (norg!)?
- ...or switch to makefile completely?
- [ ] **`locals.lua`:** refactor, move to `nvim-treesitter-refactor`
- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`?
- [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1)
- [ ] **update-lockfile:** one commit per parser/tier?
- [ ] **documentation:** consolidate, autogenerate?
@ -26,9 +26,11 @@ This document lists the planned and finished changes in this rewrite towards [Nv
- [X] remove module framework
- [X] remove extra utilities
- [X] refactor `indent.lua` into standalone
- [X] refactor `locals.lua` into standalone
- [X] refactor commands, predicates, filetypes registration to plugin/
- [X] support installing tiers of parsers
- [X] install parsers to standard directory by default
- [X] remove bundled queries from runtimepath; copy on parser install
- [X] general refactor and cleanup
- [X] switch to upstream injection format
- [X] remove locals from highlighting (cf. https://github.com/nvim-treesitter/nvim-treesitter/issues/3944#issuecomment-1458782497)

View file

@ -2,7 +2,6 @@
-- Locals are a generalization of definition and scopes
-- it's the way nvim-treesitter uses to "understand" the code
local query = require('nvim-treesitter.query')
local api = vim.api
local ts = vim.treesitter
@ -30,19 +29,6 @@ local function get_root_for_node(node)
return result
end
-- Iterates matches from a locals query file.
-- @param bufnr the buffer
-- @param root the root node
function M.iter_locals(bufnr, root)
return query.iter_group_results(bufnr, 'locals', root)
end
---@param bufnr integer
---@return any
function M.collect_locals(bufnr)
return query.collect_group_results(bufnr, 'locals')
end
-- Creates unique id for a node based on text and range
---@param scope TSNode: the scope node of the definition
---@param node_text string: the node text to use
@ -52,48 +38,6 @@ function M.get_definition_id(scope, node_text)
return table.concat({ 'k', node_text or '', scope:range() }, '_')
end
function M.get_definitions(bufnr)
local locals = M.collect_locals(bufnr)
local defs = {}
for _, loc in ipairs(locals) do
if loc.definition then
table.insert(defs, loc.definition)
end
end
return defs
end
function M.get_scopes(bufnr)
local locals = M.collect_locals(bufnr)
local scopes = {}
for _, loc in ipairs(locals) do
if loc.scope and loc.scope.node then
table.insert(scopes, loc.scope.node)
end
end
return scopes
end
function M.get_references(bufnr)
local locals = M.collect_locals(bufnr)
local refs = {}
for _, loc in ipairs(locals) do
if loc.reference and loc.reference.node then
table.insert(refs, loc.reference.node)
end
end
return refs
end
-- Gets a table with all the scopes containing a node
-- The order is from most specific to least (bottom up)
---@param node TSNode
@ -190,6 +134,59 @@ local function memoize(fn, hash_fn)
end
end
local function get_query(bufnr)
local parser = assert(ts.get_parser(bufnr))
if not parser then
return
end
local ft = vim.bo[bufnr].filetype
local lang = ts.language.get_lang(ft) or ft
local query = (ts.query.get(lang, 'locals'))
parser:parse()
local root = parser:trees():root()
return query, root
end
-- Return all locals for the buffer
--
-- memoized by buffer tick
--
---@param bufnr integer buffer
---@return table? definitions
---@return table? references
---@return table? scopes
M.get = memoize(function(bufnr)
local query, root = get_query(bufnr)
if not query then
return
end
local definitions = {}
local scopes = {}
local references = {}
for _, loc in query:iter_captures(root, bufnr) do
if loc.definition then
table.insert(definitions, loc.definition)
end
if loc.scope and loc.scope.node then
table.insert(scopes, loc.scope.node)
end
if loc.reference and loc.reference.node then
table.insert(references, loc.reference.node)
end
end
return definitions, references, scopes
end, function(bufnr)
return tostring(bufnr)
end)
-- Get a single dimension table to look definition nodes.
-- Keys are generated by using the range of the containing scope and the text of the definition node.
-- This makes looking up a definition for a given scope a simple key lookup.
@ -204,9 +201,12 @@ end
---@param bufnr integer: the buffer
---@return table result: a table for looking up definitions
M.get_definitions_lookup_table = memoize(function(bufnr)
local definitions = M.get_definitions(bufnr)
local result = {}
local definitions, _, _ = M.get(bufnr)
if not definitions then
return {}
end
local result = {}
for _, definition in ipairs(definitions) do
for _, node_entry in ipairs(M.get_local_nodes(definition)) do
local scopes = M.get_definition_scopes(node_entry.node, bufnr, node_entry.scope)
@ -297,7 +297,12 @@ function M.find_usages(node, scope_node, bufnr)
scope_node = scope_node or get_root_for_node(node)
local usages = {}
for match in M.iter_locals(bufnr, scope_node) do
local query, _ = get_query(bufnr)
if not query then
return {}
end
for match in query:iter_matches(scope_node, bufnr) do
if
match.reference
and match.reference.node
@ -322,7 +327,7 @@ function M.containing_scope(node, bufnr, allow_scope)
bufnr = bufnr or api.nvim_get_current_buf()
allow_scope = allow_scope == nil or allow_scope == true
local scopes = M.get_scopes(bufnr)
local _, _, scopes = M.get(bufnr)
if not node or not scopes then
return
end
@ -339,7 +344,7 @@ end
function M.nested_scope(node, cursor_pos)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
local _, _, scopes = M.get(bufnr)
if not node or not scopes then
return
end
@ -359,7 +364,7 @@ end
function M.next_scope(node)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
local _, _, scopes = M.get(bufnr)
if not node or not scopes then
return
end
@ -389,7 +394,7 @@ end
function M.previous_scope(node)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
local _, _, scopes = M.get(bufnr)
if not node or not scopes then
return
end

View file

@ -1,165 +0,0 @@
local M = {}
local EMPTY_ITER = function() end
---@class QueryInfo
---@field root TSNode
---@field source integer
---@field start integer
---@field stop integer
---@param bufnr integer
---@param query_name string
---@param root TSNode
---@param root_lang string|nil
---@return Query|nil, QueryInfo|nil
local function prepare_query(bufnr, query_name, root, root_lang)
local ft = vim.bo[bufnr].filetype
local buf_lang = vim.treesitter.language.get_lang(ft) or ft
if not buf_lang then
return
end
local parser = vim.treesitter.get_parser(bufnr, buf_lang)
if not parser then
return
end
if not root then
local first_tree = parser:trees()[1]
if first_tree then
root = first_tree:root()
end
end
if not root then
return
end
local range = { root:range() }
if not root_lang then
local lang_tree = parser:language_for_range(range)
if lang_tree then
root_lang = lang_tree:lang()
end
end
if not root_lang then
return
end
local query = vim.treesitter.query.get(root_lang, query_name)
if not query then
return
end
return query,
{
root = root,
source = bufnr,
start = range[1],
-- The end row is exclusive so we need to add 1 to it.
stop = range[3] + 1,
}
end
-- Given a path (i.e. a List(String)) this functions inserts value at path
---@param object any
---@param path string[]
---@param value any
function M.insert_to_path(object, path, value)
local curr_obj = object
for index = 1, (#path - 1) do
if curr_obj[path[index]] == nil then
curr_obj[path[index]] = {}
end
curr_obj = curr_obj[path[index]]
end
curr_obj[path[#path]] = value
end
---@param query Query
---@param bufnr integer
---@param start_row integer
---@param end_row integer
function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
-- A function that splits a string on '.'
---@param to_split string
---@return string[]
local function split(to_split)
local t = {}
for str in string.gmatch(to_split, '([^.]+)') do
table.insert(t, str)
end
return t
end
local matches = query:iter_matches(qnode, bufnr, start_row, end_row)
local function iterator()
local pattern, match, metadata = matches()
if pattern ~= nil then
local prepared_match = {}
-- Extract capture names from each match
for id, node in pairs(match) do
local name = query.captures[id] -- name of the capture in the query
if name ~= nil then
local path = split(name .. '.node')
M.insert_to_path(prepared_match, path, node)
local metadata_path = split(name .. '.metadata')
M.insert_to_path(prepared_match, metadata_path, metadata[id])
end
end
-- Add some predicates for testing
---@type string[][] ( TODO: make pred type so this can be pred[])
local preds = query.info.patterns[pattern]
if preds then
for _, pred in pairs(preds) do
-- functions
if pred[1] == 'set!' and type(pred[2]) == 'string' then
M.insert_to_path(prepared_match, split(pred[2]), pred[3])
end
end
end
return prepared_match
end
end
return iterator
end
---Iterates matches from a query file.
---@param bufnr integer the buffer
---@param query_group string the query file to use
---@param root TSNode the root node
---@param root_lang? string the root node lang, if known
function M.iter_group_results(bufnr, query_group, root, root_lang)
local query, params = prepare_query(bufnr, query_group, root, root_lang)
if not query then
return EMPTY_ITER
end
assert(params)
return M.iter_prepared_matches(query, params.root, params.source, params.start, params.stop)
end
function M.collect_group_results(bufnr, query_group, root, lang)
local matches = {}
for prepared_match in M.iter_group_results(bufnr, query_group, root, lang) do
table.insert(matches, prepared_match)
end
return matches
end
return M

View file

@ -47,6 +47,7 @@ for _, v in ipairs(sorted_parsers) do
.. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/folds.scm') and 'F' or ' ')
.. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/indents.scm') and 'I' or ' ')
.. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/injections.scm') and 'J' or ' ')
.. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/locals.scm') and 'L' or ' ')
.. '` | '
-- CLI