From b171f948da98d157f7143776e691e92e83b777d2 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 21 Jan 2024 12:57:34 +0200 Subject: [PATCH 001/434] feat(yuck): add missing injections And builtin variable highlights --- queries/bass/injections.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/queries/bass/injections.scm b/queries/bass/injections.scm index 2f0e58eb6..298a8d070 100644 --- a/queries/bass/injections.scm +++ b/queries/bass/injections.scm @@ -1,2 +1,26 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((function_call + name: (ident) @_name + . + (simplexpr) + . + (simplexpr + (string + (string_fragment) @injection.content)+)) + (#any-of? @_name "replace" "search" "matches" "captures") + (#set! injection.language "regex") + (#set! injection.combined)) + +((function_call + name: (ident) @_name + . + (simplexpr) + . + (simplexpr + (string + (string_fragment) @injection.content)+)) + (#eq? @_name "jq") + (#set! injection.language "jq") + (#set! injection.combined)) From 628d5e442c7c572f4d83bb551154a102eaeeafb3 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Wed, 28 Jun 2023 16:34:13 +0200 Subject: [PATCH 002/434] injections(nix): add nixosTest.testScript + home-manager nvim config (+ add Check to mkDerivation bash matches) (+ add Check to mkDerivation bash matches) --- queries/nix/injections.scm | 29 ++++++++ .../injections/nix/test-nix-injections.nix | 70 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 tests/query/injections/nix/test-nix-injections.nix diff --git a/queries/nix/injections.scm b/queries/nix/injections.scm index d5e8483f4..26ba6e2da 100644 --- a/queries/nix/injections.scm +++ b/queries/nix/injections.scm @@ -188,3 +188,32 @@ ]) (#match? @_func "(^|\\.)writeRust(Bin)?$") (#set! injection.combined)) + +; (nixosTest) testScript +((binding + attrpath: (attrpath) @_attr_name + (#eq? @_attr_name "nodes")) + (binding + attrpath: (attrpath) @_func_name + (#eq? @_func_name "testScript") + (_ + (string_fragment) @injection.content + (#set! injection.language "python"))) + (#set! injection.combined)) + +; home-manager Neovim plugin config +(attrset_expression + (binding_set + (binding + attrpath: (attrpath) @_ty_attr + (_ + (string_fragment) @_ty) + (#eq? @_ty_attr "type") + (#eq? @_ty "lua")) + (binding + attrpath: (attrpath) @_cfg_attr + (_ + (string_fragment) @injection.content + (#set! injection.language "lua")) + (#eq? @_cfg_attr "config"))) + (#set! injection.combined)) diff --git a/tests/query/injections/nix/test-nix-injections.nix b/tests/query/injections/nix/test-nix-injections.nix new file mode 100644 index 000000000..86e9f975d --- /dev/null +++ b/tests/query/injections/nix/test-nix-injections.nix @@ -0,0 +1,70 @@ +{ pkgs, stdenv }: +# NOTE: This file is for testing queries. If evaluated with nix, this will probably error. +{ + regex = builtins.match "^.*[{](.+)[}].*$" "blahblah {something} blahblah" [ "something" ]; + + drv1 = stdenv.mkDerivation { + buildPhase = "mkdir $out"; + installPhase = '' + echo "bar" > $out/foo.txt + ''; + }; + + drv2 = pkgs.writeShellApplication { + name = "shellApp"; + buildInputs = []; + text = '' + echo "Hello world!" + ''; + }; + + drv3 = pkgs.runCommand "foo-bar" {} '' + mkir $out + echo "bar" > $out/foo.txt + ''; + + drv4 = pkgs.writeShellScriptBin "hello" '' + echo "Hello world!" + ''; + + drv5 = pkgs.writeFishBin "hello" '' + echo "Hello world!" + ''; + + drv6 = pkgs.writeHaskellBin "hello" '' + main :: IO () + main = putStrLn "Hello world!" + ''; + + drv7 = pkgs.writeJSBin "hello" '' + console.log('Hello world!'); + ''; + + drv8 = pkgs.writePerlBin "hello" '' + print("Hello world!\n"); + ''; + + drv9 = pkgs.writePythonBin "hello" '' + print("Hello world!"); + ''; + + drv10 = pkgs.writeRustBin "hello" '' + fn main() { + println!("Hello world!"); + } + ''; + + drv11 = { + nodes = null; + testScript = '' + print("Hello world!"); + ''; + }; + + mod1 = { + type = "lua"; + config = '' + require('nvim-treesitter.configs').setup() + ''; + }; +} From 310f0925ec64c7e54f3ee952679d285b13e5a735 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sat, 19 Aug 2023 19:48:32 +0300 Subject: [PATCH 003/434] feat(c-family): inherit injections --- queries/arduino/injections.scm | 6 +----- queries/c/injections.scm | 2 +- queries/cpp/injections.scm | 4 +--- queries/cuda/injections.scm | 6 +----- queries/glsl/injections.scm | 6 +----- queries/hlsl/injections.scm | 6 +----- queries/rust/indents.scm | 15 +++++++++++++++ 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/queries/arduino/injections.scm b/queries/arduino/injections.scm index b637d9b2b..b617fdc56 100644 --- a/queries/arduino/injections.scm +++ b/queries/arduino/injections.scm @@ -1,5 +1 @@ -((preproc_arg) @injection.content - (#set! injection.language "arduino")) - -((comment) @injection.content - (#set! injection.language "comment")) +; inherits: cpp diff --git a/queries/c/injections.scm b/queries/c/injections.scm index 77b4d7a86..24634864e 100644 --- a/queries/c/injections.scm +++ b/queries/c/injections.scm @@ -1,5 +1,5 @@ ((preproc_arg) @injection.content - (#set! injection.language "c")) + (#set! injection.self)) ((comment) @injection.content (#set! injection.language "comment")) diff --git a/queries/cpp/injections.scm b/queries/cpp/injections.scm index 6e1657229..07f21dd14 100644 --- a/queries/cpp/injections.scm +++ b/queries/cpp/injections.scm @@ -1,6 +1,4 @@ -((preproc_arg) @injection.content - (#set! injection.language "cpp")) - +; inherits: c ((comment) @injection.content (#set! injection.language "comment")) diff --git a/queries/cuda/injections.scm b/queries/cuda/injections.scm index 0259958c5..b617fdc56 100644 --- a/queries/cuda/injections.scm +++ b/queries/cuda/injections.scm @@ -1,5 +1 @@ -((preproc_arg) @injection.content - (#set! injection.language "cuda")) - -((comment) @injection.content - (#set! injection.language "comment")) +; inherits: cpp diff --git a/queries/glsl/injections.scm b/queries/glsl/injections.scm index 90ca7b5d4..a5a5208ca 100644 --- a/queries/glsl/injections.scm +++ b/queries/glsl/injections.scm @@ -1,5 +1 @@ -((preproc_arg) @injection.content - (#set! injection.language "glsl")) - -((comment) @injection.content - (#set! injection.language "comment")) +; inherits: c diff --git a/queries/hlsl/injections.scm b/queries/hlsl/injections.scm index c2fca7121..b617fdc56 100644 --- a/queries/hlsl/injections.scm +++ b/queries/hlsl/injections.scm @@ -1,5 +1 @@ -((preproc_arg) @injection.content - (#set! injection.language "hlsl")) - -((comment) @injection.content - (#set! injection.language "comment")) +; inherits: cpp diff --git a/queries/rust/indents.scm b/queries/rust/indents.scm index dfe0a3805..9fe337d5c 100644 --- a/queries/rust/indents.scm +++ b/queries/rust/indents.scm @@ -26,6 +26,12 @@ (macro_definition) ] @indent.begin +(trait_item + body: (_) @indent.begin) + +(string_literal + (escape_sequence)) @indent.begin + ; Typing in "(" inside macro definitions breaks the tree entirely ; Making macro_definition becoming errors ; Offset this by adding back one indent for start of macro rules @@ -85,6 +91,15 @@ (tuple_struct_pattern ")" @indent.end) +; Typing in "(" inside macro definitions breaks the tree entirely +; Making macro_definition becoming errors +; Offset this by adding back one indent for start of macro rules +(ERROR + . + "macro_rules!" + "(" @indent.begin + (#set! indent.immediate) + (#set! indent.start_at_same_line)) (tuple_type ")" @indent.end) From 692b051b09935653befdb8f7ba8afdb640adf17b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 12 Jun 2023 09:54:30 -0600 Subject: [PATCH 004/434] feat!: drop modules, general refactor and cleanup --- .github/workflows/lint.yml | 4 +- .github/workflows/test-queries.yml | 2 +- .stylua.toml | 6 +- CONTRIBUTING.md | 27 +- Makefile | 7 - README.md | 754 +-- SUPPORTED_LANGUAGES.md | 305 + TODO.md | 34 + assets/logo.png | Bin 26664 -> 0 bytes autoload/nvim_treesitter.vim | 27 - doc/nvim-treesitter.txt | 492 +- lua/nvim-treesitter.lua | 22 - lua/nvim-treesitter/caching.lua | 71 - lua/nvim-treesitter/compat.lua | 39 - lua/nvim-treesitter/config.lua | 144 + lua/nvim-treesitter/configs.lua | 616 -- lua/nvim-treesitter/fold.lua | 123 - lua/nvim-treesitter/health.lua | 201 +- lua/nvim-treesitter/highlight.lua | 49 - lua/nvim-treesitter/incremental_selection.lua | 176 - lua/nvim-treesitter/indent.lua | 121 +- lua/nvim-treesitter/info.lua | 190 - lua/nvim-treesitter/init.lua | 11 + lua/nvim-treesitter/install.lua | 902 ++- lua/nvim-treesitter/locals.lua | 125 +- lua/nvim-treesitter/parsers.lua | 5398 ++++++++--------- lua/nvim-treesitter/query.lua | 304 +- lua/nvim-treesitter/query_predicates.lua | 167 - lua/nvim-treesitter/shell_cmds.lua | 255 + .../shell_command_selectors.lua | 368 -- lua/nvim-treesitter/statusline.lua | 53 - lua/nvim-treesitter/ts_utils.lua | 482 -- lua/nvim-treesitter/tsrange.lua | 154 - lua/nvim-treesitter/utils.lua | 235 +- parser-info/.gitignore | 2 - parser/.gitignore | 2 - plugin/filetypes.lua | 66 + plugin/nvim-treesitter.lua | 102 +- plugin/query_predicates.lua | 141 + {queries => runtime/queries}/ada/folds.scm | 0 .../queries}/ada/highlights.scm | 0 .../queries/ada}/injections.scm | 0 {queries => runtime/queries}/ada/locals.scm | 0 {queries => runtime/queries}/agda/folds.scm | 0 .../queries}/agda/highlights.scm | 0 .../queries/agda}/injections.scm | 0 .../queries}/angular/folds.scm | 0 .../queries}/angular/highlights.scm | 0 .../queries}/angular/indents.scm | 0 .../queries}/angular/injections.scm | 0 .../queries}/angular/locals.scm | 0 {queries => runtime/queries}/apex/folds.scm | 0 .../queries}/apex/highlights.scm | 0 .../queries}/apex/injections.scm | 0 {queries => runtime/queries}/apex/locals.scm | 0 .../queries}/arduino/folds.scm | 0 .../queries}/arduino/highlights.scm | 0 .../queries}/arduino/indents.scm | 0 .../queries}/arduino/injections.scm | 0 .../queries}/arduino/locals.scm | 0 .../queries}/asm/highlights.scm | 0 .../queries}/asm/injections.scm | 0 {queries => runtime/queries}/astro/folds.scm | 0 .../queries}/astro/highlights.scm | 0 .../queries}/astro/indents.scm | 0 .../queries}/astro/injections.scm | 0 {queries => runtime/queries}/astro/locals.scm | 0 .../queries}/authzed/highlights.scm | 0 .../queries/authzed}/injections.scm | 0 .../queries}/awk/highlights.scm | 0 .../queries}/awk/injections.scm | 0 {queries => runtime/queries}/bash/folds.scm | 0 .../queries}/bash/highlights.scm | 0 .../queries}/bash/injections.scm | 0 {queries => runtime/queries}/bash/locals.scm | 0 {queries => runtime/queries}/bass/folds.scm | 0 .../queries}/bass/highlights.scm | 0 {queries => runtime/queries}/bass/indents.scm | 0 .../queries/bass}/injections.scm | 0 {queries => runtime/queries}/bass/locals.scm | 0 .../queries}/beancount/folds.scm | 0 .../queries}/beancount/highlights.scm | 0 .../queries/beancount}/injections.scm | 0 {queries => runtime/queries}/bibtex/folds.scm | 0 .../queries}/bibtex/highlights.scm | 0 .../queries}/bibtex/indents.scm | 0 .../queries}/bibtex/injections.scm | 0 {queries => runtime/queries}/bicep/folds.scm | 0 .../queries}/bicep/highlights.scm | 0 .../queries}/bicep/indents.scm | 0 .../queries}/bicep/injections.scm | 0 {queries => runtime/queries}/bicep/locals.scm | 0 .../queries}/bitbake/folds.scm | 0 .../queries}/bitbake/highlights.scm | 0 .../queries}/bitbake/indents.scm | 0 .../queries}/bitbake/injections.scm | 0 .../queries}/bitbake/locals.scm | 0 {queries => runtime/queries}/blade/folds.scm | 0 .../queries}/blade/highlights.scm | 0 .../queries}/blade/indents.scm | 0 .../queries}/blade/injections.scm | 0 .../queries}/blueprint/highlights.scm | 0 .../queries/blueprint}/injections.scm | 0 {queries => runtime/queries}/bp/folds.scm | 0 .../queries}/bp/highlights.scm | 0 {queries => runtime/queries}/bp/indents.scm | 0 .../queries/bp}/injections.scm | 0 {queries => runtime/queries}/bp/locals.scm | 0 .../queries}/brightscript/folds.scm | 0 .../queries}/brightscript/highlights.scm | 0 .../queries}/brightscript/indents.scm | 0 .../queries/brightscript}/injections.scm | 0 {queries => runtime/queries}/c/folds.scm | 0 {queries => runtime/queries}/c/highlights.scm | 0 {queries => runtime/queries}/c/indents.scm | 0 {queries => runtime/queries}/c/injections.scm | 0 {queries => runtime/queries}/c/locals.scm | 0 .../queries}/c_sharp/folds.scm | 0 .../queries}/c_sharp/highlights.scm | 0 .../queries/c_sharp}/injections.scm | 0 .../queries}/c_sharp/locals.scm | 0 {queries => runtime/queries}/caddy/folds.scm | 0 .../queries}/caddy/highlights.scm | 0 .../queries}/caddy/indents.scm | 0 .../queries/caddy}/injections.scm | 0 {queries => runtime/queries}/cairo/folds.scm | 0 .../queries}/cairo/highlights.scm | 0 .../queries}/cairo/indents.scm | 0 .../queries}/cairo/injections.scm | 0 {queries => runtime/queries}/cairo/locals.scm | 0 {queries => runtime/queries}/capnp/folds.scm | 0 .../queries}/capnp/highlights.scm | 0 .../queries}/capnp/indents.scm | 0 .../queries/capnp}/injections.scm | 0 {queries => runtime/queries}/capnp/locals.scm | 0 .../queries}/chatito/folds.scm | 0 .../queries}/chatito/highlights.scm | 0 .../queries}/chatito/indents.scm | 0 .../queries/chatito}/injections.scm | 0 .../queries}/chatito/locals.scm | 0 {queries => runtime/queries}/circom/folds.scm | 0 .../queries}/circom/highlights.scm | 0 .../queries/circom}/injections.scm | 0 .../queries}/circom/locals.scm | 0 .../queries}/clojure/folds.scm | 0 .../queries}/clojure/highlights.scm | 0 .../queries/clojure}/injections.scm | 0 .../queries}/clojure/locals.scm | 0 {queries => runtime/queries}/cmake/folds.scm | 0 .../queries}/cmake/highlights.scm | 0 .../queries}/cmake/indents.scm | 0 .../queries}/cmake/injections.scm | 0 .../queries}/comment/highlights.scm | 0 .../queries}/commonlisp/folds.scm | 0 .../queries}/commonlisp/highlights.scm | 0 .../queries}/commonlisp/injections.scm | 0 .../queries}/commonlisp/locals.scm | 0 .../queries}/cooklang/highlights.scm | 0 .../queries/cooklang}/injections.scm | 0 {queries => runtime/queries}/corn/folds.scm | 0 .../queries}/corn/highlights.scm | 0 {queries => runtime/queries}/corn/indents.scm | 0 .../queries/corn}/injections.scm | 0 {queries => runtime/queries}/corn/locals.scm | 0 {queries => runtime/queries}/cpon/folds.scm | 0 .../queries}/cpon/highlights.scm | 0 {queries => runtime/queries}/cpon/indents.scm | 0 .../queries/cpon}/injections.scm | 0 {queries => runtime/queries}/cpon/locals.scm | 0 {queries => runtime/queries}/cpp/folds.scm | 0 .../queries}/cpp/highlights.scm | 0 {queries => runtime/queries}/cpp/indents.scm | 0 .../queries}/cpp/injections.scm | 2 - {queries => runtime/queries}/cpp/locals.scm | 0 {queries => runtime/queries}/css/folds.scm | 0 .../queries}/css/highlights.scm | 0 {queries => runtime/queries}/css/indents.scm | 0 .../queries/css}/injections.scm | 0 .../queries}/csv/highlights.scm | 0 {queries => runtime/queries}/cuda/folds.scm | 0 .../queries}/cuda/highlights.scm | 0 {queries => runtime/queries}/cuda/indents.scm | 0 .../queries}/cuda/injections.scm | 0 {queries => runtime/queries}/cuda/locals.scm | 0 {queries => runtime/queries}/cue/folds.scm | 0 .../queries}/cue/highlights.scm | 0 {queries => runtime/queries}/cue/indents.scm | 0 .../queries/cue}/injections.scm | 0 {queries => runtime/queries}/cue/locals.scm | 0 {queries => runtime/queries}/cylc/folds.scm | 0 .../queries}/cylc/highlights.scm | 0 {queries => runtime/queries}/cylc/indents.scm | 0 .../queries}/cylc/injections.scm | 0 {queries => runtime/queries}/d/folds.scm | 0 {queries => runtime/queries}/d/highlights.scm | 0 {queries => runtime/queries}/d/indents.scm | 0 {queries => runtime/queries}/d/injections.scm | 0 {queries => runtime/queries}/d/locals.scm | 0 {queries => runtime/queries}/dart/folds.scm | 0 .../queries}/dart/highlights.scm | 0 {queries => runtime/queries}/dart/indents.scm | 0 .../queries/dart}/injections.scm | 0 {queries => runtime/queries}/dart/locals.scm | 0 .../queries}/desktop/folds.scm | 0 .../queries}/desktop/highlights.scm | 0 .../queries}/desktop/injections.scm | 0 .../queries}/devicetree/folds.scm | 0 .../queries}/devicetree/highlights.scm | 0 .../queries}/devicetree/indents.scm | 0 .../queries/devicetree}/injections.scm | 0 .../queries}/devicetree/locals.scm | 0 {queries => runtime/queries}/dhall/folds.scm | 0 .../queries}/dhall/highlights.scm | 0 .../queries}/dhall/injections.scm | 0 {queries => runtime/queries}/diff/folds.scm | 0 .../queries}/diff/highlights.scm | 0 .../queries/diff}/injections.scm | 0 .../queries}/disassembly/highlights.scm | 0 .../queries}/disassembly/injections.scm | 0 {queries => runtime/queries}/djot/folds.scm | 0 .../queries}/djot/highlights.scm | 0 {queries => runtime/queries}/djot/indents.scm | 0 .../queries}/djot/injections.scm | 0 {queries => runtime/queries}/djot/locals.scm | 0 .../queries}/dockerfile/highlights.scm | 0 .../queries}/dockerfile/injections.scm | 0 .../queries}/dot/highlights.scm | 0 {queries => runtime/queries}/dot/indents.scm | 0 .../queries}/dot/injections.scm | 0 .../queries}/doxygen/highlights.scm | 0 .../queries}/doxygen/indents.scm | 0 .../queries}/doxygen/injections.scm | 0 {queries => runtime/queries}/dtd/folds.scm | 0 .../queries}/dtd/highlights.scm | 0 .../queries}/dtd/injections.scm | 0 {queries => runtime/queries}/dtd/locals.scm | 0 .../queries}/earthfile/highlights.scm | 0 .../queries}/earthfile/injections.scm | 0 .../queries}/ebnf/highlights.scm | 0 .../queries/ebnf}/injections.scm | 0 {queries => runtime/queries}/ecma/folds.scm | 0 .../queries}/ecma/highlights.scm | 0 {queries => runtime/queries}/ecma/indents.scm | 0 .../queries}/ecma/injections.scm | 0 {queries => runtime/queries}/ecma/locals.scm | 0 .../queries}/editorconfig/folds.scm | 0 .../queries}/editorconfig/highlights.scm | 0 .../queries/editorconfig}/injections.scm | 0 {queries => runtime/queries}/eds/folds.scm | 0 .../queries}/eds/highlights.scm | 0 .../queries}/eex/highlights.scm | 0 .../queries}/eex/injections.scm | 0 {queries => runtime/queries}/elixir/folds.scm | 0 .../queries}/elixir/highlights.scm | 0 .../queries}/elixir/indents.scm | 0 .../queries}/elixir/injections.scm | 0 .../queries}/elixir/locals.scm | 0 {queries => runtime/queries}/elm/folds.scm | 0 .../queries}/elm/highlights.scm | 0 .../queries}/elm/injections.scm | 0 {queries => runtime/queries}/elsa/folds.scm | 0 .../queries}/elsa/highlights.scm | 0 {queries => runtime/queries}/elsa/indents.scm | 0 .../queries/elsa}/injections.scm | 0 {queries => runtime/queries}/elsa/locals.scm | 0 .../queries}/elvish/highlights.scm | 0 .../queries/elvish}/injections.scm | 0 .../queries}/embedded_template/highlights.scm | 0 .../queries}/embedded_template/injections.scm | 0 .../queries}/enforce/folds.scm | 0 .../queries}/enforce/highlights.scm | 0 .../queries}/enforce/indents.scm | 0 .../queries}/enforce/injections.scm | 0 .../queries}/enforce/locals.scm | 0 {queries => runtime/queries}/erlang/folds.scm | 0 .../queries}/erlang/highlights.scm | 0 .../queries/erlang}/injections.scm | 0 .../queries}/facility/folds.scm | 0 .../queries}/facility/highlights.scm | 0 .../queries}/facility/indents.scm | 0 .../queries}/facility/injections.scm | 0 .../queries}/faust/highlights.scm | 0 .../queries/faust}/injections.scm | 0 {queries => runtime/queries}/fennel/folds.scm | 0 .../queries}/fennel/highlights.scm | 0 .../queries}/fennel/injections.scm | 0 .../queries}/fennel/locals.scm | 0 {queries => runtime/queries}/fidl/folds.scm | 0 .../queries}/fidl/highlights.scm | 0 .../queries/fidl}/injections.scm | 0 {queries => runtime/queries}/firrtl/folds.scm | 0 .../queries}/firrtl/highlights.scm | 0 .../queries}/firrtl/indents.scm | 0 .../queries/firrtl}/injections.scm | 0 .../queries}/firrtl/locals.scm | 0 {queries => runtime/queries}/fish/folds.scm | 0 .../queries}/fish/highlights.scm | 0 {queries => runtime/queries}/fish/indents.scm | 0 .../queries/fish}/injections.scm | 0 {queries => runtime/queries}/fish/locals.scm | 0 {queries => runtime/queries}/foam/folds.scm | 0 .../queries}/foam/highlights.scm | 0 {queries => runtime/queries}/foam/indents.scm | 0 .../queries}/foam/injections.scm | 0 {queries => runtime/queries}/foam/locals.scm | 0 {queries => runtime/queries}/forth/folds.scm | 0 .../queries}/forth/highlights.scm | 0 .../queries}/forth/indents.scm | 0 .../queries/forth}/injections.scm | 0 {queries => runtime/queries}/forth/locals.scm | 0 .../queries}/fortran/folds.scm | 0 .../queries}/fortran/highlights.scm | 0 .../queries}/fortran/indents.scm | 0 .../queries/fortran}/injections.scm | 0 .../queries}/fsh/highlights.scm | 0 .../queries}/fsh/injections.scm | 0 .../queries}/fsharp/highlights.scm | 0 .../queries}/fsharp/injections.scm | 0 .../queries}/func/highlights.scm | 0 .../queries/func}/injections.scm | 0 {queries => runtime/queries}/fusion/folds.scm | 0 .../queries}/fusion/highlights.scm | 0 .../queries}/fusion/indents.scm | 0 .../queries}/fusion/injections.scm | 0 .../queries}/fusion/locals.scm | 0 {queries => runtime/queries}/gap/folds.scm | 0 .../queries}/gap/highlights.scm | 0 .../queries/gap}/injections.scm | 0 {queries => runtime/queries}/gap/locals.scm | 0 {queries => runtime/queries}/gaptst/folds.scm | 0 .../queries}/gaptst/highlights.scm | 0 .../queries}/gaptst/injections.scm | 0 .../queries}/gdscript/folds.scm | 0 .../queries}/gdscript/highlights.scm | 0 .../queries}/gdscript/indents.scm | 0 .../queries/gdscript}/injections.scm | 0 .../queries}/gdscript/locals.scm | 0 .../queries}/gdshader/highlights.scm | 0 .../queries/gdshader}/injections.scm | 0 .../queries}/git_config/folds.scm | 0 .../queries}/git_config/highlights.scm | 0 .../queries}/git_config/injections.scm | 0 .../queries}/git_rebase/highlights.scm | 0 .../queries}/git_rebase/injections.scm | 0 .../queries}/gitattributes/highlights.scm | 0 .../queries/gitattributes}/injections.scm | 0 .../queries}/gitattributes/locals.scm | 0 .../queries}/gitcommit/highlights.scm | 0 .../queries}/gitcommit/injections.scm | 0 .../queries}/gitignore/highlights.scm | 0 .../queries/gitignore}/injections.scm | 0 {queries => runtime/queries}/gleam/folds.scm | 0 .../queries}/gleam/highlights.scm | 0 .../queries}/gleam/indents.scm | 0 .../queries}/gleam/injections.scm | 0 {queries => runtime/queries}/gleam/locals.scm | 0 .../queries}/glimmer/folds.scm | 0 .../queries}/glimmer/highlights.scm | 0 .../queries}/glimmer/indents.scm | 0 .../queries}/glimmer/injections.scm | 0 .../queries}/glimmer/locals.scm | 0 .../glimmer_javascript/highlights.scm | 0 .../queries}/glimmer_javascript/indents.scm | 0 .../glimmer_javascript/injections.scm | 0 .../queries}/glimmer_javascript/locals.scm | 0 .../glimmer_typescript/highlights.scm | 0 .../queries}/glimmer_typescript/indents.scm | 0 .../glimmer_typescript/injections.scm | 0 {queries => runtime/queries}/glsl/folds.scm | 0 .../queries}/glsl/highlights.scm | 0 {queries => runtime/queries}/glsl/indents.scm | 0 .../queries}/glsl/injections.scm | 0 {queries => runtime/queries}/glsl/locals.scm | 0 {queries => runtime/queries}/gn/folds.scm | 0 .../queries}/gn/highlights.scm | 0 {queries => runtime/queries}/gn/indents.scm | 0 .../queries/gn}/injections.scm | 0 {queries => runtime/queries}/gn/locals.scm | 0 .../queries}/gnuplot/highlights.scm | 0 .../queries/gnuplot}/injections.scm | 0 {queries => runtime/queries}/go/folds.scm | 0 .../queries}/go/highlights.scm | 0 {queries => runtime/queries}/go/indents.scm | 0 .../queries}/go/injections.scm | 0 {queries => runtime/queries}/go/locals.scm | 0 {queries => runtime/queries}/goctl/folds.scm | 0 .../queries}/goctl/highlights.scm | 0 .../queries}/goctl/indents.scm | 0 .../queries}/goctl/injections.scm | 0 .../queries}/godot_resource/folds.scm | 0 .../queries}/godot_resource/highlights.scm | 0 .../queries/godot_resource}/injections.scm | 0 .../queries}/godot_resource/locals.scm | 0 .../queries}/gomod/highlights.scm | 0 .../queries/gomod}/injections.scm | 0 .../queries}/gosum/highlights.scm | 0 {queries => runtime/queries}/gotmpl/folds.scm | 0 .../queries}/gotmpl/highlights.scm | 0 .../queries}/gotmpl/injections.scm | 0 .../queries}/gotmpl/locals.scm | 0 .../queries}/gowork/highlights.scm | 0 .../queries/gowork}/injections.scm | 0 .../queries}/gpg/highlights.scm | 0 .../queries/gpg}/injections.scm | 0 .../queries}/graphql/highlights.scm | 0 .../queries}/graphql/indents.scm | 0 .../queries/graphql}/injections.scm | 0 .../queries}/gren/highlights.scm | 0 .../queries}/gren/injections.scm | 0 {queries => runtime/queries}/groovy/folds.scm | 0 .../queries}/groovy/highlights.scm | 0 .../queries}/groovy/indents.scm | 0 .../queries}/groovy/injections.scm | 0 .../queries}/groovy/locals.scm | 0 .../queries}/gstlaunch/highlights.scm | 0 .../queries}/hack/highlights.scm | 0 .../queries}/hack/injections.scm | 0 {queries => runtime/queries}/hare/folds.scm | 0 .../queries}/hare/highlights.scm | 0 {queries => runtime/queries}/hare/indents.scm | 0 .../queries}/hare/injections.scm | 0 {queries => runtime/queries}/hare/locals.scm | 0 .../queries}/haskell/folds.scm | 0 .../queries}/haskell/highlights.scm | 0 .../queries}/haskell/injections.scm | 0 .../queries}/haskell/locals.scm | 0 .../queries}/haskell_persistent/folds.scm | 0 .../haskell_persistent/highlights.scm | 0 {queries => runtime/queries}/hcl/folds.scm | 0 .../queries}/hcl/highlights.scm | 0 {queries => runtime/queries}/hcl/indents.scm | 0 .../queries}/hcl/injections.scm | 0 {queries => runtime/queries}/heex/folds.scm | 0 .../queries}/heex/highlights.scm | 0 {queries => runtime/queries}/heex/indents.scm | 0 .../queries}/heex/injections.scm | 0 {queries => runtime/queries}/heex/locals.scm | 0 {queries => runtime/queries}/helm/folds.scm | 0 .../queries}/helm/highlights.scm | 0 .../queries}/helm/injections.scm | 0 {queries => runtime/queries}/helm/locals.scm | 0 {queries => runtime/queries}/hjson/folds.scm | 0 .../queries}/hjson/highlights.scm | 0 .../queries}/hjson/indents.scm | 0 .../queries/hjson}/injections.scm | 0 {queries => runtime/queries}/hjson/locals.scm | 0 {queries => runtime/queries}/hlsl/folds.scm | 0 .../queries}/hlsl/highlights.scm | 0 {queries => runtime/queries}/hlsl/indents.scm | 0 .../queries}/hlsl/injections.scm | 0 {queries => runtime/queries}/hlsl/locals.scm | 0 .../queries}/hlsplaylist/highlights.scm | 0 .../queries/hlsplaylist}/injections.scm | 0 {queries => runtime/queries}/hocon/folds.scm | 0 .../queries}/hocon/highlights.scm | 0 .../queries/hocon}/injections.scm | 0 {queries => runtime/queries}/hoon/folds.scm | 0 .../queries}/hoon/highlights.scm | 0 .../queries}/hoon/injections.scm | 0 {queries => runtime/queries}/hoon/locals.scm | 0 {queries => runtime/queries}/html/folds.scm | 0 .../queries}/html/highlights.scm | 0 {queries => runtime/queries}/html/indents.scm | 0 .../queries}/html/injections.scm | 0 {queries => runtime/queries}/html/locals.scm | 0 .../queries}/html_tags/highlights.scm | 0 .../queries}/html_tags/indents.scm | 0 .../queries}/html_tags/injections.scm | 0 .../queries}/htmldjango/folds.scm | 0 .../queries}/htmldjango/highlights.scm | 0 .../queries}/htmldjango/indents.scm | 0 .../queries}/htmldjango/injections.scm | 0 {queries => runtime/queries}/http/folds.scm | 0 .../queries}/http/highlights.scm | 0 .../queries}/http/injections.scm | 0 {queries => runtime/queries}/hurl/folds.scm | 0 .../queries}/hurl/highlights.scm | 0 {queries => runtime/queries}/hurl/indents.scm | 0 .../queries}/hurl/injections.scm | 0 .../queries}/hyprlang/folds.scm | 0 .../queries}/hyprlang/highlights.scm | 0 .../queries}/hyprlang/indents.scm | 0 .../queries}/hyprlang/injections.scm | 0 .../queries}/idl/highlights.scm | 0 {queries => runtime/queries}/idl/indents.scm | 0 .../queries}/idl/injections.scm | 0 {queries => runtime/queries}/idris/folds.scm | 0 .../queries}/idris/highlights.scm | 0 .../queries/idris}/injections.scm | 0 {queries => runtime/queries}/idris/locals.scm | 0 {queries => runtime/queries}/ini/folds.scm | 0 .../queries}/ini/highlights.scm | 0 .../queries}/ini/injections.scm | 0 {queries => runtime/queries}/inko/folds.scm | 0 .../queries}/inko/highlights.scm | 0 {queries => runtime/queries}/inko/indents.scm | 0 .../queries}/inko/injections.scm | 0 {queries => runtime/queries}/inko/locals.scm | 0 {queries => runtime/queries}/ipkg/folds.scm | 0 .../queries}/ipkg/highlights.scm | 0 {queries => runtime/queries}/ipkg/indents.scm | 0 .../queries}/ipkg/injections.scm | 0 {queries => runtime/queries}/ipkg/locals.scm | 0 {queries => runtime/queries}/ispc/folds.scm | 0 .../queries}/ispc/highlights.scm | 0 {queries => runtime/queries}/ispc/indents.scm | 0 .../queries}/ispc/injections.scm | 0 {queries => runtime/queries}/ispc/locals.scm | 0 .../queries}/janet_simple/folds.scm | 0 .../queries}/janet_simple/highlights.scm | 0 .../queries/janet_simple}/injections.scm | 0 .../queries}/janet_simple/locals.scm | 0 {queries => runtime/queries}/java/folds.scm | 0 .../queries}/java/highlights.scm | 0 {queries => runtime/queries}/java/indents.scm | 0 .../queries}/java/injections.scm | 0 {queries => runtime/queries}/java/locals.scm | 0 .../queries}/javadoc/highlights.scm | 0 .../queries}/javadoc/indents.scm | 0 .../queries}/javadoc/injections.scm | 0 .../queries}/javascript/folds.scm | 0 .../queries}/javascript/highlights.scm | 0 .../queries}/javascript/indents.scm | 0 .../queries}/javascript/injections.scm | 0 .../queries}/javascript/locals.scm | 0 .../queries}/jinja/highlights.scm | 0 .../queries}/jinja/injections.scm | 0 .../queries}/jinja_inline/highlights.scm | 0 .../queries/jinja_inline}/injections.scm | 0 .../queries}/jq/highlights.scm | 0 .../queries}/jq/injections.scm | 0 {queries => runtime/queries}/jq/locals.scm | 0 .../queries}/jsdoc/highlights.scm | 0 {queries => runtime/queries}/json/folds.scm | 0 .../queries}/json/highlights.scm | 0 {queries => runtime/queries}/json/indents.scm | 0 {queries => runtime/queries}/json/locals.scm | 0 .../queries}/json5/highlights.scm | 0 .../queries/json5}/injections.scm | 0 {queries => runtime/queries}/jsonc/folds.scm | 0 .../queries}/jsonc/highlights.scm | 0 .../queries}/jsonc/indents.scm | 0 .../queries/jsonc}/injections.scm | 0 {queries => runtime/queries}/jsonc/locals.scm | 0 .../queries}/jsonnet/folds.scm | 0 .../queries}/jsonnet/highlights.scm | 0 .../queries/jsonnet}/injections.scm | 0 .../queries}/jsonnet/locals.scm | 0 {queries => runtime/queries}/jsx/folds.scm | 0 .../queries}/jsx/highlights.scm | 0 {queries => runtime/queries}/jsx/indents.scm | 0 .../queries}/jsx/injections.scm | 0 {queries => runtime/queries}/julia/folds.scm | 0 .../queries}/julia/highlights.scm | 0 .../queries}/julia/indents.scm | 0 .../queries}/julia/injections.scm | 0 {queries => runtime/queries}/julia/locals.scm | 0 {queries => runtime/queries}/just/folds.scm | 0 .../queries}/just/highlights.scm | 0 {queries => runtime/queries}/just/indents.scm | 0 .../queries}/just/injections.scm | 0 {queries => runtime/queries}/just/locals.scm | 0 {queries => runtime/queries}/kcl/folds.scm | 0 .../queries}/kcl/highlights.scm | 0 .../queries}/kcl/injections.scm | 0 .../queries}/kconfig/folds.scm | 0 .../queries}/kconfig/highlights.scm | 0 .../queries}/kconfig/indents.scm | 0 .../queries/kconfig}/injections.scm | 0 .../queries}/kconfig/locals.scm | 0 {queries => runtime/queries}/kdl/folds.scm | 0 .../queries}/kdl/highlights.scm | 0 {queries => runtime/queries}/kdl/indents.scm | 0 .../queries}/kdl/injections.scm | 0 {queries => runtime/queries}/kdl/locals.scm | 0 {queries => runtime/queries}/kotlin/folds.scm | 0 .../queries}/kotlin/highlights.scm | 0 .../queries}/kotlin/injections.scm | 0 .../queries}/kotlin/locals.scm | 0 {queries => runtime/queries}/koto/folds.scm | 0 .../queries}/koto/highlights.scm | 0 .../queries/koto}/injections.scm | 0 {queries => runtime/queries}/koto/locals.scm | 0 .../queries}/kusto/highlights.scm | 0 .../queries/kusto}/injections.scm | 0 .../queries}/lalrpop/folds.scm | 0 .../queries}/lalrpop/highlights.scm | 0 .../queries}/lalrpop/injections.scm | 0 .../queries}/lalrpop/locals.scm | 0 {queries => runtime/queries}/latex/folds.scm | 0 .../queries}/latex/highlights.scm | 0 .../queries}/latex/injections.scm | 0 {queries => runtime/queries}/ledger/folds.scm | 0 .../queries}/ledger/highlights.scm | 0 .../queries}/ledger/indents.scm | 0 .../queries}/ledger/injections.scm | 0 .../queries}/leo/highlights.scm | 0 {queries => runtime/queries}/leo/indents.scm | 0 .../queries/leo}/injections.scm | 0 .../queries}/linkerscript/folds.scm | 0 .../queries}/linkerscript/highlights.scm | 0 .../queries}/linkerscript/indents.scm | 0 .../queries}/linkerscript/injections.scm | 0 .../queries}/linkerscript/locals.scm | 0 .../queries}/liquid/highlights.scm | 0 .../queries}/liquid/injections.scm | 0 .../queries}/liquidsoap/folds.scm | 0 .../queries}/liquidsoap/highlights.scm | 0 .../queries}/liquidsoap/indents.scm | 0 .../queries/liquidsoap}/injections.scm | 0 .../queries}/liquidsoap/locals.scm | 0 .../queries}/llvm/highlights.scm | 0 .../queries/llvm}/injections.scm | 0 {queries => runtime/queries}/lua/folds.scm | 0 .../queries}/lua/highlights.scm | 0 {queries => runtime/queries}/lua/indents.scm | 0 .../queries}/lua/injections.scm | 0 {queries => runtime/queries}/lua/locals.scm | 0 .../queries}/luadoc/highlights.scm | 0 .../queries}/luap/highlights.scm | 0 {queries => runtime/queries}/luau/folds.scm | 0 .../queries}/luau/highlights.scm | 0 {queries => runtime/queries}/luau/indents.scm | 0 .../queries}/luau/injections.scm | 0 {queries => runtime/queries}/luau/locals.scm | 0 {queries => runtime/queries}/m68k/folds.scm | 0 .../queries}/m68k/highlights.scm | 0 .../queries/m68k}/injections.scm | 0 {queries => runtime/queries}/m68k/locals.scm | 0 {queries => runtime/queries}/make/folds.scm | 0 .../queries}/make/highlights.scm | 0 .../queries}/make/injections.scm | 0 .../queries}/markdown/folds.scm | 0 .../queries}/markdown/highlights.scm | 0 .../queries}/markdown/indents.scm | 0 .../queries}/markdown/injections.scm | 0 .../queries}/markdown_inline/highlights.scm | 0 .../queries}/markdown_inline/injections.scm | 0 {queries => runtime/queries}/matlab/folds.scm | 0 .../queries}/matlab/highlights.scm | 0 .../queries}/matlab/indents.scm | 0 .../queries/matlab}/injections.scm | 0 .../queries}/matlab/locals.scm | 0 .../queries}/menhir/highlights.scm | 0 .../queries}/menhir/injections.scm | 0 .../queries}/mermaid/folds.scm | 0 .../queries}/mermaid/highlights.scm | 0 .../queries}/mermaid/indents.scm | 0 .../queries/mermaid}/injections.scm | 0 {queries => runtime/queries}/meson/folds.scm | 0 .../queries}/meson/highlights.scm | 0 .../queries}/meson/indents.scm | 0 .../queries/meson}/injections.scm | 0 .../queries}/mlir/highlights.scm | 0 .../queries/mlir}/injections.scm | 0 {queries => runtime/queries}/mlir/locals.scm | 0 .../queries}/muttrc/highlights.scm | 0 .../queries}/muttrc/injections.scm | 0 .../queries}/nasm/highlights.scm | 0 .../queries/nasm}/injections.scm | 0 {queries => runtime/queries}/nginx/folds.scm | 0 .../queries}/nginx/highlights.scm | 0 .../queries/nginx}/injections.scm | 0 .../queries}/nickel/highlights.scm | 0 .../queries}/nickel/indents.scm | 0 .../queries/nickel}/injections.scm | 0 {queries => runtime/queries}/nim/folds.scm | 0 .../queries}/nim/highlights.scm | 0 .../queries}/nim/injections.scm | 0 {queries => runtime/queries}/nim/locals.scm | 0 .../queries}/nim_format_string/highlights.scm | 0 .../queries}/nim_format_string/injections.scm | 0 {queries => runtime/queries}/ninja/folds.scm | 0 .../queries}/ninja/highlights.scm | 0 .../queries}/ninja/indents.scm | 0 .../queries/ninja}/injections.scm | 0 {queries => runtime/queries}/nix/folds.scm | 0 .../queries}/nix/highlights.scm | 0 {queries => runtime/queries}/nix/indents.scm | 0 .../queries}/nix/injections.scm | 0 {queries => runtime/queries}/nix/locals.scm | 0 {queries => runtime/queries}/nqc/folds.scm | 0 .../queries}/nqc/highlights.scm | 0 {queries => runtime/queries}/nqc/indents.scm | 0 .../queries}/nqc/injections.scm | 0 {queries => runtime/queries}/nqc/locals.scm | 0 {queries => runtime/queries}/nu/folds.scm | 0 .../queries}/nu/highlights.scm | 0 {queries => runtime/queries}/nu/indents.scm | 0 .../queries}/nu/injections.scm | 0 {queries => runtime/queries}/objc/folds.scm | 0 .../queries}/objc/highlights.scm | 0 {queries => runtime/queries}/objc/indents.scm | 0 .../queries}/objc/injections.scm | 0 {queries => runtime/queries}/objc/locals.scm | 0 .../queries}/objdump/highlights.scm | 0 .../queries}/objdump/injections.scm | 0 {queries => runtime/queries}/ocaml/folds.scm | 0 .../queries}/ocaml/highlights.scm | 0 .../queries}/ocaml/indents.scm | 0 .../queries/ocaml}/injections.scm | 0 {queries => runtime/queries}/ocaml/locals.scm | 0 .../queries}/ocaml_interface/folds.scm | 0 .../queries}/ocaml_interface/highlights.scm | 0 .../queries}/ocaml_interface/indents.scm | 0 .../queries}/ocaml_interface/injections.scm | 0 .../queries}/ocaml_interface/locals.scm | 0 .../queries}/ocamllex/highlights.scm | 0 .../queries}/ocamllex/injections.scm | 0 {queries => runtime/queries}/odin/folds.scm | 0 .../queries}/odin/highlights.scm | 0 {queries => runtime/queries}/odin/indents.scm | 0 .../queries/odin}/injections.scm | 0 {queries => runtime/queries}/odin/locals.scm | 0 {queries => runtime/queries}/pascal/folds.scm | 0 .../queries}/pascal/highlights.scm | 0 .../queries}/pascal/indents.scm | 0 .../queries}/pascal/injections.scm | 0 .../queries}/pascal/locals.scm | 0 .../queries}/passwd/highlights.scm | 0 {queries => runtime/queries}/pem/folds.scm | 0 .../queries}/pem/highlights.scm | 0 .../queries/pem}/injections.scm | 0 {queries => runtime/queries}/perl/folds.scm | 0 .../queries}/perl/highlights.scm | 0 .../queries}/perl/injections.scm | 0 {queries => runtime/queries}/php/folds.scm | 0 .../queries}/php/highlights.scm | 0 {queries => runtime/queries}/php/indents.scm | 0 .../queries}/php/injections.scm | 0 {queries => runtime/queries}/php/locals.scm | 0 .../queries}/php_only/folds.scm | 0 .../queries}/php_only/highlights.scm | 0 .../queries}/php_only/indents.scm | 0 .../queries}/php_only/injections.scm | 0 .../queries}/php_only/locals.scm | 0 .../queries}/phpdoc/highlights.scm | 0 .../queries}/pioasm/highlights.scm | 0 .../queries}/pioasm/injections.scm | 0 {queries => runtime/queries}/po/folds.scm | 0 .../queries}/po/highlights.scm | 0 .../queries/po}/injections.scm | 0 .../queries}/pod/highlights.scm | 0 .../queries}/poe_filter/folds.scm | 0 .../queries}/poe_filter/highlights.scm | 0 .../queries}/poe_filter/indents.scm | 0 .../queries/poe_filter}/injections.scm | 0 {queries => runtime/queries}/pony/folds.scm | 0 .../queries}/pony/highlights.scm | 0 {queries => runtime/queries}/pony/indents.scm | 0 .../queries}/pony/injections.scm | 0 {queries => runtime/queries}/pony/locals.scm | 0 .../queries}/powershell/folds.scm | 0 .../queries}/powershell/highlights.scm | 0 .../queries}/powershell/indents.scm | 0 .../queries}/powershell/injections.scm | 0 .../queries}/powershell/locals.scm | 0 .../queries}/printf/highlights.scm | 0 {queries => runtime/queries}/prisma/folds.scm | 0 .../queries}/prisma/highlights.scm | 0 .../queries}/prisma/injections.scm | 0 .../queries}/problog/folds.scm | 0 .../queries}/problog/highlights.scm | 0 .../queries}/problog/indents.scm | 0 .../queries}/problog/injections.scm | 0 {queries => runtime/queries}/prolog/folds.scm | 0 .../queries}/prolog/highlights.scm | 0 .../queries}/prolog/indents.scm | 0 .../queries/prolog}/injections.scm | 0 .../queries}/promql/highlights.scm | 0 .../queries}/promql/injections.scm | 0 .../queries}/properties/highlights.scm | 0 .../queries/properties}/injections.scm | 0 .../queries}/properties/locals.scm | 0 {queries => runtime/queries}/proto/folds.scm | 0 .../queries}/proto/highlights.scm | 0 .../queries}/proto/indents.scm | 0 .../queries/proto}/injections.scm | 0 .../queries}/prql/highlights.scm | 0 .../queries}/prql/injections.scm | 0 .../queries}/psv/highlights.scm | 0 .../queries}/pug/highlights.scm | 0 .../queries}/pug/injections.scm | 0 {queries => runtime/queries}/puppet/folds.scm | 0 .../queries}/puppet/highlights.scm | 0 .../queries}/puppet/indents.scm | 0 .../queries}/puppet/injections.scm | 0 .../queries}/puppet/locals.scm | 0 .../queries}/purescript/highlights.scm | 0 .../queries/purescript}/injections.scm | 0 .../queries}/purescript/locals.scm | 0 .../queries}/pymanifest/highlights.scm | 0 .../queries/pymanifest}/injections.scm | 0 {queries => runtime/queries}/python/folds.scm | 0 .../queries}/python/highlights.scm | 0 .../queries}/python/indents.scm | 0 .../queries}/python/injections.scm | 0 .../queries}/python/locals.scm | 0 {queries => runtime/queries}/ql/folds.scm | 0 .../queries}/ql/highlights.scm | 0 {queries => runtime/queries}/ql/indents.scm | 0 .../queries}/ql/injections.scm | 0 {queries => runtime/queries}/ql/locals.scm | 0 .../queries}/qmldir/highlights.scm | 0 .../queries/qmldir}/injections.scm | 0 {queries => runtime/queries}/qmljs/folds.scm | 0 .../queries}/qmljs/highlights.scm | 0 .../queries}/qmljs/injections.scm | 0 {queries => runtime/queries}/query/folds.scm | 0 .../queries}/query/highlights.scm | 0 .../queries}/query/indents.scm | 0 .../queries}/query/injections.scm | 0 {queries => runtime/queries}/query/locals.scm | 0 {queries => runtime/queries}/r/highlights.scm | 0 {queries => runtime/queries}/r/indents.scm | 0 .../queries/r}/injections.scm | 0 {queries => runtime/queries}/r/locals.scm | 0 {queries => runtime/queries}/racket/folds.scm | 0 .../queries}/racket/highlights.scm | 0 .../queries}/racket/injections.scm | 0 .../queries}/ralph/highlights.scm | 0 .../queries}/ralph/injections.scm | 0 {queries => runtime/queries}/rasi/folds.scm | 0 .../queries}/rasi/highlights.scm | 0 {queries => runtime/queries}/rasi/indents.scm | 0 .../queries/rasi}/injections.scm | 0 {queries => runtime/queries}/rasi/locals.scm | 0 {queries => runtime/queries}/razor/folds.scm | 0 .../queries}/razor/highlights.scm | 0 .../queries}/razor/injections.scm | 0 {queries => runtime/queries}/rbs/folds.scm | 0 .../queries}/rbs/highlights.scm | 0 {queries => runtime/queries}/rbs/indents.scm | 0 .../queries/rbs}/injections.scm | 0 {queries => runtime/queries}/re2c/folds.scm | 0 .../queries}/re2c/highlights.scm | 0 {queries => runtime/queries}/re2c/indents.scm | 0 .../queries}/re2c/injections.scm | 0 {queries => runtime/queries}/re2c/locals.scm | 0 .../queries}/readline/folds.scm | 0 .../queries}/readline/highlights.scm | 0 .../queries}/readline/indents.scm | 0 .../queries/readline}/injections.scm | 0 .../queries}/regex/highlights.scm | 0 .../queries}/rego/highlights.scm | 0 .../r => runtime/queries/rego}/injections.scm | 0 .../queries}/requirements/highlights.scm | 0 .../queries/requirements}/injections.scm | 0 .../queries}/rescript/folds.scm | 0 .../queries}/rescript/highlights.scm | 0 .../queries}/rescript/indents.scm | 0 .../queries}/rescript/injections.scm | 0 .../queries}/rescript/locals.scm | 0 {queries => runtime/queries}/rnoweb/folds.scm | 0 .../queries}/rnoweb/highlights.scm | 0 .../queries}/rnoweb/injections.scm | 0 {queries => runtime/queries}/robot/folds.scm | 0 .../queries}/robot/highlights.scm | 0 .../queries}/robot/indents.scm | 0 .../queries}/robot/injections.scm | 0 .../queries}/robots/highlights.scm | 0 .../queries/robots}/injections.scm | 0 .../queries}/roc/highlights.scm | 0 {queries => runtime/queries}/roc/indents.scm | 0 .../queries}/roc/injections.scm | 0 {queries => runtime/queries}/roc/locals.scm | 0 {queries => runtime/queries}/ron/folds.scm | 0 .../queries}/ron/highlights.scm | 0 {queries => runtime/queries}/ron/indents.scm | 0 .../queries}/ron/injections.scm | 0 {queries => runtime/queries}/ron/locals.scm | 0 .../queries}/rst/highlights.scm | 0 .../queries}/rst/injections.scm | 0 {queries => runtime/queries}/rst/locals.scm | 0 {queries => runtime/queries}/ruby/folds.scm | 0 .../queries}/ruby/highlights.scm | 3 - {queries => runtime/queries}/ruby/indents.scm | 0 .../queries}/ruby/injections.scm | 0 {queries => runtime/queries}/ruby/locals.scm | 0 .../queries}/runescript/highlights.scm | 0 .../queries/runescript}/injections.scm | 0 {queries => runtime/queries}/rust/folds.scm | 0 .../queries}/rust/highlights.scm | 0 {queries => runtime/queries}/rust/indents.scm | 0 .../queries}/rust/injections.scm | 0 {queries => runtime/queries}/rust/locals.scm | 0 {queries => runtime/queries}/scala/folds.scm | 0 .../queries}/scala/highlights.scm | 0 .../queries/scala}/injections.scm | 0 {queries => runtime/queries}/scala/locals.scm | 0 .../queries}/scfg/highlights.scm | 0 .../queries/scfg}/injections.scm | 0 {queries => runtime/queries}/scheme/folds.scm | 0 .../queries}/scheme/highlights.scm | 0 .../queries/scheme}/injections.scm | 0 {queries => runtime/queries}/scss/folds.scm | 0 .../queries}/scss/highlights.scm | 0 {queries => runtime/queries}/scss/indents.scm | 0 .../queries}/scss/injections.scm | 0 .../queries}/sflog/highlights.scm | 0 {queries => runtime/queries}/slang/folds.scm | 0 .../queries}/slang/highlights.scm | 0 .../queries}/slang/indents.scm | 0 .../queries}/slang/injections.scm | 0 {queries => runtime/queries}/slang/locals.scm | 0 {queries => runtime/queries}/slim/folds.scm | 0 .../queries}/slim/highlights.scm | 0 {queries => runtime/queries}/slim/indents.scm | 0 .../queries}/slim/injections.scm | 0 {queries => runtime/queries}/slim/locals.scm | 0 {queries => runtime/queries}/slint/folds.scm | 0 .../queries}/slint/highlights.scm | 0 .../queries}/slint/indents.scm | 0 .../queries/slint}/injections.scm | 0 {queries => runtime/queries}/slint/locals.scm | 0 {queries => runtime/queries}/smali/folds.scm | 0 .../queries}/smali/highlights.scm | 0 .../queries}/smali/indents.scm | 0 .../queries/smali}/injections.scm | 0 {queries => runtime/queries}/smali/locals.scm | 0 .../queries}/smithy/highlights.scm | 0 .../queries}/smithy/injections.scm | 0 .../queries}/snakemake/folds.scm | 0 .../queries}/snakemake/highlights.scm | 0 .../queries}/snakemake/indents.scm | 0 .../queries}/snakemake/injections.scm | 0 .../queries}/snakemake/locals.scm | 0 .../queries}/solidity/folds.scm | 0 .../queries}/solidity/highlights.scm | 0 .../queries/solidity}/injections.scm | 0 .../queries}/soql/highlights.scm | 0 .../queries}/sosl/highlights.scm | 0 .../queries}/sourcepawn/highlights.scm | 0 .../queries}/sourcepawn/injections.scm | 0 .../queries}/sourcepawn/locals.scm | 0 {queries => runtime/queries}/sparql/folds.scm | 0 .../queries}/sparql/highlights.scm | 0 .../queries}/sparql/indents.scm | 0 .../queries}/sparql/injections.scm | 0 .../queries}/sparql/locals.scm | 0 {queries => runtime/queries}/sql/folds.scm | 0 .../queries}/sql/highlights.scm | 0 {queries => runtime/queries}/sql/indents.scm | 0 .../queries}/sql/injections.scm | 0 .../queries}/squirrel/folds.scm | 0 .../queries}/squirrel/highlights.scm | 0 .../queries}/squirrel/indents.scm | 0 .../queries}/squirrel/injections.scm | 0 .../queries}/squirrel/locals.scm | 0 .../queries}/ssh_config/folds.scm | 0 .../queries}/ssh_config/highlights.scm | 0 .../queries}/ssh_config/indents.scm | 0 .../queries}/ssh_config/injections.scm | 0 .../queries}/ssh_config/locals.scm | 0 .../queries}/starlark/folds.scm | 0 .../queries}/starlark/highlights.scm | 0 .../queries}/starlark/indents.scm | 0 .../queries}/starlark/injections.scm | 0 .../queries}/starlark/locals.scm | 0 .../queries}/strace/highlights.scm | 0 .../queries/strace}/injections.scm | 0 {queries => runtime/queries}/styled/folds.scm | 0 .../queries}/styled/highlights.scm | 0 .../queries}/styled/indents.scm | 0 .../queries}/styled/injections.scm | 0 .../queries}/supercollider/folds.scm | 0 .../queries}/supercollider/highlights.scm | 0 .../queries}/supercollider/indents.scm | 0 .../queries}/supercollider/injections.scm | 0 .../queries}/supercollider/locals.scm | 0 .../queries}/superhtml/highlights.scm | 0 .../queries}/superhtml/injections.scm | 0 .../queries}/surface/folds.scm | 0 .../queries}/surface/highlights.scm | 0 .../queries}/surface/indents.scm | 0 .../queries}/surface/injections.scm | 0 {queries => runtime/queries}/svelte/folds.scm | 0 .../queries}/svelte/highlights.scm | 0 .../queries}/svelte/indents.scm | 0 .../queries}/svelte/injections.scm | 0 .../queries}/svelte/locals.scm | 0 {queries => runtime/queries}/sway/folds.scm | 0 .../queries}/sway/highlights.scm | 0 {queries => runtime/queries}/sway/indents.scm | 0 .../queries}/sway/injections.scm | 0 {queries => runtime/queries}/sway/locals.scm | 0 {queries => runtime/queries}/swift/folds.scm | 0 .../queries}/swift/highlights.scm | 0 .../queries}/swift/indents.scm | 0 .../queries}/swift/injections.scm | 0 {queries => runtime/queries}/swift/locals.scm | 0 .../queries}/sxhkdrc/folds.scm | 0 .../queries}/sxhkdrc/highlights.scm | 0 .../queries}/sxhkdrc/injections.scm | 0 .../queries}/systemtap/folds.scm | 0 .../queries}/systemtap/highlights.scm | 0 .../queries}/systemtap/injections.scm | 0 .../queries}/systemtap/locals.scm | 0 {queries => runtime/queries}/t32/folds.scm | 0 .../queries}/t32/highlights.scm | 0 {queries => runtime/queries}/t32/indents.scm | 0 .../queries/t32}/injections.scm | 0 {queries => runtime/queries}/t32/locals.scm | 0 .../queries}/tablegen/folds.scm | 0 .../queries}/tablegen/highlights.scm | 0 .../queries}/tablegen/indents.scm | 0 .../queries}/tablegen/injections.scm | 0 .../queries}/tablegen/locals.scm | 0 {queries => runtime/queries}/tact/folds.scm | 0 .../queries}/tact/highlights.scm | 0 {queries => runtime/queries}/tact/indents.scm | 0 .../queries/tact}/injections.scm | 0 {queries => runtime/queries}/tact/locals.scm | 0 {queries => runtime/queries}/tcl/folds.scm | 0 .../queries}/tcl/highlights.scm | 0 {queries => runtime/queries}/tcl/indents.scm | 0 .../queries/tcl}/injections.scm | 0 {queries => runtime/queries}/teal/folds.scm | 0 .../queries}/teal/highlights.scm | 0 {queries => runtime/queries}/teal/indents.scm | 0 .../queries}/teal/injections.scm | 0 {queries => runtime/queries}/teal/locals.scm | 0 {queries => runtime/queries}/templ/folds.scm | 0 .../queries}/templ/highlights.scm | 0 .../queries}/templ/injections.scm | 0 .../queries}/tera/highlights.scm | 0 .../queries}/tera/injections.scm | 0 .../queries}/terraform/folds.scm | 0 .../queries}/terraform/highlights.scm | 0 .../queries}/terraform/indents.scm | 0 .../queries}/terraform/injections.scm | 0 .../queries}/textproto/folds.scm | 0 .../queries}/textproto/highlights.scm | 0 .../queries}/textproto/indents.scm | 0 .../queries/textproto}/injections.scm | 0 {queries => runtime/queries}/thrift/folds.scm | 0 .../queries}/thrift/highlights.scm | 0 .../queries}/thrift/indents.scm | 0 .../queries/thrift}/injections.scm | 0 .../queries}/thrift/locals.scm | 0 {queries => runtime/queries}/tiger/folds.scm | 0 .../queries}/tiger/highlights.scm | 0 .../queries}/tiger/indents.scm | 0 .../queries}/tiger/injections.scm | 0 {queries => runtime/queries}/tiger/locals.scm | 0 .../queries}/tlaplus/folds.scm | 0 .../queries}/tlaplus/highlights.scm | 0 .../queries}/tlaplus/injections.scm | 0 .../queries}/tlaplus/locals.scm | 0 .../queries}/tmux/highlights.scm | 0 .../queries}/tmux/injections.scm | 0 .../queries}/todotxt/highlights.scm | 0 {queries => runtime/queries}/toml/folds.scm | 0 .../queries}/toml/highlights.scm | 0 {queries => runtime/queries}/toml/indents.scm | 0 .../queries/toml}/injections.scm | 0 {queries => runtime/queries}/toml/locals.scm | 0 .../queries}/tsv/highlights.scm | 0 {queries => runtime/queries}/tsx/folds.scm | 0 .../queries}/tsx/highlights.scm | 0 {queries => runtime/queries}/tsx/indents.scm | 0 .../queries}/tsx/injections.scm | 0 {queries => runtime/queries}/tsx/locals.scm | 0 {queries => runtime/queries}/turtle/folds.scm | 0 .../queries}/turtle/highlights.scm | 0 .../queries}/turtle/indents.scm | 0 .../queries/turtle}/injections.scm | 0 .../queries}/turtle/locals.scm | 0 .../queries}/twig/highlights.scm | 0 .../queries}/twig/injections.scm | 0 .../queries}/typescript/folds.scm | 0 .../queries}/typescript/highlights.scm | 0 .../queries}/typescript/indents.scm | 0 .../queries}/typescript/injections.scm | 0 .../queries}/typescript/locals.scm | 0 .../queries}/typespec/highlights.scm | 0 .../queries}/typespec/indents.scm | 0 .../queries}/typespec/injections.scm | 0 .../queries}/typoscript/folds.scm | 0 .../queries}/typoscript/highlights.scm | 0 .../queries}/typoscript/indents.scm | 0 .../queries/typoscript}/injections.scm | 0 {queries => runtime/queries}/typst/folds.scm | 0 .../queries}/typst/highlights.scm | 0 .../queries}/typst/indents.scm | 0 .../queries/typst}/injections.scm | 0 .../queries}/udev/highlights.scm | 0 .../queries}/udev/injections.scm | 0 {queries => runtime/queries}/udev/locals.scm | 0 .../queries}/ungrammar/folds.scm | 0 .../queries}/ungrammar/highlights.scm | 0 .../queries}/ungrammar/indents.scm | 0 .../queries/ungrammar}/injections.scm | 0 .../queries}/ungrammar/locals.scm | 0 {queries => runtime/queries}/unison/folds.scm | 0 .../queries}/unison/highlights.scm | 0 .../queries/unison}/injections.scm | 0 {queries => runtime/queries}/usd/folds.scm | 0 .../queries}/usd/highlights.scm | 0 {queries => runtime/queries}/usd/indents.scm | 0 .../queries}/usd/injections.scm | 0 {queries => runtime/queries}/usd/locals.scm | 0 {queries => runtime/queries}/uxntal/folds.scm | 0 .../queries}/uxntal/highlights.scm | 0 .../queries}/uxntal/indents.scm | 0 .../queries}/uxntal/injections.scm | 0 .../queries}/uxntal/locals.scm | 0 {queries => runtime/queries}/v/folds.scm | 0 {queries => runtime/queries}/v/highlights.scm | 0 {queries => runtime/queries}/v/indents.scm | 0 {queries => runtime/queries}/v/injections.scm | 0 {queries => runtime/queries}/v/locals.scm | 0 {queries => runtime/queries}/vala/folds.scm | 0 .../queries}/vala/highlights.scm | 0 .../queries}/vala/injections.scm | 0 .../queries}/vento/highlights.scm | 0 .../queries}/vento/injections.scm | 0 .../queries}/verilog/folds.scm | 0 .../queries}/verilog/highlights.scm | 0 .../queries/verilog}/injections.scm | 0 {queries => runtime/queries}/vhdl/folds.scm | 0 .../queries}/vhdl/highlights.scm | 0 .../queries}/vhdl/injections.scm | 0 .../queries}/vhs/highlights.scm | 0 .../queries/vhs}/injections.scm | 0 {queries => runtime/queries}/vim/folds.scm | 0 .../queries}/vim/highlights.scm | 0 .../queries}/vim/injections.scm | 0 {queries => runtime/queries}/vim/locals.scm | 0 .../queries}/vimdoc/highlights.scm | 0 .../queries}/vimdoc/injections.scm | 0 {queries => runtime/queries}/vrl/folds.scm | 0 .../queries}/vrl/highlights.scm | 0 {queries => runtime/queries}/vrl/indents.scm | 0 .../queries}/vrl/injections.scm | 0 {queries => runtime/queries}/vrl/locals.scm | 0 {queries => runtime/queries}/vue/folds.scm | 0 .../queries}/vue/highlights.scm | 0 {queries => runtime/queries}/vue/indents.scm | 0 .../queries}/vue/injections.scm | 0 {queries => runtime/queries}/wgsl/folds.scm | 0 .../queries}/wgsl/highlights.scm | 0 {queries => runtime/queries}/wgsl/indents.scm | 0 .../queries}/wgsl/injections.scm | 0 .../queries}/wgsl_bevy/folds.scm | 0 .../queries}/wgsl_bevy/highlights.scm | 0 .../queries}/wgsl_bevy/indents.scm | 0 {queries => runtime/queries}/wing/folds.scm | 0 .../queries}/wing/highlights.scm | 0 .../queries}/wing/injections.scm | 0 {queries => runtime/queries}/wing/locals.scm | 0 {queries => runtime/queries}/wit/folds.scm | 0 .../queries}/wit/highlights.scm | 0 .../queries/wit}/injections.scm | 0 .../queries}/xcompose/highlights.scm | 0 .../queries/xcompose}/injections.scm | 4 - .../queries}/xcompose/locals.scm | 0 {queries => runtime/queries}/xml/folds.scm | 0 .../queries}/xml/highlights.scm | 0 {queries => runtime/queries}/xml/indents.scm | 0 .../queries}/xml/injections.scm | 0 {queries => runtime/queries}/xml/locals.scm | 0 .../queries}/xresources/folds.scm | 0 .../queries}/xresources/highlights.scm | 0 .../queries}/xresources/injections.scm | 0 .../queries}/xresources/locals.scm | 0 {queries => runtime/queries}/yaml/folds.scm | 0 .../queries}/yaml/highlights.scm | 0 {queries => runtime/queries}/yaml/indents.scm | 0 .../queries}/yaml/injections.scm | 0 {queries => runtime/queries}/yaml/locals.scm | 0 {queries => runtime/queries}/yang/folds.scm | 0 .../queries}/yang/highlights.scm | 0 {queries => runtime/queries}/yang/indents.scm | 0 .../queries}/yang/injections.scm | 0 {queries => runtime/queries}/yuck/folds.scm | 0 .../queries}/yuck/highlights.scm | 0 {queries => runtime/queries}/yuck/indents.scm | 0 .../queries}/yuck/injections.scm | 0 {queries => runtime/queries}/yuck/locals.scm | 0 .../queries}/zathurarc/highlights.scm | 0 .../queries}/zathurarc/injections.scm | 0 {queries => runtime/queries}/zig/folds.scm | 0 .../queries}/zig/highlights.scm | 0 {queries => runtime/queries}/zig/indents.scm | 0 .../queries}/zig/injections.scm | 0 {queries => runtime/queries}/zig/locals.scm | 0 .../queries}/ziggy/highlights.scm | 0 .../queries}/ziggy/indents.scm | 0 .../queries}/ziggy_schema/highlights.scm | 0 .../queries}/ziggy_schema/indents.scm | 0 scripts/check-queries.lua | 80 +- scripts/ci-install.sh | 4 +- scripts/format-queries.lua | 76 +- scripts/minimal_init.lua | 36 +- scripts/update-lockfile.sh | 16 +- scripts/update-readme.lua | 90 +- scripts/write-lockfile.lua | 56 +- tests/indent/algorithm_spec.lua | 32 +- tests/indent/angular_spec.lua | 38 +- tests/indent/c_spec.lua | 97 +- tests/indent/capnp_spec.lua | 28 +- tests/indent/common.lua | 79 +- tests/indent/cpp_spec.lua | 69 +- tests/indent/css_spec.lua | 18 +- tests/indent/dart_spec.lua | 63 +- tests/indent/dot_spec.lua | 24 +- tests/indent/gdscript_spec.lua | 14 +- tests/indent/gleam_spec.lua | 210 +- tests/indent/go_spec.lua | 20 +- tests/indent/graphql_spec.lua | 12 +- tests/indent/html_spec.lua | 38 +- tests/indent/java_spec.lua | 52 +- tests/indent/javascript_spec.lua | 126 +- tests/indent/jsx_spec.lua | 38 +- tests/indent/julia_spec.lua | 10 +- tests/indent/lua_spec.lua | 70 +- tests/indent/meson_spec.lua | 30 +- tests/indent/nickel_spec.lua | 28 +- tests/indent/nix_spec.lua | 24 +- tests/indent/nu_spec.lua | 10 +- tests/indent/php_spec.lua | 121 +- tests/indent/python_spec.lua | 160 +- tests/indent/ql_spec.lua | 18 +- tests/indent/query_spec.lua | 36 +- tests/indent/r_spec.lua | 48 +- tests/indent/rescript_spec.lua | 40 +- tests/indent/ruby_spec.lua | 24 +- tests/indent/rust_spec.lua | 110 +- tests/indent/smali_spec.lua | 29 +- tests/indent/sql_spec.lua | 12 +- tests/indent/sway_spec.lua | 20 +- tests/indent/swift_spec.lua | 39 +- tests/indent/t32_spec.lua | 144 +- tests/indent/terraform_spec.lua | 65 +- tests/indent/tiger_spec.lua | 284 +- tests/indent/usd_spec.lua | 16 +- tests/indent/vue_spec.lua | 23 +- tests/indent/wgsl_spec.lua | 36 +- tests/indent/yaml_spec.lua | 16 +- tests/indent/yang_spec.lua | 20 +- tests/indent/yuck_spec.lua | 16 +- tests/indent/zig_spec.lua | 16 +- tests/query/highlights/lua/test.lua | 4 +- tests/query/highlights_spec.lua | 47 +- tests/query/injection_spec.lua | 38 +- tests/unit/ts_utils_spec.lua | 114 - 1247 files changed, 6096 insertions(+), 9074 deletions(-) delete mode 100644 Makefile create mode 100644 SUPPORTED_LANGUAGES.md create mode 100644 TODO.md delete mode 100644 assets/logo.png delete mode 100644 autoload/nvim_treesitter.vim delete mode 100644 lua/nvim-treesitter.lua delete mode 100644 lua/nvim-treesitter/caching.lua delete mode 100644 lua/nvim-treesitter/compat.lua create mode 100644 lua/nvim-treesitter/config.lua delete mode 100644 lua/nvim-treesitter/configs.lua delete mode 100644 lua/nvim-treesitter/fold.lua delete mode 100644 lua/nvim-treesitter/highlight.lua delete mode 100644 lua/nvim-treesitter/incremental_selection.lua delete mode 100644 lua/nvim-treesitter/info.lua create mode 100644 lua/nvim-treesitter/init.lua delete mode 100644 lua/nvim-treesitter/query_predicates.lua create mode 100644 lua/nvim-treesitter/shell_cmds.lua delete mode 100644 lua/nvim-treesitter/shell_command_selectors.lua delete mode 100644 lua/nvim-treesitter/statusline.lua delete mode 100644 lua/nvim-treesitter/ts_utils.lua delete mode 100644 lua/nvim-treesitter/tsrange.lua delete mode 100644 parser-info/.gitignore delete mode 100644 parser/.gitignore create mode 100644 plugin/filetypes.lua create mode 100644 plugin/query_predicates.lua rename {queries => runtime/queries}/ada/folds.scm (100%) rename {queries => runtime/queries}/ada/highlights.scm (100%) rename {queries/unison => runtime/queries/ada}/injections.scm (100%) rename {queries => runtime/queries}/ada/locals.scm (100%) rename {queries => runtime/queries}/agda/folds.scm (100%) rename {queries => runtime/queries}/agda/highlights.scm (100%) rename {queries/solidity => runtime/queries/agda}/injections.scm (100%) rename {queries => runtime/queries}/angular/folds.scm (100%) rename {queries => runtime/queries}/angular/highlights.scm (100%) rename {queries => runtime/queries}/angular/indents.scm (100%) rename {queries => runtime/queries}/angular/injections.scm (100%) rename {queries => runtime/queries}/angular/locals.scm (100%) rename {queries => runtime/queries}/apex/folds.scm (100%) rename {queries => runtime/queries}/apex/highlights.scm (100%) rename {queries => runtime/queries}/apex/injections.scm (100%) rename {queries => runtime/queries}/apex/locals.scm (100%) rename {queries => runtime/queries}/arduino/folds.scm (100%) rename {queries => runtime/queries}/arduino/highlights.scm (100%) rename {queries => runtime/queries}/arduino/indents.scm (100%) rename {queries => runtime/queries}/arduino/injections.scm (100%) rename {queries => runtime/queries}/arduino/locals.scm (100%) rename {queries => runtime/queries}/asm/highlights.scm (100%) rename {queries => runtime/queries}/asm/injections.scm (100%) rename {queries => runtime/queries}/astro/folds.scm (100%) rename {queries => runtime/queries}/astro/highlights.scm (100%) rename {queries => runtime/queries}/astro/indents.scm (100%) rename {queries => runtime/queries}/astro/injections.scm (100%) rename {queries => runtime/queries}/astro/locals.scm (100%) rename {queries => runtime/queries}/authzed/highlights.scm (100%) rename {queries/bass => runtime/queries/authzed}/injections.scm (100%) rename {queries => runtime/queries}/awk/highlights.scm (100%) rename {queries => runtime/queries}/awk/injections.scm (100%) rename {queries => runtime/queries}/bash/folds.scm (100%) rename {queries => runtime/queries}/bash/highlights.scm (100%) rename {queries => runtime/queries}/bash/injections.scm (100%) rename {queries => runtime/queries}/bash/locals.scm (100%) rename {queries => runtime/queries}/bass/folds.scm (100%) rename {queries => runtime/queries}/bass/highlights.scm (100%) rename {queries => runtime/queries}/bass/indents.scm (100%) rename {queries/scala => runtime/queries/bass}/injections.scm (100%) rename {queries => runtime/queries}/bass/locals.scm (100%) rename {queries => runtime/queries}/beancount/folds.scm (100%) rename {queries => runtime/queries}/beancount/highlights.scm (100%) rename {queries/verilog => runtime/queries/beancount}/injections.scm (100%) rename {queries => runtime/queries}/bibtex/folds.scm (100%) rename {queries => runtime/queries}/bibtex/highlights.scm (100%) rename {queries => runtime/queries}/bibtex/indents.scm (100%) rename {queries => runtime/queries}/bibtex/injections.scm (100%) rename {queries => runtime/queries}/bicep/folds.scm (100%) rename {queries => runtime/queries}/bicep/highlights.scm (100%) rename {queries => runtime/queries}/bicep/indents.scm (100%) rename {queries => runtime/queries}/bicep/injections.scm (100%) rename {queries => runtime/queries}/bicep/locals.scm (100%) rename {queries => runtime/queries}/bitbake/folds.scm (100%) rename {queries => runtime/queries}/bitbake/highlights.scm (100%) rename {queries => runtime/queries}/bitbake/indents.scm (100%) rename {queries => runtime/queries}/bitbake/injections.scm (100%) rename {queries => runtime/queries}/bitbake/locals.scm (100%) rename {queries => runtime/queries}/blade/folds.scm (100%) rename {queries => runtime/queries}/blade/highlights.scm (100%) rename {queries => runtime/queries}/blade/indents.scm (100%) rename {queries => runtime/queries}/blade/injections.scm (100%) rename {queries => runtime/queries}/blueprint/highlights.scm (100%) rename {queries/ada => runtime/queries/blueprint}/injections.scm (100%) rename {queries => runtime/queries}/bp/folds.scm (100%) rename {queries => runtime/queries}/bp/highlights.scm (100%) rename {queries => runtime/queries}/bp/indents.scm (100%) rename {queries/agda => runtime/queries/bp}/injections.scm (100%) rename {queries => runtime/queries}/bp/locals.scm (100%) rename {queries => runtime/queries}/brightscript/folds.scm (100%) rename {queries => runtime/queries}/brightscript/highlights.scm (100%) rename {queries => runtime/queries}/brightscript/indents.scm (100%) rename {queries/authzed => runtime/queries/brightscript}/injections.scm (100%) rename {queries => runtime/queries}/c/folds.scm (100%) rename {queries => runtime/queries}/c/highlights.scm (100%) rename {queries => runtime/queries}/c/indents.scm (100%) rename {queries => runtime/queries}/c/injections.scm (100%) rename {queries => runtime/queries}/c/locals.scm (100%) rename {queries => runtime/queries}/c_sharp/folds.scm (100%) rename {queries => runtime/queries}/c_sharp/highlights.scm (100%) rename {queries/beancount => runtime/queries/c_sharp}/injections.scm (100%) rename {queries => runtime/queries}/c_sharp/locals.scm (100%) rename {queries => runtime/queries}/caddy/folds.scm (100%) rename {queries => runtime/queries}/caddy/highlights.scm (100%) rename {queries => runtime/queries}/caddy/indents.scm (100%) rename {queries/blueprint => runtime/queries/caddy}/injections.scm (100%) rename {queries => runtime/queries}/cairo/folds.scm (100%) rename {queries => runtime/queries}/cairo/highlights.scm (100%) rename {queries => runtime/queries}/cairo/indents.scm (100%) rename {queries => runtime/queries}/cairo/injections.scm (100%) rename {queries => runtime/queries}/cairo/locals.scm (100%) rename {queries => runtime/queries}/capnp/folds.scm (100%) rename {queries => runtime/queries}/capnp/highlights.scm (100%) rename {queries => runtime/queries}/capnp/indents.scm (100%) rename {queries/bp => runtime/queries/capnp}/injections.scm (100%) rename {queries => runtime/queries}/capnp/locals.scm (100%) rename {queries => runtime/queries}/chatito/folds.scm (100%) rename {queries => runtime/queries}/chatito/highlights.scm (100%) rename {queries => runtime/queries}/chatito/indents.scm (100%) rename {queries/brightscript => runtime/queries/chatito}/injections.scm (100%) rename {queries => runtime/queries}/chatito/locals.scm (100%) rename {queries => runtime/queries}/circom/folds.scm (100%) rename {queries => runtime/queries}/circom/highlights.scm (100%) rename {queries/c_sharp => runtime/queries/circom}/injections.scm (100%) rename {queries => runtime/queries}/circom/locals.scm (100%) rename {queries => runtime/queries}/clojure/folds.scm (100%) rename {queries => runtime/queries}/clojure/highlights.scm (100%) rename {queries/caddy => runtime/queries/clojure}/injections.scm (100%) rename {queries => runtime/queries}/clojure/locals.scm (100%) rename {queries => runtime/queries}/cmake/folds.scm (100%) rename {queries => runtime/queries}/cmake/highlights.scm (100%) rename {queries => runtime/queries}/cmake/indents.scm (100%) rename {queries => runtime/queries}/cmake/injections.scm (100%) rename {queries => runtime/queries}/comment/highlights.scm (100%) rename {queries => runtime/queries}/commonlisp/folds.scm (100%) rename {queries => runtime/queries}/commonlisp/highlights.scm (100%) rename {queries => runtime/queries}/commonlisp/injections.scm (100%) rename {queries => runtime/queries}/commonlisp/locals.scm (100%) rename {queries => runtime/queries}/cooklang/highlights.scm (100%) rename {queries/capnp => runtime/queries/cooklang}/injections.scm (100%) rename {queries => runtime/queries}/corn/folds.scm (100%) rename {queries => runtime/queries}/corn/highlights.scm (100%) rename {queries => runtime/queries}/corn/indents.scm (100%) rename {queries/chatito => runtime/queries/corn}/injections.scm (100%) rename {queries => runtime/queries}/corn/locals.scm (100%) rename {queries => runtime/queries}/cpon/folds.scm (100%) rename {queries => runtime/queries}/cpon/highlights.scm (100%) rename {queries => runtime/queries}/cpon/indents.scm (100%) rename {queries/circom => runtime/queries/cpon}/injections.scm (100%) rename {queries => runtime/queries}/cpon/locals.scm (100%) rename {queries => runtime/queries}/cpp/folds.scm (100%) rename {queries => runtime/queries}/cpp/highlights.scm (100%) rename {queries => runtime/queries}/cpp/indents.scm (100%) rename {queries => runtime/queries}/cpp/injections.scm (79%) rename {queries => runtime/queries}/cpp/locals.scm (100%) rename {queries => runtime/queries}/css/folds.scm (100%) rename {queries => runtime/queries}/css/highlights.scm (100%) rename {queries => runtime/queries}/css/indents.scm (100%) rename {queries/clojure => runtime/queries/css}/injections.scm (100%) rename {queries => runtime/queries}/csv/highlights.scm (100%) rename {queries => runtime/queries}/cuda/folds.scm (100%) rename {queries => runtime/queries}/cuda/highlights.scm (100%) rename {queries => runtime/queries}/cuda/indents.scm (100%) rename {queries => runtime/queries}/cuda/injections.scm (100%) rename {queries => runtime/queries}/cuda/locals.scm (100%) rename {queries => runtime/queries}/cue/folds.scm (100%) rename {queries => runtime/queries}/cue/highlights.scm (100%) rename {queries => runtime/queries}/cue/indents.scm (100%) rename {queries/cooklang => runtime/queries/cue}/injections.scm (100%) rename {queries => runtime/queries}/cue/locals.scm (100%) rename {queries => runtime/queries}/cylc/folds.scm (100%) rename {queries => runtime/queries}/cylc/highlights.scm (100%) rename {queries => runtime/queries}/cylc/indents.scm (100%) rename {queries => runtime/queries}/cylc/injections.scm (100%) rename {queries => runtime/queries}/d/folds.scm (100%) rename {queries => runtime/queries}/d/highlights.scm (100%) rename {queries => runtime/queries}/d/indents.scm (100%) rename {queries => runtime/queries}/d/injections.scm (100%) rename {queries => runtime/queries}/d/locals.scm (100%) rename {queries => runtime/queries}/dart/folds.scm (100%) rename {queries => runtime/queries}/dart/highlights.scm (100%) rename {queries => runtime/queries}/dart/indents.scm (100%) rename {queries/corn => runtime/queries/dart}/injections.scm (100%) rename {queries => runtime/queries}/dart/locals.scm (100%) rename {queries => runtime/queries}/desktop/folds.scm (100%) rename {queries => runtime/queries}/desktop/highlights.scm (100%) rename {queries => runtime/queries}/desktop/injections.scm (100%) rename {queries => runtime/queries}/devicetree/folds.scm (100%) rename {queries => runtime/queries}/devicetree/highlights.scm (100%) rename {queries => runtime/queries}/devicetree/indents.scm (100%) rename {queries/cpon => runtime/queries/devicetree}/injections.scm (100%) rename {queries => runtime/queries}/devicetree/locals.scm (100%) rename {queries => runtime/queries}/dhall/folds.scm (100%) rename {queries => runtime/queries}/dhall/highlights.scm (100%) rename {queries => runtime/queries}/dhall/injections.scm (100%) rename {queries => runtime/queries}/diff/folds.scm (100%) rename {queries => runtime/queries}/diff/highlights.scm (100%) rename {queries/css => runtime/queries/diff}/injections.scm (100%) rename {queries => runtime/queries}/disassembly/highlights.scm (100%) rename {queries => runtime/queries}/disassembly/injections.scm (100%) rename {queries => runtime/queries}/djot/folds.scm (100%) rename {queries => runtime/queries}/djot/highlights.scm (100%) rename {queries => runtime/queries}/djot/indents.scm (100%) rename {queries => runtime/queries}/djot/injections.scm (100%) rename {queries => runtime/queries}/djot/locals.scm (100%) rename {queries => runtime/queries}/dockerfile/highlights.scm (100%) rename {queries => runtime/queries}/dockerfile/injections.scm (100%) rename {queries => runtime/queries}/dot/highlights.scm (100%) rename {queries => runtime/queries}/dot/indents.scm (100%) rename {queries => runtime/queries}/dot/injections.scm (100%) rename {queries => runtime/queries}/doxygen/highlights.scm (100%) rename {queries => runtime/queries}/doxygen/indents.scm (100%) rename {queries => runtime/queries}/doxygen/injections.scm (100%) rename {queries => runtime/queries}/dtd/folds.scm (100%) rename {queries => runtime/queries}/dtd/highlights.scm (100%) rename {queries => runtime/queries}/dtd/injections.scm (100%) rename {queries => runtime/queries}/dtd/locals.scm (100%) rename {queries => runtime/queries}/earthfile/highlights.scm (100%) rename {queries => runtime/queries}/earthfile/injections.scm (100%) rename {queries => runtime/queries}/ebnf/highlights.scm (100%) rename {queries/cue => runtime/queries/ebnf}/injections.scm (100%) rename {queries => runtime/queries}/ecma/folds.scm (100%) rename {queries => runtime/queries}/ecma/highlights.scm (100%) rename {queries => runtime/queries}/ecma/indents.scm (100%) rename {queries => runtime/queries}/ecma/injections.scm (100%) rename {queries => runtime/queries}/ecma/locals.scm (100%) rename {queries => runtime/queries}/editorconfig/folds.scm (100%) rename {queries => runtime/queries}/editorconfig/highlights.scm (100%) rename {queries/dart => runtime/queries/editorconfig}/injections.scm (100%) rename {queries => runtime/queries}/eds/folds.scm (100%) rename {queries => runtime/queries}/eds/highlights.scm (100%) rename {queries => runtime/queries}/eex/highlights.scm (100%) rename {queries => runtime/queries}/eex/injections.scm (100%) rename {queries => runtime/queries}/elixir/folds.scm (100%) rename {queries => runtime/queries}/elixir/highlights.scm (100%) rename {queries => runtime/queries}/elixir/indents.scm (100%) rename {queries => runtime/queries}/elixir/injections.scm (100%) rename {queries => runtime/queries}/elixir/locals.scm (100%) rename {queries => runtime/queries}/elm/folds.scm (100%) rename {queries => runtime/queries}/elm/highlights.scm (100%) rename {queries => runtime/queries}/elm/injections.scm (100%) rename {queries => runtime/queries}/elsa/folds.scm (100%) rename {queries => runtime/queries}/elsa/highlights.scm (100%) rename {queries => runtime/queries}/elsa/indents.scm (100%) rename {queries/devicetree => runtime/queries/elsa}/injections.scm (100%) rename {queries => runtime/queries}/elsa/locals.scm (100%) rename {queries => runtime/queries}/elvish/highlights.scm (100%) rename {queries/diff => runtime/queries/elvish}/injections.scm (100%) rename {queries => runtime/queries}/embedded_template/highlights.scm (100%) rename {queries => runtime/queries}/embedded_template/injections.scm (100%) rename {queries => runtime/queries}/enforce/folds.scm (100%) rename {queries => runtime/queries}/enforce/highlights.scm (100%) rename {queries => runtime/queries}/enforce/indents.scm (100%) rename {queries => runtime/queries}/enforce/injections.scm (100%) rename {queries => runtime/queries}/enforce/locals.scm (100%) rename {queries => runtime/queries}/erlang/folds.scm (100%) rename {queries => runtime/queries}/erlang/highlights.scm (100%) rename {queries/ebnf => runtime/queries/erlang}/injections.scm (100%) rename {queries => runtime/queries}/facility/folds.scm (100%) rename {queries => runtime/queries}/facility/highlights.scm (100%) rename {queries => runtime/queries}/facility/indents.scm (100%) rename {queries => runtime/queries}/facility/injections.scm (100%) rename {queries => runtime/queries}/faust/highlights.scm (100%) rename {queries/editorconfig => runtime/queries/faust}/injections.scm (100%) rename {queries => runtime/queries}/fennel/folds.scm (100%) rename {queries => runtime/queries}/fennel/highlights.scm (100%) rename {queries => runtime/queries}/fennel/injections.scm (100%) rename {queries => runtime/queries}/fennel/locals.scm (100%) rename {queries => runtime/queries}/fidl/folds.scm (100%) rename {queries => runtime/queries}/fidl/highlights.scm (100%) rename {queries/elsa => runtime/queries/fidl}/injections.scm (100%) rename {queries => runtime/queries}/firrtl/folds.scm (100%) rename {queries => runtime/queries}/firrtl/highlights.scm (100%) rename {queries => runtime/queries}/firrtl/indents.scm (100%) rename {queries/elvish => runtime/queries/firrtl}/injections.scm (100%) rename {queries => runtime/queries}/firrtl/locals.scm (100%) rename {queries => runtime/queries}/fish/folds.scm (100%) rename {queries => runtime/queries}/fish/highlights.scm (100%) rename {queries => runtime/queries}/fish/indents.scm (100%) rename {queries/erlang => runtime/queries/fish}/injections.scm (100%) rename {queries => runtime/queries}/fish/locals.scm (100%) rename {queries => runtime/queries}/foam/folds.scm (100%) rename {queries => runtime/queries}/foam/highlights.scm (100%) rename {queries => runtime/queries}/foam/indents.scm (100%) rename {queries => runtime/queries}/foam/injections.scm (100%) rename {queries => runtime/queries}/foam/locals.scm (100%) rename {queries => runtime/queries}/forth/folds.scm (100%) rename {queries => runtime/queries}/forth/highlights.scm (100%) rename {queries => runtime/queries}/forth/indents.scm (100%) rename {queries/faust => runtime/queries/forth}/injections.scm (100%) rename {queries => runtime/queries}/forth/locals.scm (100%) rename {queries => runtime/queries}/fortran/folds.scm (100%) rename {queries => runtime/queries}/fortran/highlights.scm (100%) rename {queries => runtime/queries}/fortran/indents.scm (100%) rename {queries/fidl => runtime/queries/fortran}/injections.scm (100%) rename {queries => runtime/queries}/fsh/highlights.scm (100%) rename {queries => runtime/queries}/fsh/injections.scm (100%) rename {queries => runtime/queries}/fsharp/highlights.scm (100%) rename {queries => runtime/queries}/fsharp/injections.scm (100%) rename {queries => runtime/queries}/func/highlights.scm (100%) rename {queries/firrtl => runtime/queries/func}/injections.scm (100%) rename {queries => runtime/queries}/fusion/folds.scm (100%) rename {queries => runtime/queries}/fusion/highlights.scm (100%) rename {queries => runtime/queries}/fusion/indents.scm (100%) rename {queries => runtime/queries}/fusion/injections.scm (100%) rename {queries => runtime/queries}/fusion/locals.scm (100%) rename {queries => runtime/queries}/gap/folds.scm (100%) rename {queries => runtime/queries}/gap/highlights.scm (100%) rename {queries/fish => runtime/queries/gap}/injections.scm (100%) rename {queries => runtime/queries}/gap/locals.scm (100%) rename {queries => runtime/queries}/gaptst/folds.scm (100%) rename {queries => runtime/queries}/gaptst/highlights.scm (100%) rename {queries => runtime/queries}/gaptst/injections.scm (100%) rename {queries => runtime/queries}/gdscript/folds.scm (100%) rename {queries => runtime/queries}/gdscript/highlights.scm (100%) rename {queries => runtime/queries}/gdscript/indents.scm (100%) rename {queries/forth => runtime/queries/gdscript}/injections.scm (100%) rename {queries => runtime/queries}/gdscript/locals.scm (100%) rename {queries => runtime/queries}/gdshader/highlights.scm (100%) rename {queries/fortran => runtime/queries/gdshader}/injections.scm (100%) rename {queries => runtime/queries}/git_config/folds.scm (100%) rename {queries => runtime/queries}/git_config/highlights.scm (100%) rename {queries => runtime/queries}/git_config/injections.scm (100%) rename {queries => runtime/queries}/git_rebase/highlights.scm (100%) rename {queries => runtime/queries}/git_rebase/injections.scm (100%) rename {queries => runtime/queries}/gitattributes/highlights.scm (100%) rename {queries/func => runtime/queries/gitattributes}/injections.scm (100%) rename {queries => runtime/queries}/gitattributes/locals.scm (100%) rename {queries => runtime/queries}/gitcommit/highlights.scm (100%) rename {queries => runtime/queries}/gitcommit/injections.scm (100%) rename {queries => runtime/queries}/gitignore/highlights.scm (100%) rename {queries/gap => runtime/queries/gitignore}/injections.scm (100%) rename {queries => runtime/queries}/gleam/folds.scm (100%) rename {queries => runtime/queries}/gleam/highlights.scm (100%) rename {queries => runtime/queries}/gleam/indents.scm (100%) rename {queries => runtime/queries}/gleam/injections.scm (100%) rename {queries => runtime/queries}/gleam/locals.scm (100%) rename {queries => runtime/queries}/glimmer/folds.scm (100%) rename {queries => runtime/queries}/glimmer/highlights.scm (100%) rename {queries => runtime/queries}/glimmer/indents.scm (100%) rename {queries => runtime/queries}/glimmer/injections.scm (100%) rename {queries => runtime/queries}/glimmer/locals.scm (100%) rename {queries => runtime/queries}/glimmer_javascript/highlights.scm (100%) rename {queries => runtime/queries}/glimmer_javascript/indents.scm (100%) rename {queries => runtime/queries}/glimmer_javascript/injections.scm (100%) rename {queries => runtime/queries}/glimmer_javascript/locals.scm (100%) rename {queries => runtime/queries}/glimmer_typescript/highlights.scm (100%) rename {queries => runtime/queries}/glimmer_typescript/indents.scm (100%) rename {queries => runtime/queries}/glimmer_typescript/injections.scm (100%) rename {queries => runtime/queries}/glsl/folds.scm (100%) rename {queries => runtime/queries}/glsl/highlights.scm (100%) rename {queries => runtime/queries}/glsl/indents.scm (100%) rename {queries => runtime/queries}/glsl/injections.scm (100%) rename {queries => runtime/queries}/glsl/locals.scm (100%) rename {queries => runtime/queries}/gn/folds.scm (100%) rename {queries => runtime/queries}/gn/highlights.scm (100%) rename {queries => runtime/queries}/gn/indents.scm (100%) rename {queries/gdscript => runtime/queries/gn}/injections.scm (100%) rename {queries => runtime/queries}/gn/locals.scm (100%) rename {queries => runtime/queries}/gnuplot/highlights.scm (100%) rename {queries/gdshader => runtime/queries/gnuplot}/injections.scm (100%) rename {queries => runtime/queries}/go/folds.scm (100%) rename {queries => runtime/queries}/go/highlights.scm (100%) rename {queries => runtime/queries}/go/indents.scm (100%) rename {queries => runtime/queries}/go/injections.scm (100%) rename {queries => runtime/queries}/go/locals.scm (100%) rename {queries => runtime/queries}/goctl/folds.scm (100%) rename {queries => runtime/queries}/goctl/highlights.scm (100%) rename {queries => runtime/queries}/goctl/indents.scm (100%) rename {queries => runtime/queries}/goctl/injections.scm (100%) rename {queries => runtime/queries}/godot_resource/folds.scm (100%) rename {queries => runtime/queries}/godot_resource/highlights.scm (100%) rename {queries/gitattributes => runtime/queries/godot_resource}/injections.scm (100%) rename {queries => runtime/queries}/godot_resource/locals.scm (100%) rename {queries => runtime/queries}/gomod/highlights.scm (100%) rename {queries/gitignore => runtime/queries/gomod}/injections.scm (100%) rename {queries => runtime/queries}/gosum/highlights.scm (100%) rename {queries => runtime/queries}/gotmpl/folds.scm (100%) rename {queries => runtime/queries}/gotmpl/highlights.scm (100%) rename {queries => runtime/queries}/gotmpl/injections.scm (100%) rename {queries => runtime/queries}/gotmpl/locals.scm (100%) rename {queries => runtime/queries}/gowork/highlights.scm (100%) rename {queries/gn => runtime/queries/gowork}/injections.scm (100%) rename {queries => runtime/queries}/gpg/highlights.scm (100%) rename {queries/gnuplot => runtime/queries/gpg}/injections.scm (100%) rename {queries => runtime/queries}/graphql/highlights.scm (100%) rename {queries => runtime/queries}/graphql/indents.scm (100%) rename {queries/godot_resource => runtime/queries/graphql}/injections.scm (100%) rename {queries => runtime/queries}/gren/highlights.scm (100%) rename {queries => runtime/queries}/gren/injections.scm (100%) rename {queries => runtime/queries}/groovy/folds.scm (100%) rename {queries => runtime/queries}/groovy/highlights.scm (100%) rename {queries => runtime/queries}/groovy/indents.scm (100%) rename {queries => runtime/queries}/groovy/injections.scm (100%) rename {queries => runtime/queries}/groovy/locals.scm (100%) rename {queries => runtime/queries}/gstlaunch/highlights.scm (100%) rename {queries => runtime/queries}/hack/highlights.scm (100%) rename {queries => runtime/queries}/hack/injections.scm (100%) rename {queries => runtime/queries}/hare/folds.scm (100%) rename {queries => runtime/queries}/hare/highlights.scm (100%) rename {queries => runtime/queries}/hare/indents.scm (100%) rename {queries => runtime/queries}/hare/injections.scm (100%) rename {queries => runtime/queries}/hare/locals.scm (100%) rename {queries => runtime/queries}/haskell/folds.scm (100%) rename {queries => runtime/queries}/haskell/highlights.scm (100%) rename {queries => runtime/queries}/haskell/injections.scm (100%) rename {queries => runtime/queries}/haskell/locals.scm (100%) rename {queries => runtime/queries}/haskell_persistent/folds.scm (100%) rename {queries => runtime/queries}/haskell_persistent/highlights.scm (100%) rename {queries => runtime/queries}/hcl/folds.scm (100%) rename {queries => runtime/queries}/hcl/highlights.scm (100%) rename {queries => runtime/queries}/hcl/indents.scm (100%) rename {queries => runtime/queries}/hcl/injections.scm (100%) rename {queries => runtime/queries}/heex/folds.scm (100%) rename {queries => runtime/queries}/heex/highlights.scm (100%) rename {queries => runtime/queries}/heex/indents.scm (100%) rename {queries => runtime/queries}/heex/injections.scm (100%) rename {queries => runtime/queries}/heex/locals.scm (100%) rename {queries => runtime/queries}/helm/folds.scm (100%) rename {queries => runtime/queries}/helm/highlights.scm (100%) rename {queries => runtime/queries}/helm/injections.scm (100%) rename {queries => runtime/queries}/helm/locals.scm (100%) rename {queries => runtime/queries}/hjson/folds.scm (100%) rename {queries => runtime/queries}/hjson/highlights.scm (100%) rename {queries => runtime/queries}/hjson/indents.scm (100%) rename {queries/gomod => runtime/queries/hjson}/injections.scm (100%) rename {queries => runtime/queries}/hjson/locals.scm (100%) rename {queries => runtime/queries}/hlsl/folds.scm (100%) rename {queries => runtime/queries}/hlsl/highlights.scm (100%) rename {queries => runtime/queries}/hlsl/indents.scm (100%) rename {queries => runtime/queries}/hlsl/injections.scm (100%) rename {queries => runtime/queries}/hlsl/locals.scm (100%) rename {queries => runtime/queries}/hlsplaylist/highlights.scm (100%) rename {queries/gowork => runtime/queries/hlsplaylist}/injections.scm (100%) rename {queries => runtime/queries}/hocon/folds.scm (100%) rename {queries => runtime/queries}/hocon/highlights.scm (100%) rename {queries/gpg => runtime/queries/hocon}/injections.scm (100%) rename {queries => runtime/queries}/hoon/folds.scm (100%) rename {queries => runtime/queries}/hoon/highlights.scm (100%) rename {queries => runtime/queries}/hoon/injections.scm (100%) rename {queries => runtime/queries}/hoon/locals.scm (100%) rename {queries => runtime/queries}/html/folds.scm (100%) rename {queries => runtime/queries}/html/highlights.scm (100%) rename {queries => runtime/queries}/html/indents.scm (100%) rename {queries => runtime/queries}/html/injections.scm (100%) rename {queries => runtime/queries}/html/locals.scm (100%) rename {queries => runtime/queries}/html_tags/highlights.scm (100%) rename {queries => runtime/queries}/html_tags/indents.scm (100%) rename {queries => runtime/queries}/html_tags/injections.scm (100%) rename {queries => runtime/queries}/htmldjango/folds.scm (100%) rename {queries => runtime/queries}/htmldjango/highlights.scm (100%) rename {queries => runtime/queries}/htmldjango/indents.scm (100%) rename {queries => runtime/queries}/htmldjango/injections.scm (100%) rename {queries => runtime/queries}/http/folds.scm (100%) rename {queries => runtime/queries}/http/highlights.scm (100%) rename {queries => runtime/queries}/http/injections.scm (100%) rename {queries => runtime/queries}/hurl/folds.scm (100%) rename {queries => runtime/queries}/hurl/highlights.scm (100%) rename {queries => runtime/queries}/hurl/indents.scm (100%) rename {queries => runtime/queries}/hurl/injections.scm (100%) rename {queries => runtime/queries}/hyprlang/folds.scm (100%) rename {queries => runtime/queries}/hyprlang/highlights.scm (100%) rename {queries => runtime/queries}/hyprlang/indents.scm (100%) rename {queries => runtime/queries}/hyprlang/injections.scm (100%) rename {queries => runtime/queries}/idl/highlights.scm (100%) rename {queries => runtime/queries}/idl/indents.scm (100%) rename {queries => runtime/queries}/idl/injections.scm (100%) rename {queries => runtime/queries}/idris/folds.scm (100%) rename {queries => runtime/queries}/idris/highlights.scm (100%) rename {queries/graphql => runtime/queries/idris}/injections.scm (100%) rename {queries => runtime/queries}/idris/locals.scm (100%) rename {queries => runtime/queries}/ini/folds.scm (100%) rename {queries => runtime/queries}/ini/highlights.scm (100%) rename {queries => runtime/queries}/ini/injections.scm (100%) rename {queries => runtime/queries}/inko/folds.scm (100%) rename {queries => runtime/queries}/inko/highlights.scm (100%) rename {queries => runtime/queries}/inko/indents.scm (100%) rename {queries => runtime/queries}/inko/injections.scm (100%) rename {queries => runtime/queries}/inko/locals.scm (100%) rename {queries => runtime/queries}/ipkg/folds.scm (100%) rename {queries => runtime/queries}/ipkg/highlights.scm (100%) rename {queries => runtime/queries}/ipkg/indents.scm (100%) rename {queries => runtime/queries}/ipkg/injections.scm (100%) rename {queries => runtime/queries}/ipkg/locals.scm (100%) rename {queries => runtime/queries}/ispc/folds.scm (100%) rename {queries => runtime/queries}/ispc/highlights.scm (100%) rename {queries => runtime/queries}/ispc/indents.scm (100%) rename {queries => runtime/queries}/ispc/injections.scm (100%) rename {queries => runtime/queries}/ispc/locals.scm (100%) rename {queries => runtime/queries}/janet_simple/folds.scm (100%) rename {queries => runtime/queries}/janet_simple/highlights.scm (100%) rename {queries/hjson => runtime/queries/janet_simple}/injections.scm (100%) rename {queries => runtime/queries}/janet_simple/locals.scm (100%) rename {queries => runtime/queries}/java/folds.scm (100%) rename {queries => runtime/queries}/java/highlights.scm (100%) rename {queries => runtime/queries}/java/indents.scm (100%) rename {queries => runtime/queries}/java/injections.scm (100%) rename {queries => runtime/queries}/java/locals.scm (100%) rename {queries => runtime/queries}/javadoc/highlights.scm (100%) rename {queries => runtime/queries}/javadoc/indents.scm (100%) rename {queries => runtime/queries}/javadoc/injections.scm (100%) rename {queries => runtime/queries}/javascript/folds.scm (100%) rename {queries => runtime/queries}/javascript/highlights.scm (100%) rename {queries => runtime/queries}/javascript/indents.scm (100%) rename {queries => runtime/queries}/javascript/injections.scm (100%) rename {queries => runtime/queries}/javascript/locals.scm (100%) rename {queries => runtime/queries}/jinja/highlights.scm (100%) rename {queries => runtime/queries}/jinja/injections.scm (100%) rename {queries => runtime/queries}/jinja_inline/highlights.scm (100%) rename {queries/hlsplaylist => runtime/queries/jinja_inline}/injections.scm (100%) rename {queries => runtime/queries}/jq/highlights.scm (100%) rename {queries => runtime/queries}/jq/injections.scm (100%) rename {queries => runtime/queries}/jq/locals.scm (100%) rename {queries => runtime/queries}/jsdoc/highlights.scm (100%) rename {queries => runtime/queries}/json/folds.scm (100%) rename {queries => runtime/queries}/json/highlights.scm (100%) rename {queries => runtime/queries}/json/indents.scm (100%) rename {queries => runtime/queries}/json/locals.scm (100%) rename {queries => runtime/queries}/json5/highlights.scm (100%) rename {queries/hocon => runtime/queries/json5}/injections.scm (100%) rename {queries => runtime/queries}/jsonc/folds.scm (100%) rename {queries => runtime/queries}/jsonc/highlights.scm (100%) rename {queries => runtime/queries}/jsonc/indents.scm (100%) rename {queries/idris => runtime/queries/jsonc}/injections.scm (100%) rename {queries => runtime/queries}/jsonc/locals.scm (100%) rename {queries => runtime/queries}/jsonnet/folds.scm (100%) rename {queries => runtime/queries}/jsonnet/highlights.scm (100%) rename {queries/janet_simple => runtime/queries/jsonnet}/injections.scm (100%) rename {queries => runtime/queries}/jsonnet/locals.scm (100%) rename {queries => runtime/queries}/jsx/folds.scm (100%) rename {queries => runtime/queries}/jsx/highlights.scm (100%) rename {queries => runtime/queries}/jsx/indents.scm (100%) rename {queries => runtime/queries}/jsx/injections.scm (100%) rename {queries => runtime/queries}/julia/folds.scm (100%) rename {queries => runtime/queries}/julia/highlights.scm (100%) rename {queries => runtime/queries}/julia/indents.scm (100%) rename {queries => runtime/queries}/julia/injections.scm (100%) rename {queries => runtime/queries}/julia/locals.scm (100%) rename {queries => runtime/queries}/just/folds.scm (100%) rename {queries => runtime/queries}/just/highlights.scm (100%) rename {queries => runtime/queries}/just/indents.scm (100%) rename {queries => runtime/queries}/just/injections.scm (100%) rename {queries => runtime/queries}/just/locals.scm (100%) rename {queries => runtime/queries}/kcl/folds.scm (100%) rename {queries => runtime/queries}/kcl/highlights.scm (100%) rename {queries => runtime/queries}/kcl/injections.scm (100%) rename {queries => runtime/queries}/kconfig/folds.scm (100%) rename {queries => runtime/queries}/kconfig/highlights.scm (100%) rename {queries => runtime/queries}/kconfig/indents.scm (100%) rename {queries/jinja_inline => runtime/queries/kconfig}/injections.scm (100%) rename {queries => runtime/queries}/kconfig/locals.scm (100%) rename {queries => runtime/queries}/kdl/folds.scm (100%) rename {queries => runtime/queries}/kdl/highlights.scm (100%) rename {queries => runtime/queries}/kdl/indents.scm (100%) rename {queries => runtime/queries}/kdl/injections.scm (100%) rename {queries => runtime/queries}/kdl/locals.scm (100%) rename {queries => runtime/queries}/kotlin/folds.scm (100%) rename {queries => runtime/queries}/kotlin/highlights.scm (100%) rename {queries => runtime/queries}/kotlin/injections.scm (100%) rename {queries => runtime/queries}/kotlin/locals.scm (100%) rename {queries => runtime/queries}/koto/folds.scm (100%) rename {queries => runtime/queries}/koto/highlights.scm (100%) rename {queries/json5 => runtime/queries/koto}/injections.scm (100%) rename {queries => runtime/queries}/koto/locals.scm (100%) rename {queries => runtime/queries}/kusto/highlights.scm (100%) rename {queries/jsonc => runtime/queries/kusto}/injections.scm (100%) rename {queries => runtime/queries}/lalrpop/folds.scm (100%) rename {queries => runtime/queries}/lalrpop/highlights.scm (100%) rename {queries => runtime/queries}/lalrpop/injections.scm (100%) rename {queries => runtime/queries}/lalrpop/locals.scm (100%) rename {queries => runtime/queries}/latex/folds.scm (100%) rename {queries => runtime/queries}/latex/highlights.scm (100%) rename {queries => runtime/queries}/latex/injections.scm (100%) rename {queries => runtime/queries}/ledger/folds.scm (100%) rename {queries => runtime/queries}/ledger/highlights.scm (100%) rename {queries => runtime/queries}/ledger/indents.scm (100%) rename {queries => runtime/queries}/ledger/injections.scm (100%) rename {queries => runtime/queries}/leo/highlights.scm (100%) rename {queries => runtime/queries}/leo/indents.scm (100%) rename {queries/jsonnet => runtime/queries/leo}/injections.scm (100%) rename {queries => runtime/queries}/linkerscript/folds.scm (100%) rename {queries => runtime/queries}/linkerscript/highlights.scm (100%) rename {queries => runtime/queries}/linkerscript/indents.scm (100%) rename {queries => runtime/queries}/linkerscript/injections.scm (100%) rename {queries => runtime/queries}/linkerscript/locals.scm (100%) rename {queries => runtime/queries}/liquid/highlights.scm (100%) rename {queries => runtime/queries}/liquid/injections.scm (100%) rename {queries => runtime/queries}/liquidsoap/folds.scm (100%) rename {queries => runtime/queries}/liquidsoap/highlights.scm (100%) rename {queries => runtime/queries}/liquidsoap/indents.scm (100%) rename {queries/kconfig => runtime/queries/liquidsoap}/injections.scm (100%) rename {queries => runtime/queries}/liquidsoap/locals.scm (100%) rename {queries => runtime/queries}/llvm/highlights.scm (100%) rename {queries/koto => runtime/queries/llvm}/injections.scm (100%) rename {queries => runtime/queries}/lua/folds.scm (100%) rename {queries => runtime/queries}/lua/highlights.scm (100%) rename {queries => runtime/queries}/lua/indents.scm (100%) rename {queries => runtime/queries}/lua/injections.scm (100%) rename {queries => runtime/queries}/lua/locals.scm (100%) rename {queries => runtime/queries}/luadoc/highlights.scm (100%) rename {queries => runtime/queries}/luap/highlights.scm (100%) rename {queries => runtime/queries}/luau/folds.scm (100%) rename {queries => runtime/queries}/luau/highlights.scm (100%) rename {queries => runtime/queries}/luau/indents.scm (100%) rename {queries => runtime/queries}/luau/injections.scm (100%) rename {queries => runtime/queries}/luau/locals.scm (100%) rename {queries => runtime/queries}/m68k/folds.scm (100%) rename {queries => runtime/queries}/m68k/highlights.scm (100%) rename {queries/kusto => runtime/queries/m68k}/injections.scm (100%) rename {queries => runtime/queries}/m68k/locals.scm (100%) rename {queries => runtime/queries}/make/folds.scm (100%) rename {queries => runtime/queries}/make/highlights.scm (100%) rename {queries => runtime/queries}/make/injections.scm (100%) rename {queries => runtime/queries}/markdown/folds.scm (100%) rename {queries => runtime/queries}/markdown/highlights.scm (100%) rename {queries => runtime/queries}/markdown/indents.scm (100%) rename {queries => runtime/queries}/markdown/injections.scm (100%) rename {queries => runtime/queries}/markdown_inline/highlights.scm (100%) rename {queries => runtime/queries}/markdown_inline/injections.scm (100%) rename {queries => runtime/queries}/matlab/folds.scm (100%) rename {queries => runtime/queries}/matlab/highlights.scm (100%) rename {queries => runtime/queries}/matlab/indents.scm (100%) rename {queries/leo => runtime/queries/matlab}/injections.scm (100%) rename {queries => runtime/queries}/matlab/locals.scm (100%) rename {queries => runtime/queries}/menhir/highlights.scm (100%) rename {queries => runtime/queries}/menhir/injections.scm (100%) rename {queries => runtime/queries}/mermaid/folds.scm (100%) rename {queries => runtime/queries}/mermaid/highlights.scm (100%) rename {queries => runtime/queries}/mermaid/indents.scm (100%) rename {queries/liquidsoap => runtime/queries/mermaid}/injections.scm (100%) rename {queries => runtime/queries}/meson/folds.scm (100%) rename {queries => runtime/queries}/meson/highlights.scm (100%) rename {queries => runtime/queries}/meson/indents.scm (100%) rename {queries/llvm => runtime/queries/meson}/injections.scm (100%) rename {queries => runtime/queries}/mlir/highlights.scm (100%) rename {queries/m68k => runtime/queries/mlir}/injections.scm (100%) rename {queries => runtime/queries}/mlir/locals.scm (100%) rename {queries => runtime/queries}/muttrc/highlights.scm (100%) rename {queries => runtime/queries}/muttrc/injections.scm (100%) rename {queries => runtime/queries}/nasm/highlights.scm (100%) rename {queries/matlab => runtime/queries/nasm}/injections.scm (100%) rename {queries => runtime/queries}/nginx/folds.scm (100%) rename {queries => runtime/queries}/nginx/highlights.scm (100%) rename {queries/mermaid => runtime/queries/nginx}/injections.scm (100%) rename {queries => runtime/queries}/nickel/highlights.scm (100%) rename {queries => runtime/queries}/nickel/indents.scm (100%) rename {queries/meson => runtime/queries/nickel}/injections.scm (100%) rename {queries => runtime/queries}/nim/folds.scm (100%) rename {queries => runtime/queries}/nim/highlights.scm (100%) rename {queries => runtime/queries}/nim/injections.scm (100%) rename {queries => runtime/queries}/nim/locals.scm (100%) rename {queries => runtime/queries}/nim_format_string/highlights.scm (100%) rename {queries => runtime/queries}/nim_format_string/injections.scm (100%) rename {queries => runtime/queries}/ninja/folds.scm (100%) rename {queries => runtime/queries}/ninja/highlights.scm (100%) rename {queries => runtime/queries}/ninja/indents.scm (100%) rename {queries/mlir => runtime/queries/ninja}/injections.scm (100%) rename {queries => runtime/queries}/nix/folds.scm (100%) rename {queries => runtime/queries}/nix/highlights.scm (100%) rename {queries => runtime/queries}/nix/indents.scm (100%) rename {queries => runtime/queries}/nix/injections.scm (100%) rename {queries => runtime/queries}/nix/locals.scm (100%) rename {queries => runtime/queries}/nqc/folds.scm (100%) rename {queries => runtime/queries}/nqc/highlights.scm (100%) rename {queries => runtime/queries}/nqc/indents.scm (100%) rename {queries => runtime/queries}/nqc/injections.scm (100%) rename {queries => runtime/queries}/nqc/locals.scm (100%) rename {queries => runtime/queries}/nu/folds.scm (100%) rename {queries => runtime/queries}/nu/highlights.scm (100%) rename {queries => runtime/queries}/nu/indents.scm (100%) rename {queries => runtime/queries}/nu/injections.scm (100%) rename {queries => runtime/queries}/objc/folds.scm (100%) rename {queries => runtime/queries}/objc/highlights.scm (100%) rename {queries => runtime/queries}/objc/indents.scm (100%) rename {queries => runtime/queries}/objc/injections.scm (100%) rename {queries => runtime/queries}/objc/locals.scm (100%) rename {queries => runtime/queries}/objdump/highlights.scm (100%) rename {queries => runtime/queries}/objdump/injections.scm (100%) rename {queries => runtime/queries}/ocaml/folds.scm (100%) rename {queries => runtime/queries}/ocaml/highlights.scm (100%) rename {queries => runtime/queries}/ocaml/indents.scm (100%) rename {queries/nasm => runtime/queries/ocaml}/injections.scm (100%) rename {queries => runtime/queries}/ocaml/locals.scm (100%) rename {queries => runtime/queries}/ocaml_interface/folds.scm (100%) rename {queries => runtime/queries}/ocaml_interface/highlights.scm (100%) rename {queries => runtime/queries}/ocaml_interface/indents.scm (100%) rename {queries => runtime/queries}/ocaml_interface/injections.scm (100%) rename {queries => runtime/queries}/ocaml_interface/locals.scm (100%) rename {queries => runtime/queries}/ocamllex/highlights.scm (100%) rename {queries => runtime/queries}/ocamllex/injections.scm (100%) rename {queries => runtime/queries}/odin/folds.scm (100%) rename {queries => runtime/queries}/odin/highlights.scm (100%) rename {queries => runtime/queries}/odin/indents.scm (100%) rename {queries/nginx => runtime/queries/odin}/injections.scm (100%) rename {queries => runtime/queries}/odin/locals.scm (100%) rename {queries => runtime/queries}/pascal/folds.scm (100%) rename {queries => runtime/queries}/pascal/highlights.scm (100%) rename {queries => runtime/queries}/pascal/indents.scm (100%) rename {queries => runtime/queries}/pascal/injections.scm (100%) rename {queries => runtime/queries}/pascal/locals.scm (100%) rename {queries => runtime/queries}/passwd/highlights.scm (100%) rename {queries => runtime/queries}/pem/folds.scm (100%) rename {queries => runtime/queries}/pem/highlights.scm (100%) rename {queries/nickel => runtime/queries/pem}/injections.scm (100%) rename {queries => runtime/queries}/perl/folds.scm (100%) rename {queries => runtime/queries}/perl/highlights.scm (100%) rename {queries => runtime/queries}/perl/injections.scm (100%) rename {queries => runtime/queries}/php/folds.scm (100%) rename {queries => runtime/queries}/php/highlights.scm (100%) rename {queries => runtime/queries}/php/indents.scm (100%) rename {queries => runtime/queries}/php/injections.scm (100%) rename {queries => runtime/queries}/php/locals.scm (100%) rename {queries => runtime/queries}/php_only/folds.scm (100%) rename {queries => runtime/queries}/php_only/highlights.scm (100%) rename {queries => runtime/queries}/php_only/indents.scm (100%) rename {queries => runtime/queries}/php_only/injections.scm (100%) rename {queries => runtime/queries}/php_only/locals.scm (100%) rename {queries => runtime/queries}/phpdoc/highlights.scm (100%) rename {queries => runtime/queries}/pioasm/highlights.scm (100%) rename {queries => runtime/queries}/pioasm/injections.scm (100%) rename {queries => runtime/queries}/po/folds.scm (100%) rename {queries => runtime/queries}/po/highlights.scm (100%) rename {queries/ninja => runtime/queries/po}/injections.scm (100%) rename {queries => runtime/queries}/pod/highlights.scm (100%) rename {queries => runtime/queries}/poe_filter/folds.scm (100%) rename {queries => runtime/queries}/poe_filter/highlights.scm (100%) rename {queries => runtime/queries}/poe_filter/indents.scm (100%) rename {queries/ocaml => runtime/queries/poe_filter}/injections.scm (100%) rename {queries => runtime/queries}/pony/folds.scm (100%) rename {queries => runtime/queries}/pony/highlights.scm (100%) rename {queries => runtime/queries}/pony/indents.scm (100%) rename {queries => runtime/queries}/pony/injections.scm (100%) rename {queries => runtime/queries}/pony/locals.scm (100%) rename {queries => runtime/queries}/powershell/folds.scm (100%) rename {queries => runtime/queries}/powershell/highlights.scm (100%) rename {queries => runtime/queries}/powershell/indents.scm (100%) rename {queries => runtime/queries}/powershell/injections.scm (100%) rename {queries => runtime/queries}/powershell/locals.scm (100%) rename {queries => runtime/queries}/printf/highlights.scm (100%) rename {queries => runtime/queries}/prisma/folds.scm (100%) rename {queries => runtime/queries}/prisma/highlights.scm (100%) rename {queries => runtime/queries}/prisma/injections.scm (100%) rename {queries => runtime/queries}/problog/folds.scm (100%) rename {queries => runtime/queries}/problog/highlights.scm (100%) rename {queries => runtime/queries}/problog/indents.scm (100%) rename {queries => runtime/queries}/problog/injections.scm (100%) rename {queries => runtime/queries}/prolog/folds.scm (100%) rename {queries => runtime/queries}/prolog/highlights.scm (100%) rename {queries => runtime/queries}/prolog/indents.scm (100%) rename {queries/odin => runtime/queries/prolog}/injections.scm (100%) rename {queries => runtime/queries}/promql/highlights.scm (100%) rename {queries => runtime/queries}/promql/injections.scm (100%) rename {queries => runtime/queries}/properties/highlights.scm (100%) rename {queries/pem => runtime/queries/properties}/injections.scm (100%) rename {queries => runtime/queries}/properties/locals.scm (100%) rename {queries => runtime/queries}/proto/folds.scm (100%) rename {queries => runtime/queries}/proto/highlights.scm (100%) rename {queries => runtime/queries}/proto/indents.scm (100%) rename {queries/po => runtime/queries/proto}/injections.scm (100%) rename {queries => runtime/queries}/prql/highlights.scm (100%) rename {queries => runtime/queries}/prql/injections.scm (100%) rename {queries => runtime/queries}/psv/highlights.scm (100%) rename {queries => runtime/queries}/pug/highlights.scm (100%) rename {queries => runtime/queries}/pug/injections.scm (100%) rename {queries => runtime/queries}/puppet/folds.scm (100%) rename {queries => runtime/queries}/puppet/highlights.scm (100%) rename {queries => runtime/queries}/puppet/indents.scm (100%) rename {queries => runtime/queries}/puppet/injections.scm (100%) rename {queries => runtime/queries}/puppet/locals.scm (100%) rename {queries => runtime/queries}/purescript/highlights.scm (100%) rename {queries/poe_filter => runtime/queries/purescript}/injections.scm (100%) rename {queries => runtime/queries}/purescript/locals.scm (100%) rename {queries => runtime/queries}/pymanifest/highlights.scm (100%) rename {queries/prolog => runtime/queries/pymanifest}/injections.scm (100%) rename {queries => runtime/queries}/python/folds.scm (100%) rename {queries => runtime/queries}/python/highlights.scm (100%) rename {queries => runtime/queries}/python/indents.scm (100%) rename {queries => runtime/queries}/python/injections.scm (100%) rename {queries => runtime/queries}/python/locals.scm (100%) rename {queries => runtime/queries}/ql/folds.scm (100%) rename {queries => runtime/queries}/ql/highlights.scm (100%) rename {queries => runtime/queries}/ql/indents.scm (100%) rename {queries => runtime/queries}/ql/injections.scm (100%) rename {queries => runtime/queries}/ql/locals.scm (100%) rename {queries => runtime/queries}/qmldir/highlights.scm (100%) rename {queries/properties => runtime/queries/qmldir}/injections.scm (100%) rename {queries => runtime/queries}/qmljs/folds.scm (100%) rename {queries => runtime/queries}/qmljs/highlights.scm (100%) rename {queries => runtime/queries}/qmljs/injections.scm (100%) rename {queries => runtime/queries}/query/folds.scm (100%) rename {queries => runtime/queries}/query/highlights.scm (100%) rename {queries => runtime/queries}/query/indents.scm (100%) rename {queries => runtime/queries}/query/injections.scm (100%) rename {queries => runtime/queries}/query/locals.scm (100%) rename {queries => runtime/queries}/r/highlights.scm (100%) rename {queries => runtime/queries}/r/indents.scm (100%) rename {queries/proto => runtime/queries/r}/injections.scm (100%) rename {queries => runtime/queries}/r/locals.scm (100%) rename {queries => runtime/queries}/racket/folds.scm (100%) rename {queries => runtime/queries}/racket/highlights.scm (100%) rename {queries => runtime/queries}/racket/injections.scm (100%) rename {queries => runtime/queries}/ralph/highlights.scm (100%) rename {queries => runtime/queries}/ralph/injections.scm (100%) rename {queries => runtime/queries}/rasi/folds.scm (100%) rename {queries => runtime/queries}/rasi/highlights.scm (100%) rename {queries => runtime/queries}/rasi/indents.scm (100%) rename {queries/purescript => runtime/queries/rasi}/injections.scm (100%) rename {queries => runtime/queries}/rasi/locals.scm (100%) rename {queries => runtime/queries}/razor/folds.scm (100%) rename {queries => runtime/queries}/razor/highlights.scm (100%) rename {queries => runtime/queries}/razor/injections.scm (100%) rename {queries => runtime/queries}/rbs/folds.scm (100%) rename {queries => runtime/queries}/rbs/highlights.scm (100%) rename {queries => runtime/queries}/rbs/indents.scm (100%) rename {queries/pymanifest => runtime/queries/rbs}/injections.scm (100%) rename {queries => runtime/queries}/re2c/folds.scm (100%) rename {queries => runtime/queries}/re2c/highlights.scm (100%) rename {queries => runtime/queries}/re2c/indents.scm (100%) rename {queries => runtime/queries}/re2c/injections.scm (100%) rename {queries => runtime/queries}/re2c/locals.scm (100%) rename {queries => runtime/queries}/readline/folds.scm (100%) rename {queries => runtime/queries}/readline/highlights.scm (100%) rename {queries => runtime/queries}/readline/indents.scm (100%) rename {queries/qmldir => runtime/queries/readline}/injections.scm (100%) rename {queries => runtime/queries}/regex/highlights.scm (100%) rename {queries => runtime/queries}/rego/highlights.scm (100%) rename {queries/r => runtime/queries/rego}/injections.scm (100%) rename {queries => runtime/queries}/requirements/highlights.scm (100%) rename {queries/rasi => runtime/queries/requirements}/injections.scm (100%) rename {queries => runtime/queries}/rescript/folds.scm (100%) rename {queries => runtime/queries}/rescript/highlights.scm (100%) rename {queries => runtime/queries}/rescript/indents.scm (100%) rename {queries => runtime/queries}/rescript/injections.scm (100%) rename {queries => runtime/queries}/rescript/locals.scm (100%) rename {queries => runtime/queries}/rnoweb/folds.scm (100%) rename {queries => runtime/queries}/rnoweb/highlights.scm (100%) rename {queries => runtime/queries}/rnoweb/injections.scm (100%) rename {queries => runtime/queries}/robot/folds.scm (100%) rename {queries => runtime/queries}/robot/highlights.scm (100%) rename {queries => runtime/queries}/robot/indents.scm (100%) rename {queries => runtime/queries}/robot/injections.scm (100%) rename {queries => runtime/queries}/robots/highlights.scm (100%) rename {queries/rbs => runtime/queries/robots}/injections.scm (100%) rename {queries => runtime/queries}/roc/highlights.scm (100%) rename {queries => runtime/queries}/roc/indents.scm (100%) rename {queries => runtime/queries}/roc/injections.scm (100%) rename {queries => runtime/queries}/roc/locals.scm (100%) rename {queries => runtime/queries}/ron/folds.scm (100%) rename {queries => runtime/queries}/ron/highlights.scm (100%) rename {queries => runtime/queries}/ron/indents.scm (100%) rename {queries => runtime/queries}/ron/injections.scm (100%) rename {queries => runtime/queries}/ron/locals.scm (100%) rename {queries => runtime/queries}/rst/highlights.scm (100%) rename {queries => runtime/queries}/rst/injections.scm (100%) rename {queries => runtime/queries}/rst/locals.scm (100%) rename {queries => runtime/queries}/ruby/folds.scm (100%) rename {queries => runtime/queries}/ruby/highlights.scm (97%) rename {queries => runtime/queries}/ruby/indents.scm (100%) rename {queries => runtime/queries}/ruby/injections.scm (100%) rename {queries => runtime/queries}/ruby/locals.scm (100%) rename {queries => runtime/queries}/runescript/highlights.scm (100%) rename {queries/readline => runtime/queries/runescript}/injections.scm (100%) rename {queries => runtime/queries}/rust/folds.scm (100%) rename {queries => runtime/queries}/rust/highlights.scm (100%) rename {queries => runtime/queries}/rust/indents.scm (100%) rename {queries => runtime/queries}/rust/injections.scm (100%) rename {queries => runtime/queries}/rust/locals.scm (100%) rename {queries => runtime/queries}/scala/folds.scm (100%) rename {queries => runtime/queries}/scala/highlights.scm (100%) rename {queries/rego => runtime/queries/scala}/injections.scm (100%) rename {queries => runtime/queries}/scala/locals.scm (100%) rename {queries => runtime/queries}/scfg/highlights.scm (100%) rename {queries/requirements => runtime/queries/scfg}/injections.scm (100%) rename {queries => runtime/queries}/scheme/folds.scm (100%) rename {queries => runtime/queries}/scheme/highlights.scm (100%) rename {queries/robots => runtime/queries/scheme}/injections.scm (100%) rename {queries => runtime/queries}/scss/folds.scm (100%) rename {queries => runtime/queries}/scss/highlights.scm (100%) rename {queries => runtime/queries}/scss/indents.scm (100%) rename {queries => runtime/queries}/scss/injections.scm (100%) rename {queries => runtime/queries}/sflog/highlights.scm (100%) rename {queries => runtime/queries}/slang/folds.scm (100%) rename {queries => runtime/queries}/slang/highlights.scm (100%) rename {queries => runtime/queries}/slang/indents.scm (100%) rename {queries => runtime/queries}/slang/injections.scm (100%) rename {queries => runtime/queries}/slang/locals.scm (100%) rename {queries => runtime/queries}/slim/folds.scm (100%) rename {queries => runtime/queries}/slim/highlights.scm (100%) rename {queries => runtime/queries}/slim/indents.scm (100%) rename {queries => runtime/queries}/slim/injections.scm (100%) rename {queries => runtime/queries}/slim/locals.scm (100%) rename {queries => runtime/queries}/slint/folds.scm (100%) rename {queries => runtime/queries}/slint/highlights.scm (100%) rename {queries => runtime/queries}/slint/indents.scm (100%) rename {queries/runescript => runtime/queries/slint}/injections.scm (100%) rename {queries => runtime/queries}/slint/locals.scm (100%) rename {queries => runtime/queries}/smali/folds.scm (100%) rename {queries => runtime/queries}/smali/highlights.scm (100%) rename {queries => runtime/queries}/smali/indents.scm (100%) rename {queries/scfg => runtime/queries/smali}/injections.scm (100%) rename {queries => runtime/queries}/smali/locals.scm (100%) rename {queries => runtime/queries}/smithy/highlights.scm (100%) rename {queries => runtime/queries}/smithy/injections.scm (100%) rename {queries => runtime/queries}/snakemake/folds.scm (100%) rename {queries => runtime/queries}/snakemake/highlights.scm (100%) rename {queries => runtime/queries}/snakemake/indents.scm (100%) rename {queries => runtime/queries}/snakemake/injections.scm (100%) rename {queries => runtime/queries}/snakemake/locals.scm (100%) rename {queries => runtime/queries}/solidity/folds.scm (100%) rename {queries => runtime/queries}/solidity/highlights.scm (100%) rename {queries/scheme => runtime/queries/solidity}/injections.scm (100%) rename {queries => runtime/queries}/soql/highlights.scm (100%) rename {queries => runtime/queries}/sosl/highlights.scm (100%) rename {queries => runtime/queries}/sourcepawn/highlights.scm (100%) rename {queries => runtime/queries}/sourcepawn/injections.scm (100%) rename {queries => runtime/queries}/sourcepawn/locals.scm (100%) rename {queries => runtime/queries}/sparql/folds.scm (100%) rename {queries => runtime/queries}/sparql/highlights.scm (100%) rename {queries => runtime/queries}/sparql/indents.scm (100%) rename {queries => runtime/queries}/sparql/injections.scm (100%) rename {queries => runtime/queries}/sparql/locals.scm (100%) rename {queries => runtime/queries}/sql/folds.scm (100%) rename {queries => runtime/queries}/sql/highlights.scm (100%) rename {queries => runtime/queries}/sql/indents.scm (100%) rename {queries => runtime/queries}/sql/injections.scm (100%) rename {queries => runtime/queries}/squirrel/folds.scm (100%) rename {queries => runtime/queries}/squirrel/highlights.scm (100%) rename {queries => runtime/queries}/squirrel/indents.scm (100%) rename {queries => runtime/queries}/squirrel/injections.scm (100%) rename {queries => runtime/queries}/squirrel/locals.scm (100%) rename {queries => runtime/queries}/ssh_config/folds.scm (100%) rename {queries => runtime/queries}/ssh_config/highlights.scm (100%) rename {queries => runtime/queries}/ssh_config/indents.scm (100%) rename {queries => runtime/queries}/ssh_config/injections.scm (100%) rename {queries => runtime/queries}/ssh_config/locals.scm (100%) rename {queries => runtime/queries}/starlark/folds.scm (100%) rename {queries => runtime/queries}/starlark/highlights.scm (100%) rename {queries => runtime/queries}/starlark/indents.scm (100%) rename {queries => runtime/queries}/starlark/injections.scm (100%) rename {queries => runtime/queries}/starlark/locals.scm (100%) rename {queries => runtime/queries}/strace/highlights.scm (100%) rename {queries/slint => runtime/queries/strace}/injections.scm (100%) rename {queries => runtime/queries}/styled/folds.scm (100%) rename {queries => runtime/queries}/styled/highlights.scm (100%) rename {queries => runtime/queries}/styled/indents.scm (100%) rename {queries => runtime/queries}/styled/injections.scm (100%) rename {queries => runtime/queries}/supercollider/folds.scm (100%) rename {queries => runtime/queries}/supercollider/highlights.scm (100%) rename {queries => runtime/queries}/supercollider/indents.scm (100%) rename {queries => runtime/queries}/supercollider/injections.scm (100%) rename {queries => runtime/queries}/supercollider/locals.scm (100%) rename {queries => runtime/queries}/superhtml/highlights.scm (100%) rename {queries => runtime/queries}/superhtml/injections.scm (100%) rename {queries => runtime/queries}/surface/folds.scm (100%) rename {queries => runtime/queries}/surface/highlights.scm (100%) rename {queries => runtime/queries}/surface/indents.scm (100%) rename {queries => runtime/queries}/surface/injections.scm (100%) rename {queries => runtime/queries}/svelte/folds.scm (100%) rename {queries => runtime/queries}/svelte/highlights.scm (100%) rename {queries => runtime/queries}/svelte/indents.scm (100%) rename {queries => runtime/queries}/svelte/injections.scm (100%) rename {queries => runtime/queries}/svelte/locals.scm (100%) rename {queries => runtime/queries}/sway/folds.scm (100%) rename {queries => runtime/queries}/sway/highlights.scm (100%) rename {queries => runtime/queries}/sway/indents.scm (100%) rename {queries => runtime/queries}/sway/injections.scm (100%) rename {queries => runtime/queries}/sway/locals.scm (100%) rename {queries => runtime/queries}/swift/folds.scm (100%) rename {queries => runtime/queries}/swift/highlights.scm (100%) rename {queries => runtime/queries}/swift/indents.scm (100%) rename {queries => runtime/queries}/swift/injections.scm (100%) rename {queries => runtime/queries}/swift/locals.scm (100%) rename {queries => runtime/queries}/sxhkdrc/folds.scm (100%) rename {queries => runtime/queries}/sxhkdrc/highlights.scm (100%) rename {queries => runtime/queries}/sxhkdrc/injections.scm (100%) rename {queries => runtime/queries}/systemtap/folds.scm (100%) rename {queries => runtime/queries}/systemtap/highlights.scm (100%) rename {queries => runtime/queries}/systemtap/injections.scm (100%) rename {queries => runtime/queries}/systemtap/locals.scm (100%) rename {queries => runtime/queries}/t32/folds.scm (100%) rename {queries => runtime/queries}/t32/highlights.scm (100%) rename {queries => runtime/queries}/t32/indents.scm (100%) rename {queries/smali => runtime/queries/t32}/injections.scm (100%) rename {queries => runtime/queries}/t32/locals.scm (100%) rename {queries => runtime/queries}/tablegen/folds.scm (100%) rename {queries => runtime/queries}/tablegen/highlights.scm (100%) rename {queries => runtime/queries}/tablegen/indents.scm (100%) rename {queries => runtime/queries}/tablegen/injections.scm (100%) rename {queries => runtime/queries}/tablegen/locals.scm (100%) rename {queries => runtime/queries}/tact/folds.scm (100%) rename {queries => runtime/queries}/tact/highlights.scm (100%) rename {queries => runtime/queries}/tact/indents.scm (100%) rename {queries/strace => runtime/queries/tact}/injections.scm (100%) rename {queries => runtime/queries}/tact/locals.scm (100%) rename {queries => runtime/queries}/tcl/folds.scm (100%) rename {queries => runtime/queries}/tcl/highlights.scm (100%) rename {queries => runtime/queries}/tcl/indents.scm (100%) rename {queries/t32 => runtime/queries/tcl}/injections.scm (100%) rename {queries => runtime/queries}/teal/folds.scm (100%) rename {queries => runtime/queries}/teal/highlights.scm (100%) rename {queries => runtime/queries}/teal/indents.scm (100%) rename {queries => runtime/queries}/teal/injections.scm (100%) rename {queries => runtime/queries}/teal/locals.scm (100%) rename {queries => runtime/queries}/templ/folds.scm (100%) rename {queries => runtime/queries}/templ/highlights.scm (100%) rename {queries => runtime/queries}/templ/injections.scm (100%) rename {queries => runtime/queries}/tera/highlights.scm (100%) rename {queries => runtime/queries}/tera/injections.scm (100%) rename {queries => runtime/queries}/terraform/folds.scm (100%) rename {queries => runtime/queries}/terraform/highlights.scm (100%) rename {queries => runtime/queries}/terraform/indents.scm (100%) rename {queries => runtime/queries}/terraform/injections.scm (100%) rename {queries => runtime/queries}/textproto/folds.scm (100%) rename {queries => runtime/queries}/textproto/highlights.scm (100%) rename {queries => runtime/queries}/textproto/indents.scm (100%) rename {queries/tact => runtime/queries/textproto}/injections.scm (100%) rename {queries => runtime/queries}/thrift/folds.scm (100%) rename {queries => runtime/queries}/thrift/highlights.scm (100%) rename {queries => runtime/queries}/thrift/indents.scm (100%) rename {queries/tcl => runtime/queries/thrift}/injections.scm (100%) rename {queries => runtime/queries}/thrift/locals.scm (100%) rename {queries => runtime/queries}/tiger/folds.scm (100%) rename {queries => runtime/queries}/tiger/highlights.scm (100%) rename {queries => runtime/queries}/tiger/indents.scm (100%) rename {queries => runtime/queries}/tiger/injections.scm (100%) rename {queries => runtime/queries}/tiger/locals.scm (100%) rename {queries => runtime/queries}/tlaplus/folds.scm (100%) rename {queries => runtime/queries}/tlaplus/highlights.scm (100%) rename {queries => runtime/queries}/tlaplus/injections.scm (100%) rename {queries => runtime/queries}/tlaplus/locals.scm (100%) rename {queries => runtime/queries}/tmux/highlights.scm (100%) rename {queries => runtime/queries}/tmux/injections.scm (100%) rename {queries => runtime/queries}/todotxt/highlights.scm (100%) rename {queries => runtime/queries}/toml/folds.scm (100%) rename {queries => runtime/queries}/toml/highlights.scm (100%) rename {queries => runtime/queries}/toml/indents.scm (100%) rename {queries/textproto => runtime/queries/toml}/injections.scm (100%) rename {queries => runtime/queries}/toml/locals.scm (100%) rename {queries => runtime/queries}/tsv/highlights.scm (100%) rename {queries => runtime/queries}/tsx/folds.scm (100%) rename {queries => runtime/queries}/tsx/highlights.scm (100%) rename {queries => runtime/queries}/tsx/indents.scm (100%) rename {queries => runtime/queries}/tsx/injections.scm (100%) rename {queries => runtime/queries}/tsx/locals.scm (100%) rename {queries => runtime/queries}/turtle/folds.scm (100%) rename {queries => runtime/queries}/turtle/highlights.scm (100%) rename {queries => runtime/queries}/turtle/indents.scm (100%) rename {queries/thrift => runtime/queries/turtle}/injections.scm (100%) rename {queries => runtime/queries}/turtle/locals.scm (100%) rename {queries => runtime/queries}/twig/highlights.scm (100%) rename {queries => runtime/queries}/twig/injections.scm (100%) rename {queries => runtime/queries}/typescript/folds.scm (100%) rename {queries => runtime/queries}/typescript/highlights.scm (100%) rename {queries => runtime/queries}/typescript/indents.scm (100%) rename {queries => runtime/queries}/typescript/injections.scm (100%) rename {queries => runtime/queries}/typescript/locals.scm (100%) rename {queries => runtime/queries}/typespec/highlights.scm (100%) rename {queries => runtime/queries}/typespec/indents.scm (100%) rename {queries => runtime/queries}/typespec/injections.scm (100%) rename {queries => runtime/queries}/typoscript/folds.scm (100%) rename {queries => runtime/queries}/typoscript/highlights.scm (100%) rename {queries => runtime/queries}/typoscript/indents.scm (100%) rename {queries/toml => runtime/queries/typoscript}/injections.scm (100%) rename {queries => runtime/queries}/typst/folds.scm (100%) rename {queries => runtime/queries}/typst/highlights.scm (100%) rename {queries => runtime/queries}/typst/indents.scm (100%) rename {queries/turtle => runtime/queries/typst}/injections.scm (100%) rename {queries => runtime/queries}/udev/highlights.scm (100%) rename {queries => runtime/queries}/udev/injections.scm (100%) rename {queries => runtime/queries}/udev/locals.scm (100%) rename {queries => runtime/queries}/ungrammar/folds.scm (100%) rename {queries => runtime/queries}/ungrammar/highlights.scm (100%) rename {queries => runtime/queries}/ungrammar/indents.scm (100%) rename {queries/typoscript => runtime/queries/ungrammar}/injections.scm (100%) rename {queries => runtime/queries}/ungrammar/locals.scm (100%) rename {queries => runtime/queries}/unison/folds.scm (100%) rename {queries => runtime/queries}/unison/highlights.scm (100%) rename {queries/ungrammar => runtime/queries/unison}/injections.scm (100%) rename {queries => runtime/queries}/usd/folds.scm (100%) rename {queries => runtime/queries}/usd/highlights.scm (100%) rename {queries => runtime/queries}/usd/indents.scm (100%) rename {queries => runtime/queries}/usd/injections.scm (100%) rename {queries => runtime/queries}/usd/locals.scm (100%) rename {queries => runtime/queries}/uxntal/folds.scm (100%) rename {queries => runtime/queries}/uxntal/highlights.scm (100%) rename {queries => runtime/queries}/uxntal/indents.scm (100%) rename {queries => runtime/queries}/uxntal/injections.scm (100%) rename {queries => runtime/queries}/uxntal/locals.scm (100%) rename {queries => runtime/queries}/v/folds.scm (100%) rename {queries => runtime/queries}/v/highlights.scm (100%) rename {queries => runtime/queries}/v/indents.scm (100%) rename {queries => runtime/queries}/v/injections.scm (100%) rename {queries => runtime/queries}/v/locals.scm (100%) rename {queries => runtime/queries}/vala/folds.scm (100%) rename {queries => runtime/queries}/vala/highlights.scm (100%) rename {queries => runtime/queries}/vala/injections.scm (100%) rename {queries => runtime/queries}/vento/highlights.scm (100%) rename {queries => runtime/queries}/vento/injections.scm (100%) rename {queries => runtime/queries}/verilog/folds.scm (100%) rename {queries => runtime/queries}/verilog/highlights.scm (100%) rename {queries/vhs => runtime/queries/verilog}/injections.scm (100%) rename {queries => runtime/queries}/vhdl/folds.scm (100%) rename {queries => runtime/queries}/vhdl/highlights.scm (100%) rename {queries => runtime/queries}/vhdl/injections.scm (100%) rename {queries => runtime/queries}/vhs/highlights.scm (100%) rename {queries/wit => runtime/queries/vhs}/injections.scm (100%) rename {queries => runtime/queries}/vim/folds.scm (100%) rename {queries => runtime/queries}/vim/highlights.scm (100%) rename {queries => runtime/queries}/vim/injections.scm (100%) rename {queries => runtime/queries}/vim/locals.scm (100%) rename {queries => runtime/queries}/vimdoc/highlights.scm (100%) rename {queries => runtime/queries}/vimdoc/injections.scm (100%) rename {queries => runtime/queries}/vrl/folds.scm (100%) rename {queries => runtime/queries}/vrl/highlights.scm (100%) rename {queries => runtime/queries}/vrl/indents.scm (100%) rename {queries => runtime/queries}/vrl/injections.scm (100%) rename {queries => runtime/queries}/vrl/locals.scm (100%) rename {queries => runtime/queries}/vue/folds.scm (100%) rename {queries => runtime/queries}/vue/highlights.scm (100%) rename {queries => runtime/queries}/vue/indents.scm (100%) rename {queries => runtime/queries}/vue/injections.scm (100%) rename {queries => runtime/queries}/wgsl/folds.scm (100%) rename {queries => runtime/queries}/wgsl/highlights.scm (100%) rename {queries => runtime/queries}/wgsl/indents.scm (100%) rename {queries => runtime/queries}/wgsl/injections.scm (100%) rename {queries => runtime/queries}/wgsl_bevy/folds.scm (100%) rename {queries => runtime/queries}/wgsl_bevy/highlights.scm (100%) rename {queries => runtime/queries}/wgsl_bevy/indents.scm (100%) rename {queries => runtime/queries}/wing/folds.scm (100%) rename {queries => runtime/queries}/wing/highlights.scm (100%) rename {queries => runtime/queries}/wing/injections.scm (100%) rename {queries => runtime/queries}/wing/locals.scm (100%) rename {queries => runtime/queries}/wit/folds.scm (100%) rename {queries => runtime/queries}/wit/highlights.scm (100%) rename {queries/xcompose => runtime/queries/wit}/injections.scm (100%) rename {queries => runtime/queries}/xcompose/highlights.scm (100%) rename {queries/typst => runtime/queries/xcompose}/injections.scm (50%) rename {queries => runtime/queries}/xcompose/locals.scm (100%) rename {queries => runtime/queries}/xml/folds.scm (100%) rename {queries => runtime/queries}/xml/highlights.scm (100%) rename {queries => runtime/queries}/xml/indents.scm (100%) rename {queries => runtime/queries}/xml/injections.scm (100%) rename {queries => runtime/queries}/xml/locals.scm (100%) rename {queries => runtime/queries}/xresources/folds.scm (100%) rename {queries => runtime/queries}/xresources/highlights.scm (100%) rename {queries => runtime/queries}/xresources/injections.scm (100%) rename {queries => runtime/queries}/xresources/locals.scm (100%) rename {queries => runtime/queries}/yaml/folds.scm (100%) rename {queries => runtime/queries}/yaml/highlights.scm (100%) rename {queries => runtime/queries}/yaml/indents.scm (100%) rename {queries => runtime/queries}/yaml/injections.scm (100%) rename {queries => runtime/queries}/yaml/locals.scm (100%) rename {queries => runtime/queries}/yang/folds.scm (100%) rename {queries => runtime/queries}/yang/highlights.scm (100%) rename {queries => runtime/queries}/yang/indents.scm (100%) rename {queries => runtime/queries}/yang/injections.scm (100%) rename {queries => runtime/queries}/yuck/folds.scm (100%) rename {queries => runtime/queries}/yuck/highlights.scm (100%) rename {queries => runtime/queries}/yuck/indents.scm (100%) rename {queries => runtime/queries}/yuck/injections.scm (100%) rename {queries => runtime/queries}/yuck/locals.scm (100%) rename {queries => runtime/queries}/zathurarc/highlights.scm (100%) rename {queries => runtime/queries}/zathurarc/injections.scm (100%) rename {queries => runtime/queries}/zig/folds.scm (100%) rename {queries => runtime/queries}/zig/highlights.scm (100%) rename {queries => runtime/queries}/zig/indents.scm (100%) rename {queries => runtime/queries}/zig/injections.scm (100%) rename {queries => runtime/queries}/zig/locals.scm (100%) rename {queries => runtime/queries}/ziggy/highlights.scm (100%) rename {queries => runtime/queries}/ziggy/indents.scm (100%) rename {queries => runtime/queries}/ziggy_schema/highlights.scm (100%) rename {queries => runtime/queries}/ziggy_schema/indents.scm (100%) delete mode 100644 tests/unit/ts_utils_spec.lua diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd0e51982..e51833814 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: Linting and style checking on: pull_request: branches: - - "master" + - "main" jobs: luacheck: @@ -37,7 +37,7 @@ jobs: name: Lint queries runs-on: ubuntu-latest env: - NVIM_TAG: stable + NVIM_TAG: nightly steps: - uses: actions/checkout@v4 - name: Prepare diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index 8fe1f082a..5e9be1e38 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -85,4 +85,4 @@ jobs: run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser - name: Check query files - run: $NVIM -l scripts/check-queries.lua + run: $NVIM -l ./scripts/check-queries.lua diff --git a/.stylua.toml b/.stylua.toml index ecb6dca5a..a2b344750 100644 --- a/.stylua.toml +++ b/.stylua.toml @@ -1,6 +1,6 @@ -column_width = 120 +column_width = 100 line_endings = "Unix" indent_type = "Spaces" indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "None" +quote_style = "AutoPreferSingle" +call_parentheses = "Always" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23321f0f7..473a26cb5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,10 +5,7 @@ First of all, thank you very much for contributing to `nvim-treesitter`. If you haven't already, you should really come and reach out to us on our [Matrix channel], so we can help you with any question you might have! -As you know, `nvim-treesitter` is roughly split in two parts: - -- Parser configurations : for various things like `locals`, `highlights` -- What we like to call _modules_ : tiny Lua modules that provide a given feature, based on parser configurations +The main goal of `nvim-treesitter` is to provide a framework to easily install parsers and queries. Depending on which part of the plugin you want to contribute to, please read the appropriate section. @@ -25,25 +22,9 @@ cargo install stylua ln -s ../../scripts/pre-push .git/hooks/pre-push ``` -## Adding new modules - -If you want to see a new functionality added to `nvim-treesitter` feel free to first open an issue -to that we can track our solution! -Thus far, there is basically two types of modules: - -- Little modules (like `incremental selection`) that are built in `nvim-treesitter`, we call them - `builtin modules`. -- Bigger modules (like `completion-treesitter`, or `nvim-tree-docs`), or modules that integrate - with other plugins, that we call `remote modules`. - -In any case, you can build your own module! To help you started in the process, we have a template -repository designed to build new modules [here](https://github.com/nvim-treesitter/module-template). -Feel free to use it, and contact us over on our -on the "Neovim tree-sitter" [Matrix channel]. - ## Parser configurations -Contributing to parser configurations is basically modifying one of the `queries/*/*.scm`. +Contributing to parser configurations is basically modifying one of the `runtime/queries/*/*.scm`. Each of these `scheme` files contains a _tree-sitter query_ for a given purpose. Before going any further, we highly suggest that you [read more about tree-sitter queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries). @@ -59,14 +40,12 @@ For now these are the types of queries used by `nvim-treesitter`: For these types there is a _norm_ you will have to follow so that features work fine. Here are some global advices: -- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages), - you can install the [playground plugin](https://github.com/nvim-treesitter/playground). - If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages), you can debug and experiment with your queries there. - If not, you should consider installing the [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/tree/master/cli), you should then be able to open a local playground using `tree-sitter build-wasm && tree-sitter web-ui` within the parsers repo. -- Examples of queries can be found in [queries/](queries/) +- Examples of queries can be found in [runtime/queries/](runtime/queries/) - Matches in the bottom will override queries that are above of them. #### Inheriting languages diff --git a/Makefile b/Makefile deleted file mode 100644 index 338c75463..000000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# https://github.com/luarocks/luarocks/wiki/Creating-a-Makefile-that-plays-nice-with-LuaRocks -build: - echo "Do nothing" - -install: - mkdir -p $(INST_LUADIR) - cp -r lua/* $(INST_LUADIR) diff --git a/README.md b/README.md index 2cb5f033b..715ec50ed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ +

+ nvim-treesitter +

-

nvim-treesitter

Matrix Chat @@ -13,608 +15,111 @@

-
-

- Logo -

-

- Treesitter - configurations and abstraction layer for - Neovim. -

-

- - Logo by @steelsojka - -

-
+# WARNING -The goal of `nvim-treesitter` is both to provide a simple and easy way to use the interface for [tree-sitter](https://github.com/tree-sitter/tree-sitter) in Neovim and to provide some basic functionality such as highlighting based on it: +**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`.** -![example-cpp](https://user-images.githubusercontent.com/2361214/202753610-e923bf4e-e88f-494b-bb1e-d22a7688446f.png) - -Traditional highlighting (left) vs Treesitter-based highlighting (right). -More examples can be found in [our gallery](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Gallery). - -**Warning: Treesitter and nvim-treesitter highlighting are an experimental feature of Neovim. -Please consider the experience with this plug-in as experimental until Tree-Sitter support in Neovim is stable! -We recommend using the nightly builds of Neovim if possible. -You can find the current roadmap [here](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767). -The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated!** - -Nvim-treesitter is based on three interlocking features: [**language parsers**](#language-parsers), [**queries**](#adding-queries), and [**modules**](#available-modules), where _modules_ provide features – e.g., highlighting – based on _queries_ for syntax objects extracted from a given buffer by _language parsers_. -Users will generally only need to interact with parsers and modules as explained in the next section. -For more detailed information on setting these up, see ["Advanced setup"](#advanced-setup). - ---- - -### Table of contents - -- [Quickstart](#quickstart) -- [Supported languages](#supported-languages) -- [Available modules](#available-modules) -- [Advanced setup](#advanced-setup) -- [Extra features](#extra-features) -- [Troubleshooting](#troubleshooting) - ---- +The `nvim-treesitter` plugin provides +1. functions for installing, updating, and removing [**tree-sitter parsers**](SUPPORTED_LANGUAGES.md); +2. a collection of **queries** for enabling tree-sitter features built into Neovim for these languages. # Quickstart ## Requirements -- **Neovim 0.10** or later ([nightly](https://github.com/neovim/neovim#install-from-source) recommended) +- 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)). +- 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` ## 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`. -It is strongly recommended to automate this; e.g., if you are using [vim-plug](https://github.com/junegunn/vim-plug), put this in your `init.vim` file: - -```vim -Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -``` - -For other plugin managers such as `packer.nvim`, see this [Installation page from the wiki](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Installation) (Note that this page is community maintained). - -## Language parsers - -Treesitter uses a different _parser_ for every language, which needs to be generated via `tree-sitter-cli` from a `grammar.js` file, then compiled to a `.so` library that needs to be placed in neovim's `runtimepath` (typically under `parser/{language}.so`). -To simplify this, `nvim-treesitter` provides commands to automate this process. -If the language is already [supported by `nvim-treesitter`](#supported-languages), you can install it with - -```vim -:TSInstall -``` - -This command supports tab expansion. -You can also get a list of all available languages and their installation status with `:TSInstallInfo`. -Parsers not on this list can be added manually by following the steps described under ["Adding parsers"](#adding-parsers) below. - -To make sure a parser is at the latest compatible version (as specified in `nvim-treesitter`'s `lockfile.json`), use `:TSUpdate {language}`. To update all parsers unconditionally, use `:TSUpdate all` or just `:TSUpdate`. - -## Modules - -Each module provides a distinct tree-sitter-based feature such as [highlighting](#highlight), [indentation](#indentation), or [folding](#folding); see [`:h nvim-treesitter-modules`](doc/nvim-treesitter.txt) or ["Available modules"](#available-modules) below for a list of modules and their options. - -Following examples assume that you are configuring neovim with lua. If you are using vimscript, see `:h lua-heredoc`. -All modules are disabled by default and need to be activated explicitly in your `init.lua`, e.g., via +It is strongly recommended to automate this; e.g., using [lazy.nvim](https://github.com/folke/lazy.nvim) ```lua -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the listed parsers MUST always be installed) - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline" }, +require('lazy').setup( + { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', lazy = false } +) +``` - -- Install parsers synchronously (only applied to `ensure_installed`) +**NOTE: This plugin does not support lazy-loading.** + +## Setup + +`nvim-treesitter` can be configured by calling `setup`. The following snippet lists the available options and their default values. **You do not need to call `setup` for `nvim-treesitter` to work using default values.** + +```lua +require'nvim-treesitter'.setup { + -- A list of parser names or tiers ('core', 'stable', 'community', 'unstable') + ensure_install = { }, + + -- List of parsers to ignore installing + ignore_install = { }, + + -- Install parsers synchronously (only applied to `ensure_install`) sync_install = false, -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + auto_install = false, - -- List of parsers to ignore installing (or "all") - ignore_install = { "javascript" }, - - ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) - -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! - - highlight = { - enable = true, - - -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to - -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is - -- the name of the parser) - -- list of language that will be disabled - disable = { "c", "rust" }, - -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files - disable = function(lang, buf) - local max_filesize = 100 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end - end, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, + -- Directory to install parsers and queries to + install_dir = vim.fn.stdpath('data') .. '/site' } ``` -Each module can also be enabled or disabled interactively through the following commands: - -```vim -:TSBufEnable {module} " enable module on current buffer -:TSBufDisable {module} " disable module on current buffer -:TSEnable {module} [{ft}] " enable module on every buffer. If filetype is specified, enable only for this filetype. -:TSDisable {module} [{ft}] " disable module on every buffer. If filetype is specified, disable only for this filetype. -:TSModuleInfo [{module}] " list information about modules state for each filetype -``` - Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all available commands. -It may be necessary to reload the buffer (e.g., via `:e`) after enabling a module interactively. # Supported languages For `nvim-treesitter` to support a specific feature for a specific language requires both a parser for that language and an appropriate language-specific query file for that feature. -The following is a list of languages for which a parser can be installed through `:TSInstall`; a checked box means that `nvim-treesitter` also contains queries at least for the `highlight` module. - -Experimental parsers are parsers that have a maintainer but are not stable enough for -daily use yet. +A list of the currently supported languages can be found [on this page](SUPPORTED_LANGUAGES.md). We are looking for maintainers to add more parsers and to write query files for their languages. Check our [tracking issue](https://github.com/nvim-treesitter/nvim-treesitter/issues/2282) for open language requests. - - -- [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot) -- [x] [agda](https://github.com/tree-sitter/tree-sitter-agda) (maintained by @Decodetalkers) -- [x] [angular](https://github.com/dlvandenberg/tree-sitter-angular) (experimental, maintained by @dlvandenberg) -- [x] [apex](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) -- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime) -- [x] [asm](https://github.com/RubixDev/tree-sitter-asm) (maintained by @RubixDev) -- [x] [astro](https://github.com/virchau13/tree-sitter-astro) (maintained by @virchau13) -- [x] [authzed](https://github.com/mleonidas/tree-sitter-authzed) (maintained by @mattpolzin) -- [ ] [awk](https://github.com/Beaglefoot/tree-sitter-awk) -- [x] [bash](https://github.com/tree-sitter/tree-sitter-bash) (maintained by @TravonteD) -- [x] [bass](https://github.com/vito/tree-sitter-bass) (maintained by @amaanq) -- [x] [beancount](https://github.com/polarmutex/tree-sitter-beancount) (maintained by @polarmutex) -- [x] [bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) (maintained by @theHamsta, @clason) -- [x] [bicep](https://github.com/amaanq/tree-sitter-bicep) (maintained by @amaanq) -- [x] [bitbake](https://github.com/amaanq/tree-sitter-bitbake) (maintained by @amaanq) -- [x] [blade](https://github.com/EmranMR/tree-sitter-blade) (maintained by @calebdw) -- [x] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus) -- [x] [bp](https://github.com/ambroisie/tree-sitter-bp) (maintained by @ambroisie) -- [x] [brightscript](https://github.com/ajdelcimmuto/tree-sitter-brightscript) (maintained by @ajdelcimmuto) -- [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @amaanq) -- [x] [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) (maintained by @amaanq) -- [x] [caddy](https://github.com/opa-oz/tree-sitter-caddy) (maintained by @opa-oz) -- [x] [cairo](https://github.com/amaanq/tree-sitter-cairo) (maintained by @amaanq) -- [x] [capnp](https://github.com/amaanq/tree-sitter-capnp) (maintained by @amaanq) -- [x] [chatito](https://github.com/ObserverOfTime/tree-sitter-chatito) (maintained by @ObserverOfTime) -- [x] [circom](https://github.com/Decurity/tree-sitter-circom) (maintained by @alexandr-martirosyan) -- [x] [clojure](https://github.com/sogaiu/tree-sitter-clojure) (maintained by @NoahTheDuke) -- [x] [cmake](https://github.com/uyha/tree-sitter-cmake) (maintained by @uyha) -- [x] [comment](https://github.com/stsewd/tree-sitter-comment) (maintained by @stsewd) -- [x] [commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) (maintained by @theHamsta) -- [x] [cooklang](https://github.com/addcninblue/tree-sitter-cooklang) (maintained by @addcninblue) -- [x] [corn](https://github.com/jakestanger/tree-sitter-corn) (maintained by @jakestanger) -- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq) -- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta) -- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD) -- [x] [csv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq) -- [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta) -- [x] [cue](https://github.com/eonpatapon/tree-sitter-cue) (maintained by @amaanq) -- [x] [cylc](https://github.com/elliotfontaine/tree-sitter-cylc) (maintained by @elliotfontaine) -- [x] [d](https://github.com/gdamore/tree-sitter-d) (maintained by @amaanq) -- [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @akinsho) -- [x] [desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) (maintained by @ValdezFOmar) -- [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar) -- [x] [dhall](https://github.com/jbellerb/tree-sitter-dhall) (maintained by @amaanq) -- [x] [diff](https://github.com/the-mikedavis/tree-sitter-diff) (maintained by @gbprod) -- [x] [disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) (maintained by @ColinKennedy) -- [x] [djot](https://github.com/treeman/tree-sitter-djot) (maintained by @NoahTheDuke) -- [x] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek) -- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun) -- [x] [doxygen](https://github.com/amaanq/tree-sitter-doxygen) (maintained by @amaanq) -- [x] [dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) (maintained by @ObserverOfTime) -- [x] [earthfile](https://github.com/glehmann/tree-sitter-earthfile) (maintained by @glehmann) -- [x] [ebnf](https://github.com/RubixDev/ebnf) (experimental, maintained by @RubixDev) -- [x] [editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) (maintained by @ValdezFOmar) -- [x] [eds](https://github.com/uyha/tree-sitter-eds) (maintained by @uyha) -- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay) -- [x] [elixir](https://github.com/elixir-lang/tree-sitter-elixir) (maintained by @connorlay) -- [x] [elm](https://github.com/elm-tooling/tree-sitter-elm) (maintained by @zweimach) -- [x] [elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) (maintained by @glapa-grossklag, @amaanq) -- [x] [elvish](https://github.com/elves/tree-sitter-elvish) (maintained by @elves) -- [ ] [embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) -- [x] [enforce](https://github.com/simonvic/tree-sitter-enforce) (maintained by @simonvic) -- [x] [erlang](https://github.com/WhatsApp/tree-sitter-erlang) (maintained by @filmor) -- [x] [facility](https://github.com/FacilityApi/tree-sitter-facility) (maintained by @bryankenote) -- [x] [faust](https://github.com/khiner/tree-sitter-faust) (maintained by @khiner) -- [x] [fennel](https://github.com/alexmozaidze/tree-sitter-fennel) (maintained by @alexmozaidze) -- [x] [fidl](https://github.com/google/tree-sitter-fidl) (maintained by @chaopeng) -- [x] [firrtl](https://github.com/amaanq/tree-sitter-firrtl) (maintained by @amaanq) -- [x] [fish](https://github.com/ram02z/tree-sitter-fish) (maintained by @ram02z) -- [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience) -- [x] [forth](https://github.com/AlexanderBrevig/tree-sitter-forth) (maintained by @amaanq) -- [x] [fortran](https://github.com/stadelmanma/tree-sitter-fortran) (maintained by @amaanq) -- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna) -- [x] [fsharp](https://github.com/ionide/tree-sitter-fsharp) (maintained by @nsidorenco) -- [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq) -- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn) -- [x] [GAP system](https://github.com/gap-system/tree-sitter-gap) (maintained by @reiniscirpons) -- [x] [GAP system test files](https://github.com/gap-system/tree-sitter-gaptst) (maintained by @reiniscirpons) -- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp) -- [x] [gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) (maintained by @godofavacyn) -- [x] [git_config](https://github.com/the-mikedavis/tree-sitter-git-config) (maintained by @amaanq) -- [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod) -- [x] [gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) (maintained by @ObserverOfTime) -- [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod) -- [x] [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) (maintained by @theHamsta) -- [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq) -- [x] [Glimmer and Ember](https://github.com/ember-tooling/tree-sitter-glimmer) (maintained by @NullVoxPopuli) -- [x] [glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) (maintained by @NullVoxPopuli) -- [x] [glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) (maintained by @NullVoxPopuli) -- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta) -- [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq) -- [x] [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) (maintained by @dpezto) -- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268) -- [x] [goctl](https://github.com/chaozwn/tree-sitter-goctl) (maintained by @chaozwn) -- [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo) -- [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek) -- [x] [gosum](https://github.com/amaanq/tree-sitter-go-sum) (maintained by @amaanq) -- [x] [gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) (maintained by @qvalentin) -- [x] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc) -- [x] [gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) (maintained by @ObserverOfTime) -- [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley) -- [x] [gren](https://github.com/MaeBrooks/tree-sitter-gren) (maintained by @MaeBrooks) -- [x] [groovy](https://github.com/murtaza64/tree-sitter-groovy) (maintained by @murtaza64) -- [x] [gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) (maintained by @theHamsta) -- [ ] [hack](https://github.com/slackhq/tree-sitter-hack) -- [x] [hare](https://github.com/amaanq/tree-sitter-hare) (maintained by @amaanq) -- [x] [haskell](https://github.com/tree-sitter/tree-sitter-haskell) (maintained by @mrcjkb) -- [x] [haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) (maintained by @lykahb) -- [x] [hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann) -- [x] [heex](https://github.com/connorlay/tree-sitter-heex) (maintained by @connorlay) -- [x] [helm](https://github.com/ngalaiko/tree-sitter-go-template) (maintained by @qvalentin) -- [x] [hjson](https://github.com/winston0410/tree-sitter-hjson) (maintained by @winston0410) -- [x] [hlsl](https://github.com/theHamsta/tree-sitter-hlsl) (maintained by @theHamsta) -- [x] [hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) (maintained by @Freed-Wu) -- [x] [hocon](https://github.com/antosha417/tree-sitter-hocon) (maintained by @antosha417) -- [x] [hoon](https://github.com/urbit-pilled/tree-sitter-hoon) (experimental, maintained by @urbit-pilled) -- [x] [html](https://github.com/tree-sitter/tree-sitter-html) (maintained by @TravonteD) -- [x] [htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) (experimental, maintained by @ObserverOfTime) -- [x] [http](https://github.com/rest-nvim/tree-sitter-http) (maintained by @amaanq, @NTBBloodbath) -- [x] [hurl](https://github.com/pfeiferj/tree-sitter-hurl) (maintained by @pfeiferj) -- [x] [hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) (maintained by @luckasRanarison) -- [x] [idl](https://github.com/cathaysia/tree-sitter-idl) (maintained by @cathaysia) -- [x] [idris](https://github.com/kayhide/tree-sitter-idris) (maintained by @srghma) -- [x] [ini](https://github.com/justinmk/tree-sitter-ini) (experimental, maintained by @theHamsta) -- [x] [inko](https://github.com/inko-lang/tree-sitter-inko) (maintained by @yorickpeterse) -- [x] [ipkg](https://github.com/srghma/tree-sitter-ipkg) (maintained by @srghma) -- [x] [ispc](https://github.com/fab4100/tree-sitter-ispc) (maintained by @fab4100) -- [x] [janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) (maintained by @sogaiu) -- [x] [java](https://github.com/tree-sitter/tree-sitter-java) (maintained by @p00f) -- [x] [javadoc](https://github.com/rmuir/tree-sitter-javadoc) (maintained by @rmuir) -- [x] [javascript](https://github.com/tree-sitter/tree-sitter-javascript) (maintained by @steelsojka) -- [x] [jinja](https://github.com/cathaysia/tree-sitter-jinja) (maintained by @cathaysia) -- [x] [jinja_inline](https://github.com/cathaysia/tree-sitter-jinja) (maintained by @cathaysia) -- [x] [jq](https://github.com/flurie/tree-sitter-jq) (maintained by @ObserverOfTime) -- [x] [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) (maintained by @steelsojka) -- [x] [json](https://github.com/tree-sitter/tree-sitter-json) (maintained by @steelsojka) -- [x] [json5](https://github.com/Joakker/tree-sitter-json5) (maintained by @Joakker) -- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo) -- [x] [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) (maintained by @nawordar) -- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @fredrikekre) -- [x] [just](https://github.com/IndianBoy42/tree-sitter-just) (maintained by @Hubro) -- [x] [kcl](https://github.com/kcl-lang/tree-sitter-kcl) (maintained by @bertbaron) -- [x] [kconfig](https://github.com/amaanq/tree-sitter-kconfig) (maintained by @amaanq) -- [x] [kdl](https://github.com/amaanq/tree-sitter-kdl) (maintained by @amaanq) -- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa) -- [x] [koto](https://github.com/koto-lang/tree-sitter-koto) (maintained by @irh) -- [x] [kusto](https://github.com/Willem-J-an/tree-sitter-kusto) (maintained by @Willem-J-an) -- [x] [lalrpop](https://github.com/traxys/tree-sitter-lalrpop) (maintained by @traxys) -- [x] [latex](https://github.com/latex-lsp/tree-sitter-latex) (maintained by @theHamsta, @clason) -- [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete) -- [x] [leo](https://github.com/r001/tree-sitter-leo) (maintained by @r001) -- [x] [linkerscript](https://github.com/amaanq/tree-sitter-linkerscript) (maintained by @amaanq) -- [x] [liquid](https://github.com/hankthetank27/tree-sitter-liquid) (maintained by @hankthetank27) -- [x] [liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) (maintained by @toots) -- [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham) -- [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim) -- [x] [luadoc](https://github.com/amaanq/tree-sitter-luadoc) (maintained by @amaanq) -- [x] [lua patterns](https://github.com/amaanq/tree-sitter-luap) (maintained by @amaanq) -- [x] [luau](https://github.com/amaanq/tree-sitter-luau) (maintained by @amaanq) -- [x] [m68k](https://github.com/grahambates/tree-sitter-m68k) (maintained by @grahambates) -- [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991) -- [x] [markdown (basic highlighting)](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml) -- [x] [markdown_inline (needed for full highlighting)](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml) -- [x] [matlab](https://github.com/acristoffers/tree-sitter-matlab) (maintained by @acristoffers) -- [x] [menhir](https://github.com/Kerl13/tree-sitter-menhir) (maintained by @Kerl13) -- [ ] [mermaid](https://github.com/monaqa/tree-sitter-mermaid) (experimental) -- [x] [meson](https://github.com/Decodetalkers/tree-sitter-meson) (maintained by @Decodetalkers) -- [x] [mlir](https://github.com/artagnon/tree-sitter-mlir) (experimental, maintained by @artagnon) -- [x] [muttrc](https://github.com/neomutt/tree-sitter-muttrc) (maintained by @Freed-Wu) -- [x] [nasm](https://github.com/naclsn/tree-sitter-nasm) (maintained by @ObserverOfTime) -- [x] [nginx](https://github.com/opa-oz/tree-sitter-nginx) (maintained by @opa-oz) -- [ ] [nickel](https://github.com/nickel-lang/tree-sitter-nickel) -- [x] [nim](https://github.com/alaviss/tree-sitter-nim) (maintained by @aMOPel) -- [x] [nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) (maintained by @aMOPel) -- [x] [ninja](https://github.com/alemuller/tree-sitter-ninja) (maintained by @alemuller) -- [x] [nix](https://github.com/cstrahan/tree-sitter-nix) (maintained by @leo60228) -- [x] [norg](https://github.com/nvim-neorg/tree-sitter-norg) (maintained by @JoeyGrajciar, @vhyrro) -- [x] [nqc](https://github.com/amaanq/tree-sitter-nqc) (maintained by @amaanq) -- [x] [nu](https://github.com/nushell/tree-sitter-nu) (maintained by @abhisheksingh0x558) -- [x] [objc](https://github.com/amaanq/tree-sitter-objc) (maintained by @amaanq) -- [x] [objdump](https://github.com/ColinKennedy/tree-sitter-objdump) (maintained by @ColinKennedy) -- [x] [ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu) -- [x] [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu) -- [x] [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) (maintained by @undu) -- [x] [odin](https://github.com/amaanq/tree-sitter-odin) (maintained by @amaanq) -- [x] [pascal](https://github.com/Isopod/tree-sitter-pascal) (maintained by @Isopod) -- [x] [passwd](https://github.com/ath3/tree-sitter-passwd) (maintained by @amaanq) -- [x] [pem](https://github.com/ObserverOfTime/tree-sitter-pem) (maintained by @ObserverOfTime) -- [x] [perl](https://github.com/tree-sitter-perl/tree-sitter-perl) (maintained by @RabbiVeesh, @LeoNerd) -- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw) -- [x] [php_only](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw) -- [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl) -- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228) -- [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq) -- [x] [pod](https://github.com/tree-sitter-perl/tree-sitter-pod) (maintained by @RabbiVeesh, @LeoNerd) -- [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime) -- [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche) -- [x] [powershell](https://github.com/airbus-cert/tree-sitter-powershell) (maintained by @L2jLiga) -- [x] [printf](https://github.com/ObserverOfTime/tree-sitter-printf) (maintained by @ObserverOfTime) -- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva) -- [x] [problog](https://github.com/foxyseta/tree-sitter-prolog) (maintained by @foxyseta) -- [x] [prolog](https://github.com/foxyseta/tree-sitter-prolog) (maintained by @foxyseta) -- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann) -- [x] [properties](https://github.com/tree-sitter-grammars/tree-sitter-properties) (maintained by @ObserverOfTime) -- [x] [proto](https://github.com/treywood/tree-sitter-proto) (maintained by @treywood) -- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q) -- [x] [psv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq) -- [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128) -- [x] [puppet](https://github.com/amaanq/tree-sitter-puppet) (maintained by @amaanq) -- [x] [purescript](https://github.com/postsolar/tree-sitter-purescript) (maintained by @postsolar) -- [x] [PyPA manifest](https://github.com/ObserverOfTime/tree-sitter-pymanifest) (maintained by @ObserverOfTime) -- [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta) -- [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester) -- [x] [qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) (maintained by @amaanq) -- [x] [qmljs](https://github.com/yuja/tree-sitter-qmljs) (maintained by @Decodetalkers) -- [x] [Tree-Sitter query language](https://github.com/nvim-treesitter/tree-sitter-query) (maintained by @steelsojka) -- [x] [r](https://github.com/r-lib/tree-sitter-r) (maintained by @ribru17) -- [ ] [racket](https://github.com/6cdh/tree-sitter-racket) -- [x] [ralph](https://github.com/alephium/tree-sitter-ralph) (maintained by @tdroxler) -- [x] [rasi](https://github.com/Fymyte/tree-sitter-rasi) (maintained by @Fymyte) -- [x] [razor](https://github.com/tris203/tree-sitter-razor) (maintained by @tris203) -- [x] [rbs](https://github.com/joker1007/tree-sitter-rbs) (maintained by @joker1007) -- [x] [re2c](https://github.com/amaanq/tree-sitter-re2c) (maintained by @amaanq) -- [x] [readline](https://github.com/ribru17/tree-sitter-readline) (maintained by @ribru17) -- [x] [regex](https://github.com/tree-sitter/tree-sitter-regex) (maintained by @theHamsta) -- [x] [rego](https://github.com/FallenAngel97/tree-sitter-rego) (maintained by @FallenAngel97) -- [x] [pip requirements](https://github.com/ObserverOfTime/tree-sitter-requirements) (maintained by @ObserverOfTime) -- [x] [rescript](https://github.com/rescript-lang/tree-sitter-rescript) (maintained by @ribru17) -- [x] [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) (maintained by @bamonroe) -- [x] [robot](https://github.com/Hubro/tree-sitter-robot) (maintained by @Hubro) -- [x] [robots](https://github.com/opa-oz/tree-sitter-robots-txt) (maintained by @opa-oz) -- [x] [roc](https://github.com/faldor20/tree-sitter-roc) (maintained by @nat-418) -- [x] [ron](https://github.com/amaanq/tree-sitter-ron) (maintained by @amaanq) -- [x] [rst](https://github.com/stsewd/tree-sitter-rst) (maintained by @stsewd) -- [x] [ruby](https://github.com/tree-sitter/tree-sitter-ruby) (maintained by @TravonteD) -- [x] [runescript](https://github.com/2004Scape/tree-sitter-runescript) (maintained by @2004Scape) -- [x] [rust](https://github.com/tree-sitter/tree-sitter-rust) (maintained by @amaanq) -- [x] [scala](https://github.com/tree-sitter/tree-sitter-scala) (maintained by @stevanmilic) -- [x] [scfg](https://github.com/rockorager/tree-sitter-scfg) (maintained by @WhyNotHugo) -- [ ] [scheme](https://github.com/6cdh/tree-sitter-scheme) -- [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva) -- [x] [sflog](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) -- [x] [slang](https://github.com/theHamsta/tree-sitter-slang) (experimental, maintained by @theHamsta) -- [x] [slim](https://github.com/theoo/tree-sitter-slim) (maintained by @theoo) -- [x] [slint](https://github.com/slint-ui/tree-sitter-slint) (maintained by @hunger) -- [x] [smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) (maintained by @amaanq) -- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol) -- [ ] [snakemake](https://github.com/osthomas/tree-sitter-snakemake) (experimental) -- [x] [solidity](https://github.com/JoranHonig/tree-sitter-solidity) (maintained by @amaanq) -- [x] [soql](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) -- [x] [sosl](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) -- [x] [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) (maintained by @Sarrus1) -- [x] [sparql](https://github.com/GordianDziwis/tree-sitter-sparql) (maintained by @GordianDziwis) -- [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride) -- [x] [squirrel](https://github.com/amaanq/tree-sitter-squirrel) (maintained by @amaanq) -- [x] [ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) (maintained by @ObserverOfTime) -- [x] [starlark](https://github.com/amaanq/tree-sitter-starlark) (maintained by @amaanq) -- [x] [strace](https://github.com/sigmaSd/tree-sitter-strace) (maintained by @amaanq) -- [x] [styled](https://github.com/mskelton/tree-sitter-styled) (maintained by @mskelton) -- [x] [supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) (maintained by @madskjeldgaard) -- [x] [superhtml](https://github.com/kristoff-it/superhtml) (maintained by @rockorager) -- [x] [surface](https://github.com/connorlay/tree-sitter-surface) (maintained by @connorlay) -- [x] [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) (maintained by @amaanq) -- [x] [sway](https://github.com/FuelLabs/tree-sitter-sway.git) (maintained by @ribru17) -- [x] [swift](https://github.com/alex-pinkus/tree-sitter-swift) (maintained by @alex-pinkus) -- [x] [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) (maintained by @RaafatTurki) -- [x] [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) (maintained by @ok-ryoko) -- [x] [t32](https://gitlab.com/xasc/tree-sitter-t32.git) (maintained by @xasc) -- [x] [tablegen](https://github.com/amaanq/tree-sitter-tablegen) (maintained by @amaanq) -- [x] [tact](https://github.com/tact-lang/tree-sitter-tact) (maintained by @novusnota) -- [x] [tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) (maintained by @lewis6991) -- [x] [teal](https://github.com/euclidianAce/tree-sitter-teal) (maintained by @euclidianAce) -- [x] [templ](https://github.com/vrischmann/tree-sitter-templ) (maintained by @vrischmann) -- [x] [tera](https://github.com/uncenter/tree-sitter-tera) (maintained by @uncenter) -- [x] [terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann) -- [x] [textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) (maintained by @Porter) -- [x] [thrift](https://github.com/duskmoon314/tree-sitter-thrift) (maintained by @amaanq, @duskmoon314) -- [x] [tiger](https://github.com/ambroisie/tree-sitter-tiger) (maintained by @ambroisie) -- [x] [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) (maintained by @ahelwer, @susliko) -- [x] [tmux](https://github.com/Freed-Wu/tree-sitter-tmux) (maintained by @Freed-Wu) -- [x] [todotxt](https://github.com/arnarg/tree-sitter-todotxt) (experimental, maintained by @arnarg) -- [x] [toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) (maintained by @tk-shirasaka) -- [x] [tsv](https://github.com/amaanq/tree-sitter-csv) (maintained by @amaanq) -- [x] [tsx](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka) -- [x] [turtle](https://github.com/GordianDziwis/tree-sitter-turtle) (maintained by @GordianDziwis) -- [x] [twig](https://github.com/gbprod/tree-sitter-twig) (maintained by @gbprod) -- [x] [typescript](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka) -- [x] [typespec](https://github.com/happenslol/tree-sitter-typespec) (maintained by @happenslol) -- [x] [typoscript](https://github.com/Teddytrombone/tree-sitter-typoscript) (maintained by @Teddytrombone) -- [x] [typst](https://github.com/uben0/tree-sitter-typst) (maintained by @uben0, @RaafatTurki) -- [x] [udev](https://github.com/ObserverOfTime/tree-sitter-udev) (maintained by @ObserverOfTime) -- [x] [ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) (maintained by @Philipp-M, @amaanq) -- [x] [unison](https://github.com/kylegoetz/tree-sitter-unison) (maintained by @tapegram) -- [x] [usd](https://github.com/ColinKennedy/tree-sitter-usd) (maintained by @ColinKennedy) -- [x] [uxn tal](https://github.com/amaanq/tree-sitter-uxntal) (maintained by @amaanq) -- [x] [v](https://github.com/vlang/v-analyzer) (maintained by @kkharji, @amaanq) -- [x] [vala](https://github.com/vala-lang/tree-sitter-vala) (maintained by @Prince781) -- [x] [vento](https://github.com/ventojs/tree-sitter-vento) (maintained by @wrapperup, @oscarotero) -- [x] [verilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) (maintained by @zhangwwpeng) -- [x] [vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) (maintained by @jpt13653903) -- [x] [vhs](https://github.com/charmbracelet/tree-sitter-vhs) (maintained by @caarlos0) -- [x] [vim](https://github.com/neovim/tree-sitter-vim) (maintained by @clason) -- [x] [vimdoc](https://github.com/neovim/tree-sitter-vimdoc) (maintained by @clason) -- [x] [vrl](https://github.com/belltoy/tree-sitter-vrl) (maintained by @belltoy) -- [x] [vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) (maintained by @WhyNotHugo, @lucario387) -- [x] [wgsl](https://github.com/szebniok/tree-sitter-wgsl) (maintained by @szebniok) -- [x] [wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) (maintained by @theHamsta) -- [x] [wing](https://github.com/winglang/tree-sitter-wing) (maintained by @gshpychka, @MarkMcCulloh) -- [x] [wit](https://github.com/liamwh/tree-sitter-wit) (maintained by @liamwh) -- [x] [xcompose](https://github.com/ObserverOfTime/tree-sitter-xcompose) (maintained by @ObserverOfTime) -- [x] [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) (maintained by @ObserverOfTime) -- [x] [xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) (maintained by @ValdezFOmar) -- [x] [yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) (maintained by @amaanq) -- [x] [yang](https://github.com/Hubro/tree-sitter-yang) (maintained by @Hubro) -- [x] [yuck](https://github.com/Philipp-M/tree-sitter-yuck) (maintained by @Philipp-M, @amaanq) -- [x] [zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) (maintained by @Freed-Wu) -- [x] [zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) (maintained by @amaanq) -- [x] [ziggy](https://github.com/kristoff-it/ziggy) (maintained by @rockorager) -- [x] [ziggy_schema](https://github.com/kristoff-it/ziggy) (maintained by @rockorager) - - For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information). -# Available modules +# Supported features -Modules provide the top-level features of `nvim-treesitter`. -The following is a list of modules included in `nvim-treesitter` and their configuration via `init.lua` (where multiple modules can be combined in a single call to `setup`). -Note that not all modules work for all languages (depending on the queries available for them). -Additional modules can be provided as [external plugins](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Extra-modules-and-plugins). +`nvim-treesitter` provides queries for the following features. **These are not automatically enabled.** -#### Highlight +## Highlighting -Consistent syntax highlighting. +Treesitter highlighting is provided by Neovim, see `:h treesitter-highlight`. To enable it for a filetype, put `vim.treesitter.start()` in a `ftplugin/.lua` in your config directory, or place the following in your `init.lua`: ```lua -require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} +vim.api.nvim_create_autocmd('FileType', { + pattern = { '' }, + callback = function() vim.treesitter.start() end, +}) ``` -To customize the syntax highlighting of a capture, simply define or link a highlight group of the same name: +## Folds + +Treesitter-based folding is provided by Neovim. To enable it, put the following in your `ftplugin` or `FileType` autocommand: ```lua --- Highlight the @foo.bar capture group with the "Identifier" highlight group -vim.api.nvim_set_hl(0, "@foo.bar", { link = "Identifier" }) -``` - -For a language-specific highlight, append the name of the language: - -```lua --- Highlight @foo.bar as "Identifier" only in Lua files -vim.api.nvim_set_hl(0, "@foo.bar.lua", { link = "Identifier" }) -``` - -See `:h treesitter-highlight-groups` for details. - -#### Incremental selection - -Incremental selection based on the named nodes from the grammar. - -```lua -require'nvim-treesitter.configs'.setup { - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", -- set to `false` to disable one of the mappings - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, -} -``` - -#### Indentation - -Indentation based on treesitter for the `=` operator. -**NOTE: This is an experimental feature**. - -```lua -require'nvim-treesitter.configs'.setup { - indent = { - enable = true - } -} -``` - -#### Folding - -Tree-sitter based folding (implemented in Neovim itself, see `:h vim.treesitter.foldexpr()`). To enable it for the current window, set - -```lua -vim.wo.foldmethod = 'expr' vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' ``` -This will respect your `foldminlines` and `foldnestmax` settings. +## Indentation -# Advanced setup - -## Changing the parser install directory - -If you want to install the parsers to a custom directory you can specify this -directory with `parser_install_dir` option in that is passed to `setup`. -`nvim-treesitter` will then install the parser files into this directory. - -This directory must be writeable and must be explicitly prepended to the -`runtimepath`. For example: +Treesitter-based indentation is provided by this plugin but considered **experimental**. To enable it, put the following in your `ftplugin` or `FileType` autocommand: ```lua - -- It MUST be at the beginning of runtimepath. Otherwise the parsers from Neovim itself - -- is loaded that may not be compatible with the queries from the 'nvim-treesitter' plugin. - vim.opt.runtimepath:prepend("/some/path/to/store/parsers") - - require'nvim-treesitter.configs'.setup { - parser_install_dir = "/some/path/to/store/parsers", - - ... - - } +vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" ``` -If this option is not included in the setup options, or is explicitly set to -`nil` then the default install directories will be used. If this value is set -the default directories will be ignored. +(Note the specific quotes used.) -Bear in mind that any parser installed into a parser folder on the runtime path -will still be considered installed. (For example if -"~/.local/share/nvim/site/parser/c.so" exists then the "c" parser will be -considered installed, even though it is not in `parser_install_dir`) +## Injections -The default paths are: +Injections are used for multi-language documents, see `:h treesitter-language-injections`. No setup is needed. -1. first the package folder. Where `nvim-treesitter` is installed. -2. second the site directory. This is the "site" subdirectory of `stdpath("data")`. +# Advanced setup ## Adding parsers @@ -625,139 +130,56 @@ If you have a parser that is not on the list of supported languages (either as a 3. Add the following snippet to your `init.lua`: ```lua -local parser_config = require "nvim-treesitter.parsers".get_parser_configs() +local parser_config = require "nvim-treesitter.parsers".configs parser_config.zimbu = { install_info = { url = "~/projects/tree-sitter-zimbu", -- local path or git repo files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc -- optional entries: - branch = "main", -- default branch in case of git repo if different from master + branch = "develop", -- only needed if different from default branch generate_requires_npm = false, -- if stand-alone parser without npm dependencies requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c }, - filetype = "zu", -- if filetype does not match the parser name } ``` +If you use a git repository for your parser and want to use a specific version, you can set the `revision` key +in the `install_info` table for you parser config. -If you wish to set a specific parser for a filetype, you should use `vim.treesitter.language.register()`: +4. If the parser name differs from the filetype(s) used by Neovim, you need to register the parser via ```lua -vim.treesitter.language.register('python', 'someft') -- the someft filetype will use the python parser and queries. +vim.treesitter.language.register('zimbu', { 'zu' }) ``` -Note this requires Nvim v0.9. +If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`]() to add a custom detection rule. -4. Start `nvim` and `:TSInstall zimbu`. +5. Start `nvim` and `:TSInstall zimbu`. You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`. Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`. -Note that neither `:TSInstall` nor `:TSInstallFromGrammar` copy query files from the grammar repository. -If you want your installed grammar to be useful, you must manually [add query files](#adding-queries) to your local nvim-treesitter installation. -Note also that module functionality is only triggered if your language's filetype is correctly identified. -If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`]() to add a custom detection rule. - -If you use a git repository for your parser and want to use a specific version, you can set the `revision` key -in the `install_info` table for you parser config. ## Adding queries -Queries are what `nvim-treesitter` uses to extract information from the syntax tree; -they are located in the `queries/{language}/*` runtime directories (see `:h rtp`), -like the `queries` folder of this plugin, e.g. `queries/{language}/{locals,highlights,textobjects}.scm`. -Other modules may require additional queries such as `folding.scm`. You can find a -list of all supported capture names in [CONTRIBUTING.md](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations). - -The first query file on `runtimepath` will be used (see `:h treesitter-query`). -If you want to make a query on the user config extend other queries instead of -replacing them, see `:h treesitter-query-modeline-extends`. - -If you want to completely override a query, you can use `:h vim.treesitter.query.set()`. -For example, to override the `injections` queries from `c` with your own: +Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see `:h treesitter-query`. +E.g., to add queries for `zimbu`, put `highlights.scm` etc. under ```lua -vim.treesitter.query.set("c", "injections", "(comment) @comment") +vim.fn.stdpath('data') .. 'site/queries/zimbu' ``` -Note: when using `query.set()`, all queries in the runtime directories will be ignored. - -## Adding modules - -If you wish you write your own module, you need to support - -- tree-sitter language detection support; -- attaching and detaching to buffers; -- all nvim-treesitter commands. - -At the top level, you can use the `define_modules` function to define one or more modules or module groups: - -```lua -require'nvim-treesitter'.define_modules { - my_cool_plugin = { - attach = function(bufnr, lang) - -- Do cool stuff here - end, - detach = function(bufnr) - -- Undo cool stuff here - end, - is_supported = function(lang) - -- Check if the language is supported - end - } -} -``` - -with the following properties: - -- `module_path` specifies a require path (string) that exports a module with an `attach` and `detach` function. This is not required if the functions are on this definition. -- `enable` determines if the module is enabled by default. This is usually overridden by the user. -- `disable` takes a list of languages that this module is disabled for. This is usually overridden by the user. -- `is_supported` takes a function that takes a language and determines if this module supports that language. -- `attach` takes a function that attaches to a buffer. This is required if `module_path` is not provided. -- `detach` takes a function that detaches from a buffer. This is required if `module_path` is not provided. - -# Extra features - -### Statusline indicator - -```vim -echo nvim_treesitter#statusline(90) " 90 can be any length -module->expression_statement->call->identifier -``` - -### Utilities - -You can get some utility functions with - -```lua -local ts_utils = require 'nvim-treesitter.ts_utils' -``` - -Check [`:h nvim-treesitter-utils`](doc/nvim-treesitter.txt) for more information. - # Troubleshooting 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}`... +#### Feature `{X}` does not work for `{language}`... -First, check the `health#nvim_treesitter#check` and the `health#treesitter#check` sections of `:checkhealth` for any warning. -If there is one, it's highly likely that this is the cause of the problem. +1. Check the `nvim-treesitter` section of `:checkhealth` for any warning, and make sure that the query for `{X}` is listed for `{language}`. -Next check the `## Parser/Features` subsection of the `health#nvim_treesitter#check` section of `:checkhealth` to ensure the desired module is enabled for your language. -If not, you might be missing query files; see [Adding queries](#adding-queries). +2. Ensure that the feature is enabled as explained above. -Finally, 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. -If not, add a short Vimscript file to nvim-treesitter's `ftdetect` runtime directory following [Neovim's documentation](https://neovim.io/doc/user/filetype.html#new-filetype) on filetype detection. -You can also quickly & temporarily set the filetype for a single buffer with the `:set filetype=langname` command to test whether it fixes the problem. - -If everything is okay, then it might be an actual error. -In that case, feel free to [open an issue here](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose). - -#### I get `module 'vim.treesitter.query' not found` - -Make sure you have the latest version of Neovim. +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 @@ -773,32 +195,10 @@ or due to an outdated parser. - Make sure you have the parsers up to date with `:TSUpdate` - Make sure you don't have more than one `parser` runtime directory. - You can execute this command `:echo nvim_get_runtime_file('parser', v:true)` to find all runtime directories. + You can execute this command `:= vim.api.nvim_get_runtime_file('parser', true)` to find all runtime directories. 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 experience weird highlighting issues similar to [#78](https://github.com/nvim-treesitter/nvim-treesitter/issues/78) - -This is a well known issue, which arises when the tree and the buffer have gotten out of sync. -As this is an upstream issue, we don't have any definite fix. -To get around this, you can force reparsing the buffer with - -```vim -:write | edit | TSBufEnable highlight -``` - -This will save, restore and enable highlighting for the current buffer. - -#### I experience bugs when using `nvim-treesitter`'s `foldexpr` similar to [#194](https://github.com/nvim-treesitter/nvim-treesitter/issues/194) - -This might happen, and is known to happen, with `vim-clap`. -To avoid these kind of errors, please use `setlocal` instead of `set` for the respective filetypes. - -#### I run into errors like `module 'nvim-treesitter.configs' not found` at startup - -This is because of `rtp` management in `nvim`, adding `packadd -nvim-treesitter` should fix the issue. - #### I want to use Git instead of curl for downloading the parsers In your Lua config: @@ -828,24 +228,12 @@ require("nvim-treesitter.install").prefer_git = true In your Lua config: ```lua -for _, config in pairs(require("nvim-treesitter.parsers").get_parser_configs()) do +for _, config in pairs(require("nvim-treesitter.parsers").configs) do config.install_info.url = config.install_info.url:gsub("https://github.com/", "something else") end -require'nvim-treesitter.configs'.setup { +require'nvim-treesitter'.setup { -- -- } ``` - -#### Using an existing parser for another filetype - -For example, to use the `bash` tree-sitter to highlight file with -`filetype=apkbuild`, use: - -```lua -vim.treesitter.language.register("bash", "apkbuild") -``` - -The `bash` tree-sitter must be installed following the usual procedure [as -described above](#language-parsers). diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md new file mode 100644 index 000000000..a388c9c9a --- /dev/null +++ b/SUPPORTED_LANGUAGES.md @@ -0,0 +1,305 @@ +# Supported languages + +The following is a list of languages for which a parser can be installed through `:TSInstall`. + +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 + + + +Language | Tier | Queries | CLI | NPM | Maintainer +-------- |:----:|:-------:|:---:|:---:| ---------- +[ada](https://github.com/briot/tree-sitter-ada) | | `HF  ` | | | @briot +[agda](https://github.com/tree-sitter/tree-sitter-agda) | | `HF  ` | | | @Decodetalkers +[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJ` | | ✓ | @dlvandenberg +[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  ` | | | @aheber +[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJ` | | | @ObserverOfTime +[asm](https://github.com/RubixDev/tree-sitter-asm) | community | `H  J` | | | @RubixDev +[astro](https://github.com/virchau13/tree-sitter-astro) | | `HFIJ` | | | @virchau13 +[authzed](https://github.com/mleonidas/tree-sitter-authzed) | community | `H  J` | | | @mattpolzin +[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/vito/tree-sitter-bass) | | `HFIJ` | | | @amaanq +[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF J` | | | @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` | | | @NoahTheDuke +[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) | community | `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/gdamore/tree-sitter-d) | stable | `HFIJ` | | | @amaanq +[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 +[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | community | `H  J` | | | @ColinKennedy +[djot](https://github.com/treeman/tree-sitter-djot) | community | `HFIJ` | | | @NoahTheDuke +[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | | `H  J` | | | @camdencheek +[dot](https://github.com/rydesun/tree-sitter-dot) | | `H IJ` | | | @rydesun +[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ` | | | @amaanq +[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HF J` | | | @ObserverOfTime +[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J` | | | @glehmann +[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H   ` | | | @RubixDev +[eds](https://github.com/uyha/tree-sitter-eds) | community | `HF  ` | | | @uyha +[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 +[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) | | `HF J` | | ✓ | @alexmozaidze +[fidl](https://github.com/google/tree-sitter-fidl) | community | `HF J` | | | @chaopeng +[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 +[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | community | `H  J` | | | @godofavacyn +[git_config](https://github.com/the-mikedavis/tree-sitter-git-config)[^git_config] | | `HF J` | | | @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 +[gn](https://github.com/amaanq/tree-sitter-gn) | stable | `HFIJ` | | | @amaanq +[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | community | `H  J` | | | @dpezto +[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 J` | | | @pierpo +[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J` | | | @camdencheek +[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H   ` | | | @amaanq +[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J` | | | @qvalentin +[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/murtaza64/tree-sitter-groovy) | community | `HFIJ` | | | @murtaza64 +[gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) | stable | `H   ` | | | @theHamsta +[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` | | | @mrcjkb +[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 +[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J` | | | @qvalentin +[hjson](https://github.com/winston0410/tree-sitter-hjson) | | `HFIJ` | | ✓ | @winston0410 +[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJ` | | ✓ | @theHamsta +[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | community | `H  J` | | | @Freed-Wu +[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `HF 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, @NTBBloodbath +[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ` | | | @pfeiferj +[hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) | community | `HFIJ` | | | @luckasRanarison +[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J` | | | @cathaysa +[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF  ` | | | @theHamsta +[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJ` | | | @yorickpeterse +[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 +[just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJ` | | | @Hubro +[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 +[koto](https://github.com/koto-lang/tree-sitter-koto) | community | `HF J` | | | @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) | | `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 +[leo](https://github.com/r001/tree-sitter-leo) | community | `H IJ` | | | @r001 +[linkerscript](https://github.com/amaanq/tree-sitter-linkerscript) | stable | `HFIJ` | | | @amaanq +[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | community | `H  J` | | | @hankthetank27 +[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | community | `HFI ` | | | @toots +[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) | | `HFIJ` | | | @Decodetalkers +[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   ` | ✓ | | @artagnon +[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J` | | | @Freed-Wu +[nasm](https://github.com/naclsn/tree-sitter-nasm) | stable | `H  J` | | | @ObserverOfTime +[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I ` | | | +[nim](https://github.com/alaviss/tree-sitter-nim) | community | `HF J` | | | @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) | | `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 +[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J` | | | @ColinKennedy +[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/tree-sitter-perl/tree-sitter-perl) | | `HF J` | | | @RabbiVeesh, @LeoNerd +[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | | `HFIJ` | | | @tk-shirasaka +[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | | `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 +[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | community | `H   ` | | | @RabbiVeesh, @LeoNerd +[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 +[printf](https://github.com/ObserverOfTime/tree-sitter-printf) | stable | `H   ` | | | @ObserverOfTime +[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `HF  ` | | | @elianiva +[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J` | | | @MichaHoffmann +[properties](https://github.com/ObserverOfTime/tree-sitter-properties)[^properties] | stable | `H  J` | | | @ObserverOfTime +[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 +[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  J` | | | @postsolar +[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 J` | | | @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) | | `HFIJ` | | | @Fymyte +[rbs](https://github.com/joker1007/tree-sitter-rbs) | community | `HFIJ` | | | @joker1007 +[re2c](https://github.com/amaanq/tree-sitter-re2c) | stable | `HFIJ` | | | @amaanq +[readline](https://github.com/ribru17/tree-sitter-readline) | community | `HFIJ` | | | @ribru17 +[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 +[roc](https://github.com/nat-418/tree-sitter-roc) | community | `H  J` | | | @nat-418 +[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 +[slang](https://github.com/theHamsta/tree-sitter-slang)[^slang] | unstable | `HFIJ` | | ✓ | @theHamsta +[slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJ` | | | @hunger +[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | community | `HFIJ` | | | @amaanq +[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H   ` | | | @amaanq, @keynmol +[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJ` | | | +[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `HF  ` | | | @amaanq +[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H   ` | | | @aheber +[sosl](https://github.com/aheber/tree-sitter-sfapex) | | `H   ` | | | @aheber +[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  J` | | | @Sarrus1 +[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 +[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | stable | `HFIJ` | | | @ObserverOfTime +[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJ` | | | @amaanq +[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J` | | | @amaanq +[styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ` | | | @mskelton +[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJ` | | | @madskjeldgaard +[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ` | | | @connorlay +[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | stable | `HFIJ` | | | @amaanq +[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 +[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | stable | `HFI ` | | | @lewis6991 +[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJ` | ✓ | | @euclidianAce +[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J` | | | @vrischmann +[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ` | | | @MichaHoffmann +[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | community | `HFI ` | | | @Porter +[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 +[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | community | `H  J` | | | @Freed-Wu +[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unstable | `H   ` | | | @arnarg +[toml](https://github.com/tree-sitter-grammars/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 +[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/ObserverOfTime/tree-sitter-udev) | stable | `H  J` | | | @ObserverOfTime +[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) | | `HFIJ` | | | @amaanq +[v](https://github.com/vlang/v-analyzer) | | `HFIJ` | | | @kkharji, @amaanq +[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF  ` | | | @Prince781 +[vento](https://github.com/ventojs/tree-sitter-vento) | community | `H  J` | | | @wrapperup, @oscarotero +[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/tree-sitter-grammars/tree-sitter-vue) | stable | `HFIJ` | | | @WhyNotHugo, @lucario387 +[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/tree-sitter-wing) | community | `HF  ` | | | @gshpychka, @MarkMcCulloh +[wit](https://github.com/liamwh/tree-sitter-wit) | community | `H  J` | | | @liamwh +[xcompose](https://github.com/ObserverOfTime/tree-sitter-xcompose) | stable | `H  J` | | | @ObserverOfTime +[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HFIJ` | | | @ObserverOfTime +[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | stable | `HFIJ` | | | @amaanq +[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ` | | | @Hubro +[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJ` | | | @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) | | `HFIJ` | | | @maxxnino +[^gdscript]: Godot +[^git_config]: git_config +[^glimmer]: Glimmer and Ember +[^godot_resource]: Godot Resources +[^jsonc]: JSON with comments +[^luap]: Lua patterns +[^markdown]: basic highlighting +[^markdown_inline]: needed for full highlighting +[^php]: PHP with embedded HTML +[^php_only]: PHP without embedded HTML +[^poe_filter]: Path of Exile item filter +[^properties]: Java properties files +[^query]: Tree-sitter query language +[^slang]: Shader Slang + diff --git a/TODO.md b/TODO.md new file mode 100644 index 000000000..5b5dba199 --- /dev/null +++ b/TODO.md @@ -0,0 +1,34 @@ +# Roadmap + +This document lists the planned and finished changes in this rewrite towards [Nvim-treesitter 1.0](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767). + +## TODO + +- [ ] **`query_predicates.lua`:** upstream/remove +- [ ] **`parsers.lua`:** modularize? +- [ ] **`parsers.lua`:** assign tiers +- [ ] **`install.lua`:** fix messages, add sync support (@lewis6991) +- [ ] **`install.lua`:** simplify compilation: + - hardcode one compiler + args per platform + - 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` +- [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1) +- [ ] **update-lockfile:** one commit per parser/tier? +- [ ] **documentation:** consolidate, autogenerate? +- [ ] **documentation:** migration guide +- [ ] **textobjects:** include simple(!) function, queries? (check Helix) +- [ ] **downstream:** adapt to breaking changes (`nvim-treesitter-textobjects`, `nvim-treesitter-refactor`) + +## DONE + +- [X] remove module framework +- [X] remove extra utilities +- [X] refactor `indent.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] remove locals from highlighting (cf. https://github.com/nvim-treesitter/nvim-treesitter/issues/3944#issuecomment-1458782497) diff --git a/assets/logo.png b/assets/logo.png deleted file mode 100644 index a60e536bcaf45d9612175d50ce817678bb23fb6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26664 zcmeAS@N?(olHy`uVBq!ia0y~yU^oH79Bd2>3~M9S&0}ClfA8ty7*a9k&0h97D&eL2 zHSgA5*r|R#XU0vLC3mN8(Qag6QW5yXe7dP!UgMy#AIoivgv91vLywm9+23;vZb&4n z7&xXFJlxzfk>!+Arl{HTyEo_ZPOe^7e0A^r_j8I@?@Heq<@?HjJH3AE<%O@pO0U{} zfAW9h!jmWWzF8IS8drSx^_qG6-hKSO|7+~73Fo)gK6B@1X!y$1K8^7JbHk*YMGOxt<01>5?6om)s^}G4~xIq zIy+8L=UMBIulu)e-t+tA@ws2cW3BEMhHPXo65_pY{aU~2&-ed-jbA;vxIDekH+${V z*J9PX=ihoQf3Lb`+41?OQ{2~n@s+>%=YIL0uh&-p-rk>|`{nBy@sn=x2WDy%eU+}? z`uB6W{p&g97q!0}k@(@P{-U`0Y}@slul0Am$~m5OfA%j&MfO|T^Y`8E5oi0}6<_Uo zJGb2a_NRmOJGVbx&Cg%*C*%9M7q9RC+MjN9Zl{mmk*xa9?c4t>$xlA*+PiPs&qd3U zC%kxF|M=CF-*z8u89Ex-1YVkb=zqf;tJj$Gdf$!6y$`eg$e6$VEwG2r%+$!@>0Xa* z4N~%Re?{7u8nbmCarw2k{(tI1MWLR=ttE4&|NC73qv-bY_rK=7h?=wNCU0cI6PLAp z=Jge)V{4_O^)tR~J;QD)+H4`d@5!bs^0ja5Q%vMI?S!40W}Rrzt3ILA_w8?Y^ZSfP z^W6^h`qt{}GUTrcnK-xm+Sw<&lGfM1-ksw8{F8BQ`ucl6+OGZoywp9_KmWeZF&lBu z?0auIu2x=dH@|;%`^MDd#p^TInXKngQZf|W`%U+Hd0qAE!y8}U`^j!>wQZ^G%zv-X z*YMu)V49w>_D{jd=`Y0?*0U&0o1vulGfIcHTB-&yfy=gVtn|APXfcJcb0Z6@h#8>g*( zoBi_(|NiO!y8Z7homxNf>OJTAxA(5T?jBcomiMyc;e8)e#og+k?%IBt)ivpeh>7G! zv*}$4U%xa8G{tpiq<*~KDzoBF%GKXC96#^OZ|QMNJ}$IC{kY?n(sG~g-z}%deDvF$ z&$}Xr?aGf6lHUZr?6)`Kc-OtICizYM{@-UW%l@9D6dSm4mAQ42?yis5&VK)rn-O{Y zh4&oZvz?BM%=dgYzinTCz3)Wp^u3Ha+FS}FS2K9p6zmU@vdI<^l|+E?_cC=o^&e-d0$GOXc2W}f!eV{f8X2-&AzK$|5i3# z`gGK`w7tzdYypXUOR~yyS7xlc#&q)%V^xyPAFibyKa!)Y9C>BgV|9G~PFy>8L7V@l zt=`-&-p9A(2&A8W`hG+BJn`_KIw!WR`%pYpQZ-X7&bf?f&9^+eaFuJbDsKP&UuE@p zes)QkcCWd0mhRrhnJJ}<*B7gqB(qJl_1=BU?r-yaSH0b@)?S_e*egpvp8eiKTa(6& z`ytv#?tieZ=ggJ8xS40>cXqyu+(oz9mV~4V{j&3|n&P(N^KbRvXMf}_P&@7@eaz|b zJ$XCU2W@@^Qj^0fw>b0M?5;BJoc3+=?kZXFr0f5Vy2|0UzgCdul(SVzm z%vB0wp!#m>>^G&e<2_dwlr4Jn zY)foV{hx!v59YpLU%i;Uq)zBUhWh)7Y#YMo-haIBN2s~|{Tp%r|FH-5i+7s%-V5j| z(O-H+aLyMMPo3H4JKKJ}&|^>+Gg)32I&bt}uM-`gf1S+Fr6wtM*j>mAZ-R8L1HDSn?-JaxOhUD%KJ z`S*qL3xmS{-}}YC_xbMdx4Yi_+PA-B>6?8EAHEU3{oeB95 zke9Jz+SPgTeTvc6KR&;DKKX3Z-kjS0>Ze<`&#BW@y1UKdTigAgB1Wo4%!aH+@dfva zIIpC%)dd^Ov!A)}=)xZ_Z0AQ^wcht|?fgA&HhSOR@#ZeWt*@uN8bls_d@uL!QHHi;|z1X_{qvg&O{c;nwe%dqrX#MB& z@5K9ddmIsdF#iSn&CB6G=Q=gizmiy${wGe`Yl+L%OV&GzD?V>hFTTDn{c`;ht2?et zEdgHKx2GyBZTS10@2;```8ArEY=@FhJ#$<8^!on)N9|wkFxa`~;{Jy|CX1KsJrsNY z->%I+KW*on(~#Vpu(kAZ%e5Vgwv`Dj=Gfip%ckk57PMf~Xu zZ{+X(Px-pzmCOIQx%0m`G_O70&QKM;F)Q`v6VBk}Y#yym2fS5OZq#Nk*z>q>L-;)Y zen;8x4E_| z>P(wcor|rve$wZ#2@x^vzbUg<>_AV) zWVx%l`u=+HbIv@;J6miLdnA%|(n*tw!|Dzqn^bN(MCHuqP&PO{Rf5g0?7QoF7fyzI z=hPj)>9CeQ;)u{b_xOFXjFIB=#`l+<9?0L~y>{xe<6J8*vkANZD{fu*xYJK)+8pj@ z9NrNbA19rWqsL~kGA~te*L?cyZCncF9UI- zttCgN?f;o9e!u*9ys7x)GZuV7dtO_|EBgDHC0{ygy7r6J{Mk~8$BqVbZF1KLn~s;>55s&r$uSwsCFj)u-j z&MS`uX`6daj_l_%*v}VqZ@R}4N4;3jyp*D+i$2Qtc<*=L z#H?U_kn!S1#iTu-)-8Xq=xDVqx0l6PS#_<)mnI4(a$28pz8D}Dy8r5Tk^K+&S?|f; z4-Y#(>&t1qy1$$3EC2r1|8?nE_U}0J+wHeBE*1Zo{;p4N|I1|Y`_tcbne^^5O=de; z|GRkpV6O!7+>v;6f= z{+4r`aT1&6&65S6G)}0Vc6_epVdcB`n9`5GzkhyxVsSK0X)*iNUsu){F}OG=G~ZB4 zVN;f5U~zSrdg;MbQH}WKPaoDZt$)%SAEKbk80X3R_s!?(ynlD{@0Xtpwtw~iq0fBZ z!^-Kl%Fg0sN8o`SjlR0=K1&XBSgx|u zP@JQyA1$@>Q+?g4s+fnz`d**mVExskQCh+CaTb$Cp~)Nx<@06?x0F=QYRDam+`Gl! z#+65SQqVC*2A#JJ-761$b{7`un6h`ZM{V%q#R5+zRvzcO^ff@_ZlR?=56hJDyjETB z?@waq>T_N=)f=s2smOCz!T8BU%~P(z_a`#V>0rGyO+lA)TlU4@d->=6dX;{!@P4=4 z|9cPDSGk&AK7L8Wg#V9Y^sJdr?tNSOvCaKX`qb{w9j|xCFA=q#wxqLFOJJ43lOS1h zx#bFeP1`tD+0G2?n%VHS!DCxv^+)ZzP5Kol|MReKePVIc@d8KrVingL+qE>k{NG)3 z@qVfoWVBea{^Y3*Spt%w3zi%#UikK5ledFFn*>7Eya+0qvK3WiUzivZHUdp{*uaFsM_?5&yI&>_0>ygIQJyYqAnCHnm z{{Kp^-`@BA;qpAaIT}x&|FAhP=~eC;zUQU0_}$5`x=gkR?T$af^;XAWVPB?c-%O~^oPM#aD^;=$KulsMlF@yEEn@L0c9|PAXe}(^w zY*kx3ZBI(FiD7fb4ttY?CCvT$yQfQR?Nt7COF#I?T$Kg^m7@WyA&1o~>L+;}E1M<5 zf8KR^piaR*F{wXMfjiebv>iM@Nq0fv0WOel1i=yVWUmjHl&+Sc~6uEr& z^m3b@>$3_PWK2aqo=ZDXFjcnugz}MNx&d<-mNM1(dA6l}b>DjCRm`2K6_;=CW6m>K z_j$5xRn81y2JW2(?Ol&`SZDocyrLk=8M@NJ>t^F*h8t{()kl|}?~L5ZH+OGBu!@Ja z#H*!d-YF_E7%~Q+GNritg$y`S9AZt@2rnCG^&ID zehLb*Y5iunjl-~iy#+68{h^b|EJ6#_)jLjJ`C(9bAb|JqeZ}2Xj%v}GlEtmJqI`C+ zS~YKJ-In8J#du}WvO6oD7jPWdw!8oD>G1oXU-g?N#=DQ7R_H~rM&m6 z-S;(;F8)2Tx^_PwgqLXg@AUun>a(XQSBON++`Y=x4#yrn5p+74@KtB&0=abu%HC^f z)lE8mt!Zz{&#Ps>7x_M@4msZ_JlQs2R?N{QLO;!s$6`Ny87U& z7te~HsXeIqk*Qdabvw|Tb$#Fqj)hCFS*@y>8|Jk=%QreITek8=Uv2%*!~3hhIe-2w zF}o#8(MjvowN=vgRUgm4I;&E=O5@A7_dDi(p5LXgg!kH`)CaSpimERfMSb0SxccPf zC$jf^=SSc5mVAEd=@ZB5uWS=)vlWY;zCO6~30GfzMQTv)p1;-+qD70}6dHYf<=9*K zRV_)gOyGvz)VGt^b*DY~ds>yjs_m-X%)IA|w9if~Y~pe{_AcT`X!qK=Z@l=j0+KpE z*i^jLJudfUSJGm;ZuW(qdmmk&GfUs&a`(c_BmsqwcFOM4^!8_7{lD{J^7K2~GID?I z`B~j_*3tAyzr)?A+Q;ttZk|QQ=Io2QFh}CZ{jWD_|7~pczq~|Vb_wUnlg)36O2g*) zPo7yc>rrOZNloK0j|(#mXSpf~vEMvc`o_ZX?&)~$cc<&7s%gkQm%ZbAKk&fC5XrVI zk&stsHC0_a+I}89A9(A5&sSTcHJ+}M#dcPmWH^4lR^Ml$(MTt#=oCJQ*-7W2utkkRhLa6p5Br86_>YPa?Jzi-d)`SR}i z-uF%ZOLi~5TU^PuKV!&T07hBaJI_&>1KwL&q#O+PtiINaFogQS?uaH z(^UDUH-(<ZUdhUcn)15?k^)}cYUc1>mcJGt3?{~a?${+VJI{O~ubEbrVwXPjE zFU`HU)x7S>qw1i!6KCn`6{k)3WNiPxtv=53(3ZJDbB)T72?&HsTks`4tX8X2)lH6c@ zeTUn9HTT#vPp(w6^72``{8N|k)=T=;r(gB&`5UaiJN@tJsyLJD&o64M63%alUZuV3 zU0eSIm6a>Yvybsi`u9P6zvSPm+xMtetXFqC?&WX)!?$$PeTjo@U6q@pZG!XP}!?MkjZijB1GBf2XkGj>)c5CsEl`mp!?2MV+U;i!q7T1}Q9dUS_+VPvQ z)@ElaV^-Ad6g;<-Ytc)KNah5NlX@v#-3zkZ$~;0ZT<&eKFPU>?;aVuyQjf@v+O3PuP&}Edi;M^>SzAA@B6szYG5nH^k+~9~<8=IKJG_!dXQ?c+8v4`pR?xjaMWw`NiJ{G^UF2q#o z@Z3+!PNj-5JXV(JoiFjUq}0T=Z&==WE|$7Q6R}`Teg`wddD3+RJ86DLnU~^xSQq%t!w^4?o~H&a%E*i>)PhAA;CEN{*A*j$zBnZy#Z)8o*OrCq1g zEM`yO{mGeRko~bp>$&P}RjK8Mr+3e1%D!k6G56>Bq^pN7Zu|S^)m4$u(?SW>Q?eE< z)jgoE{h`b5uj|UD>y15+r`G(sQC0w_DaWZ{o%W{;>FfQY#-P`^?mR4`ij&3 zL31b0`}xn;IBmkG&Hev$b{Ne)>!K9C_v7EU|I5x_R+=eyaVJmZq=KTKe}8)}J;?cd zz7$72uMv~fgKw{V8?t7e>S?;azki>YQxVJFm=ykS8_ui;2~YhrWW9t19VW0%EL!z@ z!qoE<78&YI))lqT=+Fw=n4l77cxL;gP8D_&e;Gzos}t*@G#z{Aq?B(FdD0j?seXyb z5$h$&CLV=q1_z(#D75hDaf)-^-Wu?0Limj$l?b!^A3L93>U-M0ukM4s+`nT7&!7AJ z*)Co4uISy8zwO)qe6NvyXPh?S(zW03dE=tr+CGrA=P|mw@sQ>JN%6|o3t|@O#Lty{ zdc;{ht3i0j3eLC8Gjo=T-ig}OHBngo_(?m?H~g#9C679|Y|4FgvNvl{&)tLhJylBD zPsKGtJ+yp!idpVonKaodOmB9r(wo@euKuM}KZI_0hZi!XDV<&Ur+OY+_01{|`CZ3f z`=tF*xRYoZ6y9nVSD+leVaBS7iotXIW(K$Jz5nNc@cP~FxvTdZTu#57G3#1Z;9=dX zl6ybws!W?S^R~j#nw!>zPgW*GZjZ9kZ1QCdyvZZ^eAk4fPh6|=Zzq)MGn!WPyzNPm z`t!Jb$GOEzdvjUmJlS?O!2Xo7XqQdmI&Wc7pIobV&d*KfY21og$EcWlvh0U(%-@Rv z)909Uy4kv3_MN1(IyBYms=GAf`tDcuJ}t4wgk#d*SF`av68TcrH)UDExm`ua_yf2K z**?!%8S}xtuI%@`@AdD>7nPj`Pj0g!-RKh@Mi>nw6}`1AGub|Wzf|%EY6L*u<+{kAb#0%b|u&Mzxj2! zzV7ti>9&8iHgB(VeR}qIb1uWr-hB-XmtrrTy?)oL?f0CyGMirozIa>l$8*QFCYvn% zc>a6;auuSiD&;H$10Fla%<2kakz6o=d3CwzkM{ClUTeR&|0nD=gwH#ELXj;i#7#IS zWbv$KAHnq%HY?}3WDDCH&S%xs_$XrR5z!fFwlg~5q(sP`6M+E+SC2`AGqZPcPH3FC zFx6ZAdi8=Wn|^#dqJLwNRq_0_73=3b7iH1+aN^qd{<*XLt-9|A%74$7-D_XG%E0dR z!CBpZ#7kaYofs5*Q8#~A>FN5~*Ur)LmX;xN=DfAoJW1hcdi}r4n%s-G9EhwIO#J*v z#rg0Yo=kJDe;b{js4bns8`8R{P;1>LG2P`YPFeXE(n8!qw(_jnEoJ8@)WXzyu=2vR z1AkX>Z<@4r%Cn$a+l&{dH|*&8D&5t=zE*e%uaVI52MZX=xKCfxJAC8tgUMDAD$n$6 zzbcgU+Xt)*n|k5jf`-33+nO!Iw#|^KO3H9Fm@L zGN=C98VMI(dHHXB@9Lj@(N?;?GB>zL{-)Sdp_f1Z{Sffv%6~4bU@bPeoI{ma>hZz5 zs@4pujw(`%wr7Xz)+jwX=Wt>u&#K-2s+SkI`?cQO$?_&`fs^xMyZKLp;*Kw!RUY#H z#5Ip45?}J3h+J#}#&)b07!m3ynMywi+z(9QlP#G+A^w>|D}^=o^Z<&LxZ zXSp3+wX7uk%Ovx=o1WTFnmaMGTy*ua$mO#tes8~DzwG?mdsiQPeXo2&hRLi$)$+me znhn?U8$X>>KM+?qZ==7ClYt_C_(li4uq2)JN1m?FYmt7{qW;yvw{N1XbDVm}%z~uF zbCVanIaKJdrM%eX&I*qeO@(_}Y-1R01YBQD)Z}^4vbRLk{g(Hcl&l8|Hx+H~eVgF; zVT0W5Qa?(@H6y18>kl<0|wu8$SIYt3h{xG2sw zP@QXc_;!AAr;ev+rnF4F?<+ycFKO|sm!D_wQt`bkb9owXM6WVu`|h-3s~%~@%nfEH=>yFnoLiT&9`nju@9G;?i_N-xm+0)ROyB&W-*%`|= z#zjwkACScoSZ=}*v+nzccK=PeO>O())il+ktrbkaEKzScxlDXYz3Ji~$8VacXO-^% zc31je+P3oxPOi|rvnPFVNcfvg@%vLh+g_Y<*XnL^+F6CHf(IE7AIjT1{|ub6Vfg`R zOIEpC;w!@@oW9oh$!p4Cm!090C1)*q`fu-)BtLE|zcXhz99FfeZ9L`M;8dzUJ+Ve7 zvr+3wWN(r3f(w3~M>v(Ivxwi~KQZTkYe<*WEryIKCO^c#E8li$&=S4L*ybZTL!G5l zYT+wKQ_E8YE9Z7+#H8H0w3*+z{7=ZvD#J;AbFLrF{i`i@cgv@)KJE11GP64V>|{EA z^>KW*`;$!}=_R*f*F9U}BmVB^yYHN=OClH&-A`06>2}>_8E`dn&n1?(Mm(>=P6#$g zPrYBJm$+gU*2_d$&sL?z^(Z z?U&4tk`N?WeGLf+KblWUt#rJO`bBaZEdzs)1Mv3==EMFf!-Lx`!`-+Er zJKJsRUtMiK>Ju8;ylisL2k+L*SCSQbJcMR`sq8$H_Uc~q*;moddU1li7fsnRe+Za7 z(44Muct(_-Pmhz!lMtg>%F|SDSU&%mZU1an?w+cX@@w`idAw<-O+Q<3@UF_|Ud5lo zr+G)dKk&_+NjciLr*ZSgpbfvT1)e$l>Yb{A#Wy2S52Y0ogA>-@WO@3w-%qx?Xl2f^ zhg*5o)=4K%$T*)8U-5@$MZ8DB3~ANJa_3!Ng)l^VZJg0{t?82M0ugPI6+8JKR`AZ7 zQN+0`B&pQfz$MUK$vAZHq@e3XnY+K$iq|ADu8#5**O-^0J%BONxaPbYp#AsyEg;e&p2K$;^@9&KXo>d;QD5#P`dtbwB$RBjvC^WaBxPtPeNBVo%Kf zz|OaE*5j#?9}aBMEYPo9%2;4rDs^-YqfbBzH_O?a6?M$&nJW{#vQ3$dMT$g^OiGel z!8}z!A<8mv^2`+R{$8F5dE5)@omL%cQRBE|W6bdP>(4nXrwlBQtzTT2^sFLil|qi9 zYI)J@BCa?L<&Q`h6L02%v zTitz4VbboxZJIsS)1{wHvCOrdz3{Q?Ca$BhZ@F%##;pCAD6lq`g)wXWEtmVZv-MO8 z*kndC3^>YsP zwcg*4T#NmB?rXi3{P|^lU%W+MSH3^9aIU@3TG^H_atj(+R&UyS&ga24ziC{IZ~ERA ze2I?W(b%3LSw5{xeWoKzi`I07(2O~o>gIlpwg^2^rcrw@u5usayvxh-+viDHs<-^` zT=#j!tLc4{It9cuH{D}jfjmq0ot{&Ac7E=!Crm+G#rzf&uqCC$Nw9da zuK)9;`TMJlie3y$%q}ifT7T|jSa9Z!7US}Z3g>!0oxHtEa;B`h(W*4In+`MIbNYwh zT2nXkWS4McnQrPGU2`|h&tc}<`vnBgIbU9uW}9(v+2+YCqAmf8U-Gf7b~}8xv!%!7 zgG)tR$j_q56FMq`L)a3p`XA-mHqG^8cU;lqRrlvlPY+4f@|{vAsbTY)_tw7;xlf+S zN;9P&UK&!~H;F}E){y%af5soJ`AwBAhdL%3TKknTU+tHE9CJ*Fh0U=_Y~8=sn23

Xn1H+d&usXX;&;#tJE(&-^g+_{6kel zmalH6ooxN~xG$GxhwWXT?z<~f`YrnuNj>v}SLWA?%`|8G$oFQ~aqC_6CtgK!KTVfY z@wxZuo%+goN*=Aeq4Fs`orXcPHD+!MNl_8J94rv3dF!H#^Uk;>zkGxkn776*7AbSp znrqOZa!X-HbZ+beei;tOm6}iQZtI=3RI*3$E??G%j0&FXi(U&X(987yA<%L`w87*oBf?EYkAl7ddrm;mGR7iM)^EU!i$f7y3AiAslKse`NA)6ltp^9-&alg zv_9ji+u!(EZqvPHn|w7|@$hkuJ92#;#{BFV;)1KD0+@^SX6&r?0K8{B-Da zUc}ev&)?Q$x%AHazV*SxpUDCy*S6pLU-s^p;ZcXPPOc^(`A`M zHm>kJFzNi_)2ZtwE{}Vq9?|u*Sm3&Hor2Se&({(HOstbs<37*hw!3#GS4gV1f7$M{ zEzhPpHe_Ahe)pa19mm26C%WTO)!u3PIXhm}nwMnIF7aK}{dV&s!4n!Q!~7E6XE(jF z$_bmC@jz(5`o%=4mp|loi0_*cv&~5C`M2yPNtJBNvuAKExbkENWMXPsq zsRjARmI$XjZ;)oxj=Gw>_nhH`=Zn`pJ*lm?yX@(ElV4VK6Ep5fF4^tuYh1s|)KD9uY-xnRo4t(QWK-_5r;H2MCHI_FT%-m*LUW1dapRP#FbQgP3Y z+qKz}EK2sCQ@cfyCr)CXpdskR+P6ad^AlC(%evw+;%|{cov--2!u7a2z#hDr38% zv3a%mm(Po19XeD64>SCzG&%O?QT3dU(h0AnB7%!9i%EouTs5AeG-ao>&W|gW+mGno zaXiMhEy`N6ptDEq5vPXyjdKUxK23^D{K$UX!H2D3jkDkhoo)9*bHnqi-d?(X{gvdu zNm(Zp9A0$)ujRJjV^mlW>rkq=)aHb%wnb6zB-LY+<$8;?*7FMU7(aYE@uA!o5BFoQ z;<9*h!}b;ko$hm86SR2XZixi(unG~d*2Ff@N)4;ajNPD{ob~!PKoi_)SdEE7}xmb3x3{t zbtg;8Z>1)wtyR~H)*LH4S77h@c>c@JIetf8RlI#~-X6aC;;PGALf1%s@bHynS^48d z?0p6QP?ckmJH5kN*TsCY5xo)WeNR1PYSSY1tXnH@-1Rus5o?^V?t*}}HJXLFW2L+P_(N&ktyPAlK@d_FL5>&o(iG;crVjH9Y^_wRbS zb?1izEmby0W@Cl85{@ON- z!Q!7qYQMAdHP{zS2(d7&m=dCYh{u9-T?@Y&Q>% z_cu|0LM~fKF`MJ3<9>Np4?SX=f91yIhd(%OiEmV?XfH38>c|fAE{MOJ*|jXg#`T`o z`wM!nY@38-uIl^`v1gZ5F8tINYJTcsXvLl@`i3uhq_?ylt`5~R@^G;^$r>RtxzNLQ z@`JMIBSp~OW-4rh|<5?MRxs;!731kSI z{6s-id*ZSq#}4fE*~b5)cbjT@YJJ?-cIkh5v&y1geT?y6?#A6F#WCTRL5EdYg7i&c zLpPnk43Fw#$xCaD?xfxjjxEq!W1za@s`%|oo@GtDpL%t~)bZYUy{+MtU%~y-IZt+a zdSxn_u8T3br|$U8XNIT`^T!=iUQd-|UY%TcH5X4S&8kK8P-r5~HV_U@aPMqghV-E^wGba>mPgO*JE z)802WY|8r+GXJaEx~l6x=WkIqit2wZJ%Men!hy$WPG2V~#2D|J9ikBPa4J{$j|F@! z4y#vwofWux$?^9)>pa4e}BfCz<~9JeSzL^ls|up zRdb?Y_e+6?EUN7pFQ0rn7u6cMWr~+mTS=eb<6gu3((gt5Wm7DEdY(IUHuc0h!A`L@ z5!W_>Nr6EZ9+WK(;c0!|zTke9;d!COM;OWlMABwDEHu0%{ZHrlrnU7?C*6;$&HR1z zYt@k?#xI(4G_U$M&9SgqaM+5+uk^dSe_+j_$lAtC-2R zzS`!!=)9zCd}brx6eh-;jEg>HS?A5z4wbId=(1CvzESgx(_(9(r_UDtuP(pqrvA#B!}FiXY%dAV`Keu(es}llPdzJD3xzFq$6t`Nt6e4E zd?RoFx#uSmo|%+f{=uf&vW558?$i+76oKh#_BXYf0)10vanJT}opr|GnW)rfwmVXD zR%os{#r%UU{CaXq`OS?pRJa_O9#*J%PRhDfd*9^l#5*D(%qe{Q@^#P7{i|PbVtVWD z+zQ|K*1xxHxh}&I{kpaBgPriI`CX+Y?-kbmDU92x`OEh}-ZIn14Hj{N>s|=5l}k%2 zt!&g1@+-2nJeToCICxEs~fZ z>hka2@_&y%*!Rkvw!8LXSO3oZLzP$MbAGImow)Vvy?;x2jjDw%{!mz(eyrL>!0w{N zN)r{} z@~dMC_YNGas|#G0_4UjJ8<&0Qw_Im)b0-Nog;iC%2q`3IP7(?W*O$Ka(WLogpq$ut zJ%%mTD%DF*ES;UcTkXWbM~S*^yp#BzH?pR7ROCAGu>a+t1SY%O~OLe@xraF@-U5Y(8qpD*Zcqj$RVVop_;2?iOV1)Dr_iOntGxJ?+qpjD>r)Mi&UoUyv__>pqGn>+} zOQPG~XO?_d-*$J6Y3p_AeZS78X215%+w)`B)cTOg>3cwa3-}wd=CHNV7O&qnhRhc7 z293^(7%G=oc}`S%wy*KmMFr($y99cFA5uB^uVJO{a*MXq&9TC3*Lj++J$})^{AVoV zDNli`>Ta!G>nC2$On81{o%+7g2lCQam=fc*d*9pf>F(UsLD|oK3SO4F@?xj`TwS60 z|F*23-{rb$a_qC!AvTQ{!~9Ac4xRLW(Y4I(?)oK_0bHGlLWd5V@-52hd|RZhJ%!7u zDd%5{kOiqYFeDa$*z^_er%~PkCkLuQpyv-*K$H>%cFF4jV`%w?3&>>H7}*5IW4v_ zKDJUbQ25E>C2rHd8iqn{T9&RGe`Z}h z;n}xhag>YfGLyyKA=*7^jRDh(-h9(d`)S?Y+?laCVs5v@KlO=8o{36t7T5&MS6LPL z!>VJ?;wy`$#JdLm5_r;>eSLoRRcWhz#cysdudjHr*;nAsjL&5sO;`WhQ<_#J!jT45Jt+I7GEO*!-M5ktbn0Nf6PrCUrAEk?{R)|Jv?2I_8>3E_#b=9|kr3;UlzbuP;IeG1$z2Qnz zJ$rdK^$PYDH;S%GxU}e3|A+QpsoOk#zQjtOiRV&qTa?&*?!Z&+N1E@PC1m<}(r)tD zg@2X2k@vH;?$pL~w{7o!e7snn|AS|Kd+urJ@V}v_FIAksBme%;iDySw8r;1flFzv) z;OWEguHDzdb|!b4tbgPfrn}Nc&s$t;?pfckZ&UfcTjal;XT&1)@ecpR9eIIUwVvI$ zeRbyy`^EEK&3a|eQK5HZ`rR{^gGA+aC*MD=&i0u-y-26<_D){Q41dTv9UY z-Za6hEz4e&d|$hMcKC@od`(S?r#SZ}uUWO|e6?rw^nbtR$Q7*ncnxU#xi47Vg{Fn6dS06FK0J07!~Y)(7c44tW88B5{f+PC!p%Pq z_s)M*e0xrZX#G?9{9iZD$h~S>@@$I2tB`uZRT2!jT&u*FPpw~7J>6_6$AVdL%`fdU zxK;(IF4nOA`bA*jEm0ZowPFvxXf9Z`hyT~A_V*WGY}Yt@bk@oDPNA=#m%piv7j7|o zwnz8ojc>C)uZ#QDcGKp*+iJhdTiSsJx00v?2v6s;C|lM$Mh?{H<(*#`-h@1}%Q zX6uFe#~E$^>3wV#N53tLg$zE8ZT!4KELL}gTw0k z?^ReDe1H4te%$|qDd}5smwiuQ3@r8%P@3~%oAcf?e>*1{yzQ)NXZbH7Fwuw6WKE{L z`l0)p_unWp1~lz>R%~)_^*`1V?}F_PZw$D_@;_kF4Y9ppJAEp68LGm*KmAvK_vgkt z6)X31eiD4XOxEofXo=GBL~i)Q%l2a^_#F4N4zP+2Zi>&9eVHACw4N zh0Wa2_H>4Xhr)gTXx_%qZ3bEVQ;!@iFuqthW7R#&%|9z!J3sw!-v0jIgFSavvjv}D zb}sw+o}`P}X+=JZLzfpjA1z8|o3ro;1Lq&jQ0}%TZmYkUuh-0*l$sxs*OYD1u=sJo ztj2Xd%kM1UShef(m12z#eXJVldoHg@EaJ1Nc=XP>f6kw{#aEa7yb<>)`t^VRCC5F_ zev30PG+o`bl(Vn>fMh`uyQ|lVZyM_#Ejn7yXtX;!X8V-Ms+Jc8b0-@e4|K{|z2LWQ z-of&V6)%j`%8hQxxc%CYu~J69=lGw6&s&tgeh~j&qhTK>lUH-@-JNY7r(Rb5{BQSu zT4nX0v(9I=9X)&xoy-ZVk@fjk^KFav=88+*UYa^z|2n*U;HKpos`f#A+3s+`t8=AG z-0Zd=-*)QdIfh9_!RPGN*-r9_9@|!z{eS-X)Sk43qSL>|Z2xmSQ(m*fD$zHQ~4GVA9QVH9O6!O|DG66K~4>yp8?B0 zbaomQGC$rE^5pSyg=sSkR~@_5crefUOb+8BYcH8YcV?}bGr6hn^AXuKS-f`Nw*GzI z!ngm?rg^ic#osFZHcz>C-p|X=C#X$TIIvRLD&nATgZH@jA6j84qA0)GAW?Wsz(21Ub3jw9^Eljvq-*V?V>{((?iWCX&8k(c5#2-qx>>`akc&4zsye; z+24B6TD&fLk@2=qpSI8czdZf-+TMM~GV{)AIbPT&vHXQ;;>%+~!B66TM6o;MNiCSN zcz;hylJr!rqkQH2pZ;K%U*5c{h%q?dJz##`$y4Rqa%1*rMmqf zj_g`lGg;RB?SkePyI1U}YL=HjzImdMsWX{k(2+cDwI zX1(bWGJZw>zZiIj&t;ssT&iH*t~%Q_@|cKX~Rpp7y3^ZT-jS>wiDK+`pbvFLzh;WG{iUlbrhbH=oPDbVqT8%$4BR z_9bO=ti65v1Pz$8-H#=iwE8^}GMg{>c>?cZpMRlKy>G5}d9}K*La{~b>XkL^Ia8dr zseMnaQ7HfOF<!nGxnmyB@3g>V*lqWSe`7 z{@GJoc(&xt@Bf*%t6Sdd|Cpz|)_bzF-oCo8?_0nBoPMCNSbbtvvdAPO^9MY^7hj%Y z^%kAP(j;Btmh@-d6_v?RkAAc5dtUj@VSZ4_ZT##gkvB_d>X zwSnCP>u*2I`Tx~EUViG%_TK9{zxVb{)y#Xp&0&H2?5LxQ_Q@T)>NR;l=6uTR$dm^UnL(dMRd~rD{jU>uraamUB3N3n)!|u*=l;%*@lx zCw8r1`Ea7_qvmHbhj#u;cUE>!k#v5pzN*i>tUL3p+x_WWiSx@icq>-8Je~Q>G@`=l zr|Qyo|DV6DXOTM9J72%}cGNT#y?rl!U40*=p%r$SjjQ!(TPD|&Lak>v)i~ewYlW|^ zc(+tgs9KRfA$;j>Z|)Gq^MaonCM@*f6PJ3Xly++iD_iY^B6&WZHJ4cLy9<5(xq1F{ zH$Fd^+Go}5|MFw~!jf-&SiQG?%8MSotS@KgKf5+ZsD*o?Pl6vu*xCYarMp*Wr`mom z-RZ#bzHyaE4|Cka-9fDvOI9q{@py^&oa0A*7HYEwhYFUP-HN*fr4x5wDtg;$u=4p-6=$JKPDZyp4f=ie zv?$$wT6FZqHMWYVnQP*6V|FPV`Yw`OD7k++*SZ>epB@p%l(_*Cv3dVi^6IR7dWJ(f zdt1w@Yv=#-hU)Hp5UP86S@~oO~2AvyEVHO ziCvm@Ht+VUMDL?rU9FRCSN!Ja<9{O;vUo+L--C7L-%qChkk67|D>65JTUq(lS7vkk z)W7?@xm}t5KV91X=<^+!7xFGy-mSk>6Mfl;BO|<*pD}l_`i)TSC7B6_SMl$x)BJlU zCThm|rP`UV97Xm{U^XpUbZNrnH{Lu&Y#Q86GDewSDs)z6-BK|Q%FL6y@RQ% zXMgwE@^$uadqcAccduqV*s(LG#a)wShvxQ&HU(w>X4qY|zIvolDV#;<-8#oep78po z!3-1CG^8F*;R)mLRu%s;-D*TD z=DaOv4w#}e@yDiJ_oSWuYbwt#S8My!E^XWX%;vqyswlt1>oeEc1pN;Y{uST8_Qr|? zP3v>heIxcZN=vNxnRerYamZ8?Z`mnQM>Mjs8b$h+i}pJEsIJ{0$-h2BOGeqkZH9;K z%505Li?4gtG~esH)Om`^|NXPhe%{Zh>oqCvIUAI|u3s_3e^tHN`qYhgd&*oGW}orYy$I~fGJ&3!uU{=GS2%>K^)dgD_Jt}x`BMlCCRsfcU}IcIene3kdfcAk>~Ps8Ff2V zo>ePz^q7t~pZ#ke@Ybl;qSW&Is~Jb9wm;csx=K=6Q>vx>_|tu_GKw|Mr@YSEWLi?! zbjy+5L;FZZ$cd*4>|3w@z850AGHUz#s`JJ9UdH)X1@E6qb6?B4I_s*ug`T;m+$x5o zcBMO=*H)d{@8z_@r!+*N=|Z1_^1J{qmG8`)QgxGdZx48=J(){ir=6$7O$89^HEtk`sEh zT-L`RFx@y|tA3j4ni=VBTGJ23y*lf_UtjjyolAIWa__#rokCvK>Y>*!T-p=xH~Uhv zjmD{kMwgnb+$A$EYH6mW!d>%z7)CsV&|=do!s76SJnS! zHriwA&A0xD-pzeVl9~TvejW*U z;^F9~#JT9^wvVS4Y|URXjj>we*$Hj7xJ=L5_h&y}zNpUj-ul~@6XsKYzC63j*L`nc zaBuk5v_;8R=g&P{#eZ3vrT24IgxnM<#(V36LOt7$Eht~Sz&r9)wx4j^t*Ifxi&IXe39_o^hLwSNLkeP=wuyBk?;Hq7btrP^lk9&I5sB3#t13I%V-(9(bQ`Jo+Y^4l~pY_43a=f)-oIF>V%Z@zBlVrBh zShPqix5mzj-D@txzA3A?ZnCb~yrwR2$=x!?Bhej(se4jO@4i3(IUsY>oXS_)yU%ed z61$h&Js`4Xf0rrqDtqa6%Yd$3H`-q_q+Sh0M;Hf?<$Z_Z7H zjOrUjOg28vcGG-?T#pGYFmmSM6Eu18@$?n3J_GiGjyDqF3fuHw zuKE49lCkQ^=G*qqrvEv3%)0da4&T`xSG`R3uL{j)yQs)8XM;qj?Ut3=$4XTVFIFsi zvtlFfBQ~`w40;V~Zb*k_er);U_nR$Q>hY1H8=*a~!c8Q-RFaNmOiD61)EB@W*QO9u zTe?%*c)_KV$}cO|zuD7TbahtFY|Wj8AzP*7@~pJ4&UUony72Q}NdDz1tSh|k8r@U7 zdF!Z<3kS2x^S0xsD!NxPty!>Vvde}a%R{R~W~m%Mq~gg{wcx4His1I2Yb@$^x?EDv z;lF+$WX|S``>Or#S$;Tkp zz_H`i)E?;w1?CTIjc*sOUi887eDSO=N4@qO-4Z`p_wJv2g+D5GsU7SQxpHLj!F$&v zSHAx{)6Vu^>s|Q|pZ*0rZrr$PTjZILOwR(LvddD6UsDA#dxN(~mDZSNJ(A!o+bmX` zQ_;SWum9KF$yzN-M60Lw>^joGeI{X5#-*Fhhcr%o4VrT^TB}8M>lBg5GltC{H0FFt zazFHL=PmtapKXD!_OevR#=bw#qhTH+ar4{Tz0do?Pfznzw_R|LXOZ_$!LE?wK?+NP zPp;)+Si4p2cFUbT^U^Q)`WQ~xuwssxPKVLoOEVw(#EE^CVSHz`^pC*?jbzOvvotYt znP8XTErClHg(-YA^%A`OP-dftP2Bn4#=*D#PEIbLcgObEW;gCWOAdi~8=M*@ud8N! zzGcNeo=KA5v>Y9urB0pCaPtytSa|%?X_8wz-moSlykwB>{w1WipXoV4WT5s$yU0kK!-D+?|DRWPe3&vb^>ZE43xN{vTnW>}`b(wg_9uG3U6WM$Xn zsf)YSTw9siyLd_`W+aw!eP8R;qP|QcrBX-A{@6yrJ?pN$3z2I^pU(3zizhZP(orKKJw&Z&H(ReQ?7!MOR?A(akC{mxx>|m^%-N+PiEy_XRtD^?y}d-{?_ z$EL{}*Bus$PP{#*Mk9qoTdPxZxt)|(t$Eh;o~0`%F7G)O_{ha&RkEw?`-?d*S6YAj zw>AEgx-@66>w$>kJ36;l?OkQcyh^+I2XnR2o-52ZIjrUz7IGFpG?}>fLLEnS!<5fc zA1v4?Sdum)cFT%c4+}FIiWdqqn@Sv>yQEooVbHA)&wM)XFrQfPBy6_S6e02Wlh^Vl zyzJZhb&vbzr5g`VK3?`W<^S>5OAlQyDi-qd4P84kpf*(JwyJ_GtNh%IZtuT2vAsn9)=2 z<#yyR2j7VWs=I=%7qLq0N?gFdfXl%zghBqy5`NzA1r1z6HWS0uI^EpWZ`}x(E*4>{ z9Usyh9VqL}xdzm7Rh zu{sf06suXJlylcBOn;SUST_Ie$mSBE`_DV9yjV>hD02p%);k03o<#Sb z%U7KYT&3(A^VwDI?QD*mGRBMN{=eB@`z7GnOt<*sb38e` zy7N`8S_W9mShy+d)$@l1??NtImXTN&G^4{R^iQLTr_+qRCzw`LNfxjsNhF47iZHPq zn-V9!`qsvoQ_2Oetn}}jWp?rD1zVYS>~9<#q zh{BdbaxE$KA)?YOe=ijZ2}^M{yll(%|Jc#0`H@9?)#1l$rmd_k)F=!JySkS-oi+Qi zX!w!I8m?KlK5h%!^7;1P?dfcrZoeu&cFQHAWsd#&FwJN?yQ+*w^IpD-k7pD7=G7I+ zvMM0dWp-2bMV6f@nhg<;l++U452?6ldjv19aP1MiW6R%?s`PSMtCXB_bk&bim6H>e zF*4PJKAG3&D0?4SLra{jaKfUCEDEscGD)%fV`9H&jOvkz=| zuGHx@`Dvs2|Jv`Xi=A6*FWcttjozSI5W39IZ`peGlc`%&eV(h^Pk*>G`c&~HMM>64 z|94&NvTG7_1`Q5qCrwSi0woWgK zsg+a_>Tl65pJ1@!tXHmrv-5k=rHj?iuW*>eqV?R;lvR><{2_Hq#aL2iZ1TIea>L=ZN$003)<3C8U9f4T_(GwZ zOw0Ez?h4b}?4q>nWcZ?&m)LAA-Aomqh?)6125xHMVVYyJviZRhY4z>;uCEub?C998 z<6+IhWA#{g``aCrVu=lsfo~&O4s_i}*m-TsQop(_6+b@SE{ijie%7$d*yHx1uS$14 z|C(zEu&db>&T8~6k>YY-IJcmedq$t)?IS6lm4X+tNXYZ>7KP6BdsN-iCzSAS)_JF` zTt0l^_dFy{b7enJoW^wX*4_lASLur$?tQ%bo9%`AycJOy8~l@>P22Reac%s)+OIxW zS7ohQKXKlx2zQ|)+RO{y^#`e(stifd4)A$=rrecn;)j?v_3Dcr9az~e<(NB*d&Yd^A^$Z}FA^h{&NR)d1Mj*F(RwbftweD5mOw|gERc-}R6 zDWoO*RmOAP-PNsUK3nXE(lf@ie^>S?N@E zbaLXGzJyeEVZ-CKsW!Q*M0QSd@n8=zXgfV&v4x)LW5d(D^QPZ9u(i43*PmQm zl>AoX#JPR0VW%&xeqFjh%k%cWjo;Y`uLEVBlqJH8Hrek8oz=5E;_tz$ceF#5p0=HM(YM^uzi+}@r%NhtEHkbwTX2o# z_>o$!oD${F51zQQE$R!3n|Rzo(~UuJP2a+`NeY?pjW5BGurN78!j!kfyPS)*Zy>e>!U6|=$q*NOWyL|Q!D*nrZ<%`&HtZ~-MxO6#k||5_rI^K z6I!x$we%f}7iR=^Ca!F46q9*)F5Op1k^OzZ*-JYMIYiGKVC~@%YzSg**!)Xq)`6^= z360M$aLku^I7RqD7?)$cz@eR+VvEElGb^mH>oG8py``sRe(?TtBb&U92V~d!oa&C* zlC?2r)2BaGcQ;2}{+9plclG`Uyk<3R=W{=At4)3%t;SZgJG-#|)p3QWH6kBPR-91~ zceTv$HVCSoF=0jE`|}gBL!Yak_}i5=(dp%b;)TLDg|6tw239loK3+?F|WCfzyQ^J<;ruE3z}DLS5)I&N*)8E9ob@mfOZdWO~6S9!ngO5eKd zQi|pGC*oy)A{Vbu=9^OgEqnKR`%ecxzQ6j4o-HA9uN&scu+K+Ivr$bXF8ECyb=Cff#Lcq<@w)^*tTA%b6VW0f7)UeYikquYuk_QFi5zlSY*A*SI>RNP41-!r3AC&P%yqnH9eF z#@Fs`lU)x8dA}~a|H@N+p46__SGFybzqXN~(Cq&N%XP2oAN;7l@_OHuR>zc8$-M?Y z{hlmz@=R;)kLPHqR^Uo3NEGjf`@ zn!}g3dV*d4ft8xixg^y$cyD?fRzi-W({p@sLpS_kh@*;xeR>Uk}Q@wrTZ}b_V$%T=6+b3PyX{dM8^zp{k(-(i3Rj@;A?y?(f z8&5{N9{(-(JzHJH{j6Z^q4!dcI`+RW_GZiC4QHx;`Rn?1kRt-F-uifUul%gZtUVv{N9+B2|A*~=;cxQGszCGhx39MOFY7n#%L+BU+UWR5K{!`D=#_^d z`@ai<+Y}29xdxle)U@|1*0L^bcQTq-XmGLgmkjT#m^O7ozpCc*(o6atc&%^ywNpqi zbXx{j$V!f|-$DYX4$R34+ufnbDWey@((>h-r4d|)J)dqeDyYcE#~LT?PSA}j_I>+4 zHaX){MOnr1?ceGa96Z^jVY$x!mcmKFfU}Y=WhFTbr;Ap^DGRZiR?P{o?N>K>^+n|4 zHl2W*g0l{+I&#J_@biJa(q`X76mE+#uP|B>+4R&%#Nnf~%rVt=`dg z@!f&*o}XSAbcav<)U#qyZP@Y&o$hQueogo}VP;YCl*z68UDa;uul%|C*skEdni%~{fLs;8mg z(Utkm{ym>su1zgqmOMQ(adVgY&W~!V0tDZc>qUzh)@Ypj`7wBb`VGnE`>QujwsG5e zLa^}uVg}`*Bun^44@_Us+ia-njQolXiCPdnsS*{d?ax z*PWa{Bd@kijD^Ygx)py)pZRzDia+hW|NaK>vkB_To?h9(DZ>6`S9nuS^pOkm7^dEP z{&C97Mmf&l8w)S3pQC1ZwQNC&!^`GZ5qnyBi$2Z!u}r{AvUFvCVyl|_iEAGMi&EWh zZrHxVe0xqjlN9ggj7^hXw@x}&=Gf1_DLf}h;>rob4N+A-zhCiqI^EoxG}YtVx|Lu5 zW~-$7Kk<9F`}2kSe&sixt63Fy9TeYIUweM`Y{w#&kZMk$_+Lpzn|vSmFS9;qzi+;v zuTPln)-6FgRBuzvnCx&*`!wh8u86nZj)7)|<*St<6wj|{s_RspbS*(Y`m6QUef7P| znCKC=e`&~OIV&06W7MQ#0;;@`i}J9qVyjo#f*yBpfu<`~c1o4z=G z-;T$%btmnOJr0Oi$<9i<6>{Sv?<5)Dg<+w=xsocM{%TN&5mdfEPJ=wwM&p~+(MMkNlOUt}Gv=wfcbRJr; zWvS2>g)19-Og$k?>qIph7O7cGysN=`98x_?gbjj83c=B`}Q zW!bVQi}6XAy+`9yrd>}jA28yat-aJGe)_tmJ7O`q?bUKCUfQl<)>i30dBgr#{Jx+1 z?^n3`%C0hw2+cJu6+m+QzctgV4W%N6r3k zW0juv#q==fmW5jD_br^-vUuUXY0OU^ba@@?PD>BWpUx8A!IyZ>P$p0CY|&>W$pdrU z!w=5tPZoLf;mj~HC;Hs?Emh2Dt0qpHO{`@#QOF0nOP??M|NZbus7ME#?$gI({nW z{Gq0uO+tB%c~V!Jtx>aZ<~EquFqZyoRD zRY{jaBKbt*t)joLikWhFc9h_x$t}$S?AwkebMMkE(*14an&P;T&HGECWen4!j~qwl z@?N)gcc~X$=OU1$F{kJ99UV8x5c^DSE~ok4otvwee@rh~$0iiTS+s-QLA+Wd)&GIx z@n`4vhFq?WR4;q@V(InIms^dmuM@c!wJqz#fftj%%2}QY3ud3Vx6v*pMcFgq*trh& z$kmhBp1Mfp_-a+F$v=NiGR6HIjoKu@GKJmyE$CuR(TUKt_ z!o*qHeLgp7)t$@#Z8sGieiwD`eAUL{-);3(vMWlBJC^dv%iOj#oshxtykVAghyEVn z=k_I`9^GMG&EGONYUQR+&zUN?Vd@Rb{D*svc*VIG^|IJ*keTxD?TzHtbH@^e$~c54 z%w5aT?{WQjOY==r-Zk5*|D14N^Fu?Z;N#v;7cFxipK}N-Ud_w7&(vCTQ<{Q^tZSLC z4ioF{&P_2ho?L%W^<-xF(gUBCozHrz_Ia^*zwe&1+5gX$_5ErOy}Inmrw5zNH#p{O z*c#3!A$4M+Y14;K?PunxY!MP~(0MIx(0zE`HM5!xo;%$4JpFn2T?S)nmPho;&++f5k4Fsc)m-{8Du3m6NGXTIHA!y7lUm z2&-%FY8)r2=%jk@6A-8ue^j2MccpvLgS0G;%qIcnUNuT5pXJxQxs`ixC;uV&u&oVu zx5-?3aaeuddbzuwS+gJAahxS(e|pnO3+>cW1JhHRRxS~hue>hv`+NS0P5<;R?X1$i z7WKn9@BHk?&HcMwxfU5jdhlOrow<3Feu+Mx_tR%CuPh54d6G`LIB0n$-FoSK{$+aK zJHzB=_nzYXy-e%E?q1xz)W7U^jf8K<;=32O=Pob&H`lx%Idihq;xniGo}SnJ|6|j6 zZ-#9pJUbd1zpt9V>Y}rR<-c7j;=k;p&dRuO-PwHY;@*GkOs@hI4(7=jCjFYJY=4dY z|0m^TqMudn?3KMP`r(97jG~8Ozd!^>$>R^gr_V8Ut`XaF_%`FKkN54;=luJ8uj|^2 zuRT%IDnIUBY$99lU9`*e_^)>JjZSSI3eA^x-)t+&Y;kw{awPoB#K!3j7VUFq+kf`l zWpKI6iPtaicR<)(_9eE9Rv-Uvn>y$3@AulzHHYDp|Ni0p*B1xkir;)m%>MIt za*pCp#>-uqVW-Yref95Jb7p3)U!ma9`?vS;+W*LBcZ?9VzZ$V&)vc^$=N!Y<)L+~A z@$&kMciv=9n{S;n`Mx;_ciS z+qSCNn|%44Z=dVt|L>vSI`^XAHRpcI*SqnR)nBZ9-{=3~{2HI6FzbEqS(U4j@}HLP z+pz!X!sXvi$^B1Oxg@=4rpv)ud;e&^{qa67WogddbJ_YcPx9UT`G9}>-;<&xYm=w^ zluV8N7QS?1bF#nR+$)Y!4W^H}?UNffEB=*1g*1GoR$&Z^F?riP(l5_Wn*s{ka zvi`cqDraA{y2fgj`}5kezuTI1m>G<#GTwB$^~t2JmSs2mdg!bIo9+u?uk*Xsf6`Fg zxp$HE_6cH#gI97UWYxvhzdy10)y8-`-(cbH<$G6&@`ib&AK7r_Yj5hZ$v$UA#ozAn z%~~31>KSw7;=R|m8F{9>Sh!LDxWB2|^BuRcW*yx%)38*{ZPzbXZqKS+i$3)IXY0sZ z&S!J#)634Kdyefc%NF~6due>Td0ScU{>q @@ -15,38 +13,37 @@ Authors: ============================================================================== INTRODUCTION *nvim-treesitter-intro* -nvim-treesitter wraps the Neovim treesitter API to provide functionalities -such as highlighting and incremental selection, and a command to easily -install parsers. +Nvim-treesitter provides functionalities for managing treesitter parsers and +compatible queries for core features (highlighting, injections, fold, indent). + +WARNING: This is work in progress and requires the latest commit on Neovim +`master`. ============================================================================== QUICK START *nvim-treesitter-quickstart* Install the parser for your language -> +>vim :TSInstall {language} < To get a list of supported languages -> +>vim :TSInstallInfo < -By default, everything is disabled. -To enable supported features, put this in your `init.lua` file: +To install supported parsers and queries, put this in your `init.lua` file: -> +>lua require'nvim-treesitter.configs'.setup { -- A directory to install the parsers into. - -- If this is excluded or nil parsers are installed - -- to either the package dir, or the "site" dir. - -- If a custom path is used (not nil) it must be added to the runtimepath. - parser_install_dir = "/some/path/to/store/parsers", + -- Defaults to the `stdpath('data')/site` dir. + install_dir = "/some/path/to/store/parsers", - -- A list of parser names, or "all" - ensure_installed = { "c", "lua", "rust" }, + -- A list of parser names, or "core", "stable", "community", "unstable" + ensure_install = { "core", "rust" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, @@ -54,174 +51,66 @@ To enable supported features, put this in your `init.lua` file: -- Automatically install missing parsers when entering buffer auto_install = false, - -- List of parsers to ignore installing (for "all") + -- List of parsers to ignore installing (for "core" etc.) ignore_install = { "javascript" }, - highlight = { - -- `false` will disable the whole extension - enable = true, - - -- list of language that will be disabled - disable = { "c", "rust" }, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - } - vim.opt.runtimepath:append("/some/path/to/store/parsers") < - -See |nvim-treesitter-modules| for a list of all available modules and its options. +See |nvim-treesitter-commands| for a list of all available commands. ============================================================================== -MODULES *nvim-treesitter-modules* +COMMANDS *nvim-treesitter-commands* -|nvim-treesitter| provides several functionalities via modules (and submodules), -each module makes use of the query files defined for each language, + *:TSInstall* +:TSInstall {language} ... ~ -All modules are disabled by default, and some provide default keymaps. -Each module corresponds to an entry in the dictionary passed to the -`nvim-treesitter.configs.setup` function, this should be in your `init.lua` file. +Install one or more treesitter parsers. +You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to +force the reinstallation of already installed parsers. + *:TSInstallSync* +:TSInstallSync {language} ... ~ -> - require'nvim-treesitter.configs'.setup { - -- Modules and its options go here - highlight = { enable = true }, - incremental_selection = { enable = true }, - textobjects = { enable = true }, - } -< +Perform the |:TSInstall| operation synchronously. -All modules share some common options, like `enable` and `disable`. -When `enable` is `true` this will enable the module for all supported languages, -if you want to disable the module for some languages you can pass a list to the `disable` option. + *:TSInstallInfo* +:TSInstallInfo ~ -> - require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - disable = { "cpp", "lua" }, - }, - } -< +List information about currently installed parsers -For more fine-grained control, `disable` can also take a function and -whenever it returns `true`, the module is disabled for that buffer. -The function is called once when a module starts in a buffer and receives the -language and buffer number as arguments: + *:TSUpdate* +:TSUpdate {language} ... ~ -> - require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - disable = function(lang, bufnr) -- Disable in large C++ buffers - return lang == "cpp" and vim.api.nvim_buf_line_count(bufnr) > 50000 - end, - }, - } -< +Update the installed parser for one more {language} or all installed parsers +if {language} is omitted. The specified parser is installed if it is not already +installed. -Options that define or accept a keymap use the same format you use to define -keymaps in Neovim, so you can write keymaps as `gd`, `a`, `a` -`` (control + a), `` (alt + n), `` (enter), etc. + *:TSUpdateSync* +:TSUpdateSync {language} ... ~ -External plugins can provide their own modules with their own options, -those can also be configured using the `nvim-treesitter.configs.setup` -function. +Perform the |:TSUpdate| operation synchronously. ------------------------------------------------------------------------------- -HIGHLIGHT *nvim-treesitter-highlight-mod* + *:TSUninstall* +:TSUninstall {language} ... ~ -Consistent syntax highlighting. +Deletes the parser for one or more {language}. You can use 'all' for language +to uninstall all parsers. -Query files: `highlights.scm`. -Supported options: - -- enable: `true` or `false`. -- disable: list of languages. -- additional_vim_regex_highlighting: `true` or `false`, or a list of languages. - Set this to `true` if you depend on 'syntax' being enabled - (like for indentation). Using this option may slow down your editor, - and you may see some duplicate highlights. - Defaults to `false`. - -> - require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - custom_captures = { - -- Highlight the @foo.bar capture group with the "Identifier" highlight group. - ["foo.bar"] = "Identifier", - }, - -- Setting this to true or a list of languages will run `:h syntax` and tree-sitter at the same time. - additional_vim_regex_highlighting = false, - }, - } -< - -You can also set custom highlight captures -> - lua < - require'nvim-treesitter.configs'.setup { - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - } -< - ------------------------------------------------------------------------------- -INDENTATION *nvim-treesitter-indentation-mod* +============================================================================== +INDENTATION *nvim-treesitter-indentation* Indentation based on treesitter for the |=| operator. -NOTE: this is an experimental feature. +NOTE: this is an experimental feature and will be upstreamed to Neovim when +stable. + +To enable it for a supported parser, add the following to a corresponding +`FileType` autocommand or `ftplugin/.lua`: >lua + + vim.bo.indentexpr = 'v.lua:require'nvim-treesitter'.indentexpr()' + +< + +Indentation for a language is controlled by `indents.scm` queries. The +following captures are supported: -Query files: `indents.scm`. -Supported options: -- enable: `true` or `false`. -- disable: list of languages. -> - require'nvim-treesitter.configs'.setup { - indent = { - enable = true - }, - } `@indent` *nvim-treesitter-indentation-queries* Queries can use the following captures: `@indent.begin` and `@indent.dedent`, @@ -233,7 +122,7 @@ the indentation to 0. The `@indent.begin` specifies that the next line should be indented. Multiple indents on the same line get collapsed. Eg. -> +>query ( (if_statement) (ERROR "else") @indent.begin @@ -244,13 +133,13 @@ permits the next line to indent even when the block intended to be indented has no content yet, improving interactive typing. eg for python: -> +>query ((if_statement) @indent.begin (#set! indent.immediate 1)) < Will allow: -> +>python if True: # Auto indent to here @@ -291,7 +180,7 @@ and finally < To specify the delimiters to use `indent.open_delimiter` and `indent.close_delimiter` should be used. Eg. -> +>query ((argument_list) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")")) @@ -302,13 +191,13 @@ the same indent as the natural next line. For example in python: -> +>python if (a > b and c < d): pass Is not correct, whereas -> +>python if (a > b and c < d): pass @@ -316,7 +205,7 @@ Is not correct, whereas Would be correctly indented. This behavior may be chosen using `indent.avoid_last_matching_next`. Eg. -> +>query (if_statement condition: (parenthesized_expression) @indent.align (#set! indent.open_delimiter "(") @@ -328,263 +217,4 @@ Could be used to specify that the last line of an `@indent.align` capture should be additionally indented to avoid clashing with the indent of the first line of the block inside an if. -============================================================================== -COMMANDS *nvim-treesitter-commands* - - *:TSInstall* -:TSInstall {language} ...~ - -Install one or more treesitter parsers. -You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to -force the reinstallation of already installed parsers. - *:TSInstallSync* -:TSInstallSync {language} ...~ - -Perform the |:TSInstall| operation synchronously. - - *:TSInstallInfo* -:TSInstallInfo~ - -List information about currently installed parsers - - *:TSUpdate* -:TSUpdate {language} ...~ - -Update the installed parser for one more {language} or all installed parsers -if {language} is omitted. The specified parser is installed if it is not already -installed. - - *:TSUpdateSync* -:TSUpdateSync {language} ...~ - -Perform the |:TSUpdate| operation synchronously. - - *:TSUninstall* -:TSUninstall {language} ...~ - -Deletes the parser for one or more {language}. You can use 'all' for language -to uninstall all parsers. - - *:TSBufEnable* -:TSBufEnable {module}~ - -Enable {module} on the current buffer. -A list of modules can be found at |:TSModuleInfo| - - *:TSBufDisable* -:TSBufDisable {module}~ - -Disable {module} on the current buffer. -A list of modules can be found at |:TSModuleInfo| - - *:TSBufToggle* -:TSBufToggle {module}~ - -Toggle (enable if disabled, disable if enabled) {module} on the current -buffer. -A list of modules can be found at |:TSModuleInfo| - - *:TSEnable* -:TSEnable {module} [{language}]~ - -Enable {module} for the session. -If {language} is specified, enable module for the session only for this -particular language. -A list of modules can be found at |:TSModuleInfo| -A list of languages can be found at |:TSInstallInfo| - - *:TSDisable* -:TSDisable {module} [{language}]~ - -Disable {module} for the session. -If {language} is specified, disable module for the session only for this -particular language. -A list of modules can be found at |:TSModuleInfo| -A list of languages can be found at |:TSInstallInfo| - - *:TSToggle* -:TSToggle {module} [{language}]~ - -Toggle (enable if disabled, disable if enabled) {module} for the session. -If {language} is specified, toggle module for the session only for this -particular language. -A list of modules can be found at |:TSModuleInfo| -A list of languages can be found at |:TSInstallInfo| - - *:TSModuleInfo* -:TSModuleInfo [{module}]~ - -List the state for the given module or all modules for the current session in -a new buffer. - -These highlight groups are used by default: -> - highlight default TSModuleInfoGood guifg=LightGreen gui=bold - highlight default TSModuleInfoBad guifg=Crimson - highlight default link TSModuleInfoHeader Type - highlight default link TSModuleInfoNamespace Statement - highlight default link TSModuleInfoParser Identifier -< - - *:TSEditQuery* -:TSEditQuery {query-group} [{lang}]~ - -Edit the query file for a {query-group} (e.g. highlights, locals) for given -{lang}. If there are multiple files, the user is prompted to select one of them. -If no such file exists, a buffer for a new file in the user's config directory -is created. If {lang} is not specified, the language of the current buffer -is used. - - *:TSEditQueryUserAfter* -:TSEditQueryUserAfter {query-group} [{lang}]~ - -Same as |:TSEditQuery| but edits a file in the `after` directory of the -user's config directory. Useful to add custom extensions for the queries -provided by a plugin. - -============================================================================== -UTILS *nvim-treesitter-utils* - -Nvim treesitter has some wrapper functions that you can retrieve with: -> - local ts_utils = require 'nvim-treesitter.ts_utils' -< -Methods - *ts_utils.get_node_at_cursor* -get_node_at_cursor(winnr)~ - -`winnr` will be 0 if nil. -Returns the node under the cursor. - - *ts_utils.is_parent* -is_parent(dest, source)~ - -Determines whether `dest` is a parent of `source`. -Returns a boolean. - - *ts_utils.get_named_children* -get_named_children(node)~ - -Returns a table of named children of `node`. - - *ts_utils.get_next_node* -get_next_node(node, allow_switch_parent, allow_next_parent)~ - -Returns the next node within the same parent. -If no node is found, returns `nil`. -If `allow_switch_parent` is true, it will allow switching parent -when the node is the last node. -If `allow_next_parent` is true, it will allow next parent if -the node is the last node and the next parent doesn't have children. - - *ts_utils.get_previous_node* -get_previous_node(node, allow_switch_parents, allow_prev_parent)~ - -Returns the previous node within the same parent. -`allow_switch_parent` and `allow_prev_parent` follow the same rule -as |ts_utils.get_next_node| but if the node is the first node. - - *ts_utils.goto_node* -goto_node(node, goto_end, avoid_set_jump)~ - -Sets cursor to the position of `node` in the current windows. -If `goto_end` is truthy, the cursor is set to the end the node range. -Setting `avoid_set_jump` to `true`, avoids setting the current cursor position -to the jump list. - - *ts_utils.swap_nodes* -swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second)~ - -Swaps the nodes or ranges. -set `cursor_to_second` to true to move the cursor to the second node - - *ts_utils.memoize_by_buf_tick* -memoize_by_buf_tick(fn, options)~ - -Caches the return value for a function and returns the cache value if the tick -of the buffer has not changed from the previous. - - `fn`: a function that takes any arguments - and returns a value to store. - `options?`: - - `bufnr`: a function/value that extracts the bufnr from the given arguments. - - `key`: a function/value that extracts the cache key from the given arguments. - `returns`: a function to call with bufnr as argument to - retrieve the value from the cache - - *ts_utils.node_to_lsp_range* -node_to_lsp_range(node)~ - -Get an lsp formatted range from a node range - - *ts_utils.node_length* -node_length(node)~ - -Get the byte length of node range - - *ts_utils.update_selection* -update_selection(buf, node)~ - -Set the selection to the node range - - *ts_utils.highlight_range* -highlight_range(range, buf, hl_namespace, hl_group)~ - -Set a highlight that spans the given range - - *ts_utils.highlight_node* -highlight_node(node, buf, hl_namespace, hl_group)~ - -Set a highlight that spans the given node's range - -============================================================================== -FUNCTIONS *nvim-treesitter-functions* - - *nvim_treesitter#statusline()* -nvim_treesitter#statusline(opts)~ - -Returns a string describing the current position in the file. This -could be used as a statusline indicator. -Default options (lua syntax): -> - { - indicator_size = 100, - type_patterns = {'class', 'function', 'method'}, - transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end, - separator = ' -> ', - allow_duplicates = false - } -< -- `indicator_size` - How long should the string be. If longer, it is cut from - the beginning. -- `type_patterns` - Which node type patterns to match. -- `transform_fn` - Function used to transform the single item in line. By - default it removes opening brackets and spaces from end. Takes two arguments: - the text of the line in question, and the corresponding treesitter node. -- `separator` - Separator between nodes. -- `allow_duplicates` - Whether or not to remove duplicate components. - - *nvim_treesitter#foldexpr()* -nvim_treesitter#foldexpr()~ - -Functions to be used to determine the fold level at a given line number. -To use it: > - set foldmethod=expr - set foldexpr=nvim_treesitter#foldexpr() -< - -This will respect your 'foldminlines' and 'foldnestmax' settings. - -Note: This is highly experimental, and folding can break on some types of - edits. If you encounter such breakage, hitting `zx` should fix folding. - In any case, feel free to open an issue with the reproducing steps. - -============================================================================== -PERFORMANCE *nvim-treesitter-performance* - -`nvim-treesitter` checks the 'runtimepath' on startup in order to discover -available parsers and queries and index them. As a consequence, a very long -'runtimepath' might result in delayed startup times. - - vim:tw=78:ts=8:expandtab:noet:ft=help:norl: diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua deleted file mode 100644 index 963fe7309..000000000 --- a/lua/nvim-treesitter.lua +++ /dev/null @@ -1,22 +0,0 @@ -local install = require "nvim-treesitter.install" -local utils = require "nvim-treesitter.utils" -local info = require "nvim-treesitter.info" -local configs = require "nvim-treesitter.configs" -local statusline = require "nvim-treesitter.statusline" - --- Registers all query predicates -require "nvim-treesitter.query_predicates" - -local M = {} - -function M.setup() - utils.setup_commands("install", install.commands) - utils.setup_commands("info", info.commands) - utils.setup_commands("configs", configs.commands) - configs.init() -end - -M.define_modules = configs.define_modules -M.statusline = statusline.statusline - -return M diff --git a/lua/nvim-treesitter/caching.lua b/lua/nvim-treesitter/caching.lua deleted file mode 100644 index 7733202ed..000000000 --- a/lua/nvim-treesitter/caching.lua +++ /dev/null @@ -1,71 +0,0 @@ -local api = vim.api - -local M = {} - --- Creates a cache table for buffers keyed by a type name. --- Cache entries attach to the buffer and cleanup entries --- as buffers are detached. -function M.create_buffer_cache() - local cache = {} - - ---@type table> - local items = setmetatable({}, { - __index = function(tbl, key) - rawset(tbl, key, {}) - return rawget(tbl, key) - end, - }) - - ---@type table - local loaded_buffers = {} - - ---@param type_name string - ---@param bufnr integer - ---@param value any - function cache.set(type_name, bufnr, value) - if not loaded_buffers[bufnr] then - loaded_buffers[bufnr] = true - -- Clean up the cache if the buffer is detached - -- to avoid memory leaks - api.nvim_buf_attach(bufnr, false, { - on_detach = function() - cache.clear_buffer(bufnr) - loaded_buffers[bufnr] = nil - return true - end, - on_reload = function() end, -- this is needed to prevent on_detach being called on buffer reload - }) - end - - items[bufnr][type_name] = value - end - - ---@param type_name string - ---@param bufnr integer - ---@return any - function cache.get(type_name, bufnr) - return items[bufnr][type_name] - end - - ---@param type_name string - ---@param bufnr integer - ---@return boolean - function cache.has(type_name, bufnr) - return cache.get(type_name, bufnr) ~= nil - end - - ---@param type_name string - ---@param bufnr integer - function cache.remove(type_name, bufnr) - items[bufnr][type_name] = nil - end - - ---@param bufnr integer - function cache.clear_buffer(bufnr) - items[bufnr] = nil - end - - return cache -end - -return M diff --git a/lua/nvim-treesitter/compat.lua b/lua/nvim-treesitter/compat.lua deleted file mode 100644 index 0ad010030..000000000 --- a/lua/nvim-treesitter/compat.lua +++ /dev/null @@ -1,39 +0,0 @@ --- Shim module to address deprecations across nvim versions -local ts = vim.treesitter -local tsq = ts.query - -local M = {} - -function M.get_query_files(lang, query_group, is_included) - return (tsq.get_files or tsq.get_query_files)(lang, query_group, is_included) -end - -function M.get_query(lang, query_name) - return (tsq.get or tsq.get_query)(lang, query_name) -end - -function M.parse_query(lang, query) - return (tsq.parse or tsq.parse_query)(lang, query) -end - -function M.get_range(node, source, metadata) - return (ts.get_range or tsq.get_range)(node, source, metadata) -end - -function M.get_node_text(node, bufnr) - return (ts.get_node_text or tsq.get_node_text)(node, bufnr) -end - -function M.require_language(lang, opts) - return (ts.language.add or ts.language.require_language)(lang, opts) -end - -function M.flatten(t) - if vim.fn.has "nvim-0.11" == 1 then - return vim.iter(t):flatten():totable() - else - return vim.tbl_flatten(t) - end -end - -return M diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua new file mode 100644 index 000000000..e43ad13c2 --- /dev/null +++ b/lua/nvim-treesitter/config.lua @@ -0,0 +1,144 @@ +local utils = require('nvim-treesitter.utils') + +local M = {} + +---@class TSConfig +---@field sync_install boolean +---@field auto_install boolean +---@field ensure_install string[] +---@field ignore_install string[] +---@field install_dir string + +---@type TSConfig +local config = { + sync_install = false, + auto_install = false, + ensure_install = {}, + ignore_install = {}, + install_dir = utils.join_path(vim.fn.stdpath('data'), 'site'), +} + +---Setup call for users to override configuration configurations. +---@param user_data TSConfig|nil user configuration table +function M.setup(user_data) + if user_data then + if user_data.install_dir then + user_data.install_dir = vim.fs.normalize(user_data.install_dir) + --TODO(clason): insert after/before site, or leave to user? + vim.opt.runtimepath:append(user_data.install_dir) + end + config = vim.tbl_deep_extend('force', config, user_data) + end + + if config.auto_install then + vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + local ft = vim.bo[args.buf].filetype + local lang = vim.treesitter.language.get_lang(ft) or ft + if + require('nvim-treesitter.parsers').configs[lang] + and not vim.list_contains(M.installed_parsers(), lang) + and not vim.list_contains(config.ignore_install, lang) + then + require('nvim-treesitter.install').install(lang) + end + end, + }) + end + + if #config.ensure_install > 0 then + local to_install = M.norm_languages(config.ensure_install, { ignored = true, installed = true }) + + if #to_install > 0 then + require('nvim-treesitter.install').install(to_install, { + with_sync = config.sync_install, + }) + end + end +end + +-- Returns the install path for parsers, parser info, and queries. +-- If the specified directory does not exist, it is created. +---@param dir_name string +---@return string +function M.get_install_dir(dir_name) + local dir = utils.join_path(config.install_dir, dir_name) + + if not vim.loop.fs_stat(dir) then + local ok, error = pcall(vim.fn.mkdir, dir, 'p', '0755') + if not ok then + vim.notify(error, vim.log.levels.ERROR) + end + end + return dir +end + +---@return string[] +function M.installed_parsers() + local install_dir = M.get_install_dir('parser') + + local installed = {} --- @type string[] + for f in vim.fs.dir(install_dir) do + local lang = assert(f:match('(.*)%..*')) + installed[#installed + 1] = lang + end + + return installed +end + +---Normalize languages +---@param languages? string[]|string +---@param skip? table +---@return string[] +function M.norm_languages(languages, skip) + if not languages then + return {} + end + local parsers = require('nvim-treesitter.parsers') + + -- Turn into table + if type(languages) == 'string' then + languages = { languages } + end + + if vim.list_contains(languages, 'all') then + if skip and skip.missing then + return M.installed_parsers() + end + languages = parsers.get_available() + end + + for i, tier in ipairs(parsers.tiers) do + if vim.list_contains(languages, tier) then + languages = vim.iter.filter(function(l) + return l ~= tier + end, languages) + vim.list_extend(languages, parsers.get_available(i)) + end + end + + if skip and skip.ignored then + local ignored = config.ignore_install + languages = vim.iter.filter(function(v) + return not vim.list_contains(ignored, v) + end, languages) + end + + if skip and skip.installed then + local installed = M.installed_parsers() + languages = vim.iter.filter(function(v) + return not vim.list_contains(installed, v) + end, languages) + end + + if skip and skip.missing then + local installed = M.installed_parsers() + languages = vim.iter.filter(function(v) + return vim.list_contains(installed, v) + end, languages) + end + + return languages +end + +return M diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua deleted file mode 100644 index a3ec30fb2..000000000 --- a/lua/nvim-treesitter/configs.lua +++ /dev/null @@ -1,616 +0,0 @@ -local api = vim.api - -local queries = require "nvim-treesitter.query" -local ts = require "nvim-treesitter.compat" -local parsers = require "nvim-treesitter.parsers" -local utils = require "nvim-treesitter.utils" -local caching = require "nvim-treesitter.caching" - -local M = {} - ----@class TSConfig ----@field modules {[string]:TSModule} ----@field sync_install boolean ----@field ensure_installed string[]|string ----@field ignore_install string[] ----@field auto_install boolean ----@field parser_install_dir string|nil - ----@type TSConfig -local config = { - modules = {}, - sync_install = false, - ensure_installed = {}, - auto_install = false, - ignore_install = {}, - parser_install_dir = nil, -} - --- List of modules that need to be setup on initialization. ----@type TSModule[][] -local queued_modules_defs = {} --- Whether we've initialized the plugin yet. -local is_initialized = false - ----@class TSModule ----@field module_path string ----@field enable boolean|string[]|function(string): boolean ----@field disable boolean|string[]|function(string): boolean ----@field keymaps table ----@field is_supported function(string): boolean ----@field attach function(string) ----@field detach function(string) ----@field enabled_buffers table ----@field additional_vim_regex_highlighting boolean|string[] - ----@type {[string]: TSModule} -local builtin_modules = { - highlight = { - module_path = "nvim-treesitter.highlight", - -- @deprecated: use `highlight.set_custom_captures` instead - custom_captures = {}, - enable = false, - is_supported = function(lang) - return queries.has_highlights(lang) - end, - additional_vim_regex_highlighting = false, - }, - incremental_selection = { - module_path = "nvim-treesitter.incremental_selection", - enable = false, - keymaps = { - init_selection = "gnn", -- set to `false` to disable one of the mappings - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - is_supported = function() - return true - end, - }, - indent = { - module_path = "nvim-treesitter.indent", - enable = false, - is_supported = queries.has_indents, - }, -} - -local attached_buffers_by_module = caching.create_buffer_cache() - ----Resolves a module by requiring the `module_path` or using the module definition. ----@param mod_name string ----@return TSModule|nil -local function resolve_module(mod_name) - local config_mod = M.get_module(mod_name) - - if not config_mod then - return - end - - if type(config_mod.attach) == "function" and type(config_mod.detach) == "function" then - return config_mod - elseif type(config_mod.module_path) == "string" then - return require(config_mod.module_path) - end -end - ----Enables and attaches the module to a buffer for lang. ----@param mod string path to module ----@param bufnr integer|nil buffer number, defaults to current buffer ----@param lang string|nil language, defaults to current language -local function enable_module(mod, bufnr, lang) - local module = M.get_module(mod) - if not module then - return - end - - bufnr = bufnr or api.nvim_get_current_buf() - lang = lang or parsers.get_buf_lang(bufnr) - - if not module.enable then - if module.enabled_buffers then - module.enabled_buffers[bufnr] = true - else - module.enabled_buffers = { [bufnr] = true } - end - end - - M.attach_module(mod, bufnr, lang) -end - ----Enables autocomands for the module. ----After the module is loaded `loaded` will be set to true for the module. ----@param mod string path to module -local function enable_mod_conf_autocmd(mod) - local config_mod = M.get_module(mod) - if not config_mod or config_mod.loaded then - return - end - - api.nvim_create_autocmd("FileType", { - group = api.nvim_create_augroup("NvimTreesitter-" .. mod, {}), - callback = function(args) - require("nvim-treesitter.configs").reattach_module(mod, args.buf) - end, - desc = "Reattach module", - }) - - config_mod.loaded = true -end - ----Enables the module globally and for all current buffers. ----After enabled, `enable` will be set to true for the module. ----@param mod string path to module -local function enable_all(mod) - local config_mod = M.get_module(mod) - if not config_mod then - return - end - - enable_mod_conf_autocmd(mod) - config_mod.enable = true - config_mod.enabled_buffers = nil - - for _, bufnr in pairs(api.nvim_list_bufs()) do - enable_module(mod, bufnr) - end -end - ----Disables and detaches the module for a buffer. ----@param mod string path to module ----@param bufnr integer buffer number, defaults to current buffer -local function disable_module(mod, bufnr) - local module = M.get_module(mod) - if not module then - return - end - - bufnr = bufnr or api.nvim_get_current_buf() - if module.enabled_buffers then - module.enabled_buffers[bufnr] = false - end - M.detach_module(mod, bufnr) -end - ----Disables autocomands for the module. ----After the module is unloaded `loaded` will be set to false for the module. ----@param mod string path to module -local function disable_mod_conf_autocmd(mod) - local config_mod = M.get_module(mod) - if not config_mod or not config_mod.loaded then - return - end - api.nvim_clear_autocmds { event = "FileType", group = "NvimTreesitter-" .. mod } - config_mod.loaded = false -end - ----Disables the module globally and for all current buffers. ----After disabled, `enable` will be set to false for the module. ----@param mod string path to module -local function disable_all(mod) - local config_mod = M.get_module(mod) - if not config_mod then - return - end - - config_mod.enabled_buffers = nil - disable_mod_conf_autocmd(mod) - config_mod.enable = false - - for _, bufnr in pairs(api.nvim_list_bufs()) do - disable_module(mod, bufnr) - end -end - ----Toggles a module for a buffer ----@param mod string path to module ----@param bufnr integer buffer number, defaults to current buffer ----@param lang string language, defaults to current language -local function toggle_module(mod, bufnr, lang) - bufnr = bufnr or api.nvim_get_current_buf() - lang = lang or parsers.get_buf_lang(bufnr) - - if attached_buffers_by_module.has(mod, bufnr) then - disable_module(mod, bufnr) - else - enable_module(mod, bufnr, lang) - end -end - --- Toggles the module globally and for all current buffers. --- @param mod path to module -local function toggle_all(mod) - local config_mod = M.get_module(mod) - if not config_mod then - return - end - - if config_mod.enable then - disable_all(mod) - else - enable_all(mod) - end -end - ----Recurses through all modules including submodules ----@param accumulator function called for each module ----@param root {[string]: TSModule}|nil root configuration table to start at ----@param path string|nil prefix path -local function recurse_modules(accumulator, root, path) - root = root or config.modules - - for name, module in pairs(root) do - local new_path = path and (path .. "." .. name) or name - - if M.is_module(module) then - accumulator(name, module, new_path, root) - elseif type(module) == "table" then - recurse_modules(accumulator, module, new_path) - end - end -end - --- Shows current configuration of all nvim-treesitter modules ----@param process_function function used as the `process` parameter ---- for vim.inspect (https://github.com/kikito/inspect.lua#optionsprocess) -local function config_info(process_function) - process_function = process_function - or function(item, path) - if path[#path] == vim.inspect.METATABLE then - return - end - if path[#path] == "is_supported" then - return - end - return item - end - print(vim.inspect(config, { process = process_function })) -end - ----@param query_group string ----@param lang string -function M.edit_query_file(query_group, lang) - lang = lang or parsers.get_buf_lang() - local files = ts.get_query_files(lang, query_group, true) - if #files == 0 then - utils.notify "No query file found! Creating a new one!" - M.edit_query_file_user_after(query_group, lang) - elseif #files == 1 then - vim.cmd(":edit " .. files[1]) - else - vim.ui.select(files, { prompt = "Select a file:" }, function(file) - if file then - vim.cmd(":edit " .. file) - end - end) - end -end - ----@param query_group string ----@param lang string -function M.edit_query_file_user_after(query_group, lang) - lang = lang or parsers.get_buf_lang() - local folder = utils.join_path(vim.fn.stdpath "config", "after", "queries", lang) - local file = utils.join_path(folder, query_group .. ".scm") - if vim.fn.isdirectory(folder) ~= 1 then - vim.ui.select({ "Yes", "No" }, { prompt = '"' .. folder .. '" does not exist. Create it?' }, function(choice) - if choice == "Yes" then - vim.fn.mkdir(folder, "p", "0755") - vim.cmd(":edit " .. file) - end - end) - else - vim.cmd(":edit " .. file) - end -end - -M.commands = { - TSBufEnable = { - run = enable_module, - args = { - "-nargs=1", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSBufDisable = { - run = disable_module, - args = { - "-nargs=1", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSBufToggle = { - run = toggle_module, - args = { - "-nargs=1", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSEnable = { - run = enable_all, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSDisable = { - run = disable_all, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSToggle = { - run = toggle_all, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, - TSConfigInfo = { - run = config_info, - args = { - "-nargs=0", - }, - }, - TSEditQuery = { - run = M.edit_query_file, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#available_query_groups", - }, - }, - TSEditQueryUserAfter = { - run = M.edit_query_file_user_after, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#available_query_groups", - }, - }, -} - ----@param mod string module ----@param lang string the language of the buffer ----@param bufnr integer the buffer -function M.is_enabled(mod, lang, bufnr) - if not parsers.has_parser(lang) then - return false - end - - local module_config = M.get_module(mod) - if not module_config then - return false - end - - local buffer_enabled = module_config.enabled_buffers and module_config.enabled_buffers[bufnr] - local config_enabled = module_config.enable or buffer_enabled - if not config_enabled or not module_config.is_supported(lang) then - return false - end - - local disable = module_config.disable - if type(disable) == "function" then - if disable(lang, bufnr) then - return false - end - elseif type(disable) == "table" then - -- Otherwise it's a list of languages - for _, parser in pairs(disable) do - if lang == parser then - return false - end - end - end - - return true -end - ----Setup call for users to override module configurations. ----@param user_data TSConfig module overrides -function M.setup(user_data) - config.modules = vim.tbl_deep_extend("force", config.modules, user_data) - config.ignore_install = user_data.ignore_install or {} - config.parser_install_dir = user_data.parser_install_dir or nil - if config.parser_install_dir then - config.parser_install_dir = vim.fn.expand(config.parser_install_dir, ":p") - end - - config.auto_install = user_data.auto_install or false - if config.auto_install then - require("nvim-treesitter.install").setup_auto_install() - end - - local ensure_installed = user_data.ensure_installed or {} - if #ensure_installed > 0 then - if user_data.sync_install then - require("nvim-treesitter.install").ensure_installed_sync(ensure_installed) - else - require("nvim-treesitter.install").ensure_installed(ensure_installed) - end - end - - config.modules.ensure_installed = nil - config.ensure_installed = ensure_installed - - recurse_modules(function(_, _, new_path) - local data = utils.get_at_path(config.modules, new_path) - if data.enable then - enable_all(new_path) - end - end, config.modules) -end - --- Defines a table of modules that can be attached/detached to buffers --- based on language support. A module consist of the following properties: ----* @enable Whether the modules is enabled. Can be true or false. ----* @disable A list of languages to disable the module for. Only relevant if enable is true. ----* @keymaps A list of user mappings for a given module if relevant. ----* @is_supported A function which, given a ft, will return true if the ft works on the module. ----* @module_path A string path to a module file using `require`. The exported module must contain ---- an `attach` and `detach` function. This path is not required if `attach` and `detach` ---- functions are provided directly on the module definition. ----* @attach An attach function that is called for each buffer that the module is enabled for. This is required ---- if a `module_path` is not specified. ----* @detach A detach function that is called for each buffer that the module is enabled for. This is required ---- if a `module_path` is not specified. --- --- Modules are not setup until `init` is invoked by the plugin. This allows modules to be defined in any order --- and can be loaded lazily. --- ----* @example ----require"nvim-treesitter".define_modules { ---- my_cool_module = { ---- attach = function() ---- do_some_cool_setup() ---- end, ---- detach = function() ---- do_some_cool_teardown() ---- end ---- } ----} ----@param mod_defs TSModule[] -function M.define_modules(mod_defs) - if not is_initialized then - table.insert(queued_modules_defs, mod_defs) - return - end - - recurse_modules(function(key, mod, _, group) - group[key] = vim.tbl_extend("keep", mod, { - enable = false, - disable = {}, - is_supported = function() - return true - end, - }) - end, mod_defs) - - config.modules = vim.tbl_deep_extend("keep", config.modules, mod_defs) - - for _, mod in ipairs(M.available_modules(mod_defs)) do - local module_config = M.get_module(mod) - if module_config and module_config.enable then - enable_mod_conf_autocmd(mod) - end - end -end - ----Attaches a module to a buffer ----@param mod_name string the module name ----@param bufnr integer the buffer ----@param lang string the language of the buffer -function M.attach_module(mod_name, bufnr, lang) - bufnr = bufnr or api.nvim_get_current_buf() - lang = lang or parsers.get_buf_lang(bufnr) - local resolved_mod = resolve_module(mod_name) - - if resolved_mod and not attached_buffers_by_module.has(mod_name, bufnr) and M.is_enabled(mod_name, lang, bufnr) then - attached_buffers_by_module.set(mod_name, bufnr, true) - resolved_mod.attach(bufnr, lang) - end -end - --- Detaches a module to a buffer ----@param mod_name string the module name ----@param bufnr integer the buffer -function M.detach_module(mod_name, bufnr) - local resolved_mod = resolve_module(mod_name) - bufnr = bufnr or api.nvim_get_current_buf() - - if resolved_mod and attached_buffers_by_module.has(mod_name, bufnr) then - attached_buffers_by_module.remove(mod_name, bufnr) - resolved_mod.detach(bufnr) - end -end - --- Same as attach_module, but if the module is already attached, detach it first. ----@param mod_name string the module name ----@param bufnr integer the buffer ----@param lang string the language of the buffer -function M.reattach_module(mod_name, bufnr, lang) - M.detach_module(mod_name, bufnr) - M.attach_module(mod_name, bufnr, lang) -end - --- Gets available modules ----@param root {[string]:TSModule}|nil table to find modules ----@return string[] modules list of module paths -function M.available_modules(root) - local modules = {} - - recurse_modules(function(_, _, path) - table.insert(modules, path) - end, root) - - return modules -end - ----Gets a module config by path ----@param mod_path string path to the module ----@return TSModule|nil: the module or nil -function M.get_module(mod_path) - local mod = utils.get_at_path(config.modules, mod_path) - - return M.is_module(mod) and mod or nil -end - --- Determines whether the provided table is a module. --- A module should contain an attach and detach function. ----@param mod table|nil the module table ----@return boolean -function M.is_module(mod) - return type(mod) == "table" - and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(mod.module_path) == "string") -end - --- Initializes built-in modules and any queued modules --- registered by plugins or the user. -function M.init() - is_initialized = true - M.define_modules(builtin_modules) - - for _, mod_def in ipairs(queued_modules_defs) do - M.define_modules(mod_def) - end -end - --- If parser_install_dir is not nil is used or created. --- If parser_install_dir is nil try the package dir of the nvim-treesitter --- plugin first, followed by the "site" dir from "runtimepath". "site" dir will --- be created if it doesn't exist. Using only the package dir won't work when --- the plugin is installed with Nix, since the "/nix/store" is read-only. ----@param folder_name string|nil ----@return string|nil, string|nil -function M.get_parser_install_dir(folder_name) - folder_name = folder_name or "parser" - - local install_dir = config.parser_install_dir or utils.get_package_path() - local parser_dir = utils.join_path(install_dir, folder_name) - - return utils.create_or_reuse_writable_dir( - parser_dir, - utils.join_space("Could not create parser dir '", parser_dir, "': "), - utils.join_space( - "Parser dir '", - parser_dir, - "' should be read/write (see README on how to configure an alternative install location)" - ) - ) -end - -function M.get_parser_info_dir() - return M.get_parser_install_dir "parser-info" -end - -function M.get_ignored_parser_installs() - return config.ignore_install or {} -end - -function M.get_ensure_installed_parsers() - if type(config.ensure_installed) == "string" then - return { config.ensure_installed } - end - return config.ensure_installed or {} -end - -return M diff --git a/lua/nvim-treesitter/fold.lua b/lua/nvim-treesitter/fold.lua deleted file mode 100644 index 759599876..000000000 --- a/lua/nvim-treesitter/fold.lua +++ /dev/null @@ -1,123 +0,0 @@ -local api = vim.api -local tsutils = require "nvim-treesitter.ts_utils" -local query = require "nvim-treesitter.query" -local parsers = require "nvim-treesitter.parsers" - -local M = {} - --- This is cached on buf tick to avoid computing that multiple times --- Especially not for every line in the file when `zx` is hit -local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr) - local max_fold_level = api.nvim_win_get_option(0, "foldnestmax") - local trim_level = function(level) - if level > max_fold_level then - return max_fold_level - end - return level - end - - local parser = parsers.get_parser(bufnr) - - if not parser then - return {} - end - - local matches = query.get_capture_matches_recursively(bufnr, function(lang) - if query.has_folds(lang) then - return "@fold", "folds" - elseif query.has_locals(lang) then - return "@scope", "locals" - end - end) - - -- start..stop is an inclusive range - - ---@type table - local start_counts = {} - ---@type table - local stop_counts = {} - - local prev_start = -1 - local prev_stop = -1 - - local min_fold_lines = api.nvim_win_get_option(0, "foldminlines") - - for _, match in ipairs(matches) do - local start, stop, stop_col ---@type integer, integer, integer - if match.metadata and match.metadata.range then - start, _, stop, stop_col = unpack(match.metadata.range) ---@type integer, integer, integer, integer - else - start, _, stop, stop_col = match.node:range() ---@type integer, integer, integer, integer - end - - if stop_col == 0 then - stop = stop - 1 - end - - local fold_length = stop - start + 1 - local should_fold = fold_length > min_fold_lines - - -- Fold only multiline nodes that are not exactly the same as previously met folds - -- Checking against just the previously found fold is sufficient if nodes - -- are returned in preorder or postorder when traversing tree - if should_fold and not (start == prev_start and stop == prev_stop) then - start_counts[start] = (start_counts[start] or 0) + 1 - stop_counts[stop] = (stop_counts[stop] or 0) + 1 - prev_start = start - prev_stop = stop - end - end - - ---@type string[] - local levels = {} - local current_level = 0 - - -- We now have the list of fold opening and closing, fill the gaps and mark where fold start - for lnum = 0, api.nvim_buf_line_count(bufnr) do - local prefix = "" - - local last_trimmed_level = trim_level(current_level) - current_level = current_level + (start_counts[lnum] or 0) - local trimmed_level = trim_level(current_level) - current_level = current_level - (stop_counts[lnum] or 0) - local next_trimmed_level = trim_level(current_level) - - -- Determine if it's the start/end of a fold - -- NB: vim's fold-expr interface does not have a mechanism to indicate that - -- two (or more) folds start at this line, so it cannot distinguish between - -- ( \n ( \n )) \n (( \n ) \n ) - -- versus - -- ( \n ( \n ) \n ( \n ) \n ) - -- If it did have such a mechanism, (trimmed_level - last_trimmed_level) - -- would be the correct number of starts to pass on. - if trimmed_level - last_trimmed_level > 0 then - prefix = ">" - elseif trimmed_level - next_trimmed_level > 0 then - -- Ending marks tend to confuse vim more than it helps, particularly when - -- the fold level changes by at least 2; we can uncomment this if - -- vim's behavior gets fixed. - -- prefix = "<" - prefix = "" - end - - levels[lnum + 1] = prefix .. tostring(trimmed_level) - end - - return levels -end) - ----@param lnum integer ----@return string -function M.get_fold_indic(lnum) - if not parsers.has_parser() or not lnum then - return "0" - end - - local buf = api.nvim_get_current_buf() - - local levels = folds_levels(buf) or {} - - return levels[lnum] or "0" -end - -return M diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 32741b136..e8c945f6c 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -1,116 +1,119 @@ -local api = vim.api -local fn = vim.fn - -local queries = require "nvim-treesitter.query" -local info = require "nvim-treesitter.info" -local shell = require "nvim-treesitter.shell_command_selectors" -local install = require "nvim-treesitter.install" -local utils = require "nvim-treesitter.utils" -local ts = require "nvim-treesitter.compat" - -local health = vim.health or require "health" - --- "report_" prefix has been deprecated, use the recommended replacements if they exist. -local _start = health.start or health.report_start -local _ok = health.ok or health.report_ok -local _warn = health.warn or health.report_warn -local _error = health.error or health.report_error +local shell = require('nvim-treesitter.shell_cmds') +local install = require('nvim-treesitter.install') +local config = require('nvim-treesitter.config') +local tsq = vim.treesitter.query local M = {} local NVIM_TREESITTER_MINIMUM_ABI = 13 -local function install_health() - _start "Installation" - - if fn.has "nvim-0.10" ~= 1 then - _error "Nvim-treesitter requires Nvim 0.10 or newer" - end - - if fn.executable "tree-sitter" == 0 then - _warn( - "`tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar," - .. " not required for :TSInstall)" - ) - else - _ok( - "`tree-sitter` found " - .. (utils.ts_cli_version() or "(unknown version)") - .. " (parser generator, only needed for :TSInstallFromGrammar)" - ) - end - - if fn.executable "node" == 0 then - _warn("`node` executable not found (only needed for :TSInstallFromGrammar," .. " not required for :TSInstall)") - else - local handle = io.popen "node --version" - local result = handle:read "*a" +---@return string|nil +local function ts_cli_version() + if vim.fn.executable('tree-sitter') == 1 then + local handle = io.popen('tree-sitter -V') + if not handle then + return + end + local result = handle:read('*a') handle:close() - local version = vim.split(result, "\n")[1] - _ok("`node` found " .. version .. " (only needed for :TSInstallFromGrammar)") + return vim.split(result, '\n')[1]:match('[^tree%psitter ].*') + end +end + +local function install_health() + vim.health.start('Installation') + + if vim.fn.has('nvim-0.10') ~= 1 then + vim.health.error('Nvim-treesitter requires Neovim Nightly') end - if fn.executable "git" == 0 then - _error("`git` executable not found.", { - "Install it with your package manager.", - "Check that your `$PATH` is set correctly.", + if vim.fn.executable('tree-sitter') == 0 then + vim.health.warn( + '`tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar,' + .. ' not required for :TSInstall)' + ) + else + vim.health.ok( + '`tree-sitter` found ' + .. (ts_cli_version() or '(unknown version)') + .. ' (parser generator, only needed for :TSInstallFromGrammar)' + ) + end + + if vim.fn.executable('node') == 0 then + vim.health.warn( + '`node` executable not found (only needed for :TSInstallFromGrammar,' + .. ' not required for :TSInstall)' + ) + else + local handle = assert(io.popen('node --version')) + local result = handle:read('*a') + handle:close() + local version = vim.split(result, '\n')[1] + vim.health.ok('`node` found ' .. version .. ' (only needed for :TSInstallFromGrammar)') + end + + if vim.fn.executable('git') == 0 then + vim.health.error('`git` executable not found.', { + 'Install it with your package manager.', + 'Check that your `$PATH` is set correctly.', }) else - _ok "`git` executable found." + vim.health.ok('`git` executable found.') end local cc = shell.select_executable(install.compilers) if not cc then - _error("`cc` executable not found.", { - "Check that any of " + vim.health.error('`cc` executable not found.', { + 'Check that any of ' .. vim.inspect(install.compilers) - .. " is in your $PATH" + .. ' is in your $PATH' .. ' or set the environment variable CC or `require"nvim-treesitter.install".compilers` explicitly!', }) else - local version = vim.fn.systemlist(cc .. (cc == "cl" and "" or " --version"))[1] - _ok( - "`" + local version = vim.fn.systemlist(cc .. (cc == 'cl' and '' or ' --version'))[1] + vim.health.ok( + '`' .. cc - .. "` executable found. Selected from " + .. '` executable found. Selected from ' .. vim.inspect(install.compilers) - .. (version and ("\nVersion: " .. version) or "") + .. (version and ('\nVersion: ' .. version) or '') ) end if vim.treesitter.language_version then if vim.treesitter.language_version >= NVIM_TREESITTER_MINIMUM_ABI then - _ok( - "Neovim was compiled with tree-sitter runtime ABI version " + vim.health.ok( + 'Neovim was compiled with tree-sitter runtime ABI version ' .. vim.treesitter.language_version - .. " (required >=" + .. ' (required >=' .. NVIM_TREESITTER_MINIMUM_ABI - .. "). Parsers must be compatible with runtime ABI." + .. '). Parsers must be compatible with runtime ABI.' ) else - _error( - "Neovim was compiled with tree-sitter runtime ABI version " + vim.health.error( + 'Neovim was compiled with tree-sitter runtime ABI version ' .. vim.treesitter.language_version - .. ".\n" - .. "nvim-treesitter expects at least ABI version " + .. '.\n' + .. 'nvim-treesitter expects at least ABI version ' .. NVIM_TREESITTER_MINIMUM_ABI - .. "\n" - .. "Please make sure that Neovim is linked against are recent tree-sitter runtime when building" - .. " or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI." + .. '\n' + .. 'Please make sure that Neovim is linked against are recent tree-sitter runtime when building' + .. ' or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI.' ) end end - _start("OS Info:\n" .. vim.inspect(vim.loop.os_uname())) + vim.health.start('OS Info:\n' .. vim.inspect(vim.loop.os_uname())) end local function query_status(lang, query_group) - local ok, err = pcall(queries.get_query, lang, query_group) + local ok, err = pcall(tsq.get, lang, query_group) if not ok then - return "x", err + return 'x', err elseif not err then - return "." + return '.' else - return "✓" + return '✓' end end @@ -118,59 +121,53 @@ function M.check() local error_collection = {} -- Installation dependency checks install_health() - queries.invalidate_query_cache() -- Parser installation checks - local parser_installation = { "Parser/Features" .. string.rep(" ", 9) .. "H L F I J" } - for _, parser_name in pairs(info.installed_parsers()) do - local installed = #api.nvim_get_runtime_file("parser/" .. parser_name .. ".so", false) - - -- Only append information about installed parsers - if installed >= 1 then - local multiple_parsers = installed > 1 and "+" or "" - local out = " - " .. parser_name .. multiple_parsers .. string.rep(" ", 20 - (#parser_name + #multiple_parsers)) - for _, query_group in pairs(queries.built_in_query_groups) do - local status, err = query_status(parser_name, query_group) - out = out .. status .. " " - if err then - table.insert(error_collection, { parser_name, query_group, err }) - end + local parser_installation = { 'Parser/Features' .. string.rep(' ', 9) .. 'H L F I J' } + for _, parser_name in pairs(config.installed_parsers()) do + local out = ' - ' .. parser_name .. string.rep(' ', 20 - #parser_name) + for _, query_group in pairs(M.bundled_queries) do + local status, err = query_status(parser_name, query_group) + out = out .. status .. ' ' + if err then + table.insert(error_collection, { parser_name, query_group, err }) end - table.insert(parser_installation, vim.fn.trim(out, " ", 2)) end + table.insert(parser_installation, vim.fn.trim(out, ' ', 2)) end local legend = [[ - Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections - +) multiple parsers found, only one will be used - x) errors found in the query, try to run :TSUpdate {lang}]] + Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[J]ections + x) errors found in the query, try to run :TSUpdate {lang}]] table.insert(parser_installation, legend) -- Finally call the report function - _start(table.concat(parser_installation, "\n")) + vim.health.start(table.concat(parser_installation, '\n')) if #error_collection > 0 then - _start "The following errors have been detected:" + vim.health.start('The following errors have been detected:') for _, p in ipairs(error_collection) do local lang, type, err = unpack(p) local lines = {} - table.insert(lines, lang .. "(" .. type .. "): " .. err) - local files = ts.get_query_files(lang, type) + table.insert(lines, lang .. '(' .. type .. '): ' .. err) + local files = tsq.get_files(lang, type) if #files > 0 then - table.insert(lines, lang .. "(" .. type .. ") is concatenated from the following files:") + table.insert(lines, lang .. '(' .. type .. ') is concatenated from the following files:') for _, file in ipairs(files) do - local fd = io.open(file, "r") + local fd = io.open(file, 'r') if fd then - local ok, file_err = pcall(ts.parse_query, lang, fd:read "*a") + local ok, file_err = pcall(tsq.parse, lang, fd:read('*a')) if ok then - table.insert(lines, '| [OK]:"' .. file .. '"') + table.insert(lines, '| [OK]:"' .. file .. '"') else - table.insert(lines, '| [ERROR]:"' .. file .. '", failed to load: ' .. file_err) + table.insert(lines, '| [ERR]:"' .. file .. '", failed to load: ' .. file_err) end fd:close() end end end - _error(table.concat(lines, "\n")) + vim.health.error(table.concat(lines, '\n')) end end end +M.bundled_queries = { 'highlights', 'locals', 'folds', 'indents', 'injections' } + return M diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua deleted file mode 100644 index 5a3cc2e86..000000000 --- a/lua/nvim-treesitter/highlight.lua +++ /dev/null @@ -1,49 +0,0 @@ -local configs = require "nvim-treesitter.configs" - -local M = {} - ----@param config TSModule ----@param lang string ----@return boolean -local function should_enable_vim_regex(config, lang) - local additional_hl = config.additional_vim_regex_highlighting - local is_table = type(additional_hl) == "table" - - ---@diagnostic disable-next-line: param-type-mismatch - return additional_hl and (not is_table or vim.tbl_contains(additional_hl, lang)) -end - ----@param bufnr integer ----@param lang string -function M.attach(bufnr, lang) - local config = configs.get_module "highlight" - vim.treesitter.start(bufnr, lang) - if config and should_enable_vim_regex(config, lang) then - vim.bo[bufnr].syntax = "ON" - end -end - ----@param bufnr integer -function M.detach(bufnr) - vim.treesitter.stop(bufnr) -end - ----@deprecated -function M.start(...) - vim.notify( - "`nvim-treesitter.highlight.start` is deprecated: use `nvim-treesitter.highlight.attach` or `vim.treesitter.start`", - vim.log.levels.WARN - ) - M.attach(...) -end - ----@deprecated -function M.stop(...) - vim.notify( - "`nvim-treesitter.highlight.stop` is deprecated: use `nvim-treesitter.highlight.detach` or `vim.treesitter.stop`", - vim.log.levels.WARN - ) - M.detach(...) -end - -return M diff --git a/lua/nvim-treesitter/incremental_selection.lua b/lua/nvim-treesitter/incremental_selection.lua deleted file mode 100644 index 570f9eed9..000000000 --- a/lua/nvim-treesitter/incremental_selection.lua +++ /dev/null @@ -1,176 +0,0 @@ -local api = vim.api - -local configs = require "nvim-treesitter.configs" -local ts_utils = require "nvim-treesitter.ts_utils" -local locals = require "nvim-treesitter.locals" -local parsers = require "nvim-treesitter.parsers" -local queries = require "nvim-treesitter.query" -local utils = require "nvim-treesitter.utils" - -local M = {} - ----@type table> -local selections = {} - -function M.init_selection() - local buf = api.nvim_get_current_buf() - parsers.get_parser():parse { vim.fn.line "w0" - 1, vim.fn.line "w$" } - local node = ts_utils.get_node_at_cursor() - selections[buf] = { [1] = node } - ts_utils.update_selection(buf, node) -end - --- Get the range of the current visual selection. --- --- The range starts with 1 and the ending is inclusive. ----@return integer, integer, integer, integer -local function visual_selection_range() - local _, csrow, cscol, _ = unpack(vim.fn.getpos "v") ---@type integer, integer, integer, integer - local _, cerow, cecol, _ = unpack(vim.fn.getpos ".") ---@type integer, integer, integer, integer - - local start_row, start_col, end_row, end_col ---@type integer, integer, integer, integer - - if csrow < cerow or (csrow == cerow and cscol <= cecol) then - start_row = csrow - start_col = cscol - end_row = cerow - end_col = cecol - else - start_row = cerow - start_col = cecol - end_row = csrow - end_col = cscol - end - - return start_row, start_col, end_row, end_col -end - ----@param node TSNode ----@return boolean -local function range_matches(node) - local csrow, cscol, cerow, cecol = visual_selection_range() - local srow, scol, erow, ecol = ts_utils.get_vim_range { node:range() } - return srow == csrow and scol == cscol and erow == cerow and ecol == cecol -end - ----@param get_parent fun(node: TSNode): TSNode|nil ----@return fun():nil -local function select_incremental(get_parent) - return function() - local buf = api.nvim_get_current_buf() - local nodes = selections[buf] - - local csrow, cscol, cerow, cecol = visual_selection_range() - -- Initialize incremental selection with current selection - if not nodes or #nodes == 0 or not range_matches(nodes[#nodes]) then - local parser = parsers.get_parser() - parser:parse { vim.fn.line "w0" - 1, vim.fn.line "w$" } - local node = parser:named_node_for_range( - { csrow - 1, cscol - 1, cerow - 1, cecol }, - { ignore_injections = false } - ) - ts_utils.update_selection(buf, node) - if nodes and #nodes > 0 then - table.insert(selections[buf], node) - else - selections[buf] = { [1] = node } - end - return - end - - -- Find a node that changes the current selection. - local node = nodes[#nodes] ---@type TSNode - while true do - local parent = get_parent(node) - if not parent or parent == node then - -- Keep searching in the parent tree - local root_parser = parsers.get_parser() - root_parser:parse { vim.fn.line "w0" - 1, vim.fn.line "w$" } - local current_parser = root_parser:language_for_range { csrow - 1, cscol - 1, cerow - 1, cecol } - if root_parser == current_parser then - node = root_parser:named_node_for_range { csrow - 1, cscol - 1, cerow - 1, cecol } - ts_utils.update_selection(buf, node) - return - end - -- NOTE: parent() method is private - local parent_parser = current_parser:parent() - parent = parent_parser:named_node_for_range { csrow - 1, cscol - 1, cerow - 1, cecol } - end - node = parent - local srow, scol, erow, ecol = ts_utils.get_vim_range { node:range() } - local same_range = (srow == csrow and scol == cscol and erow == cerow and ecol == cecol) - if not same_range then - table.insert(selections[buf], node) - if node ~= nodes[#nodes] then - table.insert(nodes, node) - end - ts_utils.update_selection(buf, node) - return - end - end - end -end - -M.node_incremental = select_incremental(function(node) - return node:parent() or node -end) - -M.scope_incremental = select_incremental(function(node) - local lang = parsers.get_buf_lang() - if queries.has_locals(lang) then - return locals.containing_scope(node:parent() or node) - else - return node - end -end) - -function M.node_decremental() - local buf = api.nvim_get_current_buf() - local nodes = selections[buf] - if not nodes or #nodes < 2 then - return - end - - table.remove(selections[buf]) - local node = nodes[#nodes] ---@type TSNode - ts_utils.update_selection(buf, node) -end - -local FUNCTION_DESCRIPTIONS = { - init_selection = "Start selecting nodes with nvim-treesitter", - node_incremental = "Increment selection to named node", - scope_incremental = "Increment selection to surrounding scope", - node_decremental = "Shrink selection to previous named node", -} - ----@param bufnr integer -function M.attach(bufnr) - local config = configs.get_module "incremental_selection" - for funcname, mapping in pairs(config.keymaps) do - if mapping then - local mode = funcname == "init_selection" and "n" or "x" - local rhs = M[funcname] ---@type function - - if not rhs then - utils.notify("Unknown keybinding: " .. funcname .. debug.traceback(), vim.log.levels.ERROR) - else - vim.keymap.set(mode, mapping, rhs, { buffer = bufnr, silent = true, desc = FUNCTION_DESCRIPTIONS[funcname] }) - end - end - end -end - -function M.detach(bufnr) - local config = configs.get_module "incremental_selection" - for f, mapping in pairs(config.keymaps) do - if mapping then - local mode = f == "init_selection" and "n" or "x" - local ok, err = pcall(vim.keymap.del, mode, mapping, { buffer = bufnr }) - if not ok then - utils.notify(string.format('%s "%s" for mode %s', err, mapping, mode), vim.log.levels.ERROR) - end - end - end -end - -return M diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 19e7ef1ee..6b674dc63 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -1,5 +1,4 @@ local ts = vim.treesitter -local parsers = require "nvim-treesitter.parsers" local M = {} @@ -14,13 +13,13 @@ M.comment_parsers = { } local function getline(lnum) - return vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1] or "" + return vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1] or '' end ---@param lnum integer ---@return integer local function get_indentcols_at_line(lnum) - local _, indentcols = getline(lnum):find "^%s*" + local _, indentcols = getline(lnum):find('^%s*') return indentcols or 0 end @@ -62,8 +61,8 @@ local function find_delimiter(bufnr, node, delimiter) local line = vim.api.nvim_buf_get_lines(bufnr, linenr, linenr + 1, false)[1] local end_char = { child:end_() } local trimmed_after_delim - local escaped_delimiter = delimiter:gsub("[%-%.%+%[%]%(%)%$%^%%%?%*]", "%%%1") - trimmed_after_delim, _ = line:sub(end_char[2] + 1):gsub("[%s" .. escaped_delimiter .. "]*", "") + local escaped_delimiter = delimiter:gsub('[%-%.%+%[%]%(%)%$%^%%%?%*]', '%%%1') + trimmed_after_delim = line:sub(end_char[2] + 1):gsub('[%s' .. escaped_delimiter .. ']*', '') return child, #trimmed_after_delim == 0 end end @@ -75,7 +74,7 @@ end ---@param hash_fn fun(...): any ---@return F local function memoize(fn, hash_fn) - local cache = setmetatable({}, { __mode = "kv" }) ---@type table + local cache = setmetatable({}, { __mode = 'kv' }) ---@type table return function(...) local key = hash_fn(...) @@ -91,47 +90,47 @@ end local get_indents = memoize(function(bufnr, root, lang) local map = { - ["indent.auto"] = {}, - ["indent.begin"] = {}, - ["indent.end"] = {}, - ["indent.dedent"] = {}, - ["indent.branch"] = {}, - ["indent.ignore"] = {}, - ["indent.align"] = {}, - ["indent.zero"] = {}, + ['indent.auto'] = {}, + ['indent.begin'] = {}, + ['indent.end'] = {}, + ['indent.dedent'] = {}, + ['indent.branch'] = {}, + ['indent.ignore'] = {}, + ['indent.align'] = {}, + ['indent.zero'] = {}, } - --TODO(clason): remove when dropping Nvim 0.8 compat - local query = (ts.query.get or ts.get_query)(lang, "indents") + local query = ts.query.get(lang, 'indents') if not query then return map end for id, node, metadata in query:iter_captures(root, bufnr) do - if query.captures[id]:sub(1, 1) ~= "_" then + if query.captures[id]:sub(1, 1) ~= '_' then map[query.captures[id]][node:id()] = metadata or {} end end return map end, function(bufnr, root, lang) - return tostring(bufnr) .. root:id() .. "_" .. lang + return tostring(bufnr) .. root:id() .. '_' .. lang end) ---@param lnum number (1-indexed) +---@return integer function M.get_indent(lnum) local bufnr = vim.api.nvim_get_current_buf() - local parser = parsers.get_parser(bufnr) + local parser = ts.get_parser(bufnr) if not parser or not lnum then return -1 end - --TODO(clason): replace when dropping Nvim 0.8 compat - local root_lang = parsers.get_buf_lang(bufnr) + local ft = vim.bo[bufnr].filetype + local root_lang = vim.treesitter.language.get_lang(ft) or ft -- some languages like Python will actually have worse results when re-parsing at opened new line if not M.avoid_force_reparsing[root_lang] then -- Reparse in case we got triggered by ":h indentkeys" - parser:parse { vim.fn.line "w0" - 1, vim.fn.line "w$" } + parser:parse({ vim.fn.line('w0') - 1, vim.fn.line('w$') }) end -- Get language tree with smallest range around node that's not a comment parser @@ -155,15 +154,14 @@ function M.get_indent(lnum) end local q = get_indents(vim.api.nvim_get_current_buf(), root, lang_tree:lang()) - local is_empty_line = string.match(getline(lnum), "^%s*$") ~= nil local node ---@type TSNode - if is_empty_line then + if getline(lnum):find('^%s*$') then local prevlnum = vim.fn.prevnonblank(lnum) local indentcols = get_indentcols_at_line(prevlnum) local prevline = vim.trim(getline(prevlnum)) -- The final position can be trailing spaces, which should not affect indentation node = get_last_node_at_line(root, prevlnum, indentcols + #prevline - 1) - if node:type():match "comment" then + if node:type():match('comment') then -- The final node we capture of the previous line can be a comment node, which should also be ignored -- Unless the last line is an entire line of comment, ignore the comment range and find the last node again local first_node = get_first_node_at_line(root, prevlnum, indentcols) @@ -176,7 +174,7 @@ function M.get_indent(lnum) node = get_last_node_at_line(root, prevlnum, col) end end - if q["indent.end"][node:id()] then + if q['indent.end'][node:id()] then node = get_first_node_at_line(root, lnum) end else @@ -192,18 +190,18 @@ function M.get_indent(lnum) end -- tracks to ensure multiple indent levels are not applied for same line - local is_processed_by_row = {} + local is_processed_by_row = {} --- @type table - if q["indent.zero"][node:id()] then + if q['indent.zero'][node:id()] then return 0 end while node do -- do 'autoindent' if not marked as @indent if - not q["indent.begin"][node:id()] - and not q["indent.align"][node:id()] - and q["indent.auto"][node:id()] + not q['indent.begin'][node:id()] + and not q['indent.align'][node:id()] + and q['indent.auto'][node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then @@ -214,8 +212,8 @@ function M.get_indent(lnum) -- If a node spans from L1,C1 to L2,C2, we know that lines where L1 < line <= L2 would -- have their indentations contained by the node. if - not q["indent.begin"][node:id()] - and q["indent.ignore"][node:id()] + not q['indent.begin'][node:id()] + and q['indent.ignore'][node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then @@ -228,7 +226,10 @@ function M.get_indent(lnum) if not is_processed_by_row[srow] - and ((q["indent.branch"][node:id()] and srow == lnum - 1) or (q["indent.dedent"][node:id()] and srow ~= lnum - 1)) + and ( + (q['indent.branch'][node:id()] and srow == lnum - 1) + or (q['indent.dedent'][node:id()] and srow ~= lnum - 1) + ) then indent = indent - indent_size is_processed = true @@ -244,16 +245,16 @@ function M.get_indent(lnum) if should_process and ( - q["indent.begin"][node:id()] - and (srow ~= erow or is_in_err or q["indent.begin"][node:id()]["indent.immediate"]) - and (srow ~= lnum - 1 or q["indent.begin"][node:id()]["indent.start_at_same_line"]) + q['indent.begin'][node:id()] + and (srow ~= erow or is_in_err or q['indent.begin'][node:id()]['indent.immediate']) + and (srow ~= lnum - 1 or q['indent.begin'][node:id()]['indent.start_at_same_line']) ) then indent = indent + indent_size is_processed = true end - if is_in_err and not q["indent.align"][node:id()] then + if is_in_err and not q['indent.align'][node:id()] then -- only when the node is in error, promote the -- first child's aligned indent to the error node -- to work around ((ERROR "X" . (_)) @aligned_indent (#set! "delimiter" "AB")) @@ -261,34 +262,41 @@ function M.get_indent(lnum) -- (ERROR "X" @aligned_indent (#set! "delimiter" "AB") . (_)) -- and we will fish it out here. for c in node:iter_children() do - if q["indent.align"][c:id()] then - q["indent.align"][node:id()] = q["indent.align"][c:id()] + if q['indent.align'][c:id()] then + q['indent.align'][node:id()] = q['indent.align'][c:id()] break end end end -- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum) - if should_process and q["indent.align"][node:id()] and (srow ~= erow or is_in_err) and (srow ~= lnum - 1) then - local metadata = q["indent.align"][node:id()] + if + should_process + and q['indent.align'][node:id()] + and (srow ~= erow or is_in_err) + and (srow ~= lnum - 1) + then + local metadata = q['indent.align'][node:id()] local o_delim_node, o_is_last_in_line ---@type TSNode|nil, boolean|nil local c_delim_node, c_is_last_in_line ---@type TSNode|nil, boolean|nil, boolean|nil local indent_is_absolute = false - if metadata["indent.open_delimiter"] then - o_delim_node, o_is_last_in_line = find_delimiter(bufnr, node, metadata["indent.open_delimiter"]) + if metadata['indent.open_delimiter'] then + o_delim_node, o_is_last_in_line = + find_delimiter(bufnr, node, metadata['indent.open_delimiter']) else o_delim_node = node end - if metadata["indent.close_delimiter"] then - c_delim_node, c_is_last_in_line = find_delimiter(bufnr, node, metadata["indent.close_delimiter"]) + if metadata['indent.close_delimiter'] then + c_delim_node, c_is_last_in_line = + find_delimiter(bufnr, node, metadata['indent.close_delimiter']) else c_delim_node = node end if o_delim_node then local o_srow, o_scol = o_delim_node:start() - local c_srow = nil + local c_srow = nil --- @type integer? if c_delim_node then - c_srow, _ = c_delim_node:start() + c_srow = c_delim_node:start() end if o_is_last_in_line then -- hanging indent (previous line ended with starting delimiter) @@ -310,7 +318,7 @@ function M.get_indent(lnum) -- Then its indent level shouldn't be affected by `@aligned_indent` node indent = math.max(indent - indent_size, 0) else - indent = o_scol + (metadata["indent.increment"] or 1) + indent = o_scol + (metadata['indent.increment'] or 1) indent_is_absolute = true end end @@ -321,7 +329,7 @@ function M.get_indent(lnum) -- then this last line may need additional indent to avoid clashes -- with the next. `indent.avoid_last_matching_next` controls this behavior, -- for example this is needed for function parameters. - avoid_last_matching_next = metadata["indent.avoid_last_matching_next"] or false + avoid_last_matching_next = metadata['indent.avoid_last_matching_next'] or false end if avoid_last_matching_next then -- last line must be indented more in cases where @@ -350,17 +358,4 @@ function M.get_indent(lnum) return indent end ----@type table -local indent_funcs = {} - ----@param bufnr integer -function M.attach(bufnr) - indent_funcs[bufnr] = vim.bo.indentexpr - vim.bo.indentexpr = "nvim_treesitter#indent()" -end - -function M.detach(bufnr) - vim.bo.indentexpr = indent_funcs[bufnr] -end - return M diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua deleted file mode 100644 index 6e94b357d..000000000 --- a/lua/nvim-treesitter/info.lua +++ /dev/null @@ -1,190 +0,0 @@ -local api = vim.api -local configs = require "nvim-treesitter.configs" -local parsers = require "nvim-treesitter.parsers" - -local M = {} - -local function install_info() - local max_len = 0 - for _, ft in pairs(parsers.available_parsers()) do - if #ft > max_len then - max_len = #ft - end - end - - local parser_list = parsers.available_parsers() - table.sort(parser_list) - for _, lang in pairs(parser_list) do - local is_installed = #api.nvim_get_runtime_file("parser/" .. lang .. ".so", false) > 0 - api.nvim_out_write(lang .. string.rep(" ", max_len - #lang + 1)) - if is_installed then - api.nvim_out_write "[✓] installed\n" - elseif pcall(vim.treesitter.inspect_lang, lang) then - api.nvim_out_write "[✗] not installed (but still loaded. Restart Neovim!)\n" - else - api.nvim_out_write "[✗] not installed\n" - end - end -end - --- Sort a list of modules into namespaces. --- {'mod1', 'mod2.sub1', 'mod2.sub2', 'mod3'} --- -> --- { default = {'mod1', 'mod3'}, mod2 = {'sub1', 'sub2'}} ----@param modulelist string[] ----@return table -local function namespace_modules(modulelist) - local modules = {} - for _, module in ipairs(modulelist) do - if module:find "%." then - local namespace, submodule = module:match "^(.*)%.(.*)$" - if not modules[namespace] then - modules[namespace] = {} - end - table.insert(modules[namespace], submodule) - else - if not modules.default then - modules.default = {} - end - table.insert(modules.default, module) - end - end - return modules -end - ----@param list string[] ----@return integer length -local function longest_string_length(list) - local length = 0 - for _, value in ipairs(list) do - if #value > length then - length = #value - end - end - return length -end - ----@param curbuf integer ----@param origbuf integer ----@param parserlist string[] ----@param namespace string ----@param modulelist string[] -local function append_module_table(curbuf, origbuf, parserlist, namespace, modulelist) - local maxlen_parser = longest_string_length(parserlist) - table.sort(modulelist) - - -- header - local header = ">> " .. namespace .. string.rep(" ", maxlen_parser - #namespace - 1) - for _, module in pairs(modulelist) do - header = header .. module .. " " - end - api.nvim_buf_set_lines(curbuf, -1, -1, true, { header }) - - -- actual table - for _, parser in ipairs(parserlist) do - local padding = string.rep(" ", maxlen_parser - #parser + 2) - local line = parser .. padding - local namespace_prefix = (namespace == "default") and "" or namespace .. "." - for _, module in pairs(modulelist) do - local modlen = #module - module = namespace_prefix .. module - if configs.is_enabled(module, parser, origbuf) then - line = line .. "✓" - else - line = line .. "✗" - end - line = line .. string.rep(" ", modlen + 1) - end - api.nvim_buf_set_lines(curbuf, -1, -1, true, { line }) - end - - api.nvim_buf_set_lines(curbuf, -1, -1, true, { "" }) -end - -local function print_info_modules(parserlist, module) - local origbuf = api.nvim_get_current_buf() - api.nvim_command "enew" - local curbuf = api.nvim_get_current_buf() - - local modules - if module then - modules = namespace_modules { module } - else - modules = namespace_modules(configs.available_modules()) - end - - ---@type string[] - local namespaces = {} - for k, _ in pairs(modules) do - table.insert(namespaces, k) - end - table.sort(namespaces) - - table.sort(parserlist) - for _, namespace in ipairs(namespaces) do - append_module_table(curbuf, origbuf, parserlist, namespace, modules[namespace]) - end - - api.nvim_buf_set_option(curbuf, "modified", false) - api.nvim_buf_set_option(curbuf, "buftype", "nofile") - vim.cmd [[ - syntax match TSModuleInfoGood /✓/ - syntax match TSModuleInfoBad /✗/ - syntax match TSModuleInfoHeader /^>>.*$/ contains=TSModuleInfoNamespace - syntax match TSModuleInfoNamespace /^>> \w*/ contained - syntax match TSModuleInfoParser /^[^> ]*\ze / - ]] - - local highlights = { - TSModuleInfoGood = { fg = "LightGreen", bold = true, default = true }, - TSModuleInfoBad = { fg = "Crimson", default = true }, - TSModuleInfoHeader = { link = "Type", default = true }, - TSModuleInfoNamespace = { link = "Statement", default = true }, - TSModuleInfoParser = { link = "Identifier", default = true }, - } - for k, v in pairs(highlights) do - api.nvim_set_hl(0, k, v) - end -end - -local function module_info(module) - if module and not configs.get_module(module) then - return - end - - local parserlist = parsers.available_parsers() - if module then - print_info_modules(parserlist, module) - else - print_info_modules(parserlist) - end -end - ----@return string[] -function M.installed_parsers() - local installed = {} - for _, p in pairs(parsers.available_parsers()) do - if parsers.has_parser(p) then - table.insert(installed, p) - end - end - return installed -end - -M.commands = { - TSInstallInfo = { - run = install_info, - args = { - "-nargs=0", - }, - }, - TSModuleInfo = { - run = module_info, - args = { - "-nargs=?", - "-complete=custom,nvim_treesitter#available_modules", - }, - }, -} - -return M diff --git a/lua/nvim-treesitter/init.lua b/lua/nvim-treesitter/init.lua new file mode 100644 index 000000000..aac1c6ba6 --- /dev/null +++ b/lua/nvim-treesitter/init.lua @@ -0,0 +1,11 @@ +local M = {} + +function M.setup(...) + require('nvim-treesitter.config').setup(...) +end + +function M.indentexpr() + return require('nvim-treesitter.indent').get_indent(vim.v.lnum) +end + +return M diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index cd12dbb81..745c2dd1f 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,13 +1,10 @@ local api = vim.api -local fn = vim.fn -local luv = vim.loop +local uv = vim.loop -local utils = require "nvim-treesitter.utils" -local parsers = require "nvim-treesitter.parsers" -local info = require "nvim-treesitter.info" -local configs = require "nvim-treesitter.configs" -local shell = require "nvim-treesitter.shell_command_selectors" -local compat = require "nvim-treesitter.compat" +local utils = require('nvim-treesitter.utils') +local parsers = require('nvim-treesitter.parsers') +local config = require('nvim-treesitter.config') +local shell = require('nvim-treesitter.shell_cmds') local M = {} @@ -17,16 +14,20 @@ local M = {} ---@type table local lockfile = {} -M.compilers = { vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" } -M.prefer_git = fn.has "win32" == 1 +M.compilers = { uv.os_getenv('CC'), 'cc', 'gcc', 'clang', 'cl', 'zig' } +M.prefer_git = uv.os_uname().sysname == 'Windows_NT' M.command_extra_args = {} M.ts_generate_args = nil local started_commands = 0 local finished_commands = 0 local failed_commands = 0 -local complete_std_output = {} -local complete_error_output = {} +local stdout_output = {} +local stderr_output = {} + +--- +--- JOB API functions +--- local function reset_progress_counter() if started_commands ~= finished_commands then @@ -35,53 +36,157 @@ local function reset_progress_counter() started_commands = 0 finished_commands = 0 failed_commands = 0 - complete_std_output = {} - complete_error_output = {} + stdout_output = {} + stderr_output = {} end local function get_job_status() - return "[nvim-treesitter] [" + return '[nvim-treesitter] [' .. finished_commands - .. "/" + .. '/' .. started_commands - .. (failed_commands > 0 and ", failed: " .. failed_commands or "") - .. "]" + .. (failed_commands > 0 and ', failed: ' .. failed_commands or '') + .. ']' end ----@param lang string ----@return function -local function reattach_if_possible_fn(lang, error_on_fail) - return function() - for _, buf in ipairs(vim.api.nvim_list_bufs()) do - if parsers.get_buf_lang(buf) == lang then - vim._ts_remove_language(lang) - local ok, err - if vim.treesitter.language.add then - local ft = vim.bo[buf].filetype - ok, err = pcall(vim.treesitter.language.add, lang, { filetype = ft }) - else - ok, err = pcall(compat.require_language, lang) - end - if not ok and error_on_fail then - vim.notify("Could not load parser for " .. lang .. ": " .. vim.inspect(err)) - end - for _, mod in ipairs(require("nvim-treesitter.configs").available_modules()) do - if ok then - require("nvim-treesitter.configs").reattach_module(mod, buf, lang) - else - require("nvim-treesitter.configs").detach_module(mod, buf) - end - end +---@param cmd Command +---@return string command +local function get_command(cmd) + local options = '' + if cmd.opts and cmd.opts.args then + if M.command_extra_args[cmd.cmd] then + vim.list_extend(cmd.opts.args, M.command_extra_args[cmd.cmd]) + end + for _, opt in ipairs(cmd.opts.args) do + options = string.format('%s %s', options, opt) + end + end + + local command = string.format('%s %s', cmd.cmd, options) + if cmd.opts and cmd.opts.cwd then + command = shell.make_directory_change_for_command(cmd.opts.cwd, command) + end + return command +end + +---@param cmd_list Command[] +---@return boolean +local function iter_cmd_sync(cmd_list) + for _, cmd in ipairs(cmd_list) do + if cmd.info then + vim.notify(cmd.info) + end + + if type(cmd.cmd) == 'function' then + cmd.cmd() + else + local ret = vim.fn.system(get_command(cmd)) + if vim.v.shell_error ~= 0 then + vim.notify(ret) + api.nvim_err_writeln( + (cmd.err and cmd.err .. '\n' or '') + .. 'Failed to execute the following command:\n' + .. vim.inspect(cmd) + ) + return false end end end + + return true end +local function iter_cmd(cmd_list, i, lang, success_message) + if i == 1 then + started_commands = started_commands + 1 + end + if i == #cmd_list + 1 then + finished_commands = finished_commands + 1 + return vim.notify(get_job_status() .. ' ' .. success_message) + end + + local attr = cmd_list[i] + if attr.info then + vim.notify(get_job_status() .. ' ' .. attr.info) + end + + if attr.opts and attr.opts.args and M.command_extra_args[attr.cmd] then + vim.list_extend(attr.opts.args, M.command_extra_args[attr.cmd]) + end + + if type(attr.cmd) == 'function' then + local ok, err = pcall(attr.cmd) + if ok then + iter_cmd(cmd_list, i + 1, lang, success_message) + else + failed_commands = failed_commands + 1 + finished_commands = finished_commands + 1 + return api.nvim_err_writeln( + (attr.err or ('Failed to execute the following command:\n' .. vim.inspect(attr))) + .. '\n' + .. vim.inspect(err) + ) + end + else + local handle + local stdout = uv.new_pipe(false) + local stderr = uv.new_pipe(false) + attr.opts.stdio = { nil, stdout, stderr } + ---@type userdata + handle = uv.spawn( + attr.cmd, + attr.opts, + vim.schedule_wrap(function(code) + if code ~= 0 then + stdout:read_stop() + stderr:read_stop() + end + stdout:close() + stderr:close() + handle:close() + if code ~= 0 then + failed_commands = failed_commands + 1 + finished_commands = finished_commands + 1 + if stdout_output[handle] and stdout_output[handle] ~= '' then + vim.notify(stdout_output[handle]) + end + + local err_msg = stderr_output[handle] or '' + api.nvim_err_writeln( + 'nvim-treesitter[' + .. lang + .. ']: ' + .. (attr.err or ('Failed to execute the following command:\n' .. vim.inspect(attr))) + .. '\n' + .. err_msg + ) + return + end + iter_cmd(cmd_list, i + 1, lang, success_message) + end) + ) + uv.read_start(stdout, function(_, data) + if data then + stdout_output[handle] = (stdout_output[handle] or '') .. data + end + end) + uv.read_start(stderr, function(_, data) + if data then + stderr_output[handle] = (stderr_output[handle] or '') .. data + end + end) + end +end + +--- +--- PARSER INFO +--- + ---@param lang string ---@param validate boolean|nil ---@return InstallInfo local function get_parser_install_info(lang, validate) - local parser_config = parsers.get_parser_configs()[lang] + local parser_config = parsers.configs[lang] if not parser_config then error('Parser not available for language "' .. lang .. '"') @@ -90,29 +195,23 @@ local function get_parser_install_info(lang, validate) local install_info = parser_config.install_info if validate then - vim.validate { - url = { install_info.url, "string" }, - files = { install_info.files, "table" }, - } + vim.validate({ + url = { install_info.url, 'string' }, + files = { install_info.files, 'table' }, + }) end return install_info end -local function load_lockfile() - local filename = utils.join_path(utils.get_package_path(), "lockfile.json") - lockfile = vim.fn.filereadable(filename) == 1 and vim.fn.json_decode(vim.fn.readfile(filename)) or {} -end - -local function is_ignored_parser(lang) - return vim.tbl_contains(configs.get_ignored_parser_installs(), lang) -end - ---@param lang string ---@return string|nil local function get_revision(lang) if #lockfile == 0 then - load_lockfile() + local filename = utils.get_package_path('lockfile.json') + local file = assert(io.open(filename, 'r')) + lockfile = vim.json.decode(file:read('*all')) + file:close() end local install_info = get_parser_install_info(lang) @@ -128,40 +227,11 @@ end ---@param lang string ---@return string|nil local function get_installed_revision(lang) - local lang_file = utils.join_path(configs.get_parser_info_dir(), lang .. ".revision") - if vim.fn.filereadable(lang_file) == 1 then - return vim.fn.readfile(lang_file)[1] - end -end - --- Clean path for use in a prefix comparison ----@param input string ----@return string -local function clean_path(input) - local pth = vim.fn.fnamemodify(input, ":p") - if fn.has "win32" == 1 then - pth = pth:gsub("/", "\\") - end - return pth -end - --- Checks if parser is installed with nvim-treesitter ----@param lang string ----@return boolean -local function is_installed(lang) - local matched_parsers = vim.api.nvim_get_runtime_file("parser/" .. lang .. ".so", true) or {} - local install_dir = configs.get_parser_install_dir() - if not install_dir then - return false - end - install_dir = clean_path(install_dir) - for _, path in ipairs(matched_parsers) do - local abspath = clean_path(path) - if vim.startswith(abspath, install_dir) then - return true - end - end - return false + local lang_file = utils.join_path(config.get_install_dir('parser-info'), lang .. '.revision') + local file = assert(io.open(lang_file, 'r')) + local revision = file:read('*a') + file:close() + return revision end ---@param lang string @@ -171,157 +241,57 @@ local function needs_update(lang) return not revision or revision ~= get_installed_revision(lang) end ----@return string[] -local function outdated_parsers() - return vim.tbl_filter(function(lang) ---@param lang string - return is_installed(lang) and needs_update(lang) - end, info.installed_parsers()) -end +function M.info() + local installed = config.installed_parsers() + local parser_list = parsers.get_available() ----@param handle userdata ----@param is_stderr boolean -local function onread(handle, is_stderr) - return function(_, data) - if data then - if is_stderr then - complete_error_output[handle] = (complete_error_output[handle] or "") .. data - else - complete_std_output[handle] = (complete_std_output[handle] or "") .. data - end + local max_len = 0 + for _, lang in pairs(parser_list) do + if #lang > max_len then + max_len = #lang end end -end -function M.iter_cmd(cmd_list, i, lang, success_message) - if i == 1 then - started_commands = started_commands + 1 - end - if i == #cmd_list + 1 then - finished_commands = finished_commands + 1 - return print(get_job_status() .. " " .. success_message) - end - - local attr = cmd_list[i] - if attr.info then - print(get_job_status() .. " " .. attr.info) - end - - if attr.opts and attr.opts.args and M.command_extra_args[attr.cmd] then - vim.list_extend(attr.opts.args, M.command_extra_args[attr.cmd]) - end - - if type(attr.cmd) == "function" then - local ok, err = pcall(attr.cmd) - if ok then - M.iter_cmd(cmd_list, i + 1, lang, success_message) + for _, lang in pairs(parser_list) do + local parser = (lang .. string.rep(' ', max_len - #lang + 1)) + local output + if vim.list_contains(installed, lang) then + output = { parser .. '[✓] installed', 'DiagnosticOk' } + elseif #api.nvim_get_runtime_file('parser/' .. lang .. '.*', true) > 0 then + output = { parser .. '[·] not installed (but available from runtimepath)', 'DiagnosticInfo' } else - failed_commands = failed_commands + 1 - finished_commands = finished_commands + 1 - return api.nvim_err_writeln( - (attr.err or ("Failed to execute the following command:\n" .. vim.inspect(attr))) .. "\n" .. vim.inspect(err) - ) + output = { parser .. '[✗] not installed' } end - else - local handle - local stdout = luv.new_pipe(false) - local stderr = luv.new_pipe(false) - attr.opts.stdio = { nil, stdout, stderr } - ---@type userdata - handle = luv.spawn( - attr.cmd, - attr.opts, - vim.schedule_wrap(function(code) - if code ~= 0 then - stdout:read_stop() - stderr:read_stop() - end - stdout:close() - stderr:close() - handle:close() - if code ~= 0 then - failed_commands = failed_commands + 1 - finished_commands = finished_commands + 1 - if complete_std_output[handle] and complete_std_output[handle] ~= "" then - print(complete_std_output[handle]) - end - - local err_msg = complete_error_output[handle] or "" - api.nvim_err_writeln( - "nvim-treesitter[" - .. lang - .. "]: " - .. (attr.err or ("Failed to execute the following command:\n" .. vim.inspect(attr))) - .. "\n" - .. err_msg - ) - return - end - M.iter_cmd(cmd_list, i + 1, lang, success_message) - end) - ) - luv.read_start(stdout, onread(handle, false)) - luv.read_start(stderr, onread(handle, true)) + api.nvim_echo({ output }, false, {}) end end ----@param cmd Command ----@return string command -local function get_command(cmd) - local options = "" - if cmd.opts and cmd.opts.args then - if M.command_extra_args[cmd.cmd] then - vim.list_extend(cmd.opts.args, M.command_extra_args[cmd.cmd]) - end - for _, opt in ipairs(cmd.opts.args) do - options = string.format("%s %s", options, opt) - end - end +--- +--- PARSER MANAGEMENT FUNCTIONS +--- - local command = string.format("%s %s", cmd.cmd, options) - if cmd.opts and cmd.opts.cwd then - command = shell.make_directory_change_for_command(cmd.opts.cwd, command) - end - return command -end - ----@param cmd_list Command[] ----@return boolean -local function iter_cmd_sync(cmd_list) - for _, cmd in ipairs(cmd_list) do - if cmd.info then - print(cmd.info) - end - - if type(cmd.cmd) == "function" then - cmd.cmd() - else - local ret = vim.fn.system(get_command(cmd)) - if vim.v.shell_error ~= 0 then - print(ret) - api.nvim_err_writeln( - (cmd.err and cmd.err .. "\n" or "") .. "Failed to execute the following command:\n" .. vim.inspect(cmd) - ) - return false - end - end - end - - return true -end - ----@param cache_folder string ----@param install_folder string ---@param lang string ----@param repo InstallInfo +---@param cache_dir string +---@param install_dir string +---@param force boolean ---@param with_sync boolean ---@param generate_from_grammar boolean -local function run_install(cache_folder, install_folder, lang, repo, with_sync, generate_from_grammar) - parsers.reset_cache() +local function install_lang(lang, cache_dir, install_dir, force, with_sync, generate_from_grammar) + if vim.list_contains(config.installed_parsers(), lang) then + if not force then + local yesno = + vim.fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') + print('\n ') + if yesno:sub(1, 1) ~= 'y' then + return + end + end + end - local path_sep = utils.get_path_sep() + local repo = get_parser_install_info(lang) - local project_name = "tree-sitter-" .. lang - local maybe_local_path = vim.fn.expand(repo.url) + local project_name = 'tree-sitter-' .. lang + local maybe_local_path = vim.fs.normalize(repo.url) local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 if from_local_path then repo.url = maybe_local_path @@ -337,48 +307,45 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, else local repo_location = project_name if repo.location then - repo_location = repo_location .. "/" .. repo.location + repo_location = utils.join_path(repo_location, repo.location) end - repo_location = repo_location:gsub("/", path_sep) - compile_location = utils.join_path(cache_folder, repo_location) + compile_location = utils.join_path(cache_dir, repo_location) end - local parser_lib_name = utils.join_path(install_folder, lang) .. ".so" + local parser_lib_name = utils.join_path(install_dir, lang) .. '.so' generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - if generate_from_grammar and vim.fn.executable "tree-sitter" ~= 1 then - api.nvim_err_writeln "tree-sitter CLI not found: `tree-sitter` is not executable!" + if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then + api.nvim_err_writeln('tree-sitter CLI not found: `tree-sitter` is not executable') if repo.requires_generate_from_grammar then api.nvim_err_writeln( - "tree-sitter CLI is needed because `" + 'tree-sitter CLI is needed because the parser for `' .. lang - .. "` is marked that it needs " - .. "to be generated from the grammar definitions to be compatible with nvim!" + .. '` needs to be generated from grammar' ) end return else if not M.ts_generate_args then - local ts_cli_version = utils.ts_cli_version() - if ts_cli_version and vim.split(ts_cli_version, " ")[1] > "0.20.2" then - M.ts_generate_args = { "generate", "--no-bindings", "--abi", vim.treesitter.language_version } - else - M.ts_generate_args = { "generate", "--no-bindings" } - end + M.ts_generate_args = { 'generate', '--no-bindings', '--abi', vim.treesitter.language_version } end end - if generate_from_grammar and vim.fn.executable "node" ~= 1 then - api.nvim_err_writeln "Node JS not found: `node` is not executable!" + if generate_from_grammar and vim.fn.executable('node') ~= 1 then + api.nvim_err_writeln('Node JS not found: `node` is not executable') return end local cc = shell.select_executable(M.compilers) if not cc then - api.nvim_err_writeln('No C compiler found! "' .. table.concat( - vim.tbl_filter(function(c) ---@param c string - return type(c) == "string" - end, M.compilers), - '", "' - ) .. '" are not executable.') + api.nvim_err_writeln( + 'No C compiler found! "' + .. table.concat( + vim.tbl_filter(function(c) ---@param c string + return type(c) == 'string' + end, M.compilers), + '", "' + ) + .. '" are not executable.' + ) return end @@ -400,25 +367,33 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, ---@type Command[] local command_list = {} if not from_local_path then - vim.list_extend(command_list, { shell.select_install_rm_cmd(cache_folder, project_name) }) + vim.list_extend(command_list, { + { + cmd = function() + vim.fn.delete(utils.join_path(cache_dir, project_name), 'rf') + end, + }, + }) vim.list_extend( command_list, - shell.select_download_commands(repo, project_name, cache_folder, revision, M.prefer_git) + shell.select_download_commands(repo, project_name, cache_dir, revision, M.prefer_git) ) end if generate_from_grammar then if repo.generate_requires_npm then - if vim.fn.executable "npm" ~= 1 then - api.nvim_err_writeln("`" .. lang .. "` requires NPM to be installed from grammar.js") + if vim.fn.executable('npm') ~= 1 then + api.nvim_err_writeln('`' .. lang .. '` requires NPM to be installed from grammar.js') return end vim.list_extend(command_list, { { - cmd = "npm", - info = "Installing NPM dependencies of " .. lang .. " parser", - err = "Error during `npm install` (required for parser generation of " .. lang .. " with npm dependencies)", + cmd = 'npm', + info = 'Installing NPM dependencies of ' .. lang .. ' parser', + err = 'Error during `npm install` (required for parser generation of ' + .. lang + .. ' with npm dependencies)', opts = { - args = { "install" }, + args = { 'install' }, cwd = compile_location, }, }, @@ -426,8 +401,8 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, end vim.list_extend(command_list, { { - cmd = vim.fn.exepath "tree-sitter", - info = "Generating source files from grammar.js...", + cmd = vim.fn.exepath('tree-sitter'), + info = 'Generating source files from grammar.js...', err = 'Error during "tree-sitter generate"', opts = { args = M.ts_generate_args, @@ -438,344 +413,153 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, end vim.list_extend(command_list, { shell.select_compile_command(repo, cc, compile_location), - shell.select_mv_cmd("parser.so", parser_lib_name, compile_location), { cmd = function() - vim.fn.writefile({ revision or "" }, utils.join_path(configs.get_parser_info_dir() or "", lang .. ".revision")) + uv.fs_copyfile(utils.join_path(compile_location, 'parser.so'), parser_lib_name) end, }, - { -- auto-attach modules after installation - cmd = reattach_if_possible_fn(lang, true), + { + cmd = function() + local file = assert( + io.open( + utils.join_path(config.get_install_dir('parser-info') or '', lang .. '.revision'), + 'w' + ) + ) + file:write(revision or '') + file:close() + end, }, }) if not from_local_path then - vim.list_extend(command_list, { shell.select_install_rm_cmd(cache_folder, project_name) }) + vim.list_extend(command_list, { + { + cmd = function() + vim.fn.delete(utils.join_path(cache_dir, project_name), 'rf') + end, + }, + }) end if with_sync then if iter_cmd_sync(command_list) == true then - print("Treesitter parser for " .. lang .. " has been installed") + vim.notify('Parser for ' .. lang .. ' has been installed') end else - M.iter_cmd(command_list, 1, lang, "Treesitter parser for " .. lang .. " has been installed") + iter_cmd(command_list, 1, lang, 'Parser for ' .. lang .. ' has been installed') end end ----@param lang string ----@param ask_reinstall boolean|string ----@param cache_folder string ----@param install_folder string ----@param with_sync boolean ----@param generate_from_grammar boolean -local function install_lang(lang, ask_reinstall, cache_folder, install_folder, with_sync, generate_from_grammar) - if is_installed(lang) and ask_reinstall ~= "force" then - if not ask_reinstall then - return - end - - local yesno = fn.input(lang .. " parser already available: would you like to reinstall ? y/n: ") - print "\n " - if not string.match(yesno, "^y.*") then - return - end - end - - local ok, install_info = pcall(get_parser_install_info, lang, true) - if not ok then - vim.notify("Installation not possible: " .. install_info, vim.log.levels.ERROR) - if not parsers.get_parser_configs()[lang] then - vim.notify( - "See https://github.com/nvim-treesitter/nvim-treesitter/#adding-parsers on how to add a new parser!", - vim.log.levels.INFO - ) - end - return - end - - run_install(cache_folder, install_folder, lang, install_info, with_sync, generate_from_grammar) -end - ---@class InstallOptions ---@field with_sync boolean ----@field ask_reinstall boolean|string +---@field force boolean ---@field generate_from_grammar boolean ----@field exclude_configured_parsers boolean +---@field skip table -- Install a parser +---@param languages? string[]|string ---@param options? InstallOptions ----@return function -local function install(options) +function M.install(languages, options) options = options or {} local with_sync = options.with_sync - local ask_reinstall = options.ask_reinstall + local force = options.force local generate_from_grammar = options.generate_from_grammar - local exclude_configured_parsers = options.exclude_configured_parsers + local skip = options.skip - return function(...) - if fn.executable "git" == 0 then - return api.nvim_err_writeln "Git is required on your system to run this command" - end + reset_progress_counter() - local cache_folder, err = utils.get_cache_dir() - if err then - return api.nvim_err_writeln(err) - end - assert(cache_folder) + if vim.fn.executable('git') == 0 then + api.nvim_err_writeln('Git is required on your system to run this command') + return + end - local install_folder - install_folder, err = configs.get_parser_install_dir() - if err then - return api.nvim_err_writeln(err) - end - install_folder = install_folder and clean_path(install_folder) - assert(install_folder) + local cache_dir = vim.fn.stdpath('cache') + local install_dir = config.get_install_dir('parser') - local languages ---@type string[] - local ask ---@type boolean|string - if ... == "all" then - languages = parsers.available_parsers() - ask = false - else - languages = compat.flatten { ... } - ask = ask_reinstall - end + if languages == 'all' then + force = true + end - if exclude_configured_parsers then - languages = utils.difference(languages, configs.get_ignored_parser_installs()) - end + languages = config.norm_languages(languages, skip) - if #languages > 1 then - reset_progress_counter() - end - - for _, lang in ipairs(languages) do - install_lang(lang, ask, cache_folder, install_folder, with_sync, generate_from_grammar) - end + for _, lang in ipairs(languages) do + install_lang(lang, cache_dir, install_dir, force, with_sync, generate_from_grammar) + uv.fs_symlink( + utils.get_package_path('runtime', 'queries', lang), + utils.join_path(config.get_install_dir('queries'), lang), + { dir = true, junction = true } -- needed on Windows (non-junction links require admin) + ) end end -function M.setup_auto_install() - local function try_install_curr_lang() - local lang = parsers.get_buf_lang() - if parsers.get_parser_configs()[lang] and not is_installed(lang) and not is_ignored_parser(lang) then - install() { lang } - end - end +---@class UpdateOptions +---@field with_sync boolean - try_install_curr_lang() - - vim.api.nvim_create_autocmd("FileType", { - pattern = { "*" }, - group = vim.api.nvim_create_augroup("NvimTreesitter-auto_install", { clear = true }), - callback = try_install_curr_lang, - }) -end - -function M.update(options) +---@param languages? string[]|string +---@param options? UpdateOptions +function M.update(languages, options) options = options or {} - return function(...) - M.lockfile = {} - reset_progress_counter() - if ... and ... ~= "all" then - ---@type string[] - local languages = compat.flatten { ... } - local installed = 0 - for _, lang in ipairs(languages) do - if (not is_installed(lang)) or (needs_update(lang)) then - installed = installed + 1 - install { - ask_reinstall = "force", - with_sync = options.with_sync, - }(lang) - end - end - if installed == 0 then - utils.notify "Parsers are up-to-date!" - end + + reset_progress_counter() + M.lockfile = {} + + languages = config.norm_languages(languages or 'all', { ignored = true, missing = true }) + languages = vim.iter.filter(needs_update, languages) --- @type string[] + + if #languages > 0 then + M.install(languages, { + force = true, + with_sync = options.with_sync, + }) + else + vim.notify('All parsers are up-to-date') + end +end + +--- @param lang string +--- @param parser string +--- @param queries string +local function uninstall(lang, parser, queries) + if vim.fn.filereadable(parser) ~= 1 then + return + end + + iter_cmd({ + { + cmd = function() + uv.fs_unlink(parser) + end, + }, + { + cmd = function() + uv.fs_unlink(queries) + end, + }, + }, 1, lang, 'Parser for ' .. lang .. ' has been uninstalled') +end + +--- @param languages string[]|string +function M.uninstall(languages) + reset_progress_counter() + + languages = config.norm_languages(languages or 'all', { missing = true }) + + local parser_dir = config.get_install_dir('parser') + local query_dir = config.get_install_dir('queries') + local installed = config.installed_parsers() + + for _, lang in ipairs(languages) do + if not vim.list_contains(installed, lang) then + vim.notify( + 'Parser for ' .. lang .. ' is is not managed by nvim-treesitter', + vim.log.levels.ERROR + ) else - local parsers_to_update = outdated_parsers() or info.installed_parsers() - if #parsers_to_update == 0 then - utils.notify "All parsers are up-to-date!" - end - for _, lang in pairs(parsers_to_update) do - install { - ask_reinstall = "force", - exclude_configured_parsers = true, - with_sync = options.with_sync, - }(lang) - end + local parser = utils.join_path(parser_dir, lang) .. '.so' + local queries = utils.join_path(query_dir, lang) + uninstall(lang, parser, queries) end end end -function M.uninstall(...) - if vim.tbl_contains({ "all" }, ...) then - reset_progress_counter() - local installed = info.installed_parsers() - M.uninstall(installed) - elseif ... then - local ensure_installed_parsers = configs.get_ensure_installed_parsers() - if ensure_installed_parsers == "all" then - ensure_installed_parsers = parsers.available_parsers() - end - ensure_installed_parsers = utils.difference(ensure_installed_parsers, configs.get_ignored_parser_installs()) - - ---@type string[] - local languages = compat.flatten { ... } - for _, lang in ipairs(languages) do - local install_dir, err = configs.get_parser_install_dir() - if err then - return api.nvim_err_writeln(err) - end - install_dir = install_dir and clean_path(install_dir) - - if vim.tbl_contains(ensure_installed_parsers, lang) then - vim.notify( - "Uninstalling " - .. lang - .. '. But the parser is still configured in "ensure_installed" setting of nvim-treesitter.' - .. " Please consider updating your config!", - vim.log.levels.ERROR - ) - end - - local parser_lib = utils.join_path(install_dir, lang) .. ".so" - local all_parsers = vim.api.nvim_get_runtime_file("parser/" .. lang .. ".so", true) - if vim.fn.filereadable(parser_lib) == 1 then - local command_list = { - shell.select_rm_file_cmd(parser_lib, "Uninstalling parser for " .. lang), - { - cmd = function() - local all_parsers_after_deletion = vim.api.nvim_get_runtime_file("parser/" .. lang .. ".so", true) - if #all_parsers_after_deletion > 0 then - vim.notify( - "Tried to uninstall parser for " - .. lang - .. "! But the parser is still installed (not by nvim-treesitter):" - .. table.concat(all_parsers_after_deletion, ", "), - vim.log.levels.ERROR - ) - end - end, - }, - { -- auto-reattach or detach modules after uninstallation - cmd = reattach_if_possible_fn(lang, false), - }, - } - M.iter_cmd(command_list, 1, lang, "Treesitter parser for " .. lang .. " has been uninstalled") - elseif #all_parsers > 0 then - vim.notify( - "Parser for " - .. lang - .. " is installed! But not by nvim-treesitter! Please manually remove the following files: " - .. table.concat(all_parsers, ", "), - vim.log.levels.ERROR - ) - end - end - end -end - -function M.write_lockfile(verbose, skip_langs) - local sorted_parsers = {} ---@type Parser[] - -- Load previous lockfile - load_lockfile() - skip_langs = skip_langs or {} - - for k, v in pairs(parsers.get_parser_configs()) do - table.insert(sorted_parsers, { name = k, parser = v }) - end - - ---@param a Parser - ---@param b Parser - table.sort(sorted_parsers, function(a, b) - return a.name < b.name - end) - - for _, v in ipairs(sorted_parsers) do - if not vim.tbl_contains(skip_langs, v.name) then - -- I'm sure this can be done in aync way with iter_cmd - local sha ---@type string - if v.parser.install_info.branch then - sha = vim.split( - vim.fn.systemlist( - "git ls-remote " .. v.parser.install_info.url .. " | grep refs/heads/" .. v.parser.install_info.branch - )[1], - "\t" - )[1] - else - sha = vim.split(vim.fn.systemlist("git ls-remote " .. v.parser.install_info.url)[1], "\t")[1] - end - lockfile[v.name] = { revision = sha } - if verbose then - print(v.name .. ": " .. sha) - end - else - print("Skipping " .. v.name) - end - end - - if verbose then - print(vim.inspect(lockfile)) - end - vim.fn.writefile( - vim.fn.split(vim.fn.json_encode(lockfile), "\n"), - utils.join_path(utils.get_package_path(), "lockfile.json") - ) -end - -M.ensure_installed = install { exclude_configured_parsers = true } -M.ensure_installed_sync = install { with_sync = true, exclude_configured_parsers = true } - -M.commands = { - TSInstall = { - run = install { ask_reinstall = true }, - ["run!"] = install { ask_reinstall = "force" }, - args = { - "-nargs=+", - "-bang", - "-complete=custom,nvim_treesitter#installable_parsers", - }, - }, - TSInstallFromGrammar = { - run = install { generate_from_grammar = true, ask_reinstall = true }, - ["run!"] = install { generate_from_grammar = true, ask_reinstall = "force" }, - args = { - "-nargs=+", - "-bang", - "-complete=custom,nvim_treesitter#installable_parsers", - }, - }, - TSInstallSync = { - run = install { with_sync = true, ask_reinstall = true }, - ["run!"] = install { with_sync = true, ask_reinstall = "force" }, - args = { - "-nargs=+", - "-bang", - "-complete=custom,nvim_treesitter#installable_parsers", - }, - }, - TSUpdate = { - run = M.update {}, - args = { - "-nargs=*", - "-complete=custom,nvim_treesitter#installed_parsers", - }, - }, - TSUpdateSync = { - run = M.update { with_sync = true }, - args = { - "-nargs=*", - "-complete=custom,nvim_treesitter#installed_parsers", - }, - }, - TSUninstall = { - run = M.uninstall, - args = { - "-nargs=+", - "-complete=custom,nvim_treesitter#installed_parsers", - }, - }, -} - return M diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index fed835bbd..fa8496469 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -1,29 +1,46 @@ -- Functions to handle locals -- Locals are a generalization of definition and scopes --- its the way nvim-treesitter uses to "understand" the code +-- it's the way nvim-treesitter uses to "understand" the code -local queries = require "nvim-treesitter.query" -local ts_utils = require "nvim-treesitter.ts_utils" -local ts = vim.treesitter +local query = require('nvim-treesitter.query') local api = vim.api +local ts = vim.treesitter local M = {} -function M.collect_locals(bufnr) - return queries.collect_group_results(bufnr, "locals") +local function get_named_children(node) + local nodes = {} ---@type TSNode[] + for i = 0, node:named_child_count() - 1, 1 do + nodes[i + 1] = node:named_child(i) + end + return nodes +end + +---@param node TSNode +---@return TSNode result +local function get_root_for_node(node) + local parent = node + local result = node + + while parent ~= nil do + result = parent + parent = result:parent() + end + + 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 queries.iter_group_results(bufnr, "locals", root) + return query.iter_group_results(bufnr, 'locals', root) end ---@param bufnr integer ---@return any -function M.get_locals(bufnr) - return queries.get_matches(bufnr, "locals") +function M.collect_locals(bufnr) + return query.collect_group_results(bufnr, 'locals') end -- Creates unique id for a node based on text and range @@ -32,17 +49,17 @@ end ---@return string: a string id function M.get_definition_id(scope, node_text) -- Add a valid starting character in case node text doesn't start with a valid one. - return table.concat({ "k", node_text or "", scope:range() }, "_") + return table.concat({ 'k', node_text or '', scope:range() }, '_') end function M.get_definitions(bufnr) - local locals = M.get_locals(bufnr) + local locals = M.collect_locals(bufnr) local defs = {} for _, loc in ipairs(locals) do - if loc["local"]["definition"] then - table.insert(defs, loc["local"]["definition"]) + if loc['local.definition'] then + table.insert(defs, loc['local.definition']) end end @@ -50,13 +67,13 @@ function M.get_definitions(bufnr) end function M.get_scopes(bufnr) - local locals = M.get_locals(bufnr) + local locals = M.collect_locals(bufnr) local scopes = {} for _, loc in ipairs(locals) do - if loc["local"]["scope"] and loc["local"]["scope"].node then - table.insert(scopes, loc["local"]["scope"].node) + if loc['local.scope'] and loc['local.scope'].node then + table.insert(scopes, loc['local.scope'].node) end end @@ -64,13 +81,13 @@ function M.get_scopes(bufnr) end function M.get_references(bufnr) - local locals = M.get_locals(bufnr) + local locals = M.collect_locals(bufnr) local refs = {} for _, loc in ipairs(locals) do - if loc["local"]["reference"] and loc["local"]["reference"].node then - table.insert(refs, loc["local"]["reference"].node) + if loc['local.reference'] and loc['local.reference'].node then + table.insert(refs, loc['local.reference'].node) end end @@ -103,7 +120,7 @@ function M.iter_scope_tree(node, bufnr) return end - local scope = M.containing_scope(last_node, bufnr, false) or ts_utils.get_root_for_node(node) + local scope = M.containing_scope(last_node, bufnr, false) or get_root_for_node(node) last_node = scope:parent() @@ -117,8 +134,8 @@ end function M.get_local_nodes(local_def) local result = {} - M.recurse_local_nodes(local_def, function(def, _node, kind) - table.insert(result, vim.tbl_extend("keep", { kind = kind }, def)) + M.recurse_local_nodes(local_def, function(def, _, kind) + table.insert(result, vim.tbl_extend('keep', { kind = kind }, def)) end) return result @@ -135,7 +152,7 @@ end ---@param full_match? string The full match path to append to ---@param last_match? string The last match function M.recurse_local_nodes(local_def, accumulator, full_match, last_match) - if type(local_def) ~= "table" then + if type(local_def) ~= 'table' then return end @@ -143,11 +160,36 @@ function M.recurse_local_nodes(local_def, accumulator, full_match, last_match) accumulator(local_def, local_def.node, full_match, last_match) else for match_key, def in pairs(local_def) do - M.recurse_local_nodes(def, accumulator, full_match and (full_match .. "." .. match_key) or match_key, match_key) + M.recurse_local_nodes( + def, + accumulator, + full_match and (full_match .. '.' .. match_key) or match_key, + match_key + ) end end end +---Memoize a function using hash_fn to hash the arguments. +---@generic F: function +---@param fn F +---@param hash_fn fun(...): any +---@return F +local function memoize(fn, hash_fn) + local cache = setmetatable({}, { __mode = 'kv' }) ---@type table + + return function(...) + local key = hash_fn(...) + if cache[key] == nil then + local v = fn(...) ---@type any + cache[key] = v ~= nil and v or vim.NIL + end + + local v = cache[key] + return v ~= vim.NIL and v or nil + end +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. @@ -161,7 +203,7 @@ end -- ---@param bufnr integer: the buffer ---@return table result: a table for looking up definitions -M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr) +M.get_definitions_lookup_table = memoize(function(bufnr) local definitions = M.get_definitions(bufnr) local result = {} @@ -178,6 +220,8 @@ M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr) end return result +end, function(bufnr) + return tostring(bufnr) end) -- Gets all the scopes of a definition based on the scope type @@ -196,10 +240,10 @@ function M.get_definition_scopes(node, bufnr, scope_type) -- Definition is valid for the containing scope -- and the containing scope of that scope - if scope_type == "parent" then + if scope_type == 'parent' then scope_count = 2 -- Definition is valid in all parent scopes - elseif scope_type == "global" then + elseif scope_type == 'global' then scope_count = nil end @@ -235,7 +279,7 @@ function M.find_definition(node, bufnr) end end - return node, ts_utils.get_root_for_node(node), nil + return node, get_root_for_node(node), nil end -- Finds usages of a node in a given scope. @@ -250,12 +294,15 @@ function M.find_usages(node, scope_node, bufnr) return {} end - local scope_node = scope_node or ts_utils.get_root_for_node(node) + scope_node = scope_node or get_root_for_node(node) local usages = {} for match in M.iter_locals(bufnr, scope_node) do - match = match["local"] - if match.reference and match.reference.node and ts.get_node_text(match.reference.node, bufnr) == node_text then + if + match.reference + and match.reference.node + and ts.get_node_text(match.reference.node, bufnr) == node_text + then local def_node, _, kind = M.find_definition(match.reference.node, bufnr) if kind == nil or def_node == node then @@ -272,8 +319,8 @@ end ---@param allow_scope? boolean ---@return TSNode|nil function M.containing_scope(node, bufnr, allow_scope) - local bufnr = bufnr or api.nvim_get_current_buf() - local allow_scope = allow_scope == nil or allow_scope == true + bufnr = bufnr or api.nvim_get_current_buf() + allow_scope = allow_scope == nil or allow_scope == true local scopes = M.get_scopes(bufnr) if not node or not scopes then @@ -301,7 +348,7 @@ function M.nested_scope(node, cursor_pos) local col = cursor_pos.col ---@type integer local scope = M.containing_scope(node) - for _, child in ipairs(ts_utils.get_named_children(scope)) do + for _, child in ipairs(get_named_children(scope)) do local row_, col_ = child:start() if vim.tbl_contains(scopes, child) and ((row_ + 1 == row and col_ > col) or row_ + 1 > row) then return child @@ -318,6 +365,9 @@ function M.next_scope(node) end local scope = M.containing_scope(node) + if not scope then + return + end local parent = scope:parent() if not parent then @@ -325,7 +375,7 @@ function M.next_scope(node) end local is_prev = true - for _, child in ipairs(ts_utils.get_named_children(parent)) do + for _, child in ipairs(get_named_children(parent)) do if child == scope then is_prev = false elseif not is_prev and vim.tbl_contains(scopes, child) then @@ -345,6 +395,9 @@ function M.previous_scope(node) end local scope = M.containing_scope(node) + if not scope then + return + end local parent = scope:parent() if not parent then @@ -352,7 +405,7 @@ function M.previous_scope(node) end local is_prev = true - local children = ts_utils.get_named_children(parent) + local children = get_named_children(parent) for i = #children, 1, -1 do if children[i] == scope then is_prev = false diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 31b691209..69e9500fe 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1,43 +1,3 @@ -local api = vim.api -local ts = vim.treesitter - -for ft, lang in pairs { - automake = "make", - javascriptreact = "javascript", - ecma = "javascript", - jsx = "javascript", - gyp = "python", - html_tags = "html", - ["typescript.tsx"] = "tsx", - ["terraform-vars"] = "terraform", - ["html.handlebars"] = "glimmer", - systemverilog = "verilog", - dosini = "ini", - confini = "ini", - svg = "xml", - xsd = "xml", - xslt = "xml", - expect = "tcl", - mysql = "sql", - sbt = "scala", - neomuttrc = "muttrc", - clientscript = "runescript", - --- short-hand list from https://github.com/helix-editor/helix/blob/master/languages.toml - rs = "rust", - ex = "elixir", - js = "javascript", - ts = "typescript", - ["c-sharp"] = "csharp", - hs = "haskell", - py = "python", - erl = "erlang", - typ = "typst", - pl = "perl", - uxn = "uxntal", -} do - ts.language.register(lang, ft) -end - ---@class InstallInfo ---@field url string ---@field branch string|nil @@ -47,2798 +7,2830 @@ end ---@field requires_generate_from_grammar boolean|nil ---@field location string|nil ---@field use_makefile boolean|nil ----@field cxx_standard string|nil ---@class ParserInfo ---@field install_info InstallInfo ----@field filetype string +---@field filetype string[] ---@field maintainers string[] ----@field experimental boolean|nil ----@field readme_name string|nil +---@field tier integer|nil +---@field readme_note string|nil + +local M = {} + +M.tiers = { 'core', 'stable', 'community', 'unstable' } ---@type ParserInfo[] -local list = setmetatable({}, { - __newindex = function(table, parsername, parserconfig) - rawset(table, parsername, parserconfig) - if parserconfig.filetype or vim.fn.has "nvim-0.11" == 0 then - ts.language.register(parsername, parserconfig.filetype or parsername) - end - end, -}) - -list.ada = { - install_info = { - url = "https://github.com/briot/tree-sitter-ada", - files = { "src/parser.c" }, - }, - maintainers = { "@briot" }, -} - -list.agda = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-agda", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@Decodetalkers" }, -} - -list.angular = { - install_info = { - url = "https://github.com/dlvandenberg/tree-sitter-angular", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - filetype = "htmlangular", - maintainers = { "@dlvandenberg" }, - experimental = true, -} - -list.apex = { - install_info = { - url = "https://github.com/aheber/tree-sitter-sfapex", - files = { "src/parser.c" }, - location = "apex", - }, - maintainers = { "@aheber", "@xixiaofinland" }, -} - -list.arduino = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-arduino", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.asm = { - install_info = { - url = "https://github.com/RubixDev/tree-sitter-asm", - files = { "src/parser.c" }, - }, - maintainers = { "@RubixDev" }, -} - -list.astro = { - install_info = { - url = "https://github.com/virchau13/tree-sitter-astro", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@virchau13" }, -} - -list.authzed = { - install_info = { - url = "https://github.com/mleonidas/tree-sitter-authzed", - files = { "src/parser.c" }, - }, - maintainers = { "@mattpolzin" }, -} - -list.awk = { - install_info = { - url = "https://github.com/Beaglefoot/tree-sitter-awk", - files = { "src/parser.c", "src/scanner.c" }, - }, -} - -list.bash = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-bash", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "sh", - maintainers = { "@TravonteD" }, -} - -list.bass = { - install_info = { - url = "https://github.com/vito/tree-sitter-bass", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.beancount = { - install_info = { - url = "https://github.com/polarmutex/tree-sitter-beancount", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@polarmutex" }, -} - -list.bibtex = { - install_info = { - url = "https://github.com/latex-lsp/tree-sitter-bibtex", - files = { "src/parser.c" }, - }, - filetype = "bib", - maintainers = { "@theHamsta", "@clason" }, -} - -list.bicep = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-bicep", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.bitbake = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-bitbake", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.blade = { - install_info = { - url = "https://github.com/EmranMR/tree-sitter-blade", - files = { "src/parser.c" }, - }, - maintainers = { "@calebdw" }, -} - -list.blueprint = { - install_info = { - url = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", - files = { "src/parser.c" }, - }, - maintainers = { "@gabmus" }, - experimental = true, -} - -list.bp = { - install_info = { - url = "https://github.com/ambroisie/tree-sitter-bp", - files = { "src/parser.c" }, - }, - maintainers = { "@ambroisie" }, -} - -list.brightscript = { - install_info = { - url = "https://github.com/ajdelcimmuto/tree-sitter-brightscript", - files = { "src/parser.c" }, - }, - maintainers = { "@ajdelcimmuto" }, -} - -list.c = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-c", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.c_sharp = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-c-sharp", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "cs", - maintainers = { "@amaanq" }, -} - -list.caddy = { - install_info = { - url = "https://github.com/opa-oz/tree-sitter-caddy", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@opa-oz" }, -} - -list.cairo = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-cairo", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.capnp = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-capnp", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.chatito = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-chatito", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.circom = { - install_info = { - url = "https://github.com/Decurity/tree-sitter-circom", - files = { "src/parser.c" }, - }, - maintainers = { "@alexandr-martirosyan" }, -} - -list.clojure = { - install_info = { - url = "https://github.com/sogaiu/tree-sitter-clojure", - files = { "src/parser.c" }, - }, - maintainers = { "@NoahTheDuke" }, -} - -list.cmake = { - install_info = { - url = "https://github.com/uyha/tree-sitter-cmake", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@uyha" }, -} - -list.comment = { - install_info = { - url = "https://github.com/stsewd/tree-sitter-comment", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@stsewd" }, -} - -list.commonlisp = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-commonlisp", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - filetype = "lisp", - maintainers = { "@theHamsta" }, -} - -list.cooklang = { - install_info = { - url = "https://github.com/addcninblue/tree-sitter-cooklang", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@addcninblue" }, - filetype = "cook", -} - -list.corn = { - install_info = { - url = "https://github.com/jakestanger/tree-sitter-corn", - files = { "src/parser.c" }, - }, - maintainers = { "@jakestanger" }, -} - -list.cpon = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-cpon", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.cpp = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-cpp", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@theHamsta" }, -} - -list.css = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-css", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@TravonteD" }, -} - -list.csv = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-csv", - files = { "src/parser.c" }, - location = "csv", - }, - maintainers = { "@amaanq" }, -} - -list.cuda = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-cuda", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@theHamsta" }, -} - -list.cue = { - install_info = { - url = "https://github.com/eonpatapon/tree-sitter-cue", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.cylc = { - install_info = { - url = "https://github.com/elliotfontaine/tree-sitter-cylc", - files = { "src/parser.c" }, - }, - maintainers = { "@elliotfontaine" }, -} - -list.d = { - install_info = { - url = "https://github.com/gdamore/tree-sitter-d", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.dart = { - install_info = { - url = "https://github.com/UserNobody14/tree-sitter-dart", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@akinsho" }, -} - -list.desktop = { - install_info = { - url = "https://github.com/ValdezFOmar/tree-sitter-desktop", - files = { "src/parser.c" }, - }, - maintainers = { "@ValdezFOmar" }, -} - -list.devicetree = { - install_info = { - url = "https://github.com/joelspadin/tree-sitter-devicetree", - files = { "src/parser.c" }, - }, - filetype = "dts", - maintainers = { "@jedrzejboczar" }, -} - -list.dhall = { - install_info = { - url = "https://github.com/jbellerb/tree-sitter-dhall", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.diff = { - install_info = { - url = "https://github.com/the-mikedavis/tree-sitter-diff", - files = { "src/parser.c" }, - }, - filetype = "gitdiff", - maintainers = { "@gbprod" }, -} - -list.disassembly = { - install_info = { - url = "https://github.com/ColinKennedy/tree-sitter-disassembly", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ColinKennedy" }, -} - -list.djot = { - install_info = { - url = "https://github.com/treeman/tree-sitter-djot", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@NoahTheDuke" }, -} - -list.dockerfile = { - install_info = { - url = "https://github.com/camdencheek/tree-sitter-dockerfile", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@camdencheek" }, -} - -list.dot = { - install_info = { - url = "https://github.com/rydesun/tree-sitter-dot", - files = { "src/parser.c" }, - }, - maintainers = { "@rydesun" }, -} - -list.doxygen = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-doxygen", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.dtd = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-xml", - files = { "src/parser.c", "src/scanner.c" }, - location = "dtd", - }, - maintainers = { "@ObserverOfTime" }, -} - -list.earthfile = { - install_info = { - url = "https://github.com/glehmann/tree-sitter-earthfile", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@glehmann" }, -} - -list.ebnf = { - install_info = { - url = "https://github.com/RubixDev/ebnf", - files = { "src/parser.c" }, - location = "crates/tree-sitter-ebnf", - }, - maintainers = { "@RubixDev" }, - experimental = true, -} - -list.editorconfig = { - install_info = { - url = "https://github.com/ValdezFOmar/tree-sitter-editorconfig", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ValdezFOmar" }, -} - -list.eds = { - install_info = { - url = "https://github.com/uyha/tree-sitter-eds", - files = { "src/parser.c" }, - }, - maintainers = { "@uyha" }, -} - -list.eex = { - install_info = { - url = "https://github.com/connorlay/tree-sitter-eex", - files = { "src/parser.c" }, - }, - filetype = "eelixir", - maintainers = { "@connorlay" }, -} - -list.elixir = { - install_info = { - url = "https://github.com/elixir-lang/tree-sitter-elixir", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@connorlay" }, -} - -list.elm = { - install_info = { - url = "https://github.com/elm-tooling/tree-sitter-elm", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@zweimach" }, -} - -list.elsa = { - install_info = { - url = "https://github.com/glapa-grossklag/tree-sitter-elsa", - files = { "src/parser.c" }, - }, - maintainers = { "@glapa-grossklag", "@amaanq" }, -} - -list.elvish = { - install_info = { - url = "https://github.com/elves/tree-sitter-elvish", - files = { "src/parser.c" }, - }, - maintainers = { "@elves" }, -} - -list.embedded_template = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-embedded-template", - files = { "src/parser.c" }, - }, - filetype = "eruby", -} - -list.enforce = { - install_info = { - url = "https://github.com/simonvic/tree-sitter-enforce", - files = { "src/parser.c" }, - }, - maintainers = { "@simonvic" }, -} - -list.erlang = { - install_info = { - url = "https://github.com/WhatsApp/tree-sitter-erlang", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@filmor" }, -} - -list.facility = { - install_info = { - url = "https://github.com/FacilityApi/tree-sitter-facility", - files = { "src/parser.c" }, - }, - filetype = "fsd", - maintainers = { "@bryankenote" }, -} - -list.faust = { - install_info = { - url = "https://github.com/khiner/tree-sitter-faust", - files = { "src/parser.c" }, - }, - filetype = "dsp", - maintainers = { "@khiner" }, -} - -list.fennel = { - install_info = { - url = "https://github.com/alexmozaidze/tree-sitter-fennel", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@alexmozaidze" }, -} - -list.fidl = { - install_info = { - url = "https://github.com/google/tree-sitter-fidl", - files = { "src/parser.c" }, - }, - maintainers = { "@chaopeng" }, -} - -list.firrtl = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-firrtl", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.fish = { - install_info = { - url = "https://github.com/ram02z/tree-sitter-fish", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ram02z" }, -} - -list.foam = { - install_info = { - url = "https://github.com/FoamScience/tree-sitter-foam", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@FoamScience" }, - -- Queries might change over time on the grammar's side - -- Otherwise everything runs fine - experimental = true, -} - -list.forth = { - install_info = { - url = "https://github.com/AlexanderBrevig/tree-sitter-forth", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.fortran = { - install_info = { - url = "https://github.com/stadelmanma/tree-sitter-fortran", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.fsh = { - install_info = { - url = "https://github.com/mgramigna/tree-sitter-fsh", - files = { "src/parser.c" }, - }, - maintainers = { "@mgramigna" }, -} - -list.fsharp = { - install_info = { - url = "https://github.com/ionide/tree-sitter-fsharp", - files = { "src/parser.c", "src/scanner.c" }, - location = "fsharp", - }, - maintainers = { "@nsidorenco" }, -} - -list.func = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-func", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.fusion = { - install_info = { - url = "https://gitlab.com/jirgn/tree-sitter-fusion.git", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@jirgn" }, -} - -list.gap = { - install_info = { - url = "https://github.com/gap-system/tree-sitter-gap", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@reiniscirpons" }, - readme_name = "GAP system", -} - -list.gaptst = { - install_info = { - url = "https://github.com/gap-system/tree-sitter-gaptst", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@reiniscirpons" }, - readme_name = "GAP system test files", -} - -list.gdscript = { - install_info = { - url = "https://github.com/PrestonKnopp/tree-sitter-gdscript", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@PrestonKnopp" }, - readme_name = "Godot (gdscript)", -} - -list.gdshader = { - install_info = { - url = "https://github.com/GodOfAvacyn/tree-sitter-gdshader", - files = { "src/parser.c" }, - }, - filetype = "gdshaderinc", - maintainers = { "@godofavacyn" }, -} - -list.git_rebase = { - install_info = { - url = "https://github.com/the-mikedavis/tree-sitter-git-rebase", - files = { "src/parser.c" }, - }, - filetype = "gitrebase", - maintainers = { "@gbprod" }, -} - -list.gitattributes = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-gitattributes", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.gitcommit = { - install_info = { - url = "https://github.com/gbprod/tree-sitter-gitcommit", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@gbprod" }, -} - -list.git_config = { - install_info = { - url = "https://github.com/the-mikedavis/tree-sitter-git-config", - files = { "src/parser.c" }, - }, - filetype = "gitconfig", - maintainers = { "@amaanq" }, - readme_name = "git_config", -} - -list.gitignore = { - install_info = { - url = "https://github.com/shunsambongi/tree-sitter-gitignore", - files = { "src/parser.c" }, - }, - maintainers = { "@theHamsta" }, -} - -list.gleam = { - install_info = { - url = "https://github.com/gleam-lang/tree-sitter-gleam", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.glimmer = { - install_info = { - url = "https://github.com/ember-tooling/tree-sitter-glimmer", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "handlebars", - maintainers = { "@NullVoxPopuli" }, - readme_name = "Glimmer and Ember", -} - -list.glimmer_javascript = { - install_info = { - url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - filetype = "javascript.glimmer", - maintainers = { "@NullVoxPopuli" }, -} - -list.glimmer_typescript = { - install_info = { - url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - filetype = "typescript.glimmer", - maintainers = { "@NullVoxPopuli" }, -} - -list.glsl = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-glsl", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - maintainers = { "@theHamsta" }, -} - -list.gn = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-gn", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, - readme_name = "GN (Generate Ninja)", -} - -list.gnuplot = { - install_info = { - url = "https://github.com/dpezto/tree-sitter-gnuplot", - files = { "src/parser.c" }, - }, - maintainers = { "@dpezto" }, -} - -list.go = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-go", - files = { "src/parser.c" }, - }, - maintainers = { "@theHamsta", "@WinWisely268" }, -} - -list.goctl = { - install_info = { - url = "https://github.com/chaozwn/tree-sitter-goctl", - files = { "src/parser.c" }, - }, - maintainers = { "@chaozwn" }, -} - -list.godot_resource = { - install_info = { - url = "https://github.com/PrestonKnopp/tree-sitter-godot-resource", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "gdresource", - maintainers = { "@pierpo" }, - readme_name = "Godot Resources (gdresource)", -} - -list.gomod = { - install_info = { - url = "https://github.com/camdencheek/tree-sitter-go-mod", - files = { "src/parser.c" }, - }, - maintainers = { "@camdencheek" }, -} - -list.gosum = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-go-sum", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.gowork = { - install_info = { - url = "https://github.com/omertuc/tree-sitter-go-work", - files = { "src/parser.c" }, - }, - maintainers = { "@omertuc" }, -} - -list.gotmpl = { - install_info = { - url = "https://github.com/ngalaiko/tree-sitter-go-template", - files = { "src/parser.c" }, - }, - maintainers = { "@qvalentin" }, -} - -list.gpg = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-gpg-config", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.gren = { - install_info = { - files = { "src/parser.c", "src/scanner.c" }, - url = "https://github.com/MaeBrooks/tree-sitter-gren", - }, - maintainers = { "@MaeBrooks" }, -} - -list.groovy = { - install_info = { - url = "https://github.com/murtaza64/tree-sitter-groovy", - files = { "src/parser.c" }, - }, - maintainers = { "@murtaza64" }, -} - -list.graphql = { - install_info = { - url = "https://github.com/bkegley/tree-sitter-graphql", - files = { "src/parser.c" }, - }, - maintainers = { "@bkegley" }, -} - -list.gstlaunch = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-gstlaunch", - files = { "src/parser.c" }, - }, - maintainers = { "@theHamsta" }, -} - -list.hack = { - install_info = { - url = "https://github.com/slackhq/tree-sitter-hack", - files = { "src/parser.c", "src/scanner.c" }, - }, -} - -list.hare = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-hare", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.haskell = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-haskell", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@mrcjkb" }, -} - -list.haskell_persistent = { - install_info = { - url = "https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "haskellpersistent", - maintainers = { "@lykahb" }, -} - -list.hcl = { - install_info = { - url = "https://github.com/MichaHoffmann/tree-sitter-hcl", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@MichaHoffmann" }, -} - -list.heex = { - install_info = { - url = "https://github.com/connorlay/tree-sitter-heex", - files = { "src/parser.c" }, - }, - maintainers = { "@connorlay" }, -} - -list.helm = { - install_info = { - url = "https://github.com/ngalaiko/tree-sitter-go-template", - location = "dialects/helm", - files = { "src/parser.c" }, - }, - maintainers = { "@qvalentin" }, -} - -list.hjson = { - install_info = { - url = "https://github.com/winston0410/tree-sitter-hjson", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - maintainers = { "@winston0410" }, -} - -list.hlsl = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-hlsl", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@theHamsta" }, -} - -list.hocon = { - install_info = { - url = "https://github.com/antosha417/tree-sitter-hocon", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - maintainers = { "@antosha417" }, -} - -list.hoon = { - install_info = { - url = "https://github.com/urbit-pilled/tree-sitter-hoon", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@urbit-pilled" }, - experimental = true, -} - -list.html = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-html", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@TravonteD" }, -} - -list.htmldjango = { - install_info = { - url = "https://github.com/interdependence/tree-sitter-htmldjango", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, - experimental = true, -} - -list.http = { - install_info = { - url = "https://github.com/rest-nvim/tree-sitter-http", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq", "@NTBBloodbath" }, -} - -list.hurl = { - install_info = { - url = "https://github.com/pfeiferj/tree-sitter-hurl", - files = { "src/parser.c" }, - }, - maintainers = { "@pfeiferj" }, -} - -list.hyprlang = { - install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hyprlang", - files = { "src/parser.c" }, - }, - maintainers = { "@luckasRanarison" }, -} - -list.idl = { - install_info = { - url = "https://github.com/cathaysia/tree-sitter-idl", - files = { "src/parser.c" }, - }, - maintainers = { "@cathaysia" }, -} - -list.idris = { - install_info = { - url = "https://github.com/kayhide/tree-sitter-idris", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "idris2", - maintainers = { "@srghma" }, -} - -list.ini = { - install_info = { - url = "https://github.com/justinmk/tree-sitter-ini", - files = { "src/parser.c" }, - }, - maintainers = { "@theHamsta" }, - experimental = true, -} - -list.inko = { - install_info = { - url = "https://github.com/inko-lang/tree-sitter-inko", - files = { "src/parser.c" }, - }, - maintainers = { "@yorickpeterse" }, -} - -list.ipkg = { - install_info = { - url = "https://github.com/srghma/tree-sitter-ipkg", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@srghma" }, -} - -list.ispc = { - install_info = { - url = "https://github.com/fab4100/tree-sitter-ispc", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - maintainers = { "@fab4100" }, -} - -list.janet_simple = { - install_info = { - url = "https://github.com/sogaiu/tree-sitter-janet-simple", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "janet", - maintainers = { "@sogaiu" }, -} - -list.java = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-java", - files = { "src/parser.c" }, - }, - maintainers = { "@p00f" }, -} - -list.javadoc = { - install_info = { - url = "https://github.com/rmuir/tree-sitter-javadoc", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@rmuir" }, -} - -list.javascript = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-javascript", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@steelsojka" }, -} - -list.jinja = { - install_info = { - url = "https://github.com/cathaysia/tree-sitter-jinja", - location = "tree-sitter-jinja", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@cathaysia" }, -} - -list.jinja_inline = { - install_info = { - url = "https://github.com/cathaysia/tree-sitter-jinja", - location = "tree-sitter-jinja_inline", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@cathaysia" }, -} - -list.jq = { - install_info = { - url = "https://github.com/flurie/tree-sitter-jq", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.jsdoc = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-jsdoc", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@steelsojka" }, -} - -list.json = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-json", - files = { "src/parser.c" }, - }, - maintainers = { "@steelsojka" }, -} - -list.json5 = { - install_info = { - url = "https://github.com/Joakker/tree-sitter-json5", - files = { "src/parser.c" }, - }, - maintainers = { "@Joakker" }, -} - -list.jsonc = { - install_info = { - url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git", - files = { "src/parser.c" }, - generate_requires_npm = true, - }, - maintainers = { "@WhyNotHugo" }, - readme_name = "JSON with comments", -} - -list.jsonnet = { - install_info = { - url = "https://github.com/sourcegraph/tree-sitter-jsonnet", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@nawordar" }, -} - -list.julia = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-julia", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@fredrikekre" }, -} - -list.just = { - install_info = { - url = "https://github.com/IndianBoy42/tree-sitter-just", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@Hubro" }, -} - -list.kcl = { - install_info = { - url = "https://github.com/kcl-lang/tree-sitter-kcl", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@bertbaron" }, -} - -list.kconfig = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-kconfig", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.kdl = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-kdl", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.kotlin = { - install_info = { - url = "https://github.com/fwcd/tree-sitter-kotlin", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@SalBakraa" }, -} - -list.koto = { - install_info = { - url = "https://github.com/koto-lang/tree-sitter-koto", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@irh" }, -} - -list.kusto = { - install_info = { - url = "https://github.com/Willem-J-an/tree-sitter-kusto", - files = { "src/parser.c" }, - }, - maintainers = { "@Willem-J-an" }, -} - -list.lalrpop = { - install_info = { - url = "https://github.com/traxys/tree-sitter-lalrpop", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@traxys" }, -} - -list.latex = { - install_info = { - url = "https://github.com/latex-lsp/tree-sitter-latex", - files = { "src/parser.c", "src/scanner.c" }, - requires_generate_from_grammar = true, - }, - filetype = "tex", - maintainers = { "@theHamsta", "@clason" }, -} - -list.ledger = { - install_info = { - url = "https://github.com/cbarrete/tree-sitter-ledger", - files = { "src/parser.c" }, - }, - maintainers = { "@cbarrete" }, -} - -list.leo = { - install_info = { - url = "https://github.com/r001/tree-sitter-leo", - files = { "src/parser.c" }, - }, - maintainers = { "@r001" }, -} - -list.llvm = { - install_info = { - url = "https://github.com/benwilliamgraham/tree-sitter-llvm", - files = { "src/parser.c" }, - }, - maintainers = { "@benwilliamgraham" }, -} - -list.linkerscript = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-linkerscript", - files = { "src/parser.c" }, - }, - filetype = "ld", - maintainers = { "@amaanq" }, -} - -list.liquid = { - install_info = { - url = "https://github.com/hankthetank27/tree-sitter-liquid", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@hankthetank27" }, -} - -list.liquidsoap = { - install_info = { - url = "https://github.com/savonet/tree-sitter-liquidsoap", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@toots" }, -} - -list.lua = { - install_info = { - url = "https://github.com/MunifTanjim/tree-sitter-lua", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@muniftanjim" }, -} - -list.luadoc = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-luadoc", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.luap = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-luap", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, - readme_name = "lua patterns", -} - -list.luau = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-luau", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.hlsplaylist = { - install_info = { - url = "https://github.com/Freed-Wu/tree-sitter-hlsplaylist", - files = { "src/parser.c" }, - }, - maintainers = { "@Freed-Wu" }, -} - -list.m68k = { - install_info = { - url = "https://github.com/grahambates/tree-sitter-m68k", - files = { "src/parser.c" }, - }, - filetype = "asm68k", - maintainers = { "@grahambates" }, -} - -list.make = { - install_info = { - url = "https://github.com/alemuller/tree-sitter-make", - files = { "src/parser.c" }, - }, - maintainers = { "@lewis6991" }, -} - -list.markdown = { - install_info = { - url = "https://github.com/MDeiml/tree-sitter-markdown", - location = "tree-sitter-markdown", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@MDeiml" }, - readme_name = "markdown (basic highlighting)", - experimental = true, -} - -list.markdown_inline = { - install_info = { - url = "https://github.com/MDeiml/tree-sitter-markdown", - location = "tree-sitter-markdown-inline", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@MDeiml" }, - readme_name = "markdown_inline (needed for full highlighting)", - experimental = true, -} - -list.matlab = { - install_info = { - url = "https://github.com/acristoffers/tree-sitter-matlab", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@acristoffers" }, -} - -list.menhir = { - install_info = { - url = "https://github.com/Kerl13/tree-sitter-menhir", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@Kerl13" }, -} - -list.mermaid = { - install_info = { - url = "https://github.com/monaqa/tree-sitter-mermaid", - files = { "src/parser.c" }, - }, - experimental = true, -} - -list.meson = { - install_info = { - url = "https://github.com/Decodetalkers/tree-sitter-meson", - files = { "src/parser.c" }, - }, - maintainers = { "@Decodetalkers" }, -} - -list.mlir = { - install_info = { - url = "https://github.com/artagnon/tree-sitter-mlir", - files = { "src/parser.c" }, - requires_generate_from_grammar = true, - }, - experimental = true, - maintainers = { "@artagnon" }, -} - -list.muttrc = { - install_info = { - url = "https://github.com/neomutt/tree-sitter-muttrc", - files = { "src/parser.c" }, - }, - maintainers = { "@Freed-Wu" }, -} - -list.nasm = { - install_info = { - url = "https://github.com/naclsn/tree-sitter-nasm", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.nginx = { - install_info = { - url = "https://github.com/opa-oz/tree-sitter-nginx", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@opa-oz" }, -} - -list.nickel = { - install_info = { - url = "https://github.com/nickel-lang/tree-sitter-nickel", - files = { "src/parser.c", "src/scanner.c" }, - }, -} - -list.nim = { - install_info = { - url = "https://github.com/alaviss/tree-sitter-nim", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@aMOPel" }, -} - -list.nim_format_string = { - install_info = { - url = "https://github.com/aMOPel/tree-sitter-nim-format-string", - files = { "src/parser.c" }, - }, - maintainers = { "@aMOPel" }, -} - -list.ninja = { - install_info = { - url = "https://github.com/alemuller/tree-sitter-ninja", - files = { "src/parser.c" }, - }, - maintainers = { "@alemuller" }, -} - -list.nix = { - install_info = { - url = "https://github.com/cstrahan/tree-sitter-nix", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@leo60228" }, -} - -list.norg = { - install_info = { - url = "https://github.com/nvim-neorg/tree-sitter-norg", - files = { "src/parser.c", "src/scanner.cc" }, - cxx_standard = "c++14", - use_makefile = true, - }, - maintainers = { "@JoeyGrajciar", "@vhyrro" }, -} - -list.nqc = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-nqc", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.nu = { - install_info = { - url = "https://github.com/nushell/tree-sitter-nu", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@abhisheksingh0x558" }, -} - -list.objc = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-objc", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.objdump = { - install_info = { - url = "https://github.com/ColinKennedy/tree-sitter-objdump", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ColinKennedy" }, -} - -list.ocaml = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-ocaml", - files = { "src/parser.c", "src/scanner.c" }, - location = "grammars/ocaml", - }, - maintainers = { "@undu" }, -} - -list.ocaml_interface = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-ocaml", - files = { "src/parser.c", "src/scanner.c" }, - location = "grammars/interface", - }, - filetype = "ocamlinterface", - maintainers = { "@undu" }, -} - -list.ocamllex = { - install_info = { - url = "https://github.com/atom-ocaml/tree-sitter-ocamllex", - files = { "src/parser.c", "src/scanner.c" }, - requires_generate_from_grammar = true, - }, - maintainers = { "@undu" }, -} - -list.odin = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-odin", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.pascal = { - install_info = { - url = "https://github.com/Isopod/tree-sitter-pascal", - files = { "src/parser.c" }, - }, - maintainers = { "@Isopod" }, -} - -list.passwd = { - install_info = { - url = "https://github.com/ath3/tree-sitter-passwd", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.pem = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-pem", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.perl = { - install_info = { - url = "https://github.com/tree-sitter-perl/tree-sitter-perl", - files = { "src/parser.c", "src/scanner.c" }, - branch = "release", - }, - maintainers = { "@RabbiVeesh", "@LeoNerd" }, -} - -list.php = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-php", - location = "php", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@tk-shirasaka", "@calebdw" }, -} - -list.php_only = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-php", - location = "php_only", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@tk-shirasaka", "@calebdw" }, -} - --- Parsers for injections -list.phpdoc = { - install_info = { - url = "https://github.com/claytonrcarter/tree-sitter-phpdoc", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@mikehaertl" }, - experimental = true, -} - -list.pioasm = { - install_info = { - url = "https://github.com/leo60228/tree-sitter-pioasm", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@leo60228" }, -} - -list.po = { - install_info = { - url = "https://github.com/erasin/tree-sitter-po", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.pod = { - install_info = { - url = "https://github.com/tree-sitter-perl/tree-sitter-pod", - files = { "src/parser.c", "src/scanner.c" }, - branch = "release", - }, - maintainers = { "@RabbiVeesh", "@LeoNerd" }, -} - -list.poe_filter = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-poe-filter", - files = { "src/parser.c" }, - }, - filetype = "poefilter", - maintainers = { "@ObserverOfTime" }, - readme_name = "Path of Exile item filter", - experimental = true, -} - -list.pony = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-pony", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq", "@mfelsche" }, -} - -list.powershell = { - install_info = { - url = "https://github.com/airbus-cert/tree-sitter-powershell", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "ps1", - maintainers = { "@L2jLiga" }, -} - -list.printf = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-printf", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, -} - -list.prisma = { - install_info = { - url = "https://github.com/victorhqc/tree-sitter-prisma", - files = { "src/parser.c" }, - }, - maintainers = { "@elianiva" }, -} - -list.problog = { - install_info = { - url = "https://github.com/foxyseta/tree-sitter-prolog", - files = { "src/parser.c" }, - location = "grammars/problog", - }, - maintainers = { "@foxyseta" }, -} - -list.prolog = { - install_info = { - url = "https://github.com/foxyseta/tree-sitter-prolog", - files = { "src/parser.c" }, - location = "grammars/prolog", - }, - maintainers = { "@foxyseta" }, -} - -list.promql = { - install_info = { - url = "https://github.com/MichaHoffmann/tree-sitter-promql", - files = { "src/parser.c" }, - experimental = true, - }, - maintainers = { "@MichaHoffmann" }, -} - -list.properties = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-properties", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "jproperties", - maintainers = { "@ObserverOfTime" }, -} - -list.proto = { - install_info = { - url = "https://github.com/treywood/tree-sitter-proto", - files = { "src/parser.c" }, - }, - maintainers = { "@treywood" }, -} - -list.prql = { - install_info = { - url = "https://github.com/PRQL/tree-sitter-prql", - files = { "src/parser.c" }, - }, - maintainers = { "@matthias-Q" }, -} - -list.psv = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-csv", - files = { "src/parser.c" }, - location = "psv", - }, - maintainers = { "@amaanq" }, -} - -list.pug = { - install_info = { - url = "https://github.com/zealot128/tree-sitter-pug", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@zealot128" }, - experimental = true, -} - -list.puppet = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-puppet", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.purescript = { - install_info = { - url = "https://github.com/postsolar/tree-sitter-purescript", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@postsolar" }, -} - -list.pymanifest = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-pymanifest", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, - readme_name = "PyPA manifest", -} - -list.python = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-python", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@stsewd", "@theHamsta" }, -} - -list.ql = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-ql", - files = { "src/parser.c" }, - }, - maintainers = { "@pwntester" }, -} - -list.qmldir = { - install_info = { - url = "https://github.com/Decodetalkers/tree-sitter-qmldir", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.qmljs = { - install_info = { - url = "https://github.com/yuja/tree-sitter-qmljs", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "qml", - maintainers = { "@Decodetalkers" }, -} - -list.query = { - install_info = { - url = "https://github.com/nvim-treesitter/tree-sitter-query", - files = { "src/parser.c" }, - }, - maintainers = { "@steelsojka" }, - readme_name = "Tree-Sitter query language", -} - -list.r = { - install_info = { - url = "https://github.com/r-lib/tree-sitter-r", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ribru17" }, -} - -list.racket = { - install_info = { - url = "https://github.com/6cdh/tree-sitter-racket", - files = { "src/parser.c", "src/scanner.c" }, - }, -} - -list.ralph = { - install_info = { - url = "https://github.com/alephium/tree-sitter-ralph", - files = { "src/parser.c" }, - }, - maintainers = { "@tdroxler" }, -} - -list.rasi = { - install_info = { - url = "https://github.com/Fymyte/tree-sitter-rasi", - files = { "src/parser.c" }, - }, - maintainers = { "@Fymyte" }, -} - -list.razor = { - install_info = { - url = "https://github.com/tris203/tree-sitter-razor", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - maintainers = { "@tris203" }, -} - -list.rbs = { - install_info = { - url = "https://github.com/joker1007/tree-sitter-rbs", - files = { "src/parser.c" }, - }, - maintainers = { "@joker1007" }, -} - -list.re2c = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-re2c", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.readline = { - install_info = { - url = "https://github.com/ribru17/tree-sitter-readline", - files = { "src/parser.c" }, - }, - maintainers = { "@ribru17" }, -} - -list.regex = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-regex", - files = { "src/parser.c" }, - }, - maintainers = { "@theHamsta" }, -} - -list.rego = { - install_info = { - url = "https://github.com/FallenAngel97/tree-sitter-rego", - files = { "src/parser.c" }, - }, - maintainers = { "@FallenAngel97" }, -} - -list.requirements = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-requirements", - files = { "src/parser.c" }, - }, - maintainers = { "@ObserverOfTime" }, - readme_name = "pip requirements", -} - -list.rescript = { - install_info = { - url = "https://github.com/rescript-lang/tree-sitter-rescript", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@ribru17" }, -} - -list.rnoweb = { - install_info = { - url = "https://github.com/bamonroe/tree-sitter-rnoweb", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@bamonroe" }, -} - -list.robot = { - install_info = { - url = "https://github.com/Hubro/tree-sitter-robot", - files = { "src/parser.c" }, - }, - maintainers = { "@Hubro" }, -} - -list.robots = { - install_info = { - url = "https://github.com/opa-oz/tree-sitter-robots-txt", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@opa-oz" }, -} - -list.roc = { - install_info = { - url = "https://github.com/faldor20/tree-sitter-roc", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@nat-418" }, -} - -list.ron = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-ron", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.rst = { - install_info = { - url = "https://github.com/stsewd/tree-sitter-rst", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@stsewd" }, -} - -list.ruby = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-ruby", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@TravonteD" }, -} - -list.runescript = { - install_info = { - url = "https://github.com/2004Scape/tree-sitter-runescript", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@2004Scape" }, -} - -list.rust = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-rust", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.scala = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-scala", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@stevanmilic" }, -} - -list.scfg = { - install_info = { - url = "https://github.com/rockorager/tree-sitter-scfg", - files = { "src/parser.c" }, - requires_generate_from_grammar = true, - }, - maintainers = { "@WhyNotHugo" }, -} - -list.scheme = { - install_info = { - url = "https://github.com/6cdh/tree-sitter-scheme", - files = { "src/parser.c" }, - }, -} - -list.scss = { - install_info = { - url = "https://github.com/serenadeai/tree-sitter-scss", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@elianiva" }, -} - -list.sflog = { - install_info = { - url = "https://github.com/aheber/tree-sitter-sfapex", - files = { "src/parser.c" }, - location = "sflog", - }, - maintainers = { "@aheber", "@xixiaofinland" }, -} - -list.slang = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-slang", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, - }, - filetype = "shaderslang", - maintainers = { "@theHamsta" }, - experimental = true, -} - -list.slim = { - install_info = { - url = "https://github.com/theoo/tree-sitter-slim", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@theoo" }, -} - -list.slint = { - install_info = { - url = "https://github.com/slint-ui/tree-sitter-slint", - files = { "src/parser.c" }, - }, - maintainers = { "@hunger" }, -} - -list.smali = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-smali", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.snakemake = { - install_info = { - url = "https://github.com/osthomas/tree-sitter-snakemake", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainer = { "@osthomas" }, - experimental = true, -} - -list.smithy = { - install_info = { - url = "https://github.com/indoorvivants/tree-sitter-smithy", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq", "@keynmol" }, -} - -list.solidity = { - install_info = { - url = "https://github.com/JoranHonig/tree-sitter-solidity", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.soql = { - install_info = { - url = "https://github.com/aheber/tree-sitter-sfapex", - files = { "src/parser.c" }, - location = "soql", - }, - maintainers = { "@aheber", "@xixiaofinland" }, -} - -list.sosl = { - install_info = { - url = "https://github.com/aheber/tree-sitter-sfapex", - files = { "src/parser.c" }, - location = "sosl", - }, - maintainers = { "@aheber", "@xixiaofinland" }, -} - -list.sourcepawn = { - install_info = { - url = "https://github.com/nilshelmig/tree-sitter-sourcepawn", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@Sarrus1" }, - tier = 3, -} - -list.sparql = { - install_info = { - url = "https://github.com/GordianDziwis/tree-sitter-sparql", - files = { "src/parser.c" }, - }, - maintainers = { "@GordianDziwis" }, -} - -list.sql = { - install_info = { - url = "https://github.com/derekstride/tree-sitter-sql", - files = { "src/parser.c", "src/scanner.c" }, - branch = "gh-pages", - }, - maintainers = { "@derekstride" }, -} - -list.squirrel = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-squirrel", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.ssh_config = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-ssh-config", - files = { "src/parser.c" }, - }, - filetype = "sshconfig", - maintainers = { "@ObserverOfTime" }, -} - -list.starlark = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-starlark", - files = { "src/parser.c", "src/scanner.c" }, - }, - filetype = "bzl", - maintainers = { "@amaanq" }, -} - -list.strace = { - install_info = { - url = "https://github.com/sigmaSd/tree-sitter-strace", - files = { "src/parser.c" }, - }, - maintainers = { "@amaanq" }, -} - -list.styled = { - install_info = { - url = "https://github.com/mskelton/tree-sitter-styled", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@mskelton" }, -} - -list.supercollider = { - install_info = { - url = "https://github.com/madskjeldgaard/tree-sitter-supercollider", - files = { "src/parser.c", "src/scanner.c" }, - }, - maintainers = { "@madskjeldgaard" }, -} - -list.superhtml = { - install_info = { - url = "https://github.com/kristoff-it/superhtml", - files = { - "src/parser.c", - "src/scanner.c", +M.configs = { + ada = { + install_info = { + url = 'https://github.com/briot/tree-sitter-ada', + files = { 'src/parser.c' }, }, - location = "tree-sitter-superhtml", + maintainers = { '@briot' }, }, - maintainers = { "@rockorager" }, -} -list.surface = { - install_info = { - url = "https://github.com/connorlay/tree-sitter-surface", - files = { "src/parser.c" }, + agda = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-agda', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Decodetalkers' }, }, - filetype = "sface", - maintainers = { "@connorlay" }, -} -list.svelte = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-svelte", - files = { "src/parser.c", "src/scanner.c" }, + angular = { + install_info = { + url = 'https://github.com/dlvandenberg/tree-sitter-angular', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@dlvandenberg' }, + tier = 4, }, - maintainers = { "@amaanq" }, -} -list.sway = { - install_info = { - url = "https://github.com/FuelLabs/tree-sitter-sway.git", - files = { "src/parser.c", "src/scanner.c" }, + apex = { + install_info = { + url = 'https://github.com/aheber/tree-sitter-sfapex', + files = { 'src/parser.c' }, + location = 'apex', + }, + maintainers = { '@aheber', '@xixiafinland' }, + tier = 3, }, - maintainers = { "@ribru17" }, -} -list.swift = { - install_info = { - url = "https://github.com/alex-pinkus/tree-sitter-swift", - files = { "src/parser.c", "src/scanner.c" }, - requires_generate_from_grammar = true, + arduino = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-arduino', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ObserverOfTime' }, }, - maintainers = { "@alex-pinkus" }, -} -list.sxhkdrc = { - install_info = { - url = "https://github.com/RaafatTurki/tree-sitter-sxhkdrc", - files = { "src/parser.c" }, + asm = { + install_info = { + url = 'https://github.com/RubixDev/tree-sitter-asm', + files = { 'src/parser.c' }, + }, + maintainers = { '@RubixDev' }, + tier = 3, }, - maintainers = { "@RaafatTurki" }, -} -list.systemtap = { - install_info = { - url = "https://github.com/ok-ryoko/tree-sitter-systemtap", - files = { "src/parser.c" }, + astro = { + install_info = { + url = 'https://github.com/virchau13/tree-sitter-astro', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@virchau13' }, }, - maintainers = { "@ok-ryoko" }, -} -list.t32 = { - install_info = { - url = "https://gitlab.com/xasc/tree-sitter-t32.git", - files = { "src/parser.c", "src/scanner.c" }, + authzed = { + install_info = { + url = 'https://github.com/mleonidas/tree-sitter-authzed', + files = { 'src/parser.c' }, + }, + maintainers = { '@mattpolzin' }, + tier = 3, }, - filetype = "trace32", - maintainers = { "@xasc" }, -} -list.tablegen = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-tablegen", - files = { "src/parser.c", "src/scanner.c" }, + awk = { + install_info = { + url = 'https://github.com/Beaglefoot/tree-sitter-awk', + files = { 'src/parser.c', 'src/scanner.c' }, + }, }, - maintainers = { "@amaanq" }, -} -list.tact = { - install_info = { - url = "https://github.com/tact-lang/tree-sitter-tact", - files = { "src/parser.c" }, + bash = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-bash', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@TravonteD' }, }, - maintainers = { "@novusnota" }, -} -list.teal = { - install_info = { - url = "https://github.com/euclidianAce/tree-sitter-teal", - files = { "src/parser.c", "src/scanner.c" }, - requires_generate_from_grammar = true, + bass = { + install_info = { + url = 'https://github.com/vito/tree-sitter-bass', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@euclidianAce" }, -} -list.tcl = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-tcl", - files = { "src/parser.c", "src/scanner.c" }, + beancount = { + install_info = { + url = 'https://github.com/polarmutex/tree-sitter-beancount', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@polarmutex' }, }, - maintainers = { "@lewis6991" }, -} -list.tera = { - install_info = { - url = "https://github.com/uncenter/tree-sitter-tera", - files = { "src/parser.c", "src/scanner.c" }, + bibtex = { + install_info = { + url = 'https://github.com/latex-lsp/tree-sitter-bibtex', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta', '@clason' }, + tier = 3, }, - maintainers = { "@uncenter" }, -} -list.terraform = { - install_info = { - url = "https://github.com/MichaHoffmann/tree-sitter-hcl", - files = { "src/parser.c", "src/scanner.c" }, - location = "dialects/terraform", + bicep = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-bicep', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@MichaHoffmann" }, -} -list.textproto = { - install_info = { - url = "https://github.com/PorterAtGoogle/tree-sitter-textproto", - files = { "src/parser.c" }, + bitbake = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-bitbake', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, }, - filetype = "pbtxt", - maintainers = { "@Porter" }, -} -list.thrift = { - install_info = { - url = "https://github.com/duskmoon314/tree-sitter-thrift", - files = { "src/parser.c" }, + blade = { + install_info = { + url = 'https://github.com/EmranMR/tree-sitter-blade', + files = { 'src/parser.c' }, + }, + maintainers = { '@calebdw' }, + tier = 2, }, - maintainers = { "@amaanq", "@duskmoon314" }, -} - -list.tiger = { - install_info = { - url = "https://github.com/ambroisie/tree-sitter-tiger", - files = { "src/parser.c", "src/scanner.c" }, + blueprint = { + install_info = { + url = 'https://gitlab.com/gabmus/tree-sitter-blueprint.git', + files = { 'src/parser.c' }, + }, + maintainers = { '@gabmus' }, + tier = 4, }, - maintainers = { "@ambroisie" }, -} -list.tlaplus = { - install_info = { - url = "https://github.com/tlaplus-community/tree-sitter-tlaplus", - files = { "src/parser.c", "src/scanner.c" }, + bp = { + install_info = { + url = 'https://github.com/ambroisie/tree-sitter-bp', + files = { 'src/parser.c' }, + }, + maintainers = { '@ambroisie' }, + tier = 3, + readme_note = 'Android Blueprint', }, - filetype = "tla", - maintainers = { "@ahelwer", "@susliko" }, -} - -list.tmux = { - install_info = { - url = "https://github.com/Freed-Wu/tree-sitter-tmux", - files = { "src/parser.c" }, + brightscript = { + install_info = { + url = 'https://github.com/ajdelcimmuto/tree-sitter-brightscript', + files = { 'src/parser.c' }, + }, + maintainers = { '@ajdelcimmuto' }, + tier = 2, }, - maintainers = { "@Freed-Wu" }, -} - -list.todotxt = { - install_info = { - url = "https://github.com/arnarg/tree-sitter-todotxt", - files = { "src/parser.c" }, + c = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-c', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 1, }, - maintainers = { "@arnarg" }, - experimental = true, -} -list.toml = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-toml", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, + c_sharp = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@tk-shirasaka" }, -} -list.tsv = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-csv", - files = { "src/parser.c" }, - location = "tsv", + cairo = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-cairo', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, }, - maintainers = { "@amaanq" }, -} -list.tsx = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-typescript", - files = { "src/parser.c", "src/scanner.c" }, - location = "tsx", - generate_requires_npm = true, + caddy = { + install_info = { + url = 'https://github.com/opa-oz/tree-sitter-caddy', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@opa-oz' }, + tier = 3, }, - filetype = "typescriptreact", - maintainers = { "@steelsojka" }, -} -list.turtle = { - install_info = { - url = "https://github.com/GordianDziwis/tree-sitter-turtle", - files = { "src/parser.c" }, + capnp = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-capnp', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@GordianDziwis" }, -} -list.twig = { - install_info = { - url = "https://github.com/gbprod/tree-sitter-twig", - files = { "src/parser.c" }, + chatito = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-chatito', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, }, - maintainers = { "@gbprod" }, -} -list.typescript = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-typescript", - files = { "src/parser.c", "src/scanner.c" }, - location = "typescript", - generate_requires_npm = true, + circom = { + install_info = { + url = 'https://github.com/Decurity/tree-sitter-circom', + files = { 'src/parser.c' }, + }, + maintainers = { '@alexandr-martirosyan' }, + tier = 3, }, - maintainers = { "@steelsojka" }, -} -list.typespec = { - install_info = { - url = "https://github.com/happenslol/tree-sitter-typespec", - files = { "src/parser.c" }, + clojure = { + install_info = { + url = 'https://github.com/sogaiu/tree-sitter-clojure', + files = { 'src/parser.c' }, + }, + maintainers = { '@NoahTheDuke' }, }, - maintainers = { "@happenslol" }, -} -list.typoscript = { - install_info = { - url = "https://github.com/Teddytrombone/tree-sitter-typoscript", - files = { "src/parser.c" }, + cmake = { + install_info = { + url = 'https://github.com/uyha/tree-sitter-cmake', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@uyha' }, }, - maintainers = { "@Teddytrombone" }, -} -list.typst = { - install_info = { - url = "https://github.com/uben0/tree-sitter-typst", - files = { "src/parser.c", "src/scanner.c" }, + comment = { + install_info = { + url = 'https://github.com/stsewd/tree-sitter-comment', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@stsewd' }, + tier = 2, }, - maintainers = { "@uben0", "@RaafatTurki" }, -} -list.udev = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-udev", - files = { "src/parser.c" }, + commonlisp = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-commonlisp', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, }, - filetype = "udevrules", - maintainers = { "@ObserverOfTime" }, -} -list.ungrammar = { - install_info = { - url = "https://github.com/Philipp-M/tree-sitter-ungrammar", - files = { "src/parser.c" }, + cooklang = { + install_info = { + url = 'https://github.com/addcninblue/tree-sitter-cooklang', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@addcninblue' }, + tier = 3, }, - maintainers = { "@Philipp-M", "@amaanq" }, -} -list.unison = { - install_info = { - url = "https://github.com/kylegoetz/tree-sitter-unison", - files = { "src/parser.c", "src/scanner.c" }, - requires_generate_from_grammar = true, + corn = { + install_info = { + url = 'https://github.com/jakestanger/tree-sitter-corn', + files = { 'src/parser.c' }, + }, + maintainers = { '@jakestanger' }, + tier = 3, }, - maintainers = { "@tapegram" }, -} -list.usd = { - install_info = { - url = "https://github.com/ColinKennedy/tree-sitter-usd", - files = { "src/parser.c" }, + cpon = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-cpon', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@ColinKennedy" }, -} -list.uxntal = { - install_info = { - url = "https://github.com/amaanq/tree-sitter-uxntal", - files = { "src/parser.c", "src/scanner.c" }, + cpp = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-cpp', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, }, - filetype = "tal", - maintainers = { "@amaanq" }, - readme_name = "uxn tal", -} -list.v = { - install_info = { - url = "https://github.com/vlang/v-analyzer", - files = { "src/parser.c" }, - location = "tree_sitter_v", + css = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-css', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@TravonteD' }, }, - filetype = "vlang", - maintainers = { "@kkharji", "@amaanq" }, -} -list.vala = { - install_info = { - url = "https://github.com/vala-lang/tree-sitter-vala", - files = { "src/parser.c" }, + csv = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-csv', + files = { 'src/parser.c' }, + location = 'csv', + }, + maintainers = { '@amaanq' }, + tier = 2, }, - maintainers = { "@Prince781" }, -} -list.vento = { - install_info = { - url = "https://github.com/ventojs/tree-sitter-vento", - files = { "src/parser.c", "src/scanner.c" }, + cuda = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-cuda', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, }, - filetype = "vto", - maintainers = { "@wrapperup", "@oscarotero" }, -} -list.verilog = { - install_info = { - url = "https://github.com/gmlarumbe/tree-sitter-systemverilog", - files = { "src/parser.c" }, + cue = { + install_info = { + url = 'https://github.com/eonpatapon/tree-sitter-cue', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@zhangwwpeng" }, -} -list.vhdl = { - install_info = { - url = "https://github.com/jpt13653903/tree-sitter-vhdl", - files = { "src/parser.c", "src/scanner.c" }, + cylc = { + install_info = { + url = 'https://github.com/elliotfontaine/tree-sitter-cylc', + files = { 'src/parser.c' }, + }, + maintainers = { '@elliotfontaine' }, + tier = 3, }, - maintainers = { "@jpt13653903" }, -} -list.vhs = { - install_info = { - url = "https://github.com/charmbracelet/tree-sitter-vhs", - files = { "src/parser.c" }, + d = { + install_info = { + url = 'https://github.com/gdamore/tree-sitter-d', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + tier = 2, + maintainers = { '@amaanq' }, }, - filetype = "tape", - maintainers = { "@caarlos0" }, -} -list.vim = { - install_info = { - url = "https://github.com/neovim/tree-sitter-vim", - files = { "src/parser.c", "src/scanner.c" }, + dart = { + install_info = { + url = 'https://github.com/UserNobody14/tree-sitter-dart', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@akinsho' }, }, - maintainers = { "@clason" }, -} -list.vimdoc = { - install_info = { - url = "https://github.com/neovim/tree-sitter-vimdoc", - files = { "src/parser.c" }, + desktop = { + install_info = { + url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', + files = { 'src/parser.c' }, + }, + maintainers = { '@ValdezFOmar' }, + tier = 3, }, - filetype = "help", - maintainers = { "@clason" }, -} -list.vrl = { - install_info = { - url = "https://github.com/belltoy/tree-sitter-vrl", - files = { "src/parser.c" }, + devicetree = { + install_info = { + url = 'https://github.com/joelspadin/tree-sitter-devicetree', + files = { 'src/parser.c' }, + }, + maintainers = { '@jedrzejboczar' }, }, - maintainers = { "@belltoy" }, -} -list.vue = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-vue", - files = { "src/parser.c", "src/scanner.c" }, - branch = "main", + dhall = { + install_info = { + url = 'https://github.com/jbellerb/tree-sitter-dhall', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, }, - maintainers = { "@WhyNotHugo", "@lucario387" }, -} -list.wgsl = { - install_info = { - url = "https://github.com/szebniok/tree-sitter-wgsl", - files = { "src/parser.c", "src/scanner.c" }, + diff = { + install_info = { + url = 'https://github.com/the-mikedavis/tree-sitter-diff', + files = { 'src/parser.c' }, + }, + maintainers = { '@gbprod' }, }, - maintainers = { "@szebniok" }, -} -list.wgsl_bevy = { - install_info = { - url = "https://github.com/theHamsta/tree-sitter-wgsl-bevy", - files = { "src/parser.c", "src/scanner.c" }, - generate_requires_npm = true, + disassembly = { + install_info = { + url = 'https://github.com/ColinKennedy/tree-sitter-disassembly', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ColinKennedy' }, + tier = 3, }, - maintainers = { "@theHamsta" }, -} -list.wing = { - install_info = { - url = "https://github.com/winglang/tree-sitter-wing", - files = { "src/parser.c", "src/scanner.c" }, + djot = { + install_info = { + url = 'https://github.com/treeman/tree-sitter-djot', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@NoahTheDuke' }, + tier = 3, }, - maintainers = { "@gshpychka", "@MarkMcCulloh" }, -} -list.wit = { - install_info = { - url = "https://github.com/liamwh/tree-sitter-wit", - files = { "src/parser.c" }, + dockerfile = { + install_info = { + url = 'https://github.com/camdencheek/tree-sitter-dockerfile', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@camdencheek' }, }, - maintainers = { "@liamwh" }, -} -list.xcompose = { - install_info = { - url = "https://github.com/ObserverOfTime/tree-sitter-xcompose", - files = { "src/parser.c" }, + dot = { + install_info = { + url = 'https://github.com/rydesun/tree-sitter-dot', + files = { 'src/parser.c' }, + }, + maintainers = { '@rydesun' }, }, - maintainers = { "@ObserverOfTime" }, -} -list.xml = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-xml", - files = { "src/parser.c", "src/scanner.c" }, - location = "xml", + doxygen = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-doxygen', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, }, - maintainers = { "@ObserverOfTime" }, -} -list.xresources = { - install_info = { - url = "https://github.com/ValdezFOmar/tree-sitter-xresources", - files = { "src/parser.c" }, + dtd = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'dtd', + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, }, - filetype = "xdefaults", - maintainers = { "@ValdezFOmar" }, -} -list.yaml = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-yaml", - files = { "src/parser.c", "src/scanner.c" }, + earthfile = { + install_info = { + url = 'https://github.com/glehmann/tree-sitter-earthfile', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@glehmann' }, + tier = 3, }, - maintainers = { "@amaanq" }, -} - -list.yang = { - install_info = { - url = "https://github.com/Hubro/tree-sitter-yang", - files = { "src/parser.c" }, + ebnf = { + install_info = { + url = 'https://github.com/RubixDev/ebnf', + files = { 'src/parser.c' }, + location = 'crates/tree-sitter-ebnf', + }, + maintainers = { '@RubixDev' }, + tier = 4, }, - maintainers = { "@Hubro" }, -} -list.yuck = { - install_info = { - url = "https://github.com/Philipp-M/tree-sitter-yuck", - files = { "src/parser.c", "src/scanner.c" }, + editorconfig = { + install_info = { + url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ValdezFOmar' }, + tier = 3, }, - maintainers = { "@Philipp-M", "@amaanq" }, -} -list.zathurarc = { - install_info = { - url = "https://github.com/Freed-Wu/tree-sitter-zathurarc", - files = { "src/parser.c" }, + eds = { + install_info = { + url = 'https://github.com/uyha/tree-sitter-eds', + files = { 'src/parser.c' }, + }, + maintainers = { '@uyha' }, + tier = 3, }, - maintainers = { "@Freed-Wu" }, -} -list.zig = { - install_info = { - url = "https://github.com/tree-sitter-grammars/tree-sitter-zig", - files = { "src/parser.c" }, + eex = { + install_info = { + url = 'https://github.com/connorlay/tree-sitter-eex', + files = { 'src/parser.c' }, + }, + maintainers = { '@connorlay' }, }, - maintainers = { "@amaanq" }, -} -list.ziggy = { - install_info = { - url = "https://github.com/kristoff-it/ziggy", - files = { "src/parser.c" }, - location = "tree-sitter-ziggy", + elixir = { + install_info = { + url = 'https://github.com/elixir-lang/tree-sitter-elixir', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@connorlay' }, }, - maintainers = { "@rockorager" }, -} -list.ziggy_schema = { - install_info = { - url = "https://github.com/kristoff-it/ziggy", - files = { "src/parser.c" }, - location = "tree-sitter-ziggy-schema", + elm = { + install_info = { + url = 'https://github.com/elm-tooling/tree-sitter-elm', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@zweimach' }, }, - maintainers = { "@rockorager" }, -} -list.templ = { - install_info = { - url = "https://github.com/vrischmann/tree-sitter-templ", - files = { "src/parser.c", "src/scanner.c" }, + elsa = { + install_info = { + url = 'https://github.com/glapa-grossklag/tree-sitter-elsa', + files = { 'src/parser.c' }, + }, + maintainers = { '@glapa-grossklag', '@amaanq' }, }, - maintainers = { "@vrischmann" }, -} -local M = { - list = list, -} + elvish = { + install_info = { + url = 'https://github.com/elves/tree-sitter-elvish', + files = { 'src/parser.c' }, + }, + maintainers = { '@elves' }, + }, -function M.ft_to_lang(ft) - local result = ts.language.get_lang(ft) - if result then - return result - else - ft = vim.split(ft, ".", { plain = true })[1] - return ts.language.get_lang(ft) or ft - end -end + embedded_template = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', + files = { 'src/parser.c' }, + }, + }, + + enforce = { + install_info = { + url = 'https://github.com/simonvic/tree-sitter-enforce', + files = { 'src/parser.c' }, + }, + maintainers = { '@simonvic' }, + tier = 3, + }, + + erlang = { + install_info = { + url = 'https://github.com/WhatsApp/tree-sitter-erlang', + files = { 'src/parser.c', 'src/parser.c' }, + }, + maintainers = { '@filmor' }, + }, + + facility = { + install_info = { + url = 'https://github.com/FacilityApi/tree-sitter-facility', + files = { 'src/parser.c' }, + }, + maintainers = { '@bryankenote' }, + tier = 3, + }, + + faust = { + install_info = { + url = 'https://github.com/khiner/tree-sitter-faust', + files = { 'src/parser.c' }, + }, + maintainers = { '@khiner' }, + tier = 3, + }, + + fennel = { + install_info = { + url = 'https://github.com/alexmozaidze/tree-sitter-fennel', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@alexmozaidze' }, + }, + + fidl = { + install_info = { + url = 'https://github.com/google/tree-sitter-fidl', + files = { 'src/parser.c' }, + }, + maintainers = { '@chaopeng' }, + tier = 3, + }, + + firrtl = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-firrtl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + fish = { + install_info = { + url = 'https://github.com/ram02z/tree-sitter-fish', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ram02z' }, + }, + + foam = { + install_info = { + url = 'https://github.com/FoamScience/tree-sitter-foam', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@FoamScience' }, + tier = 4, + }, + + forth = { + install_info = { + url = 'https://github.com/AlexanderBrevig/tree-sitter-forth', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + fortran = { + install_info = { + url = 'https://github.com/stadelmanma/tree-sitter-fortran', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + fsh = { + install_info = { + url = 'https://github.com/mgramigna/tree-sitter-fsh', + files = { 'src/parser.c' }, + }, + maintainers = { '@mgramigna' }, + }, + + fsharp = { + install_info = { + url = 'https://github.com/ionide/tree-sitter-fsharp', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'fsharp', + }, + maintainers = { '@nsidorenco' }, + tier = 3, + }, + + func = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-func', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + fusion = { + install_info = { + url = 'https://gitlab.com/jirgn/tree-sitter-fusion.git', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@jirgn' }, + }, + + gap = { + install_info = { + url = 'https://github.com/gap-system/tree-sitter-gap', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@reiniscirpons' }, + readme_name = 'GAP system', + tier = 3, + }, + + gaptst = { + install_info = { + url = 'https://github.com/gap-system/tree-sitter-gaptst', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@reiniscirpons' }, + readme_name = 'GAP system test files', + requires = { 'gap' }, + tier = 3, + }, + + gdscript = { + install_info = { + url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@PrestonKnopp' }, + readme_note = 'Godot', + }, + + gdshader = { + install_info = { + url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', + files = { 'src/parser.c' }, + }, + maintainers = { '@godofavacyn' }, + tier = 3, + }, + + git_rebase = { + install_info = { + url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', + files = { 'src/parser.c' }, + }, + maintainers = { '@gbprod' }, + }, + + gitattributes = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-gitattributes', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + }, + + gitcommit = { + install_info = { + url = 'https://github.com/gbprod/tree-sitter-gitcommit', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@gbprod' }, + }, + + git_config = { + install_info = { + url = 'https://github.com/the-mikedavis/tree-sitter-git-config', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + readme_note = 'git_config', + }, + + gitignore = { + install_info = { + url = 'https://github.com/shunsambongi/tree-sitter-gitignore', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta' }, + }, + + gleam = { + install_info = { + url = 'https://github.com/gleam-lang/tree-sitter-gleam', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + glimmer = { + install_info = { + url = 'https://github.com/ember-tooling/tree-sitter-glimmer', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@NullVoxPopuli' }, + readme_note = 'Glimmer and Ember', + }, + + glimmer_javascript = { + install_info = { + url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@NullVoxPopuli' }, + requires = { 'javascript' }, + tier = 3, + }, + + glimmer_typescript = { + install_info = { + url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@NullVoxPopuli' }, + requires = { 'typescript' }, + tier = 3, + }, + + glsl = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-glsl', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, + }, + + gn = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-gn', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + readme_name = 'GN (Generate Ninja)', + tier = 2, + }, + + gnuplot = { + install_info = { + url = 'https://github.com/dpezto/tree-sitter-gnuplot', + files = { 'src/parser.c' }, + }, + maintainers = { '@dpezto' }, + tier = 3, + }, + + go = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-go', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta', '@WinWisely268' }, + }, + + goctl = { + install_info = { + url = 'https://github.com/chaozwn/tree-sitter-goctl', + files = { 'src/parser.c' }, + }, + maintainers = { '@chaozwn' }, + tier = 3, + }, + + godot_resource = { + install_info = { + url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@pierpo' }, + readme_note = 'Godot Resources', + }, + + gomod = { + install_info = { + url = 'https://github.com/camdencheek/tree-sitter-go-mod', + files = { 'src/parser.c' }, + }, + maintainers = { '@camdencheek' }, + }, + + gosum = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-go-sum', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + gowork = { + install_info = { + url = 'https://github.com/omertuc/tree-sitter-go-work', + files = { 'src/parser.c' }, + }, + maintainers = { '@omertuc' }, + }, + + graphql = { + install_info = { + url = 'https://github.com/bkegley/tree-sitter-graphql', + files = { 'src/parser.c' }, + }, + maintainers = { '@bkegley' }, + }, + + gotmpl = { + install_info = { + url = 'https://github.com/ngalaiko/tree-sitter-go-template', + files = { 'src/parser.c' }, + }, + maintainers = { '@qvalentin' }, + tier = 3, + }, + + gpg = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-gpg-config', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + gren = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + url = 'https://github.com/MaeBrooks/tree-sitter-gren', + }, + maintainers = { '@MaeBrooks' }, + tier = 3, + }, + + groovy = { + install_info = { + url = 'https://github.com/murtaza64/tree-sitter-groovy', + files = { 'src/parser.c' }, + }, + maintainers = { '@murtaza64' }, + tier = 3, + }, + + gstlaunch = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-gstlaunch', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta' }, + tier = 2, + }, + + hack = { + install_info = { + url = 'https://github.com/slackhq/tree-sitter-hack', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + }, + + hare = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-hare', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + haskell = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-haskell', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@mrcjkb' }, + }, + + haskell_persistent = { + install_info = { + url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + filetype = 'haskell.persistent', + maintainers = { '@lykahb' }, + }, + + hcl = { + install_info = { + url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@MichaHoffmann' }, + }, + + heex = { + install_info = { + url = 'https://github.com/connorlay/tree-sitter-heex', + files = { 'src/parser.c' }, + }, + maintainers = { '@connorlay' }, + }, + + helm = { + install_info = { + url = 'https://github.com/ngalaiko/tree-sitter-go-template', + location = 'dialects/helm', + files = { 'src/parser.c' }, + }, + maintainers = { '@qvalentin' }, + tier = 3, + }, + + hjson = { + install_info = { + url = 'https://github.com/winston0410/tree-sitter-hjson', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@winston0410' }, + }, + + hlsl = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-hlsl', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, + }, + + hlsplaylist = { + install_info = { + url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', + files = { 'src/parser.c' }, + }, + maintainers = { '@Freed-Wu' }, + tier = 3, + }, + + hocon = { + install_info = { + url = 'https://github.com/antosha417/tree-sitter-hocon', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@antosha417' }, + }, + + hoon = { + install_info = { + url = 'https://github.com/urbit-pilled/tree-sitter-hoon', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@urbit-pilled' }, + tier = 4, + }, + + html = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-html', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@TravonteD' }, + }, + + htmldjango = { + install_info = { + url = 'https://github.com/interdependence/tree-sitter-htmldjango', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 4, + }, + + http = { + install_info = { + url = 'https://github.com/rest-nvim/tree-sitter-http', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq', '@NTBBloodbath' }, + }, + + hurl = { + install_info = { + url = 'https://github.com/pfeiferj/tree-sitter-hurl', + files = { 'src/parser.c' }, + }, + maintainers = { '@pfeiferj' }, + tier = 3, + }, + + hyprlang = { + install_info = { + url = 'https://github.com/luckasRanarison/tree-sitter-hyprlang', + files = { 'src/parser.c' }, + }, + maintainers = { '@luckasRanarison' }, + tier = 3, + }, + + idl = { + install_info = { + url = 'https://github.com/cathaysia/tree-sitter-idl', + files = { 'src/parser.c' }, + }, + maintainers = { '@cathaysia' }, + tier = 3, + }, + + idris = { + install_info = { + url = 'https://github.com/kayhide/tree-sitter-idris', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@srghma' }, + tier = 3, + }, + + ini = { + install_info = { + url = 'https://github.com/justinmk/tree-sitter-ini', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta' }, + tier = 4, + }, + + inko = { + install_info = { + url = 'https://github.com/inko-lang/tree-sitter-inko', + files = { 'src/parser.c' }, + }, + maintainers = { '@yorickpeterse' }, + tier = 3, + }, + + ipkg = { + install_info = { + url = 'https://github.com/srghma/tree-sitter-ipkg', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@srghma' }, + tier = 3, + }, + + ispc = { + install_info = { + url = 'https://github.com/fab4100/tree-sitter-ispc', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@fab4100' }, + }, + + janet_simple = { + install_info = { + url = 'https://github.com/sogaiu/tree-sitter-janet-simple', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@sogaiu' }, + }, + + java = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-java', + files = { 'src/parser.c' }, + }, + maintainers = { '@p00f' }, + }, + + javadoc = { + install_info = { + url = 'https://github.com/rmuir/tree-sitter-javadoc', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@rmuir' }, + tier = 2, + }, + + javascript = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-javascript', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@steelsojka' }, + }, + + jinja = { + install_info = { + url = 'https://github.com/cathaysia/tree-sitter-jinja', + location = 'tree-sitter-jinja', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@cathaysia' }, + readme_note = 'basic highlighting', + tier = 3, + }, + + jinja_inline = { + install_info = { + url = 'https://github.com/cathaysia/tree-sitter-jinja', + location = 'tree-sitter-jinja_inline', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@cathaysia' }, + readme_note = 'needed for full highlighting', + tier = 3, + }, + + jq = { + install_info = { + url = 'https://github.com/flurie/tree-sitter-jq', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + }, + + jsdoc = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@steelsojka' }, + }, + + json = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-json', + files = { 'src/parser.c' }, + }, + maintainers = { '@steelsojka' }, + }, + + json5 = { + install_info = { + url = 'https://github.com/Joakker/tree-sitter-json5', + files = { 'src/parser.c' }, + }, + maintainers = { '@Joakker' }, + }, + + jsonc = { + install_info = { + url = 'https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git', + files = { 'src/parser.c' }, + generate_requires_npm = true, + }, + maintainers = { '@WhyNotHugo' }, + readme_note = 'JSON with comments', + }, + + jsonnet = { + install_info = { + url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@nawordar' }, + }, + + julia = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-julia', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@fredrikekre' }, + tier = 3, + }, + + just = { + install_info = { + url = 'https://github.com/IndianBoy42/tree-sitter-just', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Hubro' }, + tier = 3, + }, + + kcl = { + install_info = { + url = 'https://github.com/kcl-lang/tree-sitter-kcl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@bertbaron' }, + tier = 2, + }, + + kconfig = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-kconfig', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + kdl = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-kdl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + kotlin = { + install_info = { + url = 'https://github.com/fwcd/tree-sitter-kotlin', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@SalBakraa' }, + }, + + koto = { + install_info = { + url = 'https://github.com/koto-lang/tree-sitter-koto', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@irh' }, + tier = 3, + }, + + kusto = { + install_info = { + url = 'https://github.com/Willem-J-an/tree-sitter-kusto', + files = { 'src/parser.c' }, + }, + maintainers = { '@Willem-J-an' }, + tier = 3, + }, + + lalrpop = { + install_info = { + url = 'https://github.com/traxys/tree-sitter-lalrpop', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@traxys' }, + }, + + latex = { + install_info = { + url = 'https://github.com/latex-lsp/tree-sitter-latex', + files = { 'src/parser.c', 'src/scanner.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@theHamsta', '@clason' }, + tier = 3, + }, + + ledger = { + install_info = { + url = 'https://github.com/cbarrete/tree-sitter-ledger', + files = { 'src/parser.c' }, + }, + maintainers = { '@cbarrete' }, + }, + + leo = { + install_info = { + url = 'https://github.com/r001/tree-sitter-leo', + files = { 'src/parser.c' }, + }, + maintainers = { '@r001' }, + tier = 3, + }, + + llvm = { + install_info = { + url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', + files = { 'src/parser.c' }, + }, + maintainers = { '@benwilliamgraham' }, + }, + + linkerscript = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-linkerscript', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + liquid = { + install_info = { + url = 'https://github.com/hankthetank27/tree-sitter-liquid', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@hankthetank27' }, + tier = 3, + }, + + liquidsoap = { + install_info = { + url = 'https://github.com/savonet/tree-sitter-liquidsoap', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@toots' }, + tier = 3, + }, + + lua = { + install_info = { + url = 'https://github.com/MunifTanjim/tree-sitter-lua', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + tier = 1, + maintainers = { '@muniftanjim' }, + }, + + luadoc = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-luadoc', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + luap = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-luap', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + readme_note = 'Lua patterns', + }, + + luau = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-luau', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + m68k = { + install_info = { + url = 'https://github.com/grahambates/tree-sitter-m68k', + files = { 'src/parser.c' }, + }, + maintainers = { '@grahambates' }, + }, + + make = { + install_info = { + url = 'https://github.com/alemuller/tree-sitter-make', + files = { 'src/parser.c' }, + }, + maintainers = { '@lewis6991' }, + }, + + markdown = { + install_info = { + url = 'https://github.com/MDeiml/tree-sitter-markdown', + location = 'tree-sitter-markdown', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@MDeiml' }, + readme_note = 'basic highlighting', + tier = 1, + }, + + markdown_inline = { + install_info = { + url = 'https://github.com/MDeiml/tree-sitter-markdown', + location = 'tree-sitter-markdown-inline', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@MDeiml' }, + readme_note = 'needed for full highlighting', + tier = 1, + }, + + matlab = { + install_info = { + url = 'https://github.com/acristoffers/tree-sitter-matlab', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@acristoffers' }, + }, + + menhir = { + install_info = { + url = 'https://github.com/Kerl13/tree-sitter-menhir', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Kerl13' }, + }, + + mermaid = { + install_info = { + url = 'https://github.com/monaqa/tree-sitter-mermaid', + files = { 'src/parser.c' }, + }, + tier = 4, + }, + + meson = { + install_info = { + url = 'https://github.com/Decodetalkers/tree-sitter-meson', + files = { 'src/parser.c' }, + }, + maintainers = { '@Decodetalkers' }, + }, + + mlir = { + install_info = { + url = 'https://github.com/artagnon/tree-sitter-mlir', + files = { 'src/parser.c' }, + requires_generate_from_grammar = true, + }, + tier = 4, + maintainers = { '@artagnon' }, + }, + + muttrc = { + install_info = { + url = 'https://github.com/neomutt/tree-sitter-muttrc', + files = { 'src/parser.c' }, + }, + maintainers = { '@Freed-Wu' }, + tier = 3, + }, + + nasm = { + install_info = { + url = 'https://github.com/naclsn/tree-sitter-nasm', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + nginx = { + install_info = { + url = 'https://github.com/opa-oz/tree-sitter-nginx', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@opa-oz' }, + tier = 3, + }, + + nickel = { + install_info = { + url = 'https://github.com/nickel-lang/tree-sitter-nickel', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + }, + + nim = { + install_info = { + url = 'https://github.com/alaviss/tree-sitter-nim', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@aMOPel' }, + tier = 3, + }, + + nim_format_string = { + install_info = { + url = 'https://github.com/aMOPel/tree-sitter-nim-format-string', + files = { 'src/parser.c' }, + }, + maintainers = { '@aMOPel' }, + tier = 3, + }, + + ninja = { + install_info = { + url = 'https://github.com/alemuller/tree-sitter-ninja', + files = { 'src/parser.c' }, + }, + maintainers = { '@alemuller' }, + }, + + nix = { + install_info = { + url = 'https://github.com/cstrahan/tree-sitter-nix', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@leo60228' }, + }, + + norg = { + install_info = { + url = 'https://github.com/nvim-neorg/tree-sitter-norg', + files = { 'src/parser.c', 'src/scanner.cc' }, + use_makefile = true, + }, + tier = 4, + maintainers = { '@JoeyGrajciar', '@vhyrro' }, + }, + + nqc = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-nqc', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + nu = { + install_info = { + url = 'https://github.com/nushell/tree-sitter-nu', + files = { 'src/parser.c' }, + }, + maintainers = { '@abhisheksingh0x558' }, + tier = 3, + }, + + objc = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-objc', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + objdump = { + install_info = { + url = 'https://github.com/ColinKennedy/tree-sitter-objdump', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ColinKennedy' }, + tier = 3, + }, + + ocaml = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-ocaml', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'grammars/ocaml', + }, + maintainers = { '@undu' }, + }, + + ocaml_interface = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-ocaml', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'grammars/interface', + }, + maintainers = { '@undu' }, + }, + + ocamllex = { + install_info = { + url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', + files = { 'src/parser.c', 'src/scanner.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@undu' }, + }, + + odin = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-odin', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + pascal = { + install_info = { + url = 'https://github.com/Isopod/tree-sitter-pascal', + files = { 'src/parser.c' }, + }, + maintainers = { '@Isopod' }, + }, + + passwd = { + install_info = { + url = 'https://github.com/ath3/tree-sitter-passwd', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + pem = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-pem', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + perl = { + install_info = { + url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', + branch = 'release', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@RabbiVeesh', '@LeoNerd' }, + }, + + php = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-php', + location = 'php', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@tk-shirasaka', '@calebdw' }, + requires = { 'php_only' }, + readme_note = 'PHP with embedded HTML', + }, + + php_only = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-php', + location = 'php_only', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@tk-shirasaka', '@calebdw' }, + readme_note = 'PHP without embedded HTML', + }, + + phpdoc = { + install_info = { + url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@mikehaertl' }, + tier = 4, + }, + + pioasm = { + install_info = { + url = 'https://github.com/leo60228/tree-sitter-pioasm', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@leo60228' }, + }, + + po = { + install_info = { + url = 'https://github.com/erasin/tree-sitter-po', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + pod = { + install_info = { + url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', + files = { 'src/parser.c', 'src/scanner.c' }, + branch = 'release', + }, + maintainers = { '@RabbiVeesh', '@LeoNerd' }, + tier = 3, + }, + + poe_filter = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-poe-filter', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + readme_note = 'Path of Exile item filter', + tier = 4, + }, + + pony = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-pony', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq', '@mfelsche' }, + }, + + powershell = { + install_info = { + url = 'https://github.com/airbus-cert/tree-sitter-powershell', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + filetype = 'ps1', + maintainers = { '@L2jLiga' }, + tier = 3, + }, + + printf = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-printf', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + prisma = { + install_info = { + url = 'https://github.com/victorhqc/tree-sitter-prisma', + files = { 'src/parser.c' }, + }, + maintainers = { '@elianiva' }, + }, + + problog = { + install_info = { + url = 'https://github.com/foxyseta/tree-sitter-prolog', + files = { 'src/parser.c' }, + location = 'grammars/problog', + }, + maintainers = { '@foxyseta' }, + requires = { 'prolog' }, + tier = 3, + }, + + prolog = { + install_info = { + url = 'https://github.com/foxyseta/tree-sitter-prolog', + files = { 'src/parser.c' }, + location = 'grammars/prolog', + }, + maintainers = { '@foxyseta' }, + tier = 3, + }, + + properties = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-properties', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + readme_note = 'Java properties files', + }, + + proto = { + install_info = { + url = 'https://github.com/treywood/tree-sitter-proto', + files = { 'src/parser.c' }, + }, + maintainers = { '@treywood' }, + }, + + promql = { + install_info = { + url = 'https://github.com/MichaHoffmann/tree-sitter-promql', + files = { 'src/parser.c' }, + }, + maintainers = { '@MichaHoffmann' }, + tier = 4, + }, + + prql = { + install_info = { + url = 'https://github.com/PRQL/tree-sitter-prql', + files = { 'src/parser.c' }, + }, + maintainers = { '@matthias-Q' }, + }, + + psv = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-csv', + files = { 'src/parser.c' }, + location = 'psv', + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + pug = { + install_info = { + url = 'https://github.com/zealot128/tree-sitter-pug', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@zealot128' }, + tier = 4, + }, + + puppet = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-puppet', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + purescript = { + install_info = { + url = 'https://github.com/postsolar/tree-sitter-purescript', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@postsolar' }, + tier = 3, + }, + + pymanifest = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-pymanifest', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + readme_name = 'PyPA manifest', + tier = 2, + }, + + python = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-python', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@stsewd', '@theHamsta' }, + }, + + ql = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-ql', + files = { 'src/parser.c' }, + }, + maintainers = { '@pwntester' }, + }, + + qmldir = { + install_info = { + url = 'https://github.com/Decodetalkers/tree-sitter-qmldir', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + + qmljs = { + install_info = { + url = 'https://github.com/yuja/tree-sitter-qmljs', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Decodetalkers' }, + }, + + query = { + install_info = { + url = 'https://github.com/nvim-treesitter/tree-sitter-query', + files = { 'src/parser.c' }, + }, + maintainers = { '@steelsojka' }, + readme_note = 'Tree-sitter query language', + tier = 1, + }, + + r = { + install_info = { + url = 'https://github.com/r-lib/tree-sitter-r', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ribru17' }, + tier = 3, + }, + + racket = { + install_info = { + url = 'https://github.com/6cdh/tree-sitter-racket', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + tier = 4, + }, + + ralph = { + install_info = { + url = 'https://github.com/alephium/tree-sitter-ralph', + files = { 'src/parser.c' }, + }, + maintainers = { '@tdroxler' }, + tier = 3, + }, + + rasi = { + install_info = { + url = 'https://github.com/Fymyte/tree-sitter-rasi', + files = { 'src/parser.c' }, + }, + maintainers = { '@Fymyte' }, + }, + + razor = { + install_info = { + url = 'https://github.com/tris203/tree-sitter-razor', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@tris203' }, + tier = 3, + }, + + rbs = { + install_info = { + url = 'https://github.com/joker1007/tree-sitter-rbs', + files = { 'src/parser.c' }, + }, + maintainers = { '@joker1007' }, + tier = 3, + }, + + re2c = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-re2c', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + readline = { + install_info = { + url = 'https://github.com/ribru17/tree-sitter-readline', + files = { 'src/parser.c' }, + }, + maintainers = { '@ribru17' }, + tier = 3, + }, + + regex = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-regex', + files = { 'src/parser.c' }, + }, + maintainers = { '@theHamsta' }, + }, + + rego = { + install_info = { + url = 'https://github.com/FallenAngel97/tree-sitter-rego', + files = { 'src/parser.c' }, + }, + maintainers = { '@FallenAngel97' }, + }, + + requirements = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-requirements', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + readme_name = 'pip requirements', + tier = 2, + }, + + rescript = { + install_info = { + url = 'https://github.com/rescript-lang/tree-sitter-rescript', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ribru17' }, + tier = 2, + }, + + rnoweb = { + install_info = { + url = 'https://github.com/bamonroe/tree-sitter-rnoweb', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@bamonroe' }, + }, + + robot = { + install_info = { + url = 'https://github.com/Hubro/tree-sitter-robot', + files = { 'src/parser.c' }, + }, + maintainers = { '@Hubro' }, + tier = 3, + }, + + robots = { + install_info = { + url = 'https://github.com/opa-oz/tree-sitter-robots-txt', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@opa-oz' }, + tier = 3, + }, + + roc = { + install_info = { + url = 'https://github.com/faldor20/tree-sitter-roc', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@nat-418' }, + tier = 3, + }, + + ron = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-ron', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + rst = { + install_info = { + url = 'https://github.com/stsewd/tree-sitter-rst', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@stsewd' }, + }, + + ruby = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-ruby', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@TravonteD' }, + }, + + runescript = { + install_info = { + url = 'https://github.com/2004Scape/tree-sitter-runescript', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@2004Scape' }, + tier = 3, + }, + + rust = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-rust', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + scala = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-scala', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@stevanmilic' }, + }, + + scfg = { + install_info = { + url = 'https://github.com/rockorager/tree-sitter-scfg', + files = { 'src/parser.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@WhyNotHugo' }, + tier = 3, + }, + + scheme = { + install_info = { + url = 'https://github.com/6cdh/tree-sitter-scheme', + files = { 'src/parser.c' }, + }, + tier = 4, + }, + + scss = { + install_info = { + url = 'https://github.com/serenadeai/tree-sitter-scss', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@elianiva' }, + }, + + sflog = { + install_info = { + url = 'https://github.com/aheber/tree-sitter-sfapex', + files = { 'src/parser.c' }, + location = 'sflog', + }, + maintainers = { '@aheber', '@xixiaofinland' }, + readme_note = 'Salesforce debug log', + tier = 3, + }, + slang = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-slang', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + readme_note = 'Shader Slang', + maintainers = { '@theHamsta' }, + tier = 4, + }, + + slim = { + install_info = { + url = 'https://github.com/theoo/tree-sitter-slim', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@theoo' }, + tier = 3, + }, + + slint = { + install_info = { + url = 'https://github.com/slint-ui/tree-sitter-slint', + files = { 'src/parser.c' }, + }, + maintainers = { '@hunger' }, + tier = 3, + }, + + smali = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-smali', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 3, + }, + + snakemake = { + install_info = { + url = 'https://github.com/osthomas/tree-sitter-snakemake', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainer = { '@osthomas' }, + tier = 4, + }, + + smithy = { + install_info = { + url = 'https://github.com/indoorvivants/tree-sitter-smithy', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq', '@keynmol' }, + }, + + solidity = { + install_info = { + url = 'https://github.com/JoranHonig/tree-sitter-solidity', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + }, + soql = { + install_info = { + url = 'https://github.com/aheber/tree-sitter-sfapex', + files = { 'src/parser.c' }, + location = 'soql', + }, + maintainers = { '@aheber', '@xixiafinland' }, + tier = 3, + }, + + sosl = { + install_info = { + url = 'https://github.com/aheber/tree-sitter-sfapex', + files = { 'src/parser.c' }, + location = 'sosl', + }, + maintainers = { '@aheber', '@xixiafinland' }, + }, + + sourcepawn = { + install_info = { + url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Sarrus1' }, + tier = 3, + }, + + sparql = { + install_info = { + url = 'https://github.com/GordianDziwis/tree-sitter-sparql', + files = { 'src/parser.c' }, + }, + maintainers = { '@GordianDziwis' }, + }, + + sql = { + install_info = { + url = 'https://github.com/derekstride/tree-sitter-sql', + files = { 'src/parser.c', 'src/scanner.c' }, + branch = 'gh-pages', + }, + maintainers = { '@derekstride' }, + }, + + squirrel = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-squirrel', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + ssh_config = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-ssh-config', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + starlark = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-starlark', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + strace = { + install_info = { + url = 'https://github.com/sigmaSd/tree-sitter-strace', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + styled = { + install_info = { + url = 'https://github.com/mskelton/tree-sitter-styled', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@mskelton' }, + tier = 3, + }, + + supercollider = { + install_info = { + url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@madskjeldgaard' }, + }, + + superhtml = { + install_info = { + url = 'https://github.com/kristoff-it/superhtml', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'tree-sitter-superhtml', + }, + maintainers = { '@rockorager' }, + tier = 3, + }, + + surface = { + install_info = { + url = 'https://github.com/connorlay/tree-sitter-surface', + files = { 'src/parser.c' }, + }, + maintainers = { '@connorlay' }, + }, + + svelte = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + sway = { + install_info = { + url = 'https://github.com/FuelLabs/tree-sitter-sway.git', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ribru17' }, + tier = 2, + }, + + swift = { + install_info = { + url = 'https://github.com/alex-pinkus/tree-sitter-swift', + files = { 'src/parser.c', 'src/scanner.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@alex-pinkus' }, + }, + + sxhkdrc = { + install_info = { + url = 'https://github.com/RaafatTurki/tree-sitter-sxhkdrc', + files = { 'src/parser.c' }, + }, + maintainers = { '@RaafatTurki' }, + }, + + systemtap = { + install_info = { + url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', + files = { 'src/parser.c' }, + }, + maintainers = { '@ok-ryoko' }, + tier = 3, + }, + + t32 = { + install_info = { + url = 'https://gitlab.com/xasc/tree-sitter-t32.git', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@xasc' }, + tier = 3, + }, + + tablegen = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-tablegen', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + tact = { + install_info = { + url = 'https://github.com/tact-lang/tree-sitter-tact', + files = { 'src/parser.c' }, + }, + maintainers = { '@novusnota' }, + tier = 3, + }, + + teal = { + install_info = { + url = 'https://github.com/euclidianAce/tree-sitter-teal', + files = { 'src/parser.c', 'src/scanner.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@euclidianAce' }, + }, + + templ = { + install_info = { + url = 'https://github.com/vrischmann/tree-sitter-templ', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@vrischmann' }, + tier = 3, + }, + + tcl = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@lewis6991' }, + tier = 2, + }, + + tera = { + install_info = { + url = 'https://github.com/uncenter/tree-sitter-tera', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@uncenter' }, + tier = 2, + }, + + terraform = { + install_info = { + url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'dialects/terraform', + }, + maintainers = { '@MichaHoffmann' }, + }, + + textproto = { + install_info = { + url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', + files = { 'src/parser.c' }, + }, + maintainers = { '@Porter' }, + tier = 3, + }, + + thrift = { + install_info = { + url = 'https://github.com/duskmoon314/tree-sitter-thrift', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq', '@duskmoon314' }, + }, + + tiger = { + install_info = { + url = 'https://github.com/ambroisie/tree-sitter-tiger', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ambroisie' }, + }, + + tlaplus = { + install_info = { + url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@ahelwer', '@susliko' }, + }, + + tmux = { + install_info = { + url = 'https://github.com/Freed-Wu/tree-sitter-tmux', + files = { 'src/parser.c' }, + }, + maintainers = { '@Freed-Wu' }, + tier = 3, + }, + + todotxt = { + install_info = { + url = 'https://github.com/arnarg/tree-sitter-todotxt', + files = { 'src/parser.c' }, + }, + maintainers = { '@arnarg' }, + tier = 4, + }, + + toml = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@tk-shirasaka' }, + }, + + tsv = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-csv', + files = { 'src/parser.c' }, + location = 'tsv', + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + tsx = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-typescript', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'tsx', + generate_requires_npm = true, + }, + maintainers = { '@steelsojka' }, + }, + + turtle = { + install_info = { + url = 'https://github.com/GordianDziwis/tree-sitter-turtle', + files = { 'src/parser.c' }, + }, + maintainers = { '@GordianDziwis' }, + }, + + twig = { + install_info = { + url = 'https://github.com/gbprod/tree-sitter-twig', + files = { 'src/parser.c' }, + }, + maintainers = { '@gbprod' }, + }, + + typescript = { + install_info = { + url = 'https://github.com/tree-sitter/tree-sitter-typescript', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'typescript', + generate_requires_npm = true, + }, + maintainers = { '@steelsojka' }, + }, + + typespec = { + install_info = { + url = 'https://github.com/happenslol/tree-sitter-typespec', + files = { 'src/parser.c' }, + }, + maintainers = { '@happenslol' }, + tier = 3, + }, + + typoscript = { + install_info = { + url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', + files = { 'src/parser.c' }, + }, + maintainers = { '@Teddytrombone' }, + tier = 3, + }, + + typst = { + install_info = { + url = 'https://github.com/uben0/tree-sitter-typst', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@uben0', '@RaafatTurki' }, + tier = 3, + }, + + udev = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-udev', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + ungrammar = { + install_info = { + url = 'https://github.com/Philipp-M/tree-sitter-ungrammar', + files = { 'src/parser.c' }, + }, + maintainers = { '@Philipp-M', '@amaanq' }, + }, + + unison = { + install_info = { + url = 'https://github.com/kylegoetz/tree-sitter-unison', + files = { 'src/parser.c', 'src/scanner.c' }, + requires_generate_from_grammar = true, + }, + maintainers = { '@tapegram' }, + tier = 4, + }, + + usd = { + install_info = { + url = 'https://github.com/ColinKennedy/tree-sitter-usd', + files = { 'src/parser.c' }, + }, + maintainers = { '@ColinKennedy' }, + }, + + uxntal = { + install_info = { + url = 'https://github.com/amaanq/tree-sitter-uxntal', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + }, + + v = { + install_info = { + url = 'https://github.com/vlang/v-analyzer', + files = { 'src/parser.c' }, + location = 'tree_sitter_v', + }, + maintainers = { '@kkharji', '@amaanq' }, + }, + + vala = { + install_info = { + url = 'https://github.com/vala-lang/tree-sitter-vala', + files = { 'src/parser.c' }, + }, + maintainers = { '@Prince781' }, + }, + + vento = { + install_info = { + url = 'https://github.com/ventojs/tree-sitter-vento', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@wrapperup', '@oscarotero' }, + tier = 3, + }, + + verilog = { + install_info = { + url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', + files = { 'src/parser.c' }, + }, + maintainers = { '@zhangwwpeng' }, + }, + + vhdl = { + install_info = { + url = 'https://github.com/jpt13653903/tree-sitter-vhdl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@jpt13653903' }, + tier = 3, + }, + + vhs = { + install_info = { + url = 'https://github.com/charmbracelet/tree-sitter-vhs', + files = { 'src/parser.c' }, + }, + maintainers = { '@caarlos0' }, + }, + + vim = { + install_info = { + url = 'https://github.com/neovim/tree-sitter-vim', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@clason' }, + tier = 1, + }, + + vimdoc = { + install_info = { + url = 'https://github.com/neovim/tree-sitter-vimdoc', + files = { 'src/parser.c' }, + }, + maintainers = { '@clason' }, + tier = 1, + }, + + vrl = { + install_info = { + url = 'https://github.com/belltoy/tree-sitter-vrl', + files = { 'src/parser.c' }, + }, + maintainers = { '@belltoy' }, + tier = 3, + }, + + vue = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', + files = { 'src/parser.c', 'src/scanner.c' }, + branch = 'main', + }, + maintainers = { '@WhyNotHugo', '@lucario387' }, + tier = 2, + }, + + wing = { + install_info = { + url = 'https://github.com/winglang/tree-sitter-wing', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@gshpychka', '@MarkMcCulloh' }, + tier = 3, + }, + + wgsl = { + install_info = { + url = 'https://github.com/szebniok/tree-sitter-wgsl', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@szebniok' }, + }, + + wgsl_bevy = { + install_info = { + url = 'https://github.com/theHamsta/tree-sitter-wgsl-bevy', + files = { 'src/parser.c', 'src/scanner.c' }, + generate_requires_npm = true, + }, + maintainers = { '@theHamsta' }, + }, + + wit = { + install_info = { + url = 'https://github.com/liamwh/tree-sitter-wit', + files = { 'src/parser.c' }, + }, + maintainers = { '@liamwh' }, + tier = 3, + }, + xcompose = { + install_info = { + url = 'https://github.com/ObserverOfTime/tree-sitter-xcompose', + files = { 'src/parser.c' }, + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + xml = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', + files = { 'src/parser.c', 'src/scanner.c' }, + location = 'xml', + }, + maintainers = { '@ObserverOfTime' }, + tier = 2, + }, + + xresources = { + install_info = { + url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', + files = { 'src/parser.c' }, + }, + filetype = 'xdefaults', + maintainers = { '@ValdezFOmar' }, + tier = 3, + }, + + yaml = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@amaanq' }, + tier = 2, + }, + + yang = { + install_info = { + url = 'https://github.com/Hubro/tree-sitter-yang', + files = { 'src/parser.c' }, + }, + maintainers = { '@Hubro' }, + }, + + yuck = { + install_info = { + url = 'https://github.com/Philipp-M/tree-sitter-yuck', + files = { 'src/parser.c', 'src/scanner.c' }, + }, + maintainers = { '@Philipp-M', '@amaanq' }, + }, + + zathurarc = { + install_info = { + url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', + files = { 'src/parser.c' }, + }, + maintainers = { '@Freed-Wu' }, + tier = 3, + }, + + zig = { + install_info = { + url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', + files = { 'src/parser.c' }, + }, + maintainers = { '@amaanq' }, + tier = 1, + }, + + ziggy = { + install_info = { + url = 'https://github.com/kristoff-it/ziggy', + files = { 'src/parser.c' }, + location = 'tree-sitter-ziggy', + }, + maintainers = { '@rockorager' }, + tier = 3, + }, + + ziggy_schema = { + install_info = { + url = 'https://github.com/kristoff-it/ziggy', + files = { 'src/parser.c' }, + location = 'tree-sitter-ziggy-schema', + }, + maintainers = { '@rockorager' }, + tier = 3, + }, +} -- Get a list of all available parsers +---@param tier integer? only get parsers of specified tier ---@return string[] -function M.available_parsers() - local parsers = vim.tbl_keys(M.list) +function M.get_available(tier) + local parsers = vim.tbl_keys(M.configs) table.sort(parsers) - if vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 then - return parsers - else - return vim.tbl_filter(function(p) ---@param p string - return not M.list[p].install_info.requires_generate_from_grammar + if tier then + parsers = vim.iter.filter(function(p) + return M.configs[p].tier == tier end, parsers) end -end - -function M.get_parser_configs() - return M.list -end - -local parser_files - -function M.reset_cache() - parser_files = setmetatable({}, { - __index = function(tbl, key) - rawset(tbl, key, api.nvim_get_runtime_file("parser/" .. key .. ".*", false)) - return rawget(tbl, key) - end, - }) -end - -M.reset_cache() - -function M.has_parser(lang) - lang = lang or M.get_buf_lang(api.nvim_get_current_buf()) - - if not lang or #lang == 0 then - return false + if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then + parsers = vim.iter.filter(function(p) + return not M.configs[p].install_info.requires_generate_from_grammar + end, parsers) end - -- HACK: nvim internal API - if vim._ts_has_language(lang) then - return true - end - return #parser_files[lang] > 0 -end - -function M.get_parser(bufnr, lang) - bufnr = bufnr or api.nvim_get_current_buf() - lang = lang or M.get_buf_lang(bufnr) - - if M.has_parser(lang) then - return ts.get_parser(bufnr, lang) - end -end - --- @deprecated This is only kept for legacy purposes. --- All root nodes should be accounted for. -function M.get_tree_root(bufnr) - bufnr = bufnr or api.nvim_get_current_buf() - return M.get_parser(bufnr):parse()[1]:root() -end - --- Gets the language of a given buffer ----@param bufnr number? or current buffer ----@return string -function M.get_buf_lang(bufnr) - bufnr = bufnr or api.nvim_get_current_buf() - return M.ft_to_lang(api.nvim_buf_get_option(bufnr, "ft")) + return parsers end return M diff --git a/lua/nvim-treesitter/query.lua b/lua/nvim-treesitter/query.lua index 4aba9f2fd..f7e5205f7 100644 --- a/lua/nvim-treesitter/query.lua +++ b/lua/nvim-treesitter/query.lua @@ -1,154 +1,7 @@ -local api = vim.api -local ts = require "nvim-treesitter.compat" -local tsrange = require "nvim-treesitter.tsrange" -local utils = require "nvim-treesitter.utils" -local parsers = require "nvim-treesitter.parsers" -local caching = require "nvim-treesitter.caching" - local M = {} local EMPTY_ITER = function() end -M.built_in_query_groups = { "highlights", "locals", "folds", "indents", "injections" } - --- Creates a function that checks whether a given query exists --- for a specific language. ----@param query string ----@return fun(string): boolean -local function get_query_guard(query) - return function(lang) - return M.has_query_files(lang, query) - end -end - -for _, query in ipairs(M.built_in_query_groups) do - M["has_" .. query] = get_query_guard(query) -end - ----@return string[] -function M.available_query_groups() - local query_files = api.nvim_get_runtime_file("queries/*/*.scm", true) - local groups = {} - for _, f in ipairs(query_files) do - groups[vim.fn.fnamemodify(f, ":t:r")] = true - end - local list = {} - for k, _ in pairs(groups) do - table.insert(list, k) - end - return list -end - -do - local query_cache = caching.create_buffer_cache() - - local function update_cached_matches(bufnr, changed_tick, query_group) - query_cache.set(query_group, bufnr, { - tick = changed_tick, - cache = M.collect_group_results(bufnr, query_group) or {}, - }) - end - - ---@param bufnr integer - ---@param query_group string - ---@return any - function M.get_matches(bufnr, query_group) - bufnr = bufnr or api.nvim_get_current_buf() - local cached_local = query_cache.get(query_group, bufnr) - if not cached_local or api.nvim_buf_get_changedtick(bufnr) > cached_local.tick then - update_cached_matches(bufnr, api.nvim_buf_get_changedtick(bufnr), query_group) - end - - return query_cache.get(query_group, bufnr).cache - end -end - ----@param lang string ----@param query_name string ----@return string[] -local function runtime_queries(lang, query_name) - return api.nvim_get_runtime_file(string.format("queries/%s/%s.scm", lang, query_name), true) or {} -end - ----@type table> -local query_files_cache = {} - ----@param lang string ----@param query_name string ----@return boolean -function M.has_query_files(lang, query_name) - if not query_files_cache[lang] then - query_files_cache[lang] = {} - end - if query_files_cache[lang][query_name] == nil then - local files = runtime_queries(lang, query_name) - query_files_cache[lang][query_name] = files and #files > 0 - end - return query_files_cache[lang][query_name] -end - -do - local mt = {} - mt.__index = function(tbl, key) - if rawget(tbl, key) == nil then - rawset(tbl, key, {}) - end - return rawget(tbl, key) - end - - -- cache will auto set the table for each lang if it is nil - ---@type table> - local cache = setmetatable({}, mt) - - -- Same as `vim.treesitter.query` except will return cached values - ---@param lang string - ---@param query_name string - function M.get_query(lang, query_name) - if cache[lang][query_name] == nil then - cache[lang][query_name] = ts.get_query(lang, query_name) - end - - return cache[lang][query_name] - end - - -- Invalidates the query file cache. - -- - -- If lang and query_name is both present, will reload for only the lang and query_name. - -- If only lang is present, will reload all query_names for that lang - -- If none are present, will reload everything - ---@param lang? string - ---@param query_name? string - function M.invalidate_query_cache(lang, query_name) - if lang and query_name then - cache[lang][query_name] = nil - if query_files_cache[lang] then - query_files_cache[lang][query_name] = nil - end - elseif lang and not query_name then - query_files_cache[lang] = nil - for query_name0, _ in pairs(cache[lang]) do - M.invalidate_query_cache(lang, query_name0) - end - elseif not lang and not query_name then - query_files_cache = {} - for lang0, _ in pairs(cache) do - for query_name0, _ in pairs(cache[lang0]) do - M.invalidate_query_cache(lang0, query_name0) - end - end - else - error "Cannot have query_name by itself!" - end - end -end - --- This function is meant for an autocommand and not to be used. Only use if file is a query file. ----@param fname string -function M.invalidate_query_file(fname) - local fnamemodify = vim.fn.fnamemodify - M.invalidate_query_cache(fnamemodify(fname, ":p:h:t"), fnamemodify(fname, ":t:r")) -end - ---@class QueryInfo ---@field root TSNode ---@field source integer @@ -161,13 +14,13 @@ end ---@param root_lang string|nil ---@return Query|nil, QueryInfo|nil local function prepare_query(bufnr, query_name, root, root_lang) - local buf_lang = parsers.get_buf_lang(bufnr) - + 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 = parsers.get_parser(bufnr, buf_lang) + local parser = vim.treesitter.get_parser(bufnr, buf_lang) if not parser then return end @@ -198,7 +51,7 @@ local function prepare_query(bufnr, query_name, root, root_lang) return end - local query = M.get_query(root_lang, query_name) + local query = vim.treesitter.query.get(root_lang, query_name) if not query then return end @@ -241,7 +94,7 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) ---@return string[] local function split(to_split) local t = {} - for str in string.gmatch(to_split, "([^.]+)") do + for str in string.gmatch(to_split, '([^.]+)') do table.insert(t, str) end @@ -259,9 +112,9 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) 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") + local path = split(name .. '.node') M.insert_to_path(prepared_match, path, node) - local metadata_path = split(name .. ".metadata") + local metadata_path = split(name .. '.metadata') M.insert_to_path(prepared_match, metadata_path, metadata[id]) end end @@ -272,16 +125,9 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) if preds then for _, pred in pairs(preds) do -- functions - if pred[1] == "set!" and type(pred[2]) == "string" then + if pred[1] == 'set!' and type(pred[2]) == 'string' then M.insert_to_path(prepared_match, split(pred[2]), pred[3]) end - if pred[1] == "make-range!" and type(pred[2]) == "string" and #pred == 4 then - M.insert_to_path( - prepared_match, - split(pred[2] .. ".node"), - tsrange.TSRange.from_nodes(bufnr, match[pred[3]], match[pred[4]]) - ) - end end end @@ -291,103 +137,6 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) return iterator end --- Return all nodes corresponding to a specific capture path (like @definition.var, @reference.type) --- Works like M.get_references or M.get_scopes except you can choose the capture --- Can also be a nested capture like @definition.function to get all nodes defining a function. --- ----@param bufnr integer the buffer ----@param captures string|string[] ----@param query_group string the name of query group (highlights or injections for example) ----@param root TSNode|nil node from where to start the search ----@param lang string|nil the language from where to get the captures. ---- Root nodes can have several languages. ----@return table|nil -function M.get_capture_matches(bufnr, captures, query_group, root, lang) - if type(captures) == "string" then - captures = { captures } - end - local strip_captures = {} ---@type string[] - for i, capture in ipairs(captures) do - if capture:sub(1, 1) ~= "@" then - error 'Captures must start with "@"' - return - end - -- Remove leading "@". - strip_captures[i] = capture:sub(2) - end - - local matches = {} - for match in M.iter_group_results(bufnr, query_group, root, lang) do - for _, capture in ipairs(strip_captures) do - local insert = utils.get_at_path(match, capture) - if insert then - table.insert(matches, insert) - end - end - end - return matches -end - -function M.iter_captures(bufnr, query_name, root, lang) - local query, params = prepare_query(bufnr, query_name, root, lang) - if not query then - return EMPTY_ITER - end - assert(params) - - local iter = query:iter_captures(params.root, params.source, params.start, params.stop) - - local function wrapped_iter() - local id, node, metadata = iter() - if not id then - return - end - - local name = query.captures[id] - if string.sub(name, 1, 1) == "_" then - return wrapped_iter() - end - - return name, node, metadata - end - - return wrapped_iter -end - ----@param bufnr integer ----@param capture_string string ----@param query_group string ----@param filter_predicate fun(match: table): boolean ----@param scoring_function fun(match: table): number ----@param root TSNode ----@return table|unknown -function M.find_best_match(bufnr, capture_string, query_group, filter_predicate, scoring_function, root) - if string.sub(capture_string, 1, 1) == "@" then - --remove leading "@" - capture_string = string.sub(capture_string, 2) - end - - local best ---@type table|nil - local best_score ---@type number - - for maybe_match in M.iter_group_results(bufnr, query_group, root) do - local match = utils.get_at_path(maybe_match, capture_string) - - if match and filter_predicate(match) then - local current_score = scoring_function(match) - if not best then - best = match - best_score = current_score - end - if current_score > best_score then - best = match - best_score = current_score - end - end - end - return best -end - ---Iterates matches from a query file. ---@param bufnr integer the buffer ---@param query_group string the query file to use @@ -413,41 +162,4 @@ function M.collect_group_results(bufnr, query_group, root, lang) return matches end ----@alias CaptureResFn function(string, LanguageTree, LanguageTree): string, string - --- Same as get_capture_matches except this will recursively get matches for every language in the tree. ----@param bufnr integer The buffer ----@param capture_or_fn string|CaptureResFn The capture to get. If a function is provided then that ---- function will be used to resolve both the capture and query argument. ---- The function can return `nil` to ignore that tree. ----@param query_type string? The query to get the capture from. This is ignored if a function is provided ---- for the capture argument. ----@return table[] -function M.get_capture_matches_recursively(bufnr, capture_or_fn, query_type) - ---@type CaptureResFn - local type_fn - if type(capture_or_fn) == "function" then - type_fn = capture_or_fn - else - type_fn = function(_, _, _) - return capture_or_fn, query_type - end - end - local parser = parsers.get_parser(bufnr) - local matches = {} - - if parser then - parser:for_each_tree(function(tree, lang_tree) - local lang = lang_tree:lang() - local capture, type_ = type_fn(lang, tree, lang_tree) - - if capture then - vim.list_extend(matches, M.get_capture_matches(bufnr, capture, type_, tree:root(), lang) or {}) - end - end) - end - - return matches -end - return M diff --git a/lua/nvim-treesitter/query_predicates.lua b/lua/nvim-treesitter/query_predicates.lua deleted file mode 100644 index 7539170dc..000000000 --- a/lua/nvim-treesitter/query_predicates.lua +++ /dev/null @@ -1,167 +0,0 @@ -local query = require "vim.treesitter.query" - -local html_script_type_languages = { - ["importmap"] = "json", - ["module"] = "javascript", - ["application/ecmascript"] = "javascript", - ["text/ecmascript"] = "javascript", -} - -local non_filetype_match_injection_language_aliases = { - ex = "elixir", - pl = "perl", - sh = "bash", - uxn = "uxntal", - ts = "typescript", -} - --- compatibility shim for breaking change on nightly/0.11 -local opts = vim.fn.has "nvim-0.10" == 1 and { force = true, all = false } or true - -local function get_parser_from_markdown_info_string(injection_alias) - local match = vim.filetype.match { filename = "a." .. injection_alias } - return match or non_filetype_match_injection_language_aliases[injection_alias] or injection_alias -end - -local function error(str) - vim.api.nvim_err_writeln(str) -end - -local function valid_args(name, pred, count, strict_count) - local arg_count = #pred - 1 - - if strict_count then - if arg_count ~= count then - error(string.format("%s must have exactly %d arguments", name, count)) - return false - end - elseif arg_count < count then - error(string.format("%s must have at least %d arguments", name, count)) - return false - end - - return true -end - ----@param match (TSNode|nil)[] ----@param _pattern string ----@param _bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_predicate("nth?", function(match, _pattern, _bufnr, pred) - if not valid_args("nth?", pred, 2, true) then - return - end - - local node = match[pred[2]] ---@type TSNode - local n = tonumber(pred[3]) - if node and node:parent() and node:parent():named_child_count() > n then - return node:parent():named_child(n) == node - end - - return false -end, opts) - ----@param match (TSNode|nil)[] ----@param _pattern string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_predicate("is?", function(match, _pattern, bufnr, pred) - if not valid_args("is?", pred, 2) then - return - end - - -- Avoid circular dependencies - local locals = require "nvim-treesitter.locals" - local node = match[pred[2]] - local types = { unpack(pred, 3) } - - if not node then - return true - end - - local _, _, kind = locals.find_definition(node, bufnr) - - return vim.tbl_contains(types, kind) -end, opts) - ----@param match (TSNode|nil)[] ----@param _pattern string ----@param _bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_predicate("kind-eq?", function(match, _pattern, _bufnr, pred) - if not valid_args(pred[1], pred, 2) then - return - end - - local node = match[pred[2]] - local types = { unpack(pred, 3) } - - if not node then - return true - end - - return vim.tbl_contains(types, node:type()) -end, opts) - ----@param match (TSNode|nil)[] ----@param _ string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_directive("set-lang-from-mimetype!", function(match, _, bufnr, pred, metadata) - local capture_id = pred[2] - local node = match[capture_id] - if not node then - return - end - local type_attr_value = vim.treesitter.get_node_text(node, bufnr) - local configured = html_script_type_languages[type_attr_value] - if configured then - metadata["injection.language"] = configured - else - local parts = vim.split(type_attr_value, "/", {}) - metadata["injection.language"] = parts[#parts] - end -end, opts) - ----@param match (TSNode|nil)[] ----@param _ string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_directive("set-lang-from-info-string!", function(match, _, bufnr, pred, metadata) - local capture_id = pred[2] - local node = match[capture_id] - if not node then - return - end - local injection_alias = vim.treesitter.get_node_text(node, bufnr):lower() - metadata["injection.language"] = get_parser_from_markdown_info_string(injection_alias) -end, opts) - --- Just avoid some annoying warnings for this directive -query.add_directive("make-range!", function() end, opts) - ---- transform node text to lower case (e.g., to make @injection.language case insensitive) ---- ----@param match (TSNode|nil)[] ----@param _ string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_directive("downcase!", function(match, _, bufnr, pred, metadata) - local id = pred[2] - local node = match[id] - if not node then - return - end - - local text = vim.treesitter.get_node_text(node, bufnr, { metadata = metadata[id] }) or "" - if not metadata[id] then - metadata[id] = {} - end - metadata[id].text = string.lower(text) -end, opts) diff --git a/lua/nvim-treesitter/shell_cmds.lua b/lua/nvim-treesitter/shell_cmds.lua new file mode 100644 index 000000000..2dc7f8748 --- /dev/null +++ b/lua/nvim-treesitter/shell_cmds.lua @@ -0,0 +1,255 @@ +local uv = vim.loop +local utils = require('nvim-treesitter.utils') + +local iswin = uv.os_uname().sysname == 'Windows_NT' + +local M = {} + +---@param executables string[] +---@return string|nil +function M.select_executable(executables) + return vim.tbl_filter(function(c) ---@param c string + return c ~= vim.NIL and vim.fn.executable(c) == 1 + end, executables)[1] +end + +-- Returns the compiler arguments based on the compiler and OS +---@param repo InstallInfo +---@param compiler string +---@return string[] +function M.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', + } + elseif compiler:find('zig$') or compiler:find('zig.exe$') then + return { + 'c++', + '-o', + 'parser.so', + repo.files, + '-lc', + '-Isrc', + '-shared', + '-Os', + } + else + local args = { + '-o', + 'parser.so', + '-I./src', + repo.files, + '-Os', + } + if uv.os_uname().sysname == 'Darwin' then + table.insert(args, '-bundle') + else + table.insert(args, '-shared') + end + if + #vim.tbl_filter(function(file) ---@param file string + local ext = vim.fn.fnamemodify(file, ':e') + return ext == 'cc' or ext == 'cpp' or ext == 'cxx' + end, repo.files) > 0 + then + table.insert(args, '-lstdc++') + end + if not iswin then + table.insert(args, '-fPIC') + end + return args + end +end + +-- Returns the compile command based on the OS and user options +---@param repo InstallInfo +---@param cc string +---@param compile_location string +---@return Command +function M.select_compile_command(repo, cc, compile_location) + local make = M.select_executable({ 'gmake', 'make' }) + if cc:find('cl$') or cc:find('cl.exe$') or not repo.use_makefile or iswin or not make then + return { + cmd = cc, + info = 'Compiling...', + err = 'Error during compilation', + opts = { + args = vim.tbl_flatten(M.select_compiler_args(repo, cc)), + cwd = compile_location, + }, + } + else + return { + cmd = make, + info = 'Compiling...', + err = 'Error during compilation', + opts = { + args = { + '--makefile=' .. utils.get_package_path('scripts', 'compile_parsers.makefile'), + 'CC=' .. cc, + }, + cwd = compile_location, + }, + } + end +end + +---@param repo InstallInfo +---@param project_name string +---@param cache_dir string +---@param revision string|nil +---@param prefer_git boolean +---@return table +function M.select_download_commands(repo, project_name, cache_dir, revision, prefer_git) + local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 + local is_github = repo.url:find('github.com', 1, true) + local is_gitlab = repo.url:find('gitlab.com', 1, true) + local project_dir = utils.join_path(cache_dir, project_name) + + revision = revision or repo.branch or 'master' + + if can_use_tar and (is_github or is_gitlab) and not prefer_git then + local url = repo.url:gsub('.git$', '') + + local dir_rev = revision + if is_github and revision:find('^v%d') then + dir_rev = revision:sub(2) + end + + local temp_dir = project_dir .. '-tmp' + + return { + { + cmd = function() + vim.fn.delete(temp_dir, 'rf') + end, + }, + { + cmd = 'curl', + info = 'Downloading ' .. project_name .. '...', + err = 'Error during download, please verify your internet connection', + opts = { + args = { + '--silent', + '-L', -- follow redirects + is_github and url .. '/archive/' .. revision .. '.tar.gz' + or url + .. '/-/archive/' + .. revision + .. '/' + .. project_name + .. '-' + .. revision + .. '.tar.gz', + '--output', + project_name .. '.tar.gz', + }, + cwd = cache_dir, + }, + }, + { + cmd = function() + --TODO(clason): use vim.fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created + uv.fs_mkdir(temp_dir, 493) + end, + info = 'Creating temporary directory', + err = 'Could not create ' .. project_name .. '-tmp', + }, + { + cmd = 'tar', + info = 'Extracting ' .. project_name .. '...', + err = 'Error during tarball extraction.', + opts = { + args = { + '-xvzf', + project_name .. '.tar.gz', + '-C', + project_name .. '-tmp', + }, + cwd = cache_dir, + }, + }, + { + cmd = function() + uv.fs_unlink(project_dir .. '.tar.gz') + end, + }, + { + cmd = function() + uv.fs_rename( + utils.join_path(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), + project_dir + ) + end, + }, + { + cmd = function() + vim.fn.delete(temp_dir, 'rf') + end, + }, + } + else + local git_dir = project_dir + local clone_error = 'Error during download, please verify your internet connection' + + return { + { + cmd = 'git', + info = 'Downloading ' .. project_name .. '...', + err = clone_error, + opts = { + args = { + 'clone', + repo.url, + project_name, + }, + cwd = cache_dir, + }, + }, + { + cmd = 'git', + info = 'Checking out locked revision', + err = 'Error while checking out revision', + opts = { + args = { + 'checkout', + revision, + }, + cwd = git_dir, + }, + }, + } + end +end + +--TODO(clason): only needed for iter_cmd_sync -> replace with uv.spawn? + +-- Convert path for cmd.exe on Windows (needed when shellslash is set) +---@param p string +---@return string +local function cmdpath(p) + return vim.o.shellslash and p:gsub('/', '\\') or p +end + +---@param dir string +---@param command string +---@return string command +function M.make_directory_change_for_command(dir, command) + if iswin then + if string.find(vim.o.shell, 'cmd') ~= nil then + return string.format('pushd %s & %s & popd', cmdpath(dir), command) + else + return string.format('pushd %s ; %s ; popd', cmdpath(dir), command) + end + else + return string.format('cd %s;\n %s', dir, command) + end +end + +return M diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua deleted file mode 100644 index ee1d64745..000000000 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ /dev/null @@ -1,368 +0,0 @@ -local fn = vim.fn -local utils = require "nvim-treesitter.utils" -local uv = vim.uv or vim.loop - --- Convert path for cmd.exe on Windows. --- This is needed when vim.opt.shellslash is in use. ----@param p string ----@return string -local function cmdpath(p) - if vim.opt.shellslash:get() then - local r = p:gsub("/", "\\") - return r - else - return p - end -end - -local M = {} - --- Returns the mkdir command based on the OS ----@param directory string ----@param cwd string ----@param info_msg string ----@return table -function M.select_mkdir_cmd(directory, cwd, info_msg) - if fn.has "win32" == 1 then - return { - cmd = "cmd", - opts = { - args = { "/C", "mkdir", cmdpath(directory) }, - cwd = cwd, - }, - info = info_msg, - err = "Could not create " .. directory, - } - else - return { - cmd = "mkdir", - opts = { - args = { directory }, - cwd = cwd, - }, - info = info_msg, - err = "Could not create " .. directory, - } - end -end - --- Returns the remove command based on the OS ----@param file string ----@param info_msg string ----@return table -function M.select_rm_file_cmd(file, info_msg) - if fn.has "win32" == 1 then - return { - cmd = "cmd", - opts = { - args = { "/C", "if", "exist", cmdpath(file), "del", cmdpath(file) }, - }, - info = info_msg, - err = "Could not delete " .. file, - } - else - return { - cmd = "rm", - opts = { - args = { file }, - }, - info = info_msg, - err = "Could not delete " .. file, - } - end -end - ----@param executables string[] ----@return string|nil -function M.select_executable(executables) - return vim.tbl_filter(function(c) ---@param c string - return c ~= vim.NIL and fn.executable(c) == 1 - end, executables)[1] -end - --- Returns the compiler arguments based on the compiler and OS ----@param repo InstallInfo ----@param compiler string ----@return string[] -function M.select_compiler_args(repo, compiler) - if string.match(compiler, "cl$") or string.match(compiler, "cl.exe$") then - return { - "/Fe:", - "parser.so", - "/Isrc", - repo.files, - "-Os", - "/std:c11", - "/utf-8", - "/LD", - } - elseif string.match(compiler, "zig$") or string.match(compiler, "zig.exe$") then - return { - "c++", - "-o", - "parser.so", - repo.files, - "-lc", - "-Isrc", - "-shared", - "-Os", - "-std=c11", - } - else - local args = { - "-o", - "parser.so", - "-I./src", - repo.files, - "-Os", - "-std=c11", - } - if fn.has "mac" == 1 then - table.insert(args, "-bundle") - else - table.insert(args, "-shared") - end - if - #vim.tbl_filter(function(file) ---@param file string - local ext = vim.fn.fnamemodify(file, ":e") - return ext == "cc" or ext == "cpp" or ext == "cxx" - end, repo.files) > 0 - then - table.insert(args, "-lstdc++") - end - if fn.has "win32" == 0 then - table.insert(args, "-fPIC") - end - return args - end -end - --- Returns the compile command based on the OS and user options ----@param repo InstallInfo ----@param cc string ----@param compile_location string ----@return Command -function M.select_compile_command(repo, cc, compile_location) - local make = M.select_executable { "gmake", "make" } - if - string.match(cc, "cl$") - or string.match(cc, "cl.exe$") - or not repo.use_makefile - or fn.has "win32" == 1 - or not make - then - return { - cmd = cc, - info = "Compiling...", - err = "Error during compilation", - opts = { - args = require("nvim-treesitter.compat").flatten(M.select_compiler_args(repo, cc)), - cwd = compile_location, - }, - } - else - return { - cmd = make, - info = "Compiling...", - err = "Error during compilation", - opts = { - args = { - "--makefile=" .. utils.join_path(utils.get_package_path(), "scripts", "compile_parsers.makefile"), - "CC=" .. cc, - "CXX_STANDARD=" .. (repo.cxx_standard or "c++14"), - }, - cwd = compile_location, - }, - } - end -end - --- Returns the remove command based on the OS ----@param cache_folder string ----@param project_name string ----@return Command -function M.select_install_rm_cmd(cache_folder, project_name) - if fn.has "win32" == 1 then - local dir = cache_folder .. "\\" .. project_name - return { - cmd = "cmd", - opts = { - args = { "/C", "if", "exist", cmdpath(dir), "rmdir", "/s", "/q", cmdpath(dir) }, - }, - } - else - return { - cmd = "rm", - opts = { - args = { "-rf", cache_folder .. "/" .. project_name }, - }, - } - end -end - --- Returns the move command based on the OS ----@param from string ----@param to string ----@param cwd string ----@return Command -function M.select_mv_cmd(from, to, cwd) - if fn.has "win32" == 1 then - return { - cmd = "cmd", - opts = { - args = { "/C", "move", "/Y", cmdpath(from), cmdpath(to) }, - cwd = cwd, - }, - } - else - return { - cmd = "mv", - opts = { - args = { "-f", from, to }, - cwd = cwd, - }, - } - end -end - ----@param repo InstallInfo ----@param project_name string ----@param cache_folder string ----@param revision string|nil ----@param prefer_git boolean ----@return table -function M.select_download_commands(repo, project_name, cache_folder, revision, prefer_git) - local can_use_tar = vim.fn.executable "tar" == 1 and vim.fn.executable "curl" == 1 - local is_github = repo.url:find("github.com", 1, true) - local is_gitlab = repo.url:find("gitlab.com", 1, true) - - revision = revision or repo.branch or "master" - - if can_use_tar and (is_github or is_gitlab) and not prefer_git then - local path_sep = utils.get_path_sep() - local url = repo.url:gsub(".git$", "") - - local folder_rev = revision - if is_github and revision:match "^v%d" then - folder_rev = revision:sub(2) - end - - return { - M.select_install_rm_cmd(cache_folder, project_name .. "-tmp"), - { - cmd = "curl", - info = "Downloading " .. project_name .. "...", - err = "Error during download, please verify your internet connection", - opts = { - args = { - "--silent", - "--show-error", - "-L", -- follow redirects - is_github and url .. "/archive/" .. revision .. ".tar.gz" - or url .. "/-/archive/" .. revision .. "/" .. project_name .. "-" .. revision .. ".tar.gz", - "--output", - project_name .. ".tar.gz", - }, - cwd = cache_folder, - }, - }, - M.select_mkdir_cmd(project_name .. "-tmp", cache_folder, "Creating temporary directory"), - { - cmd = "tar", - info = "Extracting " .. project_name .. "...", - err = "Error during tarball extraction.", - opts = { - args = { - "-xvzf", - project_name .. ".tar.gz", - "-C", - project_name .. "-tmp", - }, - cwd = cache_folder, - }, - }, - M.select_rm_file_cmd(cache_folder .. path_sep .. project_name .. ".tar.gz"), - M.select_mv_cmd( - utils.join_path(project_name .. "-tmp", url:match "[^/]-$" .. "-" .. folder_rev), - project_name, - cache_folder - ), - M.select_install_rm_cmd(cache_folder, project_name .. "-tmp"), - } - else - local git_folder = utils.join_path(cache_folder, project_name) - local clone_error = "Error during download, please verify your internet connection" - - -- Running `git clone` or `git checkout` while running under Git (such as - -- editing a `git commit` message) will likely fail to install parsers - -- (such as 'gitcommit') and can also corrupt the index file of the current - -- Git repository. Check for typical git environment variables and abort if found. - for _, k in pairs { - "GIT_ALTERNATE_OBJECT_DIRECTORIES", - "GIT_CEILING_DIRECTORIES", - "GIT_DIR", - "GIT_INDEX", - "GIT_INDEX_FILE", - "GIT_OBJECT_DIRECTORY", - "GIT_PREFIX", - "GIT_WORK_TREE", - } do - if uv.os_getenv(k) then - vim.api.nvim_err_writeln( - string.format( - "Cannot install %s with git in an active git session. Exit the session and run ':TSInstall %s' manually", - project_name, - project_name - ) - ) - return {} - end - end - - return { - { - cmd = "git", - info = "Downloading " .. project_name .. "...", - err = clone_error, - opts = { - args = { - "clone", - repo.url, - project_name, - "--filter=blob:none", - }, - cwd = cache_folder, - }, - }, - { - cmd = "git", - info = "Checking out locked revision", - err = "Error while checking out revision", - opts = { - args = { - "checkout", - revision, - }, - cwd = git_folder, - }, - }, - } - end -end - ----@param dir string ----@param command string ----@return string command -function M.make_directory_change_for_command(dir, command) - if fn.has "win32" == 1 then - if string.find(vim.o.shell, "cmd") ~= nil then - return string.format("pushd %s & %s", cmdpath(dir), command) - else - return string.format("pushd %s ; %s", cmdpath(dir), command) - end - else - return string.format("cd %s;\n%s", dir, command) - end -end - -return M diff --git a/lua/nvim-treesitter/statusline.lua b/lua/nvim-treesitter/statusline.lua deleted file mode 100644 index 68ba41aca..000000000 --- a/lua/nvim-treesitter/statusline.lua +++ /dev/null @@ -1,53 +0,0 @@ -local parsers = require "nvim-treesitter.parsers" -local ts_utils = require "nvim-treesitter.ts_utils" - -local M = {} - --- Trim spaces and opening brackets from end -local transform_line = function(line) - return line:gsub("%s*[%[%(%{]*%s*$", "") -end - -function M.statusline(opts) - if not parsers.has_parser() then - return - end - local options = opts or {} - if type(opts) == "number" then - options = { indicator_size = opts } - end - local bufnr = options.bufnr or 0 - local indicator_size = options.indicator_size or 100 - local type_patterns = options.type_patterns or { "class", "function", "method" } - local transform_fn = options.transform_fn or transform_line - local separator = options.separator or " -> " - local allow_duplicates = options.allow_duplicates or false - - local current_node = ts_utils.get_node_at_cursor() - if not current_node then - return "" - end - - local lines = {} - local expr = current_node - - while expr do - local line = ts_utils._get_line_for_node(expr, type_patterns, transform_fn, bufnr) - if line ~= "" then - if allow_duplicates or not vim.tbl_contains(lines, line) then - table.insert(lines, 1, line) - end - end - expr = expr:parent() - end - - local text = table.concat(lines, separator) - local text_len = #text - if text_len > indicator_size then - return "..." .. text:sub(text_len - indicator_size, text_len) - end - - return text -end - -return M diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua deleted file mode 100644 index ce103790c..000000000 --- a/lua/nvim-treesitter/ts_utils.lua +++ /dev/null @@ -1,482 +0,0 @@ -local api = vim.api - -local parsers = require "nvim-treesitter.parsers" -local utils = require "nvim-treesitter.utils" -local ts = vim.treesitter - -local M = {} - -local function get_node_text(node, bufnr) - bufnr = bufnr or api.nvim_get_current_buf() - if not node then - return {} - end - - -- We have to remember that end_col is end-exclusive - local start_row, start_col, end_row, end_col = ts.get_node_range(node) - - if start_row ~= end_row then - local lines = api.nvim_buf_get_lines(bufnr, start_row, end_row + 1, false) - if next(lines) == nil then - return {} - end - lines[1] = string.sub(lines[1], start_col + 1) - -- end_row might be just after the last line. In this case the last line is not truncated. - if #lines == end_row - start_row + 1 then - lines[#lines] = string.sub(lines[#lines], 1, end_col) - end - return lines - else - local line = api.nvim_buf_get_lines(bufnr, start_row, start_row + 1, false)[1] - -- If line is nil then the line is empty - return line and { string.sub(line, start_col + 1, end_col) } or {} - end -end - ----@private ----@param node TSNode ----@param type_patterns string[] ----@param transform_fn fun(line: string): string ----@param bufnr integer ----@return string -function M._get_line_for_node(node, type_patterns, transform_fn, bufnr) - local node_type = node:type() - local is_valid = false - for _, rgx in ipairs(type_patterns) do - if node_type:find(rgx) then - is_valid = true - break - end - end - if not is_valid then - return "" - end - local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""), node) - -- Escape % to avoid statusline to evaluate content as expression - return line:gsub("%%", "%%%%") -end - --- Gets the actual text content of a node --- @deprecated Use vim.treesitter.get_node_text --- @param node the node to get the text from --- @param bufnr the buffer containing the node --- @return list of lines of text of the node -function M.get_node_text(node, bufnr) - vim.notify_once( - "nvim-treesitter.ts_utils.get_node_text is deprecated: use vim.treesitter.get_node_text", - vim.log.levels.WARN - ) - return get_node_text(node, bufnr) -end - --- Determines whether a node is the parent of another --- @param dest the possible parent --- @param source the possible child node -function M.is_parent(dest, source) - if not (dest and source) then - return false - end - - local current = source - while current ~= nil do - if current == dest then - return true - end - - current = current:parent() - end - - return false -end - --- Get next node with same parent ----@param node TSNode ----@param allow_switch_parents? boolean allow switching parents if last node ----@param allow_next_parent? boolean allow next parent if last node and next parent without children -function M.get_next_node(node, allow_switch_parents, allow_next_parent) - local destination_node ---@type TSNode - local parent = node:parent() - - if not parent then - return - end - local found_pos = 0 - for i = 0, parent:named_child_count() - 1, 1 do - if parent:named_child(i) == node then - found_pos = i - break - end - end - if parent:named_child_count() > found_pos + 1 then - destination_node = parent:named_child(found_pos + 1) - elseif allow_switch_parents then - local next_node = M.get_next_node(node:parent()) - if next_node and next_node:named_child_count() > 0 then - destination_node = next_node:named_child(0) - elseif next_node and allow_next_parent then - destination_node = next_node - end - end - - return destination_node -end - --- Get previous node with same parent ----@param node TSNode ----@param allow_switch_parents? boolean allow switching parents if first node ----@param allow_previous_parent? boolean allow previous parent if first node and previous parent without children -function M.get_previous_node(node, allow_switch_parents, allow_previous_parent) - local destination_node ---@type TSNode - local parent = node:parent() - if not parent then - return - end - - local found_pos = 0 - for i = 0, parent:named_child_count() - 1, 1 do - if parent:named_child(i) == node then - found_pos = i - break - end - end - if 0 < found_pos then - destination_node = parent:named_child(found_pos - 1) - elseif allow_switch_parents then - local previous_node = M.get_previous_node(node:parent()) - if previous_node and previous_node:named_child_count() > 0 then - destination_node = previous_node:named_child(previous_node:named_child_count() - 1) - elseif previous_node and allow_previous_parent then - destination_node = previous_node - end - end - return destination_node -end - -function M.get_named_children(node) - local nodes = {} ---@type TSNode[] - for i = 0, node:named_child_count() - 1, 1 do - nodes[i + 1] = node:named_child(i) - end - return nodes -end - -function M.get_node_at_cursor(winnr, ignore_injected_langs) - winnr = winnr or 0 - local cursor = api.nvim_win_get_cursor(winnr) - local cursor_range = { cursor[1] - 1, cursor[2] } - - local buf = vim.api.nvim_win_get_buf(winnr) - local root_lang_tree = parsers.get_parser(buf) - if not root_lang_tree then - return - end - - local root ---@type TSNode|nil - if ignore_injected_langs then - for _, tree in pairs(root_lang_tree:trees()) do - local tree_root = tree:root() - if tree_root and ts.is_in_node_range(tree_root, cursor_range[1], cursor_range[2]) then - root = tree_root - break - end - end - else - root = M.get_root_for_position(cursor_range[1], cursor_range[2], root_lang_tree) - end - - if not root then - return - end - - return root:named_descendant_for_range(cursor_range[1], cursor_range[2], cursor_range[1], cursor_range[2]) -end - -function M.get_root_for_position(line, col, root_lang_tree) - if not root_lang_tree then - if not parsers.has_parser() then - return - end - - root_lang_tree = parsers.get_parser() - end - - local lang_tree = root_lang_tree:language_for_range { line, col, line, col } - - while true do - for _, tree in pairs(lang_tree:trees()) do - local root = tree:root() - - if root and ts.is_in_node_range(root, line, col) then - return root, tree, lang_tree - end - end - - if lang_tree == root_lang_tree then - break - end - - -- This case can happen when the cursor is at the start of a line that ends a injected region, - -- e.g., the first `]` in the following lua code: - -- ``` - -- vim.cmd[[ - -- ]] - -- ``` - lang_tree = lang_tree:parent() -- NOTE: parent() method is private - end - - -- This isn't a likely scenario, since the position must belong to a tree somewhere. - return nil, nil, lang_tree -end - ----comment ----@param node TSNode ----@return TSNode result -function M.get_root_for_node(node) - local parent = node - local result = node - - while parent ~= nil do - result = parent - parent = result:parent() - end - - return result -end - -function M.highlight_node(node, buf, hl_namespace, hl_group) - if not node then - return - end - M.highlight_range({ node:range() }, buf, hl_namespace, hl_group) -end - --- Get a compatible vim range (1 index based) from a TS node range. --- --- TS nodes start with 0 and the end col is ending exclusive. --- They also treat a EOF/EOL char as a char ending in the first --- col of the next row. ----comment ----@param range integer[] ----@param buf integer|nil ----@return integer, integer, integer, integer -function M.get_vim_range(range, buf) - ---@type integer, integer, integer, integer - local srow, scol, erow, ecol = unpack(range) - srow = srow + 1 - scol = scol + 1 - erow = erow + 1 - - if ecol == 0 then - -- Use the value of the last col of the previous row instead. - erow = erow - 1 - if not buf or buf == 0 then - ecol = vim.fn.col { erow, "$" } - 1 - else - ecol = #api.nvim_buf_get_lines(buf, erow - 1, erow, false)[1] - end - ecol = math.max(ecol, 1) - end - return srow, scol, erow, ecol -end - -function M.highlight_range(range, buf, hl_namespace, hl_group) - ---@type integer, integer, integer, integer - local start_row, start_col, end_row, end_col = unpack(range) - ---@diagnostic disable-next-line: missing-parameter - vim.highlight.range(buf, hl_namespace, hl_group, { start_row, start_col }, { end_row, end_col }) -end - --- Set visual selection to node --- @param selection_mode One of "charwise" (default) or "v", "linewise" or "V", --- "blockwise" or "" (as a string with 5 characters or a single character) -function M.update_selection(buf, node, selection_mode) - local start_row, start_col, end_row, end_col = M.get_vim_range({ ts.get_node_range(node) }, buf) - - local v_table = { charwise = "v", linewise = "V", blockwise = "" } - selection_mode = selection_mode or "charwise" - - -- Normalise selection_mode - if vim.tbl_contains(vim.tbl_keys(v_table), selection_mode) then - selection_mode = v_table[selection_mode] - end - - -- enter visual mode if normal or operator-pending (no) mode - -- Why? According to https://learnvimscriptthehardway.stevelosh.com/chapters/15.html - -- If your operator-pending mapping ends with some text visually selected, Vim will operate on that text. - -- Otherwise, Vim will operate on the text between the original cursor position and the new position. - local mode = api.nvim_get_mode() - if mode.mode ~= selection_mode then - -- Call to `nvim_replace_termcodes()` is needed for sending appropriate command to enter blockwise mode - selection_mode = vim.api.nvim_replace_termcodes(selection_mode, true, true, true) - api.nvim_cmd({ cmd = "normal", bang = true, args = { selection_mode } }, {}) - end - - api.nvim_win_set_cursor(0, { start_row, start_col - 1 }) - vim.cmd "normal! o" - api.nvim_win_set_cursor(0, { end_row, end_col - 1 }) -end - --- Byte length of node range ----@param node TSNode ----@return number -function M.node_length(node) - local _, _, start_byte = node:start() - local _, _, end_byte = node:end_() - return end_byte - start_byte -end - ----@deprecated Use `vim.treesitter.is_in_node_range()` instead -function M.is_in_node_range(node, line, col) - vim.notify_once( - "nvim-treesitter.ts_utils.is_in_node_range is deprecated: use vim.treesitter.is_in_node_range", - vim.log.levels.WARN - ) - return ts.is_in_node_range(node, line, col) -end - ----@deprecated Use `vim.treesitter.get_node_range()` instead -function M.get_node_range(node_or_range) - vim.notify_once( - "nvim-treesitter.ts_utils.get_node_range is deprecated: use vim.treesitter.get_node_range", - vim.log.levels.WARN - ) - return ts.get_node_range(node_or_range) -end - ----@param node TSNode ----@return table -function M.node_to_lsp_range(node) - local start_line, start_col, end_line, end_col = ts.get_node_range(node) - local rtn = {} - rtn.start = { line = start_line, character = start_col } - rtn["end"] = { line = end_line, character = end_col } - return rtn -end - --- Memoizes a function based on the buffer tick of the provided bufnr. --- The cache entry is cleared when the buffer is detached to avoid memory leaks. --- The options argument is a table with two optional values: --- - bufnr: extracts a bufnr from the given arguments. --- - key: extracts the cache key from the given arguments. ----@param fn function the fn to memoize, taking the buffer as first argument ----@param options? {bufnr: integer?, key: string|fun(...): string?} the memoization options ----@return function: a memoized function -function M.memoize_by_buf_tick(fn, options) - options = options or {} - - ---@type table - local cache = setmetatable({}, { __mode = "kv" }) - local bufnr_fn = utils.to_func(options.bufnr or utils.identity) - local key_fn = utils.to_func(options.key or utils.identity) - - return function(...) - local bufnr = bufnr_fn(...) - local key = key_fn(...) - local tick = api.nvim_buf_get_changedtick(bufnr) - - if cache[key] then - if cache[key].last_tick == tick then - return cache[key].result - end - else - local function detach_handler() - cache[key] = nil - end - - -- Clean up logic only! - api.nvim_buf_attach(bufnr, false, { - on_detach = detach_handler, - on_reload = detach_handler, - }) - end - - cache[key] = { - result = fn(...), - last_tick = tick, - } - - return cache[key].result - end -end - -function M.swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second) - if not node_or_range1 or not node_or_range2 then - return - end - local range1 = M.node_to_lsp_range(node_or_range1) - local range2 = M.node_to_lsp_range(node_or_range2) - - local text1 = get_node_text(node_or_range1, bufnr) - local text2 = get_node_text(node_or_range2, bufnr) - - local edit1 = { range = range1, newText = table.concat(text2, "\n") } - local edit2 = { range = range2, newText = table.concat(text1, "\n") } - bufnr = bufnr == 0 and vim.api.nvim_get_current_buf() or bufnr - vim.lsp.util.apply_text_edits({ edit1, edit2 }, bufnr, "utf-8") - - if cursor_to_second then - utils.set_jump() - - local char_delta = 0 - local line_delta = 0 - if - range1["end"].line < range2.start.line - or (range1["end"].line == range2.start.line and range1["end"].character <= range2.start.character) - then - line_delta = #text2 - #text1 - end - - if range1["end"].line == range2.start.line and range1["end"].character <= range2.start.character then - if line_delta ~= 0 then - --- why? - --correction_after_line_change = -range2.start.character - --text_now_before_range2 = #(text2[#text2]) - --space_between_ranges = range2.start.character - range1["end"].character - --char_delta = correction_after_line_change + text_now_before_range2 + space_between_ranges - --- Equivalent to: - char_delta = #text2[#text2] - range1["end"].character - - -- add range1.start.character if last line of range1 (now text2) does not start at 0 - if range1.start.line == range2.start.line + line_delta then - char_delta = char_delta + range1.start.character - end - else - char_delta = #text2[#text2] - #text1[#text1] - end - end - - api.nvim_win_set_cursor( - api.nvim_get_current_win(), - { range2.start.line + 1 + line_delta, range2.start.character + char_delta } - ) - end -end - -function M.goto_node(node, goto_end, avoid_set_jump) - if not node then - return - end - if not avoid_set_jump then - utils.set_jump() - end - local range = { M.get_vim_range { node:range() } } - ---@type table - local position - if not goto_end then - position = { range[1], range[2] } - else - position = { range[3], range[4] } - end - - -- Enter visual mode if we are in operator pending mode - -- If we don't do this, it will miss the last character. - local mode = vim.api.nvim_get_mode() - if mode.mode == "no" then - vim.cmd "normal! v" - end - - -- Position is 1, 0 indexed. - api.nvim_win_set_cursor(0, { position[1], position[2] - 1 }) -end - -return M diff --git a/lua/nvim-treesitter/tsrange.lua b/lua/nvim-treesitter/tsrange.lua deleted file mode 100644 index d41585c60..000000000 --- a/lua/nvim-treesitter/tsrange.lua +++ /dev/null @@ -1,154 +0,0 @@ -local M = {} -local TSRange = {} -TSRange.__index = TSRange - -local api = vim.api -local ts_utils = require "nvim-treesitter.ts_utils" -local parsers = require "nvim-treesitter.parsers" - -local function get_byte_offset(buf, row, col) - return api.nvim_buf_get_offset(buf, row) + vim.fn.byteidx(api.nvim_buf_get_lines(buf, row, row + 1, false)[1], col) -end - -function TSRange.new(buf, start_row, start_col, end_row, end_col) - return setmetatable({ - start_pos = { start_row, start_col, get_byte_offset(buf, start_row, start_col) }, - end_pos = { end_row, end_col, get_byte_offset(buf, end_row, end_col) }, - buf = buf, - [1] = start_row, - [2] = start_col, - [3] = end_row, - [4] = end_col, - }, TSRange) -end - -function TSRange.from_nodes(buf, start_node, end_node) - TSRange.__index = TSRange - local start_pos = start_node and { start_node:start() } or { end_node:start() } - local end_pos = end_node and { end_node:end_() } or { start_node:end_() } - return setmetatable({ - start_pos = { start_pos[1], start_pos[2], start_pos[3] }, - end_pos = { end_pos[1], end_pos[2], end_pos[3] }, - buf = buf, - [1] = start_pos[1], - [2] = start_pos[2], - [3] = end_pos[1], - [4] = end_pos[2], - }, TSRange) -end - -function TSRange.from_table(buf, range) - return setmetatable({ - start_pos = { range[1], range[2], get_byte_offset(buf, range[1], range[2]) }, - end_pos = { range[3], range[4], get_byte_offset(buf, range[3], range[4]) }, - buf = buf, - [1] = range[1], - [2] = range[2], - [3] = range[3], - [4] = range[4], - }, TSRange) -end - -function TSRange:parent() - local root_lang_tree = parsers.get_parser(self.buf) - local root = ts_utils.get_root_for_position(self[1], self[2], root_lang_tree) - - return root - and root:named_descendant_for_range(self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2]) - or nil -end - -function TSRange:field() end - -function TSRange:child_count() - return #self:collect_children() -end - -function TSRange:named_child_count() - return #self:collect_children(function(c) - return c:named() - end) -end - -function TSRange:iter_children() - local raw_iterator = self:parent().iter_children() - return function() - while true do - local node = raw_iterator() - if not node then - return - end - local _, _, start_byte = node:start() - local _, _, end_byte = node:end_() - if start_byte >= self.start_pos[3] and end_byte <= self.end_pos[3] then - return node - end - end - end -end - -function TSRange:collect_children(filter_fun) - local children = {} - for _, c in self:iter_children() do - if not filter_fun or filter_fun(c) then - table.insert(children, c) - end - end - return children -end - -function TSRange:child(index) - return self:collect_children()[index + 1] -end - -function TSRange:named_child(index) - return self:collect_children(function(c) - return c.named() - end)[index + 1] -end - -function TSRange:start() - return unpack(self.start_pos) -end - -function TSRange:end_() - return unpack(self.end_pos) -end - -function TSRange:range() - return self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2] -end - -function TSRange:type() - return "nvim-treesitter-range" -end - -function TSRange:symbol() - return -1 -end - -function TSRange:named() - return false -end - -function TSRange:missing() - return false -end - -function TSRange:has_error() - return #self:collect_children(function(c) - return c:has_error() - end) > 0 and true or false -end - -function TSRange:sexpr() - return table.concat( - vim.tbl_map(function(c) - return c:sexpr() - end, self:collect_children()), - " " - ) -end - -M.TSRange = TSRange -return M diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index d920f4a61..f9e5a2b86 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -1,237 +1,12 @@ -local api = vim.api -local fn = vim.fn -local luv = vim.loop - local M = {} --- Wrapper around vim.notify with common options set. ----@param msg string ----@param log_level number|nil ----@param opts table|nil -function M.notify(msg, log_level, opts) - local default_opts = { title = "nvim-treesitter" } - vim.notify(msg, log_level, vim.tbl_extend("force", default_opts, opts or {})) +--TODO(clason): replace by vim.fs._join_paths +function M.join_path(...) + return (table.concat({ ... }, '/'):gsub('//+', '/')) end --- Returns the system-specific path separator. ----@return string -function M.get_path_sep() - return (fn.has "win32" == 1 and not vim.opt.shellslash:get()) and "\\" or "/" -end - --- Returns a function that joins the given arguments with separator. Arguments --- can't be nil. Example: --- ---[[ - print(M.generate_join(" ")("foo", "bar")) ---]] ---prints "foo bar" ----@param separator string ----@return fun(...: string): string -function M.generate_join(separator) - return function(...) - return table.concat({ ... }, separator) - end -end - -M.join_path = M.generate_join(M.get_path_sep()) - -M.join_space = M.generate_join " " - ----@class Command ----@field run function ----@field f_args string ----@field args string - --- Define user defined vim command which calls nvim-treesitter module function --- - If module name is 'mod', it should be defined in hierarchy 'nvim-treesitter.mod' --- - A table with name 'commands' should be defined in 'mod' which needs to be passed as --- the commands param of this function --- ----@param mod string Name of the module that resides in the hierarchy - nvim-treesitter.module ----@param commands table Command list for the module ---- - {command_name} Name of the vim user defined command, Keys: ---- - {run}: (function) callback function that needs to be executed ---- - {f_args}: (string, default ) ---- - type of arguments that needs to be passed to the vim command ---- - {args}: (string, optional) ---- - vim command attributes ---- ----* @example ---- If module is nvim-treesitter.custom_mod ----
----  M.commands = {
----      custom_command = {
----          run = M.module_function,
----          f_args = "",
----          args = {
----              "-range"
----          }
----      }
----  }
----
----  utils.setup_commands("custom_mod", require("nvim-treesitter.custom_mod").commands)
----  
---- ---- Will generate command : ----
----  command! -range custom_command \
----      lua require'nvim-treesitter.custom_mod'.commands.custom_command['run']()
----  
-function M.setup_commands(mod, commands) - for command_name, def in pairs(commands) do - local f_args = def.f_args or "" - local call_fn = - string.format("lua require'nvim-treesitter.%s'.commands.%s['run'](%s)", mod, command_name, f_args) - local parts = require("nvim-treesitter.compat").flatten { - "command!", - "-bar", - def.args, - command_name, - call_fn, - } - api.nvim_command(table.concat(parts, " ")) - end -end - ----@param dir string ----@param create_err string ----@param writeable_err string ----@return string|nil, string|nil -function M.create_or_reuse_writable_dir(dir, create_err, writeable_err) - create_err = create_err or M.join_space("Could not create dir '", dir, "': ") - writeable_err = writeable_err or M.join_space("Invalid rights, '", dir, "' should be read/write") - -- Try creating and using parser_dir if it doesn't exist - if not luv.fs_stat(dir) then - local ok, error = pcall(vim.fn.mkdir, dir, "p", "0755") - if not ok then - return nil, M.join_space(create_err, error) - end - - return dir - end - - -- parser_dir exists, use it if it's read/write - if luv.fs_access(dir, "RW") then - return dir - end - - -- parser_dir exists but isn't read/write, give up - return nil, M.join_space(writeable_err, dir, "'") -end - -function M.get_package_path() - -- Path to this source file, removing the leading '@' - local source = string.sub(debug.getinfo(1, "S").source, 2) - - -- Path to the package root - return fn.fnamemodify(source, ":p:h:h:h") -end - -function M.get_cache_dir() - local cache_dir = fn.stdpath "data" - - if luv.fs_access(cache_dir, "RW") then - return cache_dir - elseif luv.fs_access("/tmp", "RW") then - return "/tmp" - end - - return nil, M.join_space("Invalid cache rights,", fn.stdpath "data", "or /tmp should be read/write") -end - --- Returns $XDG_DATA_HOME/nvim/site, but could use any directory that is in --- runtimepath -function M.get_site_dir() - return M.join_path(fn.stdpath "data", "site") -end - --- Gets a property at path ----@param tbl table the table to access ----@param path string the '.' separated path ----@return table|nil result the value at path or nil -function M.get_at_path(tbl, path) - if path == "" then - return tbl - end - - local segments = vim.split(path, ".", true) - ---@type table[]|table - local result = tbl - - for _, segment in ipairs(segments) do - if type(result) == "table" then - ---@type table - -- TODO: figure out the actual type of tbl - result = result[segment] - end - end - - return result -end - -function M.set_jump() - vim.cmd "normal! m'" -end - --- Filters a list based on the given predicate ----@param tbl any[] The list to filter ----@param predicate fun(v:any, i:number):boolean The predicate to filter with -function M.filter(tbl, predicate) - local result = {} - - for i, v in ipairs(tbl) do - if predicate(v, i) then - table.insert(result, v) - end - end - - return result -end - --- Returns a list of all values from the first list --- that are not present in the second list. ----@param tbl1 any[] The first table ----@param tbl2 any[] The second table ----@return table -function M.difference(tbl1, tbl2) - return M.filter(tbl1, function(v) - return not vim.tbl_contains(tbl2, v) - end) -end - -function M.identity(a) - return a -end - --- Returns a function returning the given value ----@param a any ----@return fun():any -function M.constant(a) - return function() - return a - end -end - --- Returns a function that returns the given value if it is a function, --- otherwise returns a function that returns the given value. ----@param a any ----@return fun(...):any -function M.to_func(a) - return type(a) == "function" and a or M.constant(a) -end - ----@return string|nil -function M.ts_cli_version() - if fn.executable "tree-sitter" == 1 then - local handle = io.popen "tree-sitter -V" - if not handle then - return - end - local result = handle:read "*a" - handle:close() - return vim.split(result, "\n")[1]:match "[^tree%psitter ].*" - end +function M.get_package_path(...) + return M.join_path(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) end return M diff --git a/parser-info/.gitignore b/parser-info/.gitignore deleted file mode 100644 index d6b7ef32c..000000000 --- a/parser-info/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/parser/.gitignore b/parser/.gitignore deleted file mode 100644 index d6b7ef32c..000000000 --- a/parser/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua new file mode 100644 index 000000000..a4c236ec3 --- /dev/null +++ b/plugin/filetypes.lua @@ -0,0 +1,66 @@ +local filetypes = { + angular = { 'htmlangular' }, + bash = { 'sh' }, + bibtex = { 'bib' }, + c_sharp = { 'cs', 'csharp', 'c-sharp' }, + commonlisp = { 'lisp' }, + cooklang = { 'cook' }, + devicetree = { 'dts' }, + diff = { 'gitdiff' }, + eex = { 'eelixir' }, + elixir = { 'ex' }, + embedded_template = { 'eruby' }, + erlang = { 'erl' }, + facility = { 'fsd' }, + faust = { 'dsp' }, + gdshader = { 'gdshaderinc' }, + git_config = { 'gitconfig' }, + git_rebase = { 'gitrebase' }, + glimmer = { 'handlebars', 'html.handlebars' }, + godot_resource = { 'gdresource' }, + haskell = { 'hs' }, + haskell_persistent = { 'haskellpersistent' }, + idris = { 'idris2' }, + janet_simple = { 'janet' }, + javascript = { 'javascriptreact', 'ecma', 'jsx', 'js' }, + javascript_glimmer = { 'javascript.glimmer' }, + linkerscript = { 'ld' }, + latex = { 'tex' }, + m68k = { 'asm68k' }, + make = { 'automake' }, + markdown = { 'pandoc', 'quarto', 'rmd' }, + muttrc = { 'neomuttrc' }, + ocaml_interface = { 'ocamlinterface' }, + perl = { 'pl' }, + poe_filter = { 'poefilter' }, + properties = { 'jproperties' }, + python = { 'py', 'gyp' }, + qmljs = { 'qml' }, + runescript = { 'clientscript' }, + scala = { 'sbt' }, + slang = { 'shaderslang' }, + sqp = { 'mysqp' }, + ssh_config = { 'sshconfig' }, + starlark = { 'bzl' }, + surface = { 'sface' }, + t32 = { 'trace32' }, + tcl = { 'expect' }, + terraform = { 'terraform-vars' }, + textproto = { 'pbtxt' }, + tlaplus = { 'tla' }, + tsx = { 'typescriptreact', 'typescript.tsx' }, + typescript = { 'ts' }, + typescript_glimmer = { 'typescript.glimmer' }, + typst = { 'typ' }, + udev = { 'udevrules' }, + uxntal = { 'tal', 'uxn' }, + v = { 'vlang' }, + verilog = { 'systemverilog' }, + vhs = { 'tape' }, + xml = { 'xsd', 'xslt', 'svg' }, + xresources = { 'xdefaults' }, +} + +for lang, ft in pairs(filetypes) do + vim.treesitter.language.register(lang, ft) +end diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 4ea3925fd..3ab264d41 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -1,34 +1,86 @@ --- Last Change: 2022 Apr 16 - if vim.g.loaded_nvim_treesitter then return end vim.g.loaded_nvim_treesitter = true --- setup modules -require("nvim-treesitter").setup() - local api = vim.api --- define autocommands -local augroup = api.nvim_create_augroup("NvimTreesitter", {}) +local function complete_available_parsers(arglead) + return vim.iter.filter(function(v) + return v:find(arglead) + end, require('nvim-treesitter.parsers').get_available()) +end -api.nvim_create_autocmd("Filetype", { - pattern = "query", - group = augroup, - callback = function() - api.nvim_clear_autocmds { - group = augroup, - event = "BufWritePost", - } - api.nvim_create_autocmd("BufWritePost", { - group = augroup, - buffer = 0, - callback = function(opts) - require("nvim-treesitter.query").invalidate_query_file(opts.file) - end, - desc = "Invalidate query file", - }) - end, - desc = "Reload query", +local function complete_installed_parsers(arglead) + return vim.iter.filter(function(v) + return v:find(arglead) + end, require('nvim-treesitter.config').installed_parsers()) +end + +-- create user commands +api.nvim_create_user_command('TSInstallInfo', function() + require('nvim-treesitter.install').info() +end, { nargs = 0, desc = 'List available treesitter parsers' }) + +api.nvim_create_user_command('TSInstall', function(args) + require('nvim-treesitter.install').install(args.fargs, { force = args.bang }) +end, { + nargs = '+', + bang = true, + bar = true, + complete = complete_available_parsers, + desc = 'Install treesitter parsers', +}) + +api.nvim_create_user_command('TSInstallFromGrammar', function(args) + require('nvim-treesitter.install').install(args.fargs, { + generate_from_grammar = true, + force = args.bang, + }) +end, { + nargs = '+', + bang = true, + bar = true, + complete = complete_available_parsers, + desc = 'Install treesitter parsers from grammar', +}) + +api.nvim_create_user_command('TSInstallSync', function(args) + require('nvim-treesitter.install').install(args.fargs, { + with_sync = true, + force = args.bang, + }) +end, { + nargs = '+', + bang = true, + bar = true, + complete = complete_available_parsers, + desc = 'Install treesitter parsers synchronously', +}) + +api.nvim_create_user_command('TSUpdate', function(args) + require('nvim-treesitter.install').update(args.fargs) +end, { + nargs = '*', + bar = true, + complete = complete_installed_parsers, + desc = 'Update installed treesitter parsers', +}) + +api.nvim_create_user_command('TSUpdateSync', function(args) + require('nvim-treesitter.install').update(args.fargs, { with_sync = true }) +end, { + nargs = '*', + bar = true, + complete = complete_installed_parsers, + desc = 'Update installed treesitter parsers synchronously', +}) + +api.nvim_create_user_command('TSUninstall', function(args) + require('nvim-treesitter.install').uninstall(args.fargs) +end, { + nargs = '+', + bar = true, + complete = complete_installed_parsers, + desc = 'Uninstall treesitter parsers', }) diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua new file mode 100644 index 000000000..abffea2f0 --- /dev/null +++ b/plugin/query_predicates.lua @@ -0,0 +1,141 @@ +local query = vim.treesitter.query + +-- register custom predicates + +---@param match (TSNode|nil)[] +---@param pred string[] +---@return boolean|nil +query.add_predicate('kind-eq?', function(match, _, _, pred) + local node = match[pred[2]] + if not node then + return true + end + + local types = { unpack(pred, 3) } + return vim.list_contains(types, node:type()) +end) + +-- register custom directives + +local mimetype_aliases = { + ['importmap'] = 'json', + ['module'] = 'javascript', + ['application/ecmascript'] = 'javascript', + ['text/ecmascript'] = 'javascript', +} + +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, metadata) + local capture_id = pred[2] + local node = match[capture_id] + if not node then + return + end + local type_attr_value = vim.treesitter.get_node_text(node, bufnr) + local configured = mimetype_aliases[type_attr_value] + if configured then + metadata['injection.language'] = configured + else + local parts = vim.split(type_attr_value, '/', {}) + metadata['injection.language'] = parts[#parts] + end +end) + +local injection_aliases = { + ex = 'elixir', + pl = 'perl', + sh = 'bash', + uxn = 'uxntal', + ts = 'typescript', +} + +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_directive('set-lang-from-info-string!', function(match, _, bufnr, pred, metadata) + local capture_id = pred[2] + local node = match[capture_id] + if not node then + return + end + + local injection_alias = vim.treesitter.get_node_text(node, bufnr) + local filetype = vim.filetype.match({ filename = 'a.' .. injection_alias }) + metadata['injection.language'] = filetype or injection_aliases[injection_alias] or injection_alias +end) + +query.add_directive('downcase!', function(match, _, bufnr, pred, metadata) + local text, key, value ---@type string|string[], string, string|integer + + if #pred == 3 then + -- (#downcase! @capture "key") + key = pred[3] + value = metadata[pred[2]][key] + else + -- (#downcase! "key") + key = pred[2] + value = metadata[key] + end + + if type(value) == 'string' then + text = value + else + local node = match[value] + text = vim.treesitter.get_node_text(node, bufnr) or '' + end + + if #pred == 3 then + metadata[pred[2]][key] = string.lower(text) + else + metadata[key] = string.lower(text) + end +end) + +-- Trim blank lines from end of the region +-- Arguments are the captures to trim. +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@param metadata table +---TODO(clason): upstream +query.add_directive('trim!', function(match, _, bufnr, pred, metadata) + for _, id in ipairs({ select(2, unpack(pred)) }) do + local node = match[id] + if not node then + return + end + + local start_row, start_col, end_row, end_col = node:range() + + -- Don't trim if region ends in middle of a line + if end_col ~= 0 then + return + end + + while true do + -- As we only care when end_col == 0, always inspect one line above end_row. + local end_line = vim.api.nvim_buf_get_lines(bufnr, end_row - 1, end_row, true)[1] + + if end_line ~= '' then + break + end + + end_row = end_row - 1 + end + + -- If this produces an invalid range, we just skip it. + if start_row < end_row or (start_row == end_row and start_col <= end_col) then + if not metadata[id] then + metadata[id] = {} + end + metadata[id].range = { start_row, start_col, end_row, end_col } + end + end +end) diff --git a/queries/ada/folds.scm b/runtime/queries/ada/folds.scm similarity index 100% rename from queries/ada/folds.scm rename to runtime/queries/ada/folds.scm diff --git a/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm similarity index 100% rename from queries/ada/highlights.scm rename to runtime/queries/ada/highlights.scm diff --git a/queries/unison/injections.scm b/runtime/queries/ada/injections.scm similarity index 100% rename from queries/unison/injections.scm rename to runtime/queries/ada/injections.scm diff --git a/queries/ada/locals.scm b/runtime/queries/ada/locals.scm similarity index 100% rename from queries/ada/locals.scm rename to runtime/queries/ada/locals.scm diff --git a/queries/agda/folds.scm b/runtime/queries/agda/folds.scm similarity index 100% rename from queries/agda/folds.scm rename to runtime/queries/agda/folds.scm diff --git a/queries/agda/highlights.scm b/runtime/queries/agda/highlights.scm similarity index 100% rename from queries/agda/highlights.scm rename to runtime/queries/agda/highlights.scm diff --git a/queries/solidity/injections.scm b/runtime/queries/agda/injections.scm similarity index 100% rename from queries/solidity/injections.scm rename to runtime/queries/agda/injections.scm diff --git a/queries/angular/folds.scm b/runtime/queries/angular/folds.scm similarity index 100% rename from queries/angular/folds.scm rename to runtime/queries/angular/folds.scm diff --git a/queries/angular/highlights.scm b/runtime/queries/angular/highlights.scm similarity index 100% rename from queries/angular/highlights.scm rename to runtime/queries/angular/highlights.scm diff --git a/queries/angular/indents.scm b/runtime/queries/angular/indents.scm similarity index 100% rename from queries/angular/indents.scm rename to runtime/queries/angular/indents.scm diff --git a/queries/angular/injections.scm b/runtime/queries/angular/injections.scm similarity index 100% rename from queries/angular/injections.scm rename to runtime/queries/angular/injections.scm diff --git a/queries/angular/locals.scm b/runtime/queries/angular/locals.scm similarity index 100% rename from queries/angular/locals.scm rename to runtime/queries/angular/locals.scm diff --git a/queries/apex/folds.scm b/runtime/queries/apex/folds.scm similarity index 100% rename from queries/apex/folds.scm rename to runtime/queries/apex/folds.scm diff --git a/queries/apex/highlights.scm b/runtime/queries/apex/highlights.scm similarity index 100% rename from queries/apex/highlights.scm rename to runtime/queries/apex/highlights.scm diff --git a/queries/apex/injections.scm b/runtime/queries/apex/injections.scm similarity index 100% rename from queries/apex/injections.scm rename to runtime/queries/apex/injections.scm diff --git a/queries/apex/locals.scm b/runtime/queries/apex/locals.scm similarity index 100% rename from queries/apex/locals.scm rename to runtime/queries/apex/locals.scm diff --git a/queries/arduino/folds.scm b/runtime/queries/arduino/folds.scm similarity index 100% rename from queries/arduino/folds.scm rename to runtime/queries/arduino/folds.scm diff --git a/queries/arduino/highlights.scm b/runtime/queries/arduino/highlights.scm similarity index 100% rename from queries/arduino/highlights.scm rename to runtime/queries/arduino/highlights.scm diff --git a/queries/arduino/indents.scm b/runtime/queries/arduino/indents.scm similarity index 100% rename from queries/arduino/indents.scm rename to runtime/queries/arduino/indents.scm diff --git a/queries/arduino/injections.scm b/runtime/queries/arduino/injections.scm similarity index 100% rename from queries/arduino/injections.scm rename to runtime/queries/arduino/injections.scm diff --git a/queries/arduino/locals.scm b/runtime/queries/arduino/locals.scm similarity index 100% rename from queries/arduino/locals.scm rename to runtime/queries/arduino/locals.scm diff --git a/queries/asm/highlights.scm b/runtime/queries/asm/highlights.scm similarity index 100% rename from queries/asm/highlights.scm rename to runtime/queries/asm/highlights.scm diff --git a/queries/asm/injections.scm b/runtime/queries/asm/injections.scm similarity index 100% rename from queries/asm/injections.scm rename to runtime/queries/asm/injections.scm diff --git a/queries/astro/folds.scm b/runtime/queries/astro/folds.scm similarity index 100% rename from queries/astro/folds.scm rename to runtime/queries/astro/folds.scm diff --git a/queries/astro/highlights.scm b/runtime/queries/astro/highlights.scm similarity index 100% rename from queries/astro/highlights.scm rename to runtime/queries/astro/highlights.scm diff --git a/queries/astro/indents.scm b/runtime/queries/astro/indents.scm similarity index 100% rename from queries/astro/indents.scm rename to runtime/queries/astro/indents.scm diff --git a/queries/astro/injections.scm b/runtime/queries/astro/injections.scm similarity index 100% rename from queries/astro/injections.scm rename to runtime/queries/astro/injections.scm diff --git a/queries/astro/locals.scm b/runtime/queries/astro/locals.scm similarity index 100% rename from queries/astro/locals.scm rename to runtime/queries/astro/locals.scm diff --git a/queries/authzed/highlights.scm b/runtime/queries/authzed/highlights.scm similarity index 100% rename from queries/authzed/highlights.scm rename to runtime/queries/authzed/highlights.scm diff --git a/queries/bass/injections.scm b/runtime/queries/authzed/injections.scm similarity index 100% rename from queries/bass/injections.scm rename to runtime/queries/authzed/injections.scm diff --git a/queries/awk/highlights.scm b/runtime/queries/awk/highlights.scm similarity index 100% rename from queries/awk/highlights.scm rename to runtime/queries/awk/highlights.scm diff --git a/queries/awk/injections.scm b/runtime/queries/awk/injections.scm similarity index 100% rename from queries/awk/injections.scm rename to runtime/queries/awk/injections.scm diff --git a/queries/bash/folds.scm b/runtime/queries/bash/folds.scm similarity index 100% rename from queries/bash/folds.scm rename to runtime/queries/bash/folds.scm diff --git a/queries/bash/highlights.scm b/runtime/queries/bash/highlights.scm similarity index 100% rename from queries/bash/highlights.scm rename to runtime/queries/bash/highlights.scm diff --git a/queries/bash/injections.scm b/runtime/queries/bash/injections.scm similarity index 100% rename from queries/bash/injections.scm rename to runtime/queries/bash/injections.scm diff --git a/queries/bash/locals.scm b/runtime/queries/bash/locals.scm similarity index 100% rename from queries/bash/locals.scm rename to runtime/queries/bash/locals.scm diff --git a/queries/bass/folds.scm b/runtime/queries/bass/folds.scm similarity index 100% rename from queries/bass/folds.scm rename to runtime/queries/bass/folds.scm diff --git a/queries/bass/highlights.scm b/runtime/queries/bass/highlights.scm similarity index 100% rename from queries/bass/highlights.scm rename to runtime/queries/bass/highlights.scm diff --git a/queries/bass/indents.scm b/runtime/queries/bass/indents.scm similarity index 100% rename from queries/bass/indents.scm rename to runtime/queries/bass/indents.scm diff --git a/queries/scala/injections.scm b/runtime/queries/bass/injections.scm similarity index 100% rename from queries/scala/injections.scm rename to runtime/queries/bass/injections.scm diff --git a/queries/bass/locals.scm b/runtime/queries/bass/locals.scm similarity index 100% rename from queries/bass/locals.scm rename to runtime/queries/bass/locals.scm diff --git a/queries/beancount/folds.scm b/runtime/queries/beancount/folds.scm similarity index 100% rename from queries/beancount/folds.scm rename to runtime/queries/beancount/folds.scm diff --git a/queries/beancount/highlights.scm b/runtime/queries/beancount/highlights.scm similarity index 100% rename from queries/beancount/highlights.scm rename to runtime/queries/beancount/highlights.scm diff --git a/queries/verilog/injections.scm b/runtime/queries/beancount/injections.scm similarity index 100% rename from queries/verilog/injections.scm rename to runtime/queries/beancount/injections.scm diff --git a/queries/bibtex/folds.scm b/runtime/queries/bibtex/folds.scm similarity index 100% rename from queries/bibtex/folds.scm rename to runtime/queries/bibtex/folds.scm diff --git a/queries/bibtex/highlights.scm b/runtime/queries/bibtex/highlights.scm similarity index 100% rename from queries/bibtex/highlights.scm rename to runtime/queries/bibtex/highlights.scm diff --git a/queries/bibtex/indents.scm b/runtime/queries/bibtex/indents.scm similarity index 100% rename from queries/bibtex/indents.scm rename to runtime/queries/bibtex/indents.scm diff --git a/queries/bibtex/injections.scm b/runtime/queries/bibtex/injections.scm similarity index 100% rename from queries/bibtex/injections.scm rename to runtime/queries/bibtex/injections.scm diff --git a/queries/bicep/folds.scm b/runtime/queries/bicep/folds.scm similarity index 100% rename from queries/bicep/folds.scm rename to runtime/queries/bicep/folds.scm diff --git a/queries/bicep/highlights.scm b/runtime/queries/bicep/highlights.scm similarity index 100% rename from queries/bicep/highlights.scm rename to runtime/queries/bicep/highlights.scm diff --git a/queries/bicep/indents.scm b/runtime/queries/bicep/indents.scm similarity index 100% rename from queries/bicep/indents.scm rename to runtime/queries/bicep/indents.scm diff --git a/queries/bicep/injections.scm b/runtime/queries/bicep/injections.scm similarity index 100% rename from queries/bicep/injections.scm rename to runtime/queries/bicep/injections.scm diff --git a/queries/bicep/locals.scm b/runtime/queries/bicep/locals.scm similarity index 100% rename from queries/bicep/locals.scm rename to runtime/queries/bicep/locals.scm diff --git a/queries/bitbake/folds.scm b/runtime/queries/bitbake/folds.scm similarity index 100% rename from queries/bitbake/folds.scm rename to runtime/queries/bitbake/folds.scm diff --git a/queries/bitbake/highlights.scm b/runtime/queries/bitbake/highlights.scm similarity index 100% rename from queries/bitbake/highlights.scm rename to runtime/queries/bitbake/highlights.scm diff --git a/queries/bitbake/indents.scm b/runtime/queries/bitbake/indents.scm similarity index 100% rename from queries/bitbake/indents.scm rename to runtime/queries/bitbake/indents.scm diff --git a/queries/bitbake/injections.scm b/runtime/queries/bitbake/injections.scm similarity index 100% rename from queries/bitbake/injections.scm rename to runtime/queries/bitbake/injections.scm diff --git a/queries/bitbake/locals.scm b/runtime/queries/bitbake/locals.scm similarity index 100% rename from queries/bitbake/locals.scm rename to runtime/queries/bitbake/locals.scm diff --git a/queries/blade/folds.scm b/runtime/queries/blade/folds.scm similarity index 100% rename from queries/blade/folds.scm rename to runtime/queries/blade/folds.scm diff --git a/queries/blade/highlights.scm b/runtime/queries/blade/highlights.scm similarity index 100% rename from queries/blade/highlights.scm rename to runtime/queries/blade/highlights.scm diff --git a/queries/blade/indents.scm b/runtime/queries/blade/indents.scm similarity index 100% rename from queries/blade/indents.scm rename to runtime/queries/blade/indents.scm diff --git a/queries/blade/injections.scm b/runtime/queries/blade/injections.scm similarity index 100% rename from queries/blade/injections.scm rename to runtime/queries/blade/injections.scm diff --git a/queries/blueprint/highlights.scm b/runtime/queries/blueprint/highlights.scm similarity index 100% rename from queries/blueprint/highlights.scm rename to runtime/queries/blueprint/highlights.scm diff --git a/queries/ada/injections.scm b/runtime/queries/blueprint/injections.scm similarity index 100% rename from queries/ada/injections.scm rename to runtime/queries/blueprint/injections.scm diff --git a/queries/bp/folds.scm b/runtime/queries/bp/folds.scm similarity index 100% rename from queries/bp/folds.scm rename to runtime/queries/bp/folds.scm diff --git a/queries/bp/highlights.scm b/runtime/queries/bp/highlights.scm similarity index 100% rename from queries/bp/highlights.scm rename to runtime/queries/bp/highlights.scm diff --git a/queries/bp/indents.scm b/runtime/queries/bp/indents.scm similarity index 100% rename from queries/bp/indents.scm rename to runtime/queries/bp/indents.scm diff --git a/queries/agda/injections.scm b/runtime/queries/bp/injections.scm similarity index 100% rename from queries/agda/injections.scm rename to runtime/queries/bp/injections.scm diff --git a/queries/bp/locals.scm b/runtime/queries/bp/locals.scm similarity index 100% rename from queries/bp/locals.scm rename to runtime/queries/bp/locals.scm diff --git a/queries/brightscript/folds.scm b/runtime/queries/brightscript/folds.scm similarity index 100% rename from queries/brightscript/folds.scm rename to runtime/queries/brightscript/folds.scm diff --git a/queries/brightscript/highlights.scm b/runtime/queries/brightscript/highlights.scm similarity index 100% rename from queries/brightscript/highlights.scm rename to runtime/queries/brightscript/highlights.scm diff --git a/queries/brightscript/indents.scm b/runtime/queries/brightscript/indents.scm similarity index 100% rename from queries/brightscript/indents.scm rename to runtime/queries/brightscript/indents.scm diff --git a/queries/authzed/injections.scm b/runtime/queries/brightscript/injections.scm similarity index 100% rename from queries/authzed/injections.scm rename to runtime/queries/brightscript/injections.scm diff --git a/queries/c/folds.scm b/runtime/queries/c/folds.scm similarity index 100% rename from queries/c/folds.scm rename to runtime/queries/c/folds.scm diff --git a/queries/c/highlights.scm b/runtime/queries/c/highlights.scm similarity index 100% rename from queries/c/highlights.scm rename to runtime/queries/c/highlights.scm diff --git a/queries/c/indents.scm b/runtime/queries/c/indents.scm similarity index 100% rename from queries/c/indents.scm rename to runtime/queries/c/indents.scm diff --git a/queries/c/injections.scm b/runtime/queries/c/injections.scm similarity index 100% rename from queries/c/injections.scm rename to runtime/queries/c/injections.scm diff --git a/queries/c/locals.scm b/runtime/queries/c/locals.scm similarity index 100% rename from queries/c/locals.scm rename to runtime/queries/c/locals.scm diff --git a/queries/c_sharp/folds.scm b/runtime/queries/c_sharp/folds.scm similarity index 100% rename from queries/c_sharp/folds.scm rename to runtime/queries/c_sharp/folds.scm diff --git a/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm similarity index 100% rename from queries/c_sharp/highlights.scm rename to runtime/queries/c_sharp/highlights.scm diff --git a/queries/beancount/injections.scm b/runtime/queries/c_sharp/injections.scm similarity index 100% rename from queries/beancount/injections.scm rename to runtime/queries/c_sharp/injections.scm diff --git a/queries/c_sharp/locals.scm b/runtime/queries/c_sharp/locals.scm similarity index 100% rename from queries/c_sharp/locals.scm rename to runtime/queries/c_sharp/locals.scm diff --git a/queries/caddy/folds.scm b/runtime/queries/caddy/folds.scm similarity index 100% rename from queries/caddy/folds.scm rename to runtime/queries/caddy/folds.scm diff --git a/queries/caddy/highlights.scm b/runtime/queries/caddy/highlights.scm similarity index 100% rename from queries/caddy/highlights.scm rename to runtime/queries/caddy/highlights.scm diff --git a/queries/caddy/indents.scm b/runtime/queries/caddy/indents.scm similarity index 100% rename from queries/caddy/indents.scm rename to runtime/queries/caddy/indents.scm diff --git a/queries/blueprint/injections.scm b/runtime/queries/caddy/injections.scm similarity index 100% rename from queries/blueprint/injections.scm rename to runtime/queries/caddy/injections.scm diff --git a/queries/cairo/folds.scm b/runtime/queries/cairo/folds.scm similarity index 100% rename from queries/cairo/folds.scm rename to runtime/queries/cairo/folds.scm diff --git a/queries/cairo/highlights.scm b/runtime/queries/cairo/highlights.scm similarity index 100% rename from queries/cairo/highlights.scm rename to runtime/queries/cairo/highlights.scm diff --git a/queries/cairo/indents.scm b/runtime/queries/cairo/indents.scm similarity index 100% rename from queries/cairo/indents.scm rename to runtime/queries/cairo/indents.scm diff --git a/queries/cairo/injections.scm b/runtime/queries/cairo/injections.scm similarity index 100% rename from queries/cairo/injections.scm rename to runtime/queries/cairo/injections.scm diff --git a/queries/cairo/locals.scm b/runtime/queries/cairo/locals.scm similarity index 100% rename from queries/cairo/locals.scm rename to runtime/queries/cairo/locals.scm diff --git a/queries/capnp/folds.scm b/runtime/queries/capnp/folds.scm similarity index 100% rename from queries/capnp/folds.scm rename to runtime/queries/capnp/folds.scm diff --git a/queries/capnp/highlights.scm b/runtime/queries/capnp/highlights.scm similarity index 100% rename from queries/capnp/highlights.scm rename to runtime/queries/capnp/highlights.scm diff --git a/queries/capnp/indents.scm b/runtime/queries/capnp/indents.scm similarity index 100% rename from queries/capnp/indents.scm rename to runtime/queries/capnp/indents.scm diff --git a/queries/bp/injections.scm b/runtime/queries/capnp/injections.scm similarity index 100% rename from queries/bp/injections.scm rename to runtime/queries/capnp/injections.scm diff --git a/queries/capnp/locals.scm b/runtime/queries/capnp/locals.scm similarity index 100% rename from queries/capnp/locals.scm rename to runtime/queries/capnp/locals.scm diff --git a/queries/chatito/folds.scm b/runtime/queries/chatito/folds.scm similarity index 100% rename from queries/chatito/folds.scm rename to runtime/queries/chatito/folds.scm diff --git a/queries/chatito/highlights.scm b/runtime/queries/chatito/highlights.scm similarity index 100% rename from queries/chatito/highlights.scm rename to runtime/queries/chatito/highlights.scm diff --git a/queries/chatito/indents.scm b/runtime/queries/chatito/indents.scm similarity index 100% rename from queries/chatito/indents.scm rename to runtime/queries/chatito/indents.scm diff --git a/queries/brightscript/injections.scm b/runtime/queries/chatito/injections.scm similarity index 100% rename from queries/brightscript/injections.scm rename to runtime/queries/chatito/injections.scm diff --git a/queries/chatito/locals.scm b/runtime/queries/chatito/locals.scm similarity index 100% rename from queries/chatito/locals.scm rename to runtime/queries/chatito/locals.scm diff --git a/queries/circom/folds.scm b/runtime/queries/circom/folds.scm similarity index 100% rename from queries/circom/folds.scm rename to runtime/queries/circom/folds.scm diff --git a/queries/circom/highlights.scm b/runtime/queries/circom/highlights.scm similarity index 100% rename from queries/circom/highlights.scm rename to runtime/queries/circom/highlights.scm diff --git a/queries/c_sharp/injections.scm b/runtime/queries/circom/injections.scm similarity index 100% rename from queries/c_sharp/injections.scm rename to runtime/queries/circom/injections.scm diff --git a/queries/circom/locals.scm b/runtime/queries/circom/locals.scm similarity index 100% rename from queries/circom/locals.scm rename to runtime/queries/circom/locals.scm diff --git a/queries/clojure/folds.scm b/runtime/queries/clojure/folds.scm similarity index 100% rename from queries/clojure/folds.scm rename to runtime/queries/clojure/folds.scm diff --git a/queries/clojure/highlights.scm b/runtime/queries/clojure/highlights.scm similarity index 100% rename from queries/clojure/highlights.scm rename to runtime/queries/clojure/highlights.scm diff --git a/queries/caddy/injections.scm b/runtime/queries/clojure/injections.scm similarity index 100% rename from queries/caddy/injections.scm rename to runtime/queries/clojure/injections.scm diff --git a/queries/clojure/locals.scm b/runtime/queries/clojure/locals.scm similarity index 100% rename from queries/clojure/locals.scm rename to runtime/queries/clojure/locals.scm diff --git a/queries/cmake/folds.scm b/runtime/queries/cmake/folds.scm similarity index 100% rename from queries/cmake/folds.scm rename to runtime/queries/cmake/folds.scm diff --git a/queries/cmake/highlights.scm b/runtime/queries/cmake/highlights.scm similarity index 100% rename from queries/cmake/highlights.scm rename to runtime/queries/cmake/highlights.scm diff --git a/queries/cmake/indents.scm b/runtime/queries/cmake/indents.scm similarity index 100% rename from queries/cmake/indents.scm rename to runtime/queries/cmake/indents.scm diff --git a/queries/cmake/injections.scm b/runtime/queries/cmake/injections.scm similarity index 100% rename from queries/cmake/injections.scm rename to runtime/queries/cmake/injections.scm diff --git a/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm similarity index 100% rename from queries/comment/highlights.scm rename to runtime/queries/comment/highlights.scm diff --git a/queries/commonlisp/folds.scm b/runtime/queries/commonlisp/folds.scm similarity index 100% rename from queries/commonlisp/folds.scm rename to runtime/queries/commonlisp/folds.scm diff --git a/queries/commonlisp/highlights.scm b/runtime/queries/commonlisp/highlights.scm similarity index 100% rename from queries/commonlisp/highlights.scm rename to runtime/queries/commonlisp/highlights.scm diff --git a/queries/commonlisp/injections.scm b/runtime/queries/commonlisp/injections.scm similarity index 100% rename from queries/commonlisp/injections.scm rename to runtime/queries/commonlisp/injections.scm diff --git a/queries/commonlisp/locals.scm b/runtime/queries/commonlisp/locals.scm similarity index 100% rename from queries/commonlisp/locals.scm rename to runtime/queries/commonlisp/locals.scm diff --git a/queries/cooklang/highlights.scm b/runtime/queries/cooklang/highlights.scm similarity index 100% rename from queries/cooklang/highlights.scm rename to runtime/queries/cooklang/highlights.scm diff --git a/queries/capnp/injections.scm b/runtime/queries/cooklang/injections.scm similarity index 100% rename from queries/capnp/injections.scm rename to runtime/queries/cooklang/injections.scm diff --git a/queries/corn/folds.scm b/runtime/queries/corn/folds.scm similarity index 100% rename from queries/corn/folds.scm rename to runtime/queries/corn/folds.scm diff --git a/queries/corn/highlights.scm b/runtime/queries/corn/highlights.scm similarity index 100% rename from queries/corn/highlights.scm rename to runtime/queries/corn/highlights.scm diff --git a/queries/corn/indents.scm b/runtime/queries/corn/indents.scm similarity index 100% rename from queries/corn/indents.scm rename to runtime/queries/corn/indents.scm diff --git a/queries/chatito/injections.scm b/runtime/queries/corn/injections.scm similarity index 100% rename from queries/chatito/injections.scm rename to runtime/queries/corn/injections.scm diff --git a/queries/corn/locals.scm b/runtime/queries/corn/locals.scm similarity index 100% rename from queries/corn/locals.scm rename to runtime/queries/corn/locals.scm diff --git a/queries/cpon/folds.scm b/runtime/queries/cpon/folds.scm similarity index 100% rename from queries/cpon/folds.scm rename to runtime/queries/cpon/folds.scm diff --git a/queries/cpon/highlights.scm b/runtime/queries/cpon/highlights.scm similarity index 100% rename from queries/cpon/highlights.scm rename to runtime/queries/cpon/highlights.scm diff --git a/queries/cpon/indents.scm b/runtime/queries/cpon/indents.scm similarity index 100% rename from queries/cpon/indents.scm rename to runtime/queries/cpon/indents.scm diff --git a/queries/circom/injections.scm b/runtime/queries/cpon/injections.scm similarity index 100% rename from queries/circom/injections.scm rename to runtime/queries/cpon/injections.scm diff --git a/queries/cpon/locals.scm b/runtime/queries/cpon/locals.scm similarity index 100% rename from queries/cpon/locals.scm rename to runtime/queries/cpon/locals.scm diff --git a/queries/cpp/folds.scm b/runtime/queries/cpp/folds.scm similarity index 100% rename from queries/cpp/folds.scm rename to runtime/queries/cpp/folds.scm diff --git a/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm similarity index 100% rename from queries/cpp/highlights.scm rename to runtime/queries/cpp/highlights.scm diff --git a/queries/cpp/indents.scm b/runtime/queries/cpp/indents.scm similarity index 100% rename from queries/cpp/indents.scm rename to runtime/queries/cpp/indents.scm diff --git a/queries/cpp/injections.scm b/runtime/queries/cpp/injections.scm similarity index 79% rename from queries/cpp/injections.scm rename to runtime/queries/cpp/injections.scm index 07f21dd14..1fbc8e131 100644 --- a/queries/cpp/injections.scm +++ b/runtime/queries/cpp/injections.scm @@ -1,6 +1,4 @@ ; inherits: c -((comment) @injection.content - (#set! injection.language "comment")) ((comment) @injection.content (#lua-match? @injection.content "/[*\/][!*\/] 0 and { unpack(_G.arg) } or require("nvim-treesitter.info").installed_parsers() - local query_types = queries.built_in_query_groups + local parsers = require('nvim-treesitter.config').installed_parsers() + local query_types = require('nvim-treesitter.health').bundled_queries local captures = extract_captures() local errors = {} - io_print "::group::Check parsers" + io_print('::group::Check parsers') for _, lang in pairs(parsers) do timings[lang] = {} for _, query_type in pairs(query_types) do local before = vim.loop.hrtime() - local ok, query = pcall(queries.get_query, lang, query_type) + local ok, query = pcall(vim.treesitter.query.get, lang, query_type) local after = vim.loop.hrtime() local duration = after - before table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) - io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6)) + io_print( + 'Checking ' .. lang .. ' ' .. query_type .. string.format(' (%.02fms)', duration * 1e-6) + ) if not ok then - local err_msg = lang .. " (" .. query_type .. "): " .. query + local err_msg = lang .. ' (' .. query_type .. '): ' .. query errors[#errors + 1] = err_msg else if query then for _, capture in ipairs(query.captures) do local is_valid = ( - vim.startswith(capture, "_") -- Helpers. - or vim.tbl_contains(captures[query_type], capture) + vim.startswith(capture, '_') -- Helpers. + or vim.list_contains(captures[query_type], capture) ) if not is_valid then - local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang) + local error = + string.format('(x) Invalid capture @%s in %s for %s.', capture, query_type, lang) errors[#errors + 1] = error end end @@ -76,10 +77,10 @@ local function do_check() end end - io_print "::endgroup::" + io_print('::endgroup::') if #errors > 0 then - io_print "\nCheck failed!\nErrors:" + io_print('\nCheck failed!\nErrors:') for _, err in ipairs(errors) do print(err) end @@ -89,35 +90,42 @@ local function do_check() end local ok, result = pcall(do_check) -local allowed_to_fail = vim.split(vim.env.ALLOWED_INSTALLATION_FAILURES or "", ",", true) +local allowed_to_fail = vim.split(vim.env.ALLOWED_INSTALLATION_FAILURES or '', ',', true) -for k, v in pairs(require("nvim-treesitter.parsers").get_parser_configs()) do - if not require("nvim-treesitter.parsers").has_parser(k) then +for k, v in pairs(require('nvim-treesitter.parsers').configs) do + if #vim.api.nvim_get_runtime_file('parser/' .. k .. '.*', false) == 0 then -- On CI all parsers that can be installed from C files should be installed if vim.env.CI and not v.install_info.requires_generate_from_grammar - and not vim.tbl_contains(allowed_to_fail, k) + and not vim.list_contains(allowed_to_fail, k) then - io_print("Error: parser for " .. k .. " is not installed") - vim.cmd "cq" + io_print('Error: parser for ' .. k .. ' is not installed') + vim.cmd('cq') else - io_print("Warning: parser for " .. k .. " is not installed") + io_print('Warning: parser for ' .. k .. ' is not installed') end end end if ok then - io_print "::group::Timings" + io_print('::group::Timings') table.sort(result, function(a, b) return a.duration < b.duration end) for i, val in ipairs(result) do - io_print(string.format("%i. %.02fms %s %s", #result - i + 1, val.duration * 1e-6, val.lang, val.query_type)) + io_print( + string.format( + '%i. %.02fms %s %s', + #result - i + 1, + val.duration * 1e-6, + val.lang, + val.query_type + ) + ) end - io_print "::endgroup::" - io_print "Check successful!" - vim.cmd "q" + io_print('::endgroup::') + io_print('Check successful!') else - vim.cmd "cq" + vim.cmd('cq') end diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh index 5ab8887de..100cfde27 100755 --- a/scripts/ci-install.sh +++ b/scripts/ci-install.sh @@ -2,6 +2,8 @@ set -e +NVIM_TAG=${NVIM_TAG-nightly} + os=$(uname -s) if [[ $os == Linux ]]; then wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux-x86_64.tar.gz @@ -18,7 +20,7 @@ elif [[ $os == Darwin ]]; then mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start else - curl -L https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-win64.zip -o nvim-win64.zip + curl -L "https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-win64.zip" -o nvim-win64.zip unzip nvim-win64 mkdir -p ~/AppData/Local/nvim/pack/nvim-treesitter/start mkdir -p ~/AppData/Local/nvim-data diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index 0839760d2..8639daf2b 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -6,16 +6,16 @@ local get_node_text = ts.get_node_text ---@type string[] local files -local arg = _G.arg[1] or "." -if arg:match ".*%.scm$" then +local arg = _G.arg[1] or '.' +if arg:match('.*%.scm$') then files = { arg } else - files = vim.fn.split(vim.fn.glob(arg .. "/**/*.scm")) + files = vim.fn.split(vim.fn.glob(arg .. '/**/*.scm')) end -ts.query.add_predicate("kind-eq?", function(match, _, _, pred) +ts.query.add_predicate('kind-eq?', function(match, _, _, pred) local cap = match[pred[2]] - local node = type(cap) == "table" and cap[1] or cap + local node = type(cap) == 'table' and cap[1] or cap if not node then return true end @@ -24,9 +24,9 @@ ts.query.add_predicate("kind-eq?", function(match, _, _, pred) return vim.tbl_contains(types, node:type()) end, true) -ts.query.add_predicate("is-start-of-line?", function(match, _, _, pred) +ts.query.add_predicate('is-start-of-line?', function(match, _, _, pred) local cap = match[pred[2]] - local node = type(cap) == "table" and cap[1] or cap + local node = type(cap) == 'table' and cap[1] or cap if not node then return true end @@ -35,7 +35,7 @@ ts.query.add_predicate("is-start-of-line?", function(match, _, _, pred) end) --- Control the indent here. Change to \t if uses tab instead -local indent_str = " " +local indent_str = ' ' local indent_width_plus_one = 3 local textwidth = 100 @@ -328,7 +328,7 @@ local function append_lines(lines, lines_to_append) for i = 1, #lines_to_append, 1 do lines[#lines] = lines[#lines] .. lines_to_append[i] if i ~= #lines_to_append then - lines[#lines + 1] = "" + lines[#lines + 1] = '' end end end @@ -347,16 +347,17 @@ local function iter(bufnr, node, lines, q, level) apply_newline = false lines[#lines + 1] = string.rep(indent_str, level) end - if q["format.ignore"][id] then - local text = vim.split(get_node_text(child, bufnr):gsub("\r\n?", "\n"), "\n", { trimempty = true }) + if q['format.ignore'][id] then + local text = + vim.split(get_node_text(child, bufnr):gsub('\r\n?', '\n'), '\n', { trimempty = true }) append_lines(lines, text) - elseif not q["format.remove"][id] then - if not q["format.cancel-prepend"][id] then - if q["format.prepend-newline"][id] then + elseif not q['format.remove'][id] then + if not q['format.cancel-prepend'][id] then + if q['format.prepend-newline'][id] then lines[#lines + 1] = string.rep(indent_str, level) - elseif q["format.prepend-space"][id] then - if not q["format.prepend-space"][id]["conditional-newline"] then - lines[#lines] = lines[#lines] .. " " + elseif q['format.prepend-space'][id] then + if not q['format.prepend-space'][id]['conditional-newline'] then + lines[#lines] = lines[#lines] .. ' ' elseif child:byte_length() + 1 + #lines[#lines] > textwidth then lines[#lines + 1] = string.rep(indent_str, level) else @@ -365,43 +366,47 @@ local function iter(bufnr, node, lines, q, level) local _, _, byte_start = child:start() local _, _, byte_end = node:end_() if - q["format.prepend-space"][id]["lookahead-newline"] + q['format.prepend-space'][id]['lookahead-newline'] and (byte_end - byte_start) + #lines[#lines] > textwidth then lines[#lines + 1] = string.rep(indent_str, level) else - lines[#lines] = lines[#lines] .. " " + lines[#lines] = lines[#lines] .. ' ' end end end end - if q["format.replace"][id] then - append_lines(lines, vim.split(q["format.replace"][id].text, "\n", { trimempty = true })) + if q['format.replace'][id] then + append_lines(lines, vim.split(q['format.replace'][id].text, '\n', { trimempty = true })) elseif child:named_child_count() == 0 -- Workaround to preserve string content - or child:type() == "string" + or child:type() == 'string' then append_lines( lines, - vim.split(string.gsub(get_node_text(child, bufnr), "\r\n?", "\n"), "\n+", { trimempty = true }) + vim.split( + string.gsub(get_node_text(child, bufnr), '\r\n?', '\n'), + '\n+', + { trimempty = true } + ) ) else iter(bufnr, child, lines, q, level) end - if q["format.indent.begin"][id] then + if q['format.indent.begin'][id] then level = level + 1 apply_newline = true - elseif q["format.indent.dedent"][id] then + elseif q['format.indent.dedent'][id] then lines[#lines] = string.sub(lines[#lines], indent_width_plus_one) end end - if q["format.cancel-append"][id] then + if q['format.cancel-append'][id] then apply_newline = false - elseif q["format.append-newline"][id] then + elseif q['format.append-newline'][id] then apply_newline = true - elseif q["format.append-space"][id] then - lines[#lines] = lines[#lines] .. " " + elseif q['format.append-space'][id] then + lines[#lines] = lines[#lines] .. ' ' end end end @@ -409,7 +414,7 @@ end ---@param bufnr integer ---@param queries string local function format(bufnr, queries) - local lines = { "" } + local lines = { '' } -- stylua: ignore local map = { ['format.ignore'] = {}, -- Ignore the node and its children @@ -424,11 +429,12 @@ local function format(bufnr, queries) ['format.replace'] = {}, -- Dedicated capture used to store results of `(#gsub!)` ['format.remove'] = {}, -- Do not add the syntax node to the result, i.e. brackets [], parens () } - local root = ts.get_parser(bufnr, "query"):parse(true)[1]:root() - local query = ts.query.parse("query", queries) + local root = ts.get_parser(bufnr, 'query'):parse(true)[1]:root() + local query = ts.query.parse('query', queries) for id, node, metadata in query:iter_captures(root, bufnr) do - if query.captures[id]:sub(1, 1) ~= "_" then - map[query.captures[id]][node:id()] = metadata and (metadata[id] and metadata[id] or metadata) or {} + if query.captures[id]:sub(1, 1) ~= '_' then + map[query.captures[id]][node:id()] = metadata and (metadata[id] and metadata[id] or metadata) + or {} end end @@ -443,4 +449,4 @@ for _, file in ipairs(files) do format(buf, format_queries) end -vim.cmd "silent wa!" +vim.cmd('silent wa!') diff --git a/scripts/minimal_init.lua b/scripts/minimal_init.lua index f7a7ee590..c826ddbf2 100644 --- a/scripts/minimal_init.lua +++ b/scripts/minimal_init.lua @@ -1,25 +1,25 @@ -vim.opt.runtimepath:append "." -vim.cmd.runtime { "plugin/plenary.vim", bang = true } -vim.cmd.runtime { "plugin/nvim-treesitter.lua", bang = true } +vim.opt.runtimepath:append('.') +vim.cmd.runtime({ 'plugin/plenary.vim', bang = true }) +vim.cmd.runtime({ 'plugin/nvim-treesitter.lua', bang = true }) +vim.cmd.runtime({ 'plugin/query_predicates.lua', bang = true }) -vim.filetype.add { +vim.filetype.add({ extension = { - conf = "hocon", - cmm = "t32", - hurl = "hurl", - ncl = "nickel", - tig = "tiger", - usd = "usd", - usda = "usd", - wgsl = "wgsl", - w = "wing", + conf = 'hocon', + cmm = 't32', + ncl = 'nickel', + tig = 'tiger', + w = 'wing', }, -} +}) vim.o.swapfile = false vim.bo.swapfile = false -require("nvim-treesitter.configs").setup { - indent = { enable = true }, - highlight = { enable = true }, -} +require('nvim-treesitter').setup() +vim.api.nvim_create_autocmd('FileType', { + callback = function(args) + pcall(vim.treesitter.start) + vim.bo[args.buffer].indentexpr = 'v:lua.require"nvim-treesitter".indentexpr()' + end, +}) diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh index 22460d14b..d950b321a 100755 --- a/scripts/update-lockfile.sh +++ b/scripts/update-lockfile.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash make_ignored() { - if [[ -n $1 ]]; then + if [ -n "$1" ] + then while read -r lang; do - if [[ $lang != "$1" ]]; then - printf '%s,' "$lang" + if [ "$lang" != "$1" ] + then + printf "%s," "$lang" fi - done < <(jq -r 'keys[]' lockfile.json) + done < <(jq 'keys|@sh' -c lockfile.json) fi } -SKIP_LOCKFILE_UPDATE_FOR_LANGS="$(make_ignored "$1")" \ - nvim --headless -c 'luafile ./scripts/write-lockfile.lua' +q +TO_IGNORE=$(make_ignored $1) +SKIP_LOCKFILE_UPDATE_FOR_LANGS="$TO_IGNORE" nvim -l ./scripts/write-lockfile.lua # Pretty print cp lockfile.json /tmp/lockfile.json -jq --sort-keys > lockfile.json < /tmp/lockfile.json +cat /tmp/lockfile.json | jq --sort-keys > lockfile.json diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index 251a64af4..825d84037 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -1,59 +1,85 @@ #!/usr/bin/env -S nvim -l +vim.opt.runtimepath:append('.') ---@class Parser ---@field name string ---@field parser ParserInfo -local parsers = require("nvim-treesitter.parsers").get_parser_configs() +local parsers = require('nvim-treesitter.parsers').configs local sorted_parsers = {} - for k, v in pairs(parsers) do table.insert(sorted_parsers, { name = k, parser = v }) end - ----@param a Parser ----@param b Parser table.sort(sorted_parsers, function(a, b) return a.name < b.name end) -local generated_text = "" +local tiers = require('nvim-treesitter.parsers').tiers + +local generated_text = [[ +Language | Tier | Queries | CLI | NPM | Maintainer +-------- |:----:|:-------:|:---:|:---:| ---------- +]] +local footnotes = '' ----@param v Parser for _, v in ipairs(sorted_parsers) do - local link = "[" .. (v.parser.readme_name or v.name) .. "](" .. v.parser.install_info.url .. ")" - - if v.parser.maintainers then - generated_text = generated_text - .. "- [x] " - .. link - .. " (" - .. (v.parser.experimental and "experimental, " or "") - .. "maintained by " - .. table.concat(v.parser.maintainers, ", ") - .. ")\n" - else - generated_text = generated_text .. "- [ ] " .. link .. (v.parser.experimental and " (experimental)" or "") .. "\n" + local p = v.parser + -- language + generated_text = generated_text + .. '[' + .. v.name + .. '](' + .. p.install_info.url + .. ')' + .. (p.readme_note and '[^' .. v.name .. ']' or '') + .. ' | ' + if p.readme_note then + footnotes = footnotes .. '[^' .. v.name .. ']: ' .. p.readme_note .. '\n' end + + -- tier + generated_text = generated_text .. (p.tier and tiers[p.tier] or '') .. ' | ' + + -- queries + generated_text = generated_text + .. '`' + .. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/highlights.scm') and 'H' or ' ') + .. (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 ' ') + .. '` | ' + + -- CLI + generated_text = generated_text + .. (p.install_info.requires_generate_from_grammar and '✓' or '') + .. ' | ' + + -- NPM + generated_text = generated_text .. (p.install_info.generate_requires_npm and '✓' or '') .. ' | ' + + -- Maintainer + generated_text = generated_text + .. (p.maintainers and table.concat(p.maintainers, ', ') or '') + .. '\n' end +generated_text = generated_text .. footnotes -print(generated_text) -print "\n" - -local readme_text = table.concat(vim.fn.readfile "README.md", "\n") +local readme = assert(io.open('SUPPORTED_LANGUAGES.md', 'r')) +local readme_text = readme:read('*a') +readme:close() local new_readme_text = string.gsub( readme_text, - ".*", - "\n" .. generated_text .. "" + '.*', + '\n' .. generated_text .. '' ) -vim.fn.writefile(vim.fn.split(new_readme_text, "\n"), "README.md") + +readme = assert(io.open('SUPPORTED_LANGUAGES.md', 'w')) +readme:write(new_readme_text) +readme:close() if string.find(readme_text, generated_text, 1, true) then - print "README.md is up-to-date!" - vim.cmd "q" + print('README.md is up-to-date\n') else - print "New README.md was written. Please commit that change! Old text was: " - print(string.sub(readme_text, string.find(readme_text, ".*"))) - vim.cmd "cq" + print('New README.md was written\n') end diff --git a/scripts/write-lockfile.lua b/scripts/write-lockfile.lua index 7a7606c51..a264af83c 100755 --- a/scripts/write-lockfile.lua +++ b/scripts/write-lockfile.lua @@ -1,14 +1,52 @@ #!/usr/bin/env -S nvim -l +vim.opt.runtimepath:append('.') ----@type string|any[] -local skip_langs = vim.fn.getenv "SKIP_LOCKFILE_UPDATE_FOR_LANGS" +-- Load previous lockfile +local filename = require('nvim-treesitter.utils').get_package_path('lockfile.json') +local file = assert(io.open(filename, 'r')) +local lockfile = vim.json.decode(file:read('*a')) +file:close() -if skip_langs == vim.NIL then - skip_langs = {} -else - ---@diagnostic disable-next-line: param-type-mismatch - skip_langs = vim.fn.split(skip_langs, ",") +---@type string? +local skip_lang_string = os.getenv('SKIP_LOCKFILE_UPDATE_FOR_LANGS') +local skip_langs = skip_lang_string and vim.split(skip_lang_string, ',') or {} +vim.print('Skipping languages: ', skip_langs) + +local sorted_parsers = {} +local configs = require('nvim-treesitter.parsers').configs +for k, v in pairs(configs) do + table.insert(sorted_parsers, { name = k, parser = v }) end +table.sort(sorted_parsers, function(a, b) + return a.name < b.name +end) -require("nvim-treesitter.install").write_lockfile("verbose", skip_langs) -vim.cmd "q" +-- check for new revisions +for _, v in ipairs(sorted_parsers) do + if skip_langs and not vim.list_contains(skip_langs, v.name) then + local sha ---@type string + if v.parser.install_info.branch then + sha = vim.split( + vim.fn.systemlist( + 'git ls-remote ' + .. v.parser.install_info.url + .. ' | grep refs/heads/' + .. v.parser.install_info.branch + )[1], + '\t' + )[1] + else + sha = vim.split(vim.fn.systemlist('git ls-remote ' .. v.parser.install_info.url)[1], '\t')[1] + end + lockfile[v.name] = { revision = sha } + print(v.name .. ': ' .. sha) + else + print('Skipping ' .. v.name) + end +end +vim.print(lockfile) + +-- write new lockfile +file = assert(io.open(filename, 'w')) +file:write(vim.json.encode(lockfile)) +file:close() diff --git a/tests/indent/algorithm_spec.lua b/tests/indent/algorithm_spec.lua index faf7998ec..d93521040 100644 --- a/tests/indent/algorithm_spec.lua +++ b/tests/indent/algorithm_spec.lua @@ -1,18 +1,34 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -- local XFAIL = require("tests.indent.common").XFAIL -local runner = Runner:new(it, "tests/indent/algorithm", { +local runner = Runner:new(it, 'tests/indent/algorithm', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = true, }) -describe("test indent algorithm: ", function() - describe("new line:", function() - runner:new_line("trailing.py", { on_line = 1, text = "x: str", indent = 4 }, "indent next line, ignore comment") - runner:new_line("trailing.py", { on_line = 4, text = "pass", indent = 8 }, "indent next line, ignore comment") - runner:new_line("trailing.py", { on_line = 6, text = "pass", indent = 4 }, "indent next line, ignore whitespace") - runner:new_line("trailing_whitespace.html", { on_line = 9, text = "x", indent = 8 }, "not ignore @indent.end") +describe('test indent algorithm: ', function() + describe('new line:', function() + runner:new_line( + 'trailing.py', + { on_line = 1, text = 'x: str', indent = 4 }, + 'indent next line, ignore comment' + ) + runner:new_line( + 'trailing.py', + { on_line = 4, text = 'pass', indent = 8 }, + 'indent next line, ignore comment' + ) + runner:new_line( + 'trailing.py', + { on_line = 6, text = 'pass', indent = 4 }, + 'indent next line, ignore whitespace' + ) + runner:new_line( + 'trailing_whitespace.html', + { on_line = 9, text = 'x', indent = 8 }, + 'not ignore @indent.end' + ) end) end) diff --git a/tests/indent/angular_spec.lua b/tests/indent/angular_spec.lua index 2090420ce..3ead248b7 100644 --- a/tests/indent/angular_spec.lua +++ b/tests/indent/angular_spec.lua @@ -1,18 +1,18 @@ -local Runner = require("tests.indent.common").Runner -local runner = Runner:new(it, "tests/indent/angular", { +local Runner = require('tests.indent.common').Runner +local runner = Runner:new(it, 'tests/indent/angular', { tabstop = 2, shiftwidth = 2, expandtab = true, - filetype = "htmlangular", + filetype = 'htmlangular', }) -describe("indent HTML Angular:", function() - describe("whole file:", function() - runner:whole_file "." +describe('indent HTML Angular:', function() + describe('whole file:', function() + runner:whole_file('.') end) - describe("new line:", function() - for _, info in ipairs { + describe('new line:', function() + for _, info in ipairs({ { 1, 2 }, { 2, 2 }, { 3, 2 }, @@ -25,11 +25,11 @@ describe("indent HTML Angular:", function() { 12, 6 }, { 13, 4 }, { 14, 2 }, - } do - runner:new_line("if-else.html", { on_line = info[1], text = "//", indent = info[2] }) + }) do + runner:new_line('if-else.html', { on_line = info[1], text = '//', indent = info[2] }) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 4 }, { 3, 6 }, @@ -39,21 +39,21 @@ describe("indent HTML Angular:", function() { 9, 6 }, { 10, 6 }, { 12, 2 }, - } do - runner:new_line("switch-case.html", { on_line = info[1], text = "//", indent = info[2] }) + }) do + runner:new_line('switch-case.html', { on_line = info[1], text = '//', indent = info[2] }) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 2 }, { 3, 2 }, { 4, 2 }, { 5, 0 }, - } do - runner:new_line("for.html", { on_line = info[1], text = "//", indent = info[2] }) + }) do + runner:new_line('for.html', { on_line = info[1], text = '//', indent = info[2] }) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 2 }, { 3, 2 }, @@ -63,8 +63,8 @@ describe("indent HTML Angular:", function() { 7, 2 }, { 8, 2 }, { 9, 0 }, - } do - runner:new_line("defer.html", { on_line = info[1], text = "//", indent = info[2] }) + }) do + runner:new_line('defer.html', { on_line = info[1], text = '//', indent = info[2] }) end end) end) diff --git a/tests/indent/c_spec.lua b/tests/indent/c_spec.lua index 4e2826a54..528933599 100644 --- a/tests/indent/c_spec.lua +++ b/tests/indent/c_spec.lua @@ -1,58 +1,63 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -local runner = Runner:new(it, "tests/indent/c", { +local runner = Runner:new(it, 'tests/indent/c', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, }) -describe("indent C:", function() - describe("whole file:", function() - runner:whole_file(".", { +describe('indent C:', function() + describe('whole file:', function() + runner:whole_file('.', { expected_failures = { - "./preproc_func.c", - "./unfinished_comment.c", + './preproc_func.c', + './unfinished_comment.c', }, }) end) - describe("new line:", function() - runner:new_line("array.c", { on_line = 2, text = "0,", indent = 4 }) - runner:new_line("compound_lit.c", { on_line = 7, text = ".z = 5,", indent = 8 }) - runner:new_line("cond.c", { on_line = 3, text = "x++;", indent = 8 }) - runner:new_line("cond.c", { on_line = 6, text = "x++;", indent = 8 }) - runner:new_line("cond.c", { on_line = 8, text = "x++;", indent = 8 }) - runner:new_line("cond.c", { on_line = 9, text = "x++;", indent = 4 }) - runner:new_line("expr.c", { on_line = 10, text = "2 *", indent = 8 }) - runner:new_line("func.c", { on_line = 17, text = "int z,", indent = 4 }) - runner:new_line("label.c", { on_line = 3, text = "normal:", indent = 0 }) - runner:new_line("loop.c", { on_line = 3, text = "x++;", indent = 8 }) - runner:new_line("preproc_cond.c", { on_line = 5, text = "x++;", indent = 4 }) - runner:new_line("preproc_func.c", { on_line = 3, text = "x++; \\", indent = 8 }, "expected failure", XFAIL) - runner:new_line("string.c", { on_line = 1, text = "brave new \\", indent = 0 }) - runner:new_line("string.c", { on_line = 4, text = '"brave new "', indent = 4 }) - runner:new_line("struct.c", { on_line = 4, text = "int y;", indent = 8 }) - runner:new_line("switch.c", { on_line = 3, text = "x++;", indent = 12 }) - runner:new_line("ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }) - runner:new_line("issue-1568.c", { on_line = 4, text = "x++;", indent = 8 }) - runner:new_line("issue-2086.c", { on_line = 3, text = "}", indent = 0 }) - runner:new_line("issue-4079.c", { on_line = 2, text = "return;", indent = 8 }) - runner:new_line("issue-4079.c", { on_line = 2, text = "{", indent = 4 }) - runner:new_line("issue-4079.c", { on_line = 6, text = "{", indent = 4 }) - runner:new_line("issue-4117.c", { on_line = 3, text = "else", indent = 4 }) + describe('new line:', function() + runner:new_line('array.c', { on_line = 2, text = '0,', indent = 4 }) + runner:new_line('compound_lit.c', { on_line = 7, text = '.z = 5,', indent = 8 }) + runner:new_line('cond.c', { on_line = 3, text = 'x++;', indent = 8 }) + runner:new_line('cond.c', { on_line = 6, text = 'x++;', indent = 8 }) + runner:new_line('cond.c', { on_line = 8, text = 'x++;', indent = 8 }) + runner:new_line('cond.c', { on_line = 9, text = 'x++;', indent = 4 }) + runner:new_line('expr.c', { on_line = 10, text = '2 *', indent = 8 }) + runner:new_line('func.c', { on_line = 17, text = 'int z,', indent = 4 }) + runner:new_line('label.c', { on_line = 3, text = 'normal:', indent = 0 }) + runner:new_line('loop.c', { on_line = 3, text = 'x++;', indent = 8 }) + runner:new_line('preproc_cond.c', { on_line = 5, text = 'x++;', indent = 4 }) + runner:new_line( + 'preproc_func.c', + { on_line = 3, text = 'x++; \\', indent = 8 }, + 'expected failure', + XFAIL + ) + runner:new_line('string.c', { on_line = 1, text = 'brave new \\', indent = 0 }) + runner:new_line('string.c', { on_line = 4, text = '"brave new "', indent = 4 }) + runner:new_line('struct.c', { on_line = 4, text = 'int y;', indent = 8 }) + runner:new_line('switch.c', { on_line = 3, text = 'x++;', indent = 12 }) + runner:new_line('ternary.c', { on_line = 4, text = ': (x == 0) : 0', indent = 8 }) + runner:new_line('issue-1568.c', { on_line = 4, text = 'x++;', indent = 8 }) + runner:new_line('issue-2086.c', { on_line = 3, text = '}', indent = 0 }) + runner:new_line('issue-4079.c', { on_line = 2, text = 'return;', indent = 8 }) + runner:new_line('issue-4079.c', { on_line = 2, text = '{', indent = 4 }) + runner:new_line('issue-4079.c', { on_line = 6, text = '{', indent = 4 }) + runner:new_line('issue-4117.c', { on_line = 3, text = 'else', indent = 4 }) -- the line after inserted one will be left with wrong indent but we only care about the inserted one - for _, line in ipairs { 2, 4, 7, 10 } do - runner:new_line("no_braces.c", { on_line = line, text = "x++;", indent = 8 }) + for _, line in ipairs({ 2, 4, 7, 10 }) do + runner:new_line('no_braces.c', { on_line = line, text = 'x++;', indent = 8 }) end - for _, line in ipairs { 2, 5, 7, 10, 12, 14, 20, 22, 25, 27, 28, 33 } do - runner:new_line("if_else.c", { on_line = line, text = "x++;", indent = 8 }) + for _, line in ipairs({ 2, 5, 7, 10, 12, 14, 20, 22, 25, 27, 28, 33 }) do + runner:new_line('if_else.c', { on_line = line, text = 'x++;', indent = 8 }) end - for _, line in ipairs { 3, 6, 8, 13, 15, 20, 23 } do - runner:new_line("if_else.c", { on_line = line, text = "else", indent = 4 }) + for _, line in ipairs({ 3, 6, 8, 13, 15, 20, 23 }) do + runner:new_line('if_else.c', { on_line = line, text = 'else', indent = 4 }) end - for _, info in ipairs { + for _, info in ipairs({ { 36, 12 }, { 37, 16 }, { 38, 12 }, @@ -66,15 +71,15 @@ describe("indent C:", function() { 52, 8 }, { 53, 12 }, { 54, 12 }, - } do - runner:new_line("if_else.c", { on_line = info[1], text = "x++;", indent = info[2] }) + }) do + runner:new_line('if_else.c', { on_line = info[1], text = 'x++;', indent = info[2] }) end -- dedent braces on new line - for _, line in ipairs { 10, 12, 14 } do - runner:new_line("if_else.c", { on_line = line, text = "{}", indent = 4 }) + for _, line in ipairs({ 10, 12, 14 }) do + runner:new_line('if_else.c', { on_line = line, text = '{}', indent = 4 }) end - for _, info in ipairs { + for _, info in ipairs({ { 8, 0 }, { 10, 0 }, { 13, 4 }, @@ -86,8 +91,8 @@ describe("indent C:", function() { 20, 8 }, { 21, 8 }, { 22, 4 }, - } do - runner:new_line("issue-4525.c", { on_line = info[1], text = "x++;", indent = info[2] }) + }) do + runner:new_line('issue-4525.c', { on_line = info[1], text = 'x++;', indent = info[2] }) end end) end) diff --git a/tests/indent/capnp_spec.lua b/tests/indent/capnp_spec.lua index 7c8418b06..d5dd8c5fd 100644 --- a/tests/indent/capnp_spec.lua +++ b/tests/indent/capnp_spec.lua @@ -1,30 +1,30 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/capnp", { +local run = Runner:new(it, 'tests/indent/capnp', { tabstop = 2, shiftwidth = 2, expandtab = true, }) describe("indent Cap'n Proto:", function() - describe("whole file:", function() - run:whole_file(".", { + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("test.capnp", { on_line = 31, text = "foo @0;", indent = 2 }) - run:new_line("test.capnp", { on_line = 96, text = "boolField = true,", indent = 4 }) - run:new_line("test.capnp", { on_line = 340, text = "grault @7 :UInt64;", indent = 8 }) - run:new_line("test.capnp", { + describe('new line:', function() + run:new_line('test.capnp', { on_line = 31, text = 'foo @0;', indent = 2 }) + run:new_line('test.capnp', { on_line = 96, text = 'boolField = true,', indent = 4 }) + run:new_line('test.capnp', { on_line = 340, text = 'grault @7 :UInt64;', indent = 8 }) + run:new_line('test.capnp', { on_line = 573, - text = "call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));", + text = 'call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));', indent = 4, }) - run:new_line("test.capnp", { on_line = 617, text = "foo @0 :Foo;", indent = 4 }) - run:new_line("test.capnp", { on_line = 654, text = "foo = (int16Field = 123),", indent = 4 }) - run:new_line("test.capnp", { on_line = 695, text = 'textField = "nested",', indent = 6 }) - run:new_line("test.capnp", { on_line = 970, text = "testTailCaller @4;", indent = 4 }) + run:new_line('test.capnp', { on_line = 617, text = 'foo @0 :Foo;', indent = 4 }) + run:new_line('test.capnp', { on_line = 654, text = 'foo = (int16Field = 123),', indent = 4 }) + run:new_line('test.capnp', { on_line = 695, text = 'textField = "nested",', indent = 6 }) + run:new_line('test.capnp', { on_line = 970, text = 'testTailCaller @4;', indent = 4 }) end) end) diff --git a/tests/indent/common.lua b/tests/indent/common.lua index 6cfedafff..5c291070e 100644 --- a/tests/indent/common.lua +++ b/tests/indent/common.lua @@ -1,11 +1,11 @@ local M = {} -local assert = require "luassert" -local say = require "say" -local scan_dir = require("plenary.scandir").scan_dir -local Path = require "plenary.path" +local assert = require('luassert') +local say = require('say') +local scan_dir = require('plenary.scandir').scan_dir +local Path = require('plenary.path') -M.XFAIL = "xfail" +M.XFAIL = 'xfail' local function same_indent(state, arguments) local before = arguments[1] @@ -14,11 +14,11 @@ local function same_indent(state, arguments) local ok = true local errors = { before = {}, after = {} } for line = 1, #before do - if #string.match(before[line], "^%s*") ~= #string.match(after[line], "^%s*") then + if #string.match(before[line], '^%s*') ~= #string.match(after[line], '^%s*') then if before[line] and after[line] then -- store the actual indentation length for each line - errors.before[line] = #string.match(before[line], "^%s*") - errors.after[line] = #string.match(after[line], "^%s*") + errors.before[line] = #string.match(before[line], '^%s*') + errors.after[line] = #string.match(after[line], '^%s*') end ok = false end @@ -42,39 +42,39 @@ local function format_indent(arg, fmtargs) end width = width + 3 - local header_fmt = "%8s %2s%-" .. tostring(width + 1) .. "s %s" - local fmt = "%8s %2s |%-" .. tostring(width) .. "s |%s" + local header_fmt = '%8s %2s%-' .. tostring(width + 1) .. 's %s' + local fmt = '%8s %2s |%-' .. tostring(width) .. 's |%s' - local output = { header_fmt:format("", "", "Found:", "Expected:") } + local output = { header_fmt:format('', '', 'Found:', 'Expected:') } for i, line in ipairs(arg) do if fmtargs.errors.before[i] then - local indents = string.format("%d vs %d", fmtargs.errors.after[i], fmtargs.errors.before[i]) - table.insert(output, fmt:format(indents, "=>", fmtargs.other[i], line)) + local indents = string.format('%d vs %d', fmtargs.errors.after[i], fmtargs.errors.before[i]) + table.insert(output, fmt:format(indents, '=>', fmtargs.other[i], line)) else - table.insert(output, fmt:format("", "", fmtargs.other[i], line)) + table.insert(output, fmt:format('', '', fmtargs.other[i], line)) end end - return table.concat(output, "\n") + return table.concat(output, '\n') end -say:set_namespace "en" -say:set("assertion.same_indent.positive", "Incorrect indentation\n%s") -say:set("assertion.same_indent.negative", "Incorrect indentation\n%s") +say:set_namespace('en') +say:set('assertion.same_indent.positive', 'Incorrect indentation\n%s') +say:set('assertion.same_indent.negative', 'Incorrect indentation\n%s') assert:register( - "assertion", - "same_indent", + 'assertion', + 'same_indent', same_indent, - "assertion.same_indent.positive", - "assert.same_indent.negative" + 'assertion.same_indent.positive', + 'assert.same_indent.negative' ) -- Custom assertion better suited for indentation diffs local function compare_indent(before, after, xfail) assert:add_formatter(format_indent) if xfail then - io.stdout:write "Warning! Known failure of this test! Please help to fix it! " + io.stdout:write('Warning! Known failure of this test! Please help to fix it! ') assert.is_not.same_indent(before, after) else assert.is.same_indent(before, after) @@ -83,7 +83,8 @@ local function compare_indent(before, after, xfail) end local function set_buf_indent_opts(opts) - local optnames = { "tabstop", "shiftwidth", "softtabstop", "expandtab", "filetype", "lispoptions" } + local optnames = + { 'tabstop', 'shiftwidth', 'softtabstop', 'expandtab', 'filetype', 'lispoptions' } for _, opt in ipairs(optnames) do if opts[opt] ~= nil then vim.bo[opt] = opts[opt] @@ -95,11 +96,11 @@ function M.run_indent_test(file, runner, opts) assert.are.same(1, vim.fn.filereadable(file), string.format('File "%s" not readable', file)) -- load reference file - vim.cmd(string.format("edit %s", file)) - vim.bo.indentexpr = "nvim_treesitter#indent()" + vim.cmd(string.format('edit %s', file)) + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" local before = vim.api.nvim_buf_get_lines(0, 0, -1, true) - assert.are.same("nvim_treesitter#indent()", vim.bo.indentexpr) + assert.are.same("v:lua.require'nvim-treesitter'.indentexpr()", vim.bo.indentexpr) set_buf_indent_opts(opts) -- perform the test @@ -109,14 +110,14 @@ function M.run_indent_test(file, runner, opts) local after = vim.api.nvim_buf_get_lines(0, 0, -1, true) -- clear any changes to avoid 'No write since last change (add ! to override)' - vim.cmd "edit!" + vim.cmd('edit!') return before, after end function M.indent_whole_file(file, opts, xfail) local before, after = M.run_indent_test(file, function() - vim.cmd "silent normal gg=G" + vim.cmd('silent normal gg=G') end, opts) compare_indent(before, after, xfail) @@ -132,22 +133,24 @@ end function M.indent_new_line(file, spec, opts, xfail) local before, after = M.run_indent_test(file, function() -- move to the line and input the new one - vim.cmd(string.format("normal! %dG", spec.on_line)) - vim.cmd(string.format("normal! o%s", spec.text)) + vim.cmd(string.format('normal! %dG', spec.on_line)) + vim.cmd(string.format('normal! o%s', spec.text)) end, opts) - local indent = type(spec.indent) == "string" and spec.indent or string.rep(" ", spec.indent) + local indent = type(spec.indent) == 'string' and spec.indent or string.rep(' ', spec.indent) table.insert(before, spec.on_line + 1, indent .. spec.text) compare_indent(before, after, xfail) before, after = M.run_indent_test(file, function() -- move to the line and input the new one - vim.cmd(string.format("normal! %dG$", spec.on_line)) - vim.cmd(string.format(vim.api.nvim_replace_termcodes("normal! a%s", true, true, true), spec.text)) + vim.cmd(string.format('normal! %dG$', spec.on_line)) + vim.cmd( + string.format(vim.api.nvim_replace_termcodes('normal! a%s', true, true, true), spec.text) + ) end, opts) - indent = type(spec.indent) == "string" and spec.indent or string.rep(" ", spec.indent) + indent = type(spec.indent) == 'string' and spec.indent or string.rep(' ', spec.indent) table.insert(before, spec.on_line + 1, indent .. spec.text) compare_indent(before, after, xfail) @@ -174,13 +177,13 @@ function Runner:whole_file(dirs, opts) expected_failures = vim.tbl_map(function(f) return Path:new(f):make_relative(self.base_dir.filename) end, expected_failures) - dirs = type(dirs) == "table" and dirs or { dirs } + dirs = type(dirs) == 'table' and dirs or { dirs } dirs = vim.tbl_map(function(dir) dir = self.base_dir / Path:new(dir) assert.is.same(1, vim.fn.isdirectory(dir.filename)) return dir.filename end, dirs) - local files = require("nvim-treesitter.compat").flatten(vim.tbl_map(scan_dir, dirs)) + local files = require('nvim-treesitter.compat').flatten(vim.tbl_map(scan_dir, dirs)) for _, file in ipairs(files) do local relpath = Path:new(file):make_relative(self.base_dir.filename) self.it(relpath, function() @@ -191,7 +194,7 @@ end function Runner:new_line(file, spec, title, xfail) title = title and title or tostring(spec.on_line) - self.it(string.format("%s[%s]", file, title), function() + self.it(string.format('%s[%s]', file, title), function() local path = self.base_dir / file M.indent_new_line(path.filename, spec, self.buf_opts, xfail) end) diff --git a/tests/indent/cpp_spec.lua b/tests/indent/cpp_spec.lua index 7ac69e2a6..8e97c805e 100644 --- a/tests/indent/cpp_spec.lua +++ b/tests/indent/cpp_spec.lua @@ -1,51 +1,56 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -- will use both c/ and cpp/ -local run = Runner:new(it, "tests/indent", { +local run = Runner:new(it, 'tests/indent', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, - filetype = "cpp", + filetype = 'cpp', }) -describe("indent C++:", function() - describe("whole file:", function() - run:whole_file({ "c/", "cpp/" }, { +describe('indent C++:', function() + describe('whole file:', function() + run:whole_file({ 'c/', 'cpp/' }, { expected_failures = { -- C - "c/preproc_func.c", - "c/unfinished_comment.c", + 'c/preproc_func.c', + 'c/unfinished_comment.c', }, }) end) - describe("new line:", function() - run:new_line("cpp/access.cpp", { on_line = 3, text = "protected:", indent = 0 }) - run:new_line("cpp/class.cpp", { on_line = 2, text = "using T = int;", indent = 4 }) - run:new_line("cpp/stream.cpp", { on_line = 5, text = "<< x + 3", indent = 8 }) + describe('new line:', function() + run:new_line('cpp/access.cpp', { on_line = 3, text = 'protected:', indent = 0 }) + run:new_line('cpp/class.cpp', { on_line = 2, text = 'using T = int;', indent = 4 }) + run:new_line('cpp/stream.cpp', { on_line = 5, text = '<< x + 3', indent = 8 }) -- TODO: find a clean way to import these from c_spec.lua - run:new_line("c/array.c", { on_line = 2, text = "0,", indent = 4 }) - run:new_line("c/cond.c", { on_line = 3, text = "x++;", indent = 8 }) - run:new_line("c/cond.c", { on_line = 6, text = "x++;", indent = 8 }) - run:new_line("c/cond.c", { on_line = 8, text = "x++;", indent = 8 }) - run:new_line("c/cond.c", { on_line = 9, text = "x++;", indent = 4 }) - run:new_line("c/expr.c", { on_line = 10, text = "2 *", indent = 8 }) - run:new_line("c/func.c", { on_line = 17, text = "int z,", indent = 4 }) - run:new_line("c/label.c", { on_line = 3, text = "normal:", indent = 0 }) - run:new_line("c/loop.c", { on_line = 3, text = "x++;", indent = 8 }) - run:new_line("c/preproc_cond.c", { on_line = 5, text = "x++;", indent = 4 }) - run:new_line("c/preproc_func.c", { on_line = 3, text = "x++; \\", indent = 8 }, "expected failure", XFAIL) - run:new_line("c/string.c", { on_line = 1, text = "brave new \\", indent = 0 }) - run:new_line("c/string.c", { on_line = 4, text = '"brave new "', indent = 4 }) - run:new_line("c/struct.c", { on_line = 4, text = "int y;", indent = 8 }) - run:new_line("c/switch.c", { on_line = 3, text = "x++;", indent = 12 }) - run:new_line("c/ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }) + run:new_line('c/array.c', { on_line = 2, text = '0,', indent = 4 }) + run:new_line('c/cond.c', { on_line = 3, text = 'x++;', indent = 8 }) + run:new_line('c/cond.c', { on_line = 6, text = 'x++;', indent = 8 }) + run:new_line('c/cond.c', { on_line = 8, text = 'x++;', indent = 8 }) + run:new_line('c/cond.c', { on_line = 9, text = 'x++;', indent = 4 }) + run:new_line('c/expr.c', { on_line = 10, text = '2 *', indent = 8 }) + run:new_line('c/func.c', { on_line = 17, text = 'int z,', indent = 4 }) + run:new_line('c/label.c', { on_line = 3, text = 'normal:', indent = 0 }) + run:new_line('c/loop.c', { on_line = 3, text = 'x++;', indent = 8 }) + run:new_line('c/preproc_cond.c', { on_line = 5, text = 'x++;', indent = 4 }) + run:new_line( + 'c/preproc_func.c', + { on_line = 3, text = 'x++; \\', indent = 8 }, + 'expected failure', + XFAIL + ) + run:new_line('c/string.c', { on_line = 1, text = 'brave new \\', indent = 0 }) + run:new_line('c/string.c', { on_line = 4, text = '"brave new "', indent = 4 }) + run:new_line('c/struct.c', { on_line = 4, text = 'int y;', indent = 8 }) + run:new_line('c/switch.c', { on_line = 3, text = 'x++;', indent = 12 }) + run:new_line('c/ternary.c', { on_line = 4, text = ': (x == 0) : 0', indent = 8 }) -- the line after inserted one will be left with wrong indent but we only care about the inserted one - run:new_line("c/no_braces.c", { on_line = 4, text = "x++;", indent = 8 }) - run:new_line("c/no_braces.c", { on_line = 7, text = "x++;", indent = 8 }) - run:new_line("c/no_braces.c", { on_line = 10, text = "x++;", indent = 8 }) + run:new_line('c/no_braces.c', { on_line = 4, text = 'x++;', indent = 8 }) + run:new_line('c/no_braces.c', { on_line = 7, text = 'x++;', indent = 8 }) + run:new_line('c/no_braces.c', { on_line = 10, text = 'x++;', indent = 8 }) end) end) diff --git a/tests/indent/css_spec.lua b/tests/indent/css_spec.lua index 46c7e1afb..69de62e92 100644 --- a/tests/indent/css_spec.lua +++ b/tests/indent/css_spec.lua @@ -1,22 +1,22 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/css", { +local run = Runner:new(it, 'tests/indent/css', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent CSS:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent CSS:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("open_block.css", { on_line = 1, text = "}", indent = 0 }) - run:new_line("open_block.css", { on_line = 1, text = "color: green;", indent = 2 }) - run:new_line("next_rule.css", { on_line = 3, text = ".next {", indent = 0 }) + describe('new line:', function() + run:new_line('open_block.css', { on_line = 1, text = '}', indent = 0 }) + run:new_line('open_block.css', { on_line = 1, text = 'color: green;', indent = 2 }) + run:new_line('next_rule.css', { on_line = 3, text = '.next {', indent = 0 }) end) end) diff --git a/tests/indent/dart_spec.lua b/tests/indent/dart_spec.lua index c1d018738..4817c2ab2 100644 --- a/tests/indent/dart_spec.lua +++ b/tests/indent/dart_spec.lua @@ -1,46 +1,51 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -local run = Runner:new(it, "tests/indent/dart", { +local run = Runner:new(it, 'tests/indent/dart', { tabstop = 2, shiftwidth = 2, softtabstop = 2, expandtab = true, }) -describe("indent Lua:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Lua:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = { - "./multiple_arguments.dart", - "./class.dart", - "./class_function_argument.dart", + './multiple_arguments.dart', + './class.dart', + './class_function_argument.dart', }, }) end) end) -describe("new line:", function() - run:new_line("class.dart", { on_line = 4, text = "int five;", indent = 2 }) - run:new_line("class.dart", { on_line = 6, text = "'100'", indent = 8 }, "expected failure", XFAIL) - run:new_line("class.dart", { on_line = 7, text = "int five = 5", indent = 2 }, "expected failure", XFAIL) - run:new_line("try.dart", { on_line = 2, text = "var x;", indent = 4 }) - for _, content in ipairs { "var x;", "var x" } do - run:new_line("try.dart", { on_line = 10, text = content, indent = 6 }) - end - run:new_line("switch.dart", { on_line = 3, text = "x = 1;", indent = 6 }) - run:new_line("switch.dart", { on_line = 9, text = "x = 1;", indent = 6 }) - run:new_line("switch.dart", { on_line = 3, text = "case 2:", indent = 4 }) - run:new_line("switch.dart", { on_line = 16, text = "abc;", indent = 4 }) - run:new_line("switch.dart", { on_line = 20, text = "abc;", indent = 4 }) - run:new_line("switch.dart", { on_line = 28, text = "y++;", indent = 6 }) - - run:new_line("multiple_arguments.dart", { on_line = 10, text = "var x;", indent = 4 }) +describe('new line:', function() + run:new_line('class.dart', { on_line = 4, text = 'int five;', indent = 2 }) + run:new_line('class.dart', { on_line = 6, text = "'100'", indent = 8 }, 'expected failure', XFAIL) run:new_line( - "multiple_arguments.dart", - { on_line = 11, text = "var x;", indent = 4 }, - "expected failure issue #4637", + 'class.dart', + { on_line = 7, text = 'int five = 5', indent = 2 }, + 'expected failure', XFAIL ) - run:new_line("class_function_argument.dart", { on_line = 11, text = "}", indent = 4 }) + run:new_line('try.dart', { on_line = 2, text = 'var x;', indent = 4 }) + for _, content in ipairs({ 'var x;', 'var x' }) do + run:new_line('try.dart', { on_line = 10, text = content, indent = 6 }) + end + run:new_line('switch.dart', { on_line = 3, text = 'x = 1;', indent = 6 }) + run:new_line('switch.dart', { on_line = 9, text = 'x = 1;', indent = 6 }) + run:new_line('switch.dart', { on_line = 3, text = 'case 2:', indent = 4 }) + run:new_line('switch.dart', { on_line = 16, text = 'abc;', indent = 4 }) + run:new_line('switch.dart', { on_line = 20, text = 'abc;', indent = 4 }) + run:new_line('switch.dart', { on_line = 28, text = 'y++;', indent = 6 }) + + run:new_line('multiple_arguments.dart', { on_line = 10, text = 'var x;', indent = 4 }) + run:new_line( + 'multiple_arguments.dart', + { on_line = 11, text = 'var x;', indent = 4 }, + 'expected failure issue #4637', + XFAIL + ) + run:new_line('class_function_argument.dart', { on_line = 11, text = '}', indent = 4 }) end) diff --git a/tests/indent/dot_spec.lua b/tests/indent/dot_spec.lua index ac78f8d92..135321da2 100644 --- a/tests/indent/dot_spec.lua +++ b/tests/indent/dot_spec.lua @@ -1,25 +1,25 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/dot", { +local run = Runner:new(it, 'tests/indent/dot', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent dot:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent dot:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("test.dot", { on_line = 1, text = "node [", indent = 2 }) - run:new_line("test.dot", { on_line = 2, text = "shape=ellipse,", indent = 4 }) - run:new_line("test.dot", { on_line = 4, text = "subgraph sub {", indent = 2 }) - run:new_line("test.dot", { on_line = 5, text = "a1 -> a2 -> a3;", indent = 4 }) - run:new_line("test.dot", { on_line = 6, text = "}", indent = 2 }) - run:new_line("test.dot", { on_line = 7, text = "}", indent = 0 }) + describe('new line:', function() + run:new_line('test.dot', { on_line = 1, text = 'node [', indent = 2 }) + run:new_line('test.dot', { on_line = 2, text = 'shape=ellipse,', indent = 4 }) + run:new_line('test.dot', { on_line = 4, text = 'subgraph sub {', indent = 2 }) + run:new_line('test.dot', { on_line = 5, text = 'a1 -> a2 -> a3;', indent = 4 }) + run:new_line('test.dot', { on_line = 6, text = '}', indent = 2 }) + run:new_line('test.dot', { on_line = 7, text = '}', indent = 0 }) end) end) diff --git a/tests/indent/gdscript_spec.lua b/tests/indent/gdscript_spec.lua index c1770f41a..ee6f58a4b 100644 --- a/tests/indent/gdscript_spec.lua +++ b/tests/indent/gdscript_spec.lua @@ -1,20 +1,20 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/gdscript", { +local run = Runner:new(it, 'tests/indent/gdscript', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = false, }) -describe("indent GDScript:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent GDScript:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("basic_blocks.gd", { on_line = 1, text = "var member := 0", indent = 0 }) + describe('new line:', function() + run:new_line('basic_blocks.gd', { on_line = 1, text = 'var member := 0', indent = 0 }) end) end) diff --git a/tests/indent/gleam_spec.lua b/tests/indent/gleam_spec.lua index 8de57fd50..1d77e52a1 100644 --- a/tests/indent/gleam_spec.lua +++ b/tests/indent/gleam_spec.lua @@ -1,127 +1,127 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/gleam", { +local run = Runner:new(it, 'tests/indent/gleam', { tabstop = 2, shiftwidth = 2, softtabstop = 2, expandtab = true, }) -describe("indent Gleam:", function() - describe("whole file:", function() - run:whole_file "." +describe('indent Gleam:', function() + describe('whole file:', function() + run:whole_file('.') end) - describe("new line:", function() - run:new_line("type.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 2, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 3, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 4, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 5, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 6, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 7, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 8, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 9, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 10, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 11, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 12, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 13, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 14, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 15, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 16, text = "//", indent = 0 }) - run:new_line("type.gleam", { on_line = 17, text = "//", indent = 2 }) - run:new_line("type.gleam", { on_line = 18, text = "//", indent = 0 }) + describe('new line:', function() + run:new_line('type.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 2, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 3, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 4, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 5, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 6, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 7, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 8, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 9, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 10, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 11, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 12, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 13, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 14, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 15, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 16, text = '//', indent = 0 }) + run:new_line('type.gleam', { on_line = 17, text = '//', indent = 2 }) + run:new_line('type.gleam', { on_line = 18, text = '//', indent = 0 }) - run:new_line("function.gleam", { on_line = 1, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 2, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 3, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 4, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 5, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 6, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 7, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 8, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 9, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 10, text = "//", indent = 0 }) - run:new_line("function.gleam", { on_line = 11, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 12, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 13, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 14, text = "//", indent = 2 }) - run:new_line("function.gleam", { on_line = 15, text = "//", indent = 2 }) + run:new_line('function.gleam', { on_line = 1, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 2, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 3, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 4, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 5, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 6, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 7, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 8, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 9, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 10, text = '//', indent = 0 }) + run:new_line('function.gleam', { on_line = 11, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 12, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 13, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 14, text = '//', indent = 2 }) + run:new_line('function.gleam', { on_line = 15, text = '//', indent = 2 }) - run:new_line("list.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("list.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("list.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("list.gleam", { on_line = 4, text = "//", indent = 6 }) - run:new_line("list.gleam", { on_line = 5, text = "//", indent = 6 }) - run:new_line("list.gleam", { on_line = 6, text = "//", indent = 8 }) - run:new_line("list.gleam", { on_line = 7, text = "//", indent = 8 }) - run:new_line("list.gleam", { on_line = 8, text = "//", indent = 6 }) - run:new_line("list.gleam", { on_line = 9, text = "//", indent = 4 }) - run:new_line("list.gleam", { on_line = 10, text = "//", indent = 2 }) - run:new_line("list.gleam", { on_line = 11, text = "//", indent = 0 }) + run:new_line('list.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('list.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('list.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('list.gleam', { on_line = 4, text = '//', indent = 6 }) + run:new_line('list.gleam', { on_line = 5, text = '//', indent = 6 }) + run:new_line('list.gleam', { on_line = 6, text = '//', indent = 8 }) + run:new_line('list.gleam', { on_line = 7, text = '//', indent = 8 }) + run:new_line('list.gleam', { on_line = 8, text = '//', indent = 6 }) + run:new_line('list.gleam', { on_line = 9, text = '//', indent = 4 }) + run:new_line('list.gleam', { on_line = 10, text = '//', indent = 2 }) + run:new_line('list.gleam', { on_line = 11, text = '//', indent = 0 }) - run:new_line("tuple.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("tuple.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("tuple.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("tuple.gleam", { on_line = 4, text = "//", indent = 6 }) - run:new_line("tuple.gleam", { on_line = 5, text = "//", indent = 6 }) - run:new_line("tuple.gleam", { on_line = 6, text = "//", indent = 8 }) - run:new_line("tuple.gleam", { on_line = 7, text = "//", indent = 8 }) - run:new_line("tuple.gleam", { on_line = 8, text = "//", indent = 6 }) - run:new_line("tuple.gleam", { on_line = 9, text = "//", indent = 4 }) - run:new_line("tuple.gleam", { on_line = 10, text = "//", indent = 2 }) - run:new_line("tuple.gleam", { on_line = 11, text = "//", indent = 0 }) + run:new_line('tuple.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('tuple.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('tuple.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('tuple.gleam', { on_line = 4, text = '//', indent = 6 }) + run:new_line('tuple.gleam', { on_line = 5, text = '//', indent = 6 }) + run:new_line('tuple.gleam', { on_line = 6, text = '//', indent = 8 }) + run:new_line('tuple.gleam', { on_line = 7, text = '//', indent = 8 }) + run:new_line('tuple.gleam', { on_line = 8, text = '//', indent = 6 }) + run:new_line('tuple.gleam', { on_line = 9, text = '//', indent = 4 }) + run:new_line('tuple.gleam', { on_line = 10, text = '//', indent = 2 }) + run:new_line('tuple.gleam', { on_line = 11, text = '//', indent = 0 }) - run:new_line("case.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("case.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("case.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("case.gleam", { on_line = 4, text = "//", indent = 6 }) - run:new_line("case.gleam", { on_line = 5, text = "//", indent = 8 }) - run:new_line("case.gleam", { on_line = 6, text = "//", indent = 8 }) - run:new_line("case.gleam", { on_line = 7, text = "//", indent = 6 }) - run:new_line("case.gleam", { on_line = 8, text = "//", indent = 4 }) - run:new_line("case.gleam", { on_line = 9, text = "//", indent = 2 }) - run:new_line("case.gleam", { on_line = 10, text = "//", indent = 0 }) + run:new_line('case.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('case.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('case.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('case.gleam', { on_line = 4, text = '//', indent = 6 }) + run:new_line('case.gleam', { on_line = 5, text = '//', indent = 8 }) + run:new_line('case.gleam', { on_line = 6, text = '//', indent = 8 }) + run:new_line('case.gleam', { on_line = 7, text = '//', indent = 6 }) + run:new_line('case.gleam', { on_line = 8, text = '//', indent = 4 }) + run:new_line('case.gleam', { on_line = 9, text = '//', indent = 2 }) + run:new_line('case.gleam', { on_line = 10, text = '//', indent = 0 }) - run:new_line("let.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("let.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("let.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("let.gleam", { on_line = 4, text = "//", indent = 0 }) + run:new_line('let.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('let.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('let.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('let.gleam', { on_line = 4, text = '//', indent = 0 }) - run:new_line("pipe.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("pipe.gleam", { on_line = 2, text = "//", indent = 2 }) - run:new_line("pipe.gleam", { on_line = 3, text = "//", indent = 2 }) - run:new_line("pipe.gleam", { on_line = 4, text = "//", indent = 0 }) + run:new_line('pipe.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('pipe.gleam', { on_line = 2, text = '//', indent = 2 }) + run:new_line('pipe.gleam', { on_line = 3, text = '//', indent = 2 }) + run:new_line('pipe.gleam', { on_line = 4, text = '//', indent = 0 }) - run:new_line("binary_expression.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("binary_expression.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("binary_expression.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("binary_expression.gleam", { on_line = 4, text = "//", indent = 0 }) + run:new_line('binary_expression.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('binary_expression.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('binary_expression.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('binary_expression.gleam', { on_line = 4, text = '//', indent = 0 }) - run:new_line("import.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("import.gleam", { on_line = 2, text = "//", indent = 2 }) - run:new_line("import.gleam", { on_line = 3, text = "//", indent = 2 }) - run:new_line("import.gleam", { on_line = 4, text = "//", indent = 0 }) + run:new_line('import.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('import.gleam', { on_line = 2, text = '//', indent = 2 }) + run:new_line('import.gleam', { on_line = 3, text = '//', indent = 2 }) + run:new_line('import.gleam', { on_line = 4, text = '//', indent = 0 }) - run:new_line("constant.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("constant.gleam", { on_line = 2, text = "//", indent = 2 }) + run:new_line('constant.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('constant.gleam', { on_line = 2, text = '//', indent = 2 }) - run:new_line("assert.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("assert.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("assert.gleam", { on_line = 3, text = "//", indent = 2 }) - run:new_line("assert.gleam", { on_line = 4, text = "//", indent = 0 }) + run:new_line('assert.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('assert.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('assert.gleam', { on_line = 3, text = '//', indent = 2 }) + run:new_line('assert.gleam', { on_line = 4, text = '//', indent = 0 }) - run:new_line("todo.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("todo.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("todo.gleam", { on_line = 3, text = "//", indent = 4 }) - run:new_line("todo.gleam", { on_line = 4, text = "//", indent = 2 }) - run:new_line("todo.gleam", { on_line = 5, text = "//", indent = 0 }) + run:new_line('todo.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('todo.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('todo.gleam', { on_line = 3, text = '//', indent = 4 }) + run:new_line('todo.gleam', { on_line = 4, text = '//', indent = 2 }) + run:new_line('todo.gleam', { on_line = 5, text = '//', indent = 0 }) - run:new_line("anonymous_function.gleam", { on_line = 1, text = "//", indent = 2 }) - run:new_line("anonymous_function.gleam", { on_line = 2, text = "//", indent = 4 }) - run:new_line("anonymous_function.gleam", { on_line = 3, text = "//", indent = 6 }) - run:new_line("anonymous_function.gleam", { on_line = 4, text = "//", indent = 6 }) - run:new_line("anonymous_function.gleam", { on_line = 5, text = "//", indent = 4 }) - run:new_line("anonymous_function.gleam", { on_line = 6, text = "//", indent = 2 }) - run:new_line("anonymous_function.gleam", { on_line = 7, text = "//", indent = 0 }) + run:new_line('anonymous_function.gleam', { on_line = 1, text = '//', indent = 2 }) + run:new_line('anonymous_function.gleam', { on_line = 2, text = '//', indent = 4 }) + run:new_line('anonymous_function.gleam', { on_line = 3, text = '//', indent = 6 }) + run:new_line('anonymous_function.gleam', { on_line = 4, text = '//', indent = 6 }) + run:new_line('anonymous_function.gleam', { on_line = 5, text = '//', indent = 4 }) + run:new_line('anonymous_function.gleam', { on_line = 6, text = '//', indent = 2 }) + run:new_line('anonymous_function.gleam', { on_line = 7, text = '//', indent = 0 }) end) end) diff --git a/tests/indent/go_spec.lua b/tests/indent/go_spec.lua index 4d604f3ef..f29379139 100644 --- a/tests/indent/go_spec.lua +++ b/tests/indent/go_spec.lua @@ -1,24 +1,24 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/go", { +local run = Runner:new(it, 'tests/indent/go', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = false, }) -describe("indent Go:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Go:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new lines:", function() - run:new_line("issue-2369.go", { on_line = 13, text = "// some comment", indent = 1 }) - run:new_line("issue-2369-newline.go", { on_line = 8, text = "// comment", indent = 0 }) - run:new_line("const_declaration.go", { on_line = 3, text = "Constant", indent = 1 }) - run:new_line("const_declaration.go", { on_line = 7, text = "func main() {", indent = 0 }) + describe('new lines:', function() + run:new_line('issue-2369.go', { on_line = 13, text = '// some comment', indent = 1 }) + run:new_line('issue-2369-newline.go', { on_line = 8, text = '// comment', indent = 0 }) + run:new_line('const_declaration.go', { on_line = 3, text = 'Constant', indent = 1 }) + run:new_line('const_declaration.go', { on_line = 7, text = 'func main() {', indent = 0 }) end) end) diff --git a/tests/indent/graphql_spec.lua b/tests/indent/graphql_spec.lua index 9fc9896a7..d54cf60c5 100644 --- a/tests/indent/graphql_spec.lua +++ b/tests/indent/graphql_spec.lua @@ -1,19 +1,19 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/graphql", { +local run = Runner:new(it, 'tests/indent/graphql', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent GraphQL:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent GraphQL:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() end) + describe('new line:', function() end) end) diff --git a/tests/indent/html_spec.lua b/tests/indent/html_spec.lua index b94653613..b240b7150 100644 --- a/tests/indent/html_spec.lua +++ b/tests/indent/html_spec.lua @@ -1,28 +1,28 @@ -local Runner = require("tests.indent.common").Runner -local runner = Runner:new(it, "tests/indent/html", { +local Runner = require('tests.indent.common').Runner +local runner = Runner:new(it, 'tests/indent/html', { tabstop = 2, shiftwidth = 2, expandtab = true, }) -describe("indent HTML:", function() - describe("whole file:", function() - runner:whole_file "." +describe('indent HTML:', function() + describe('whole file:', function() + runner:whole_file('.') end) - describe("new line:", function() - runner:new_line("start_tag.html", { on_line = 1, text = "anything", indent = 0 }) - runner:new_line("start_tag.html", { on_line = 4, text = "anything", indent = 4 }) - runner:new_line("start_tag.html", { on_line = 6, text = "charset = utf-8", indent = 6 }) - runner:new_line("start_tag.html", { on_line = 6, text = ">", indent = 4 }) - runner:new_line("start_tag.html", { on_line = 6, text = "/>", indent = 4 }) - runner:new_line("issue-3986.html", { on_line = 3, text = "indent once", indent = 2 }) - runner:new_line("self_closing_tag.html", { on_line = 10, text = "Something", indent = 4 }) - runner:new_line("self_closing_tag.html", { on_line = 12, text = "disabled", indent = 6 }) - runner:new_line("self_closing_tag.html", { on_line = 12, text = "/>", indent = 4 }) - runner:new_line("script_style.html", { on_line = 5, text = "body", indent = 2 }) - runner:new_line("script_style.html", { on_line = 6, text = "
", indent = 2 }) - runner:new_line("script_style.html", { on_line = 9, text = "const x = 1", indent = 2 }) - runner:new_line("script_style.html", { on_line = 11, text = "Text", indent = 2 }) + describe('new line:', function() + runner:new_line('start_tag.html', { on_line = 1, text = 'anything', indent = 0 }) + runner:new_line('start_tag.html', { on_line = 4, text = 'anything', indent = 4 }) + runner:new_line('start_tag.html', { on_line = 6, text = 'charset = utf-8', indent = 6 }) + runner:new_line('start_tag.html', { on_line = 6, text = '>', indent = 4 }) + runner:new_line('start_tag.html', { on_line = 6, text = '/>', indent = 4 }) + runner:new_line('issue-3986.html', { on_line = 3, text = 'indent once', indent = 2 }) + runner:new_line('self_closing_tag.html', { on_line = 10, text = 'Something', indent = 4 }) + runner:new_line('self_closing_tag.html', { on_line = 12, text = 'disabled', indent = 6 }) + runner:new_line('self_closing_tag.html', { on_line = 12, text = '/>', indent = 4 }) + runner:new_line('script_style.html', { on_line = 5, text = 'body', indent = 2 }) + runner:new_line('script_style.html', { on_line = 6, text = '
', indent = 2 }) + runner:new_line('script_style.html', { on_line = 9, text = 'const x = 1', indent = 2 }) + runner:new_line('script_style.html', { on_line = 11, text = 'Text', indent = 2 }) end) end) diff --git a/tests/indent/java_spec.lua b/tests/indent/java_spec.lua index 1d10046bb..97354dbc7 100644 --- a/tests/indent/java_spec.lua +++ b/tests/indent/java_spec.lua @@ -1,39 +1,45 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -local run = Runner:new(it, "tests/indent/java", { +local run = Runner:new(it, 'tests/indent/java', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Java:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Java:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("method.java", { on_line = 1, text = "void foo() {}", indent = 2 }) - run:new_line("issue_2571.java", { on_line = 5, text = "void bar() {}", indent = 2 }) - run:new_line("enum.java", { on_line = 2, text = "THING_B,", indent = 2 }) - run:new_line("class_with_annotation.java", { on_line = 2, text = "void foo() {}", indent = 2 }) - run:new_line("enum_with_annotation.java", { on_line = 2, text = "THING;", indent = 2 }) - run:new_line("interface.java", { on_line = 1, text = "void foo();", indent = 2 }) - run:new_line("javadoc.java", { on_line = 2, text = "* Sample javadoc line", indent = 3 }) + describe('new line:', function() + run:new_line('method.java', { on_line = 1, text = 'void foo() {}', indent = 2 }) + run:new_line('issue_2571.java', { on_line = 5, text = 'void bar() {}', indent = 2 }) + run:new_line('enum.java', { on_line = 2, text = 'THING_B,', indent = 2 }) + run:new_line('class_with_annotation.java', { on_line = 2, text = 'void foo() {}', indent = 2 }) + run:new_line('enum_with_annotation.java', { on_line = 2, text = 'THING;', indent = 2 }) + run:new_line('interface.java', { on_line = 1, text = 'void foo();', indent = 2 }) + run:new_line('javadoc.java', { on_line = 2, text = '* Sample javadoc line', indent = 3 }) run:new_line( - "issue_2583.java", - { on_line = 3, text = "int x = 1;", indent = 4 }, - "fails because tree is in a broken state", + 'issue_2583.java', + { on_line = 3, text = 'int x = 1;', indent = 4 }, + 'fails because tree is in a broken state', XFAIL ) - run:new_line("issue_2583.java", { on_line = 4, text = "int x = 1;", indent = 4 }) - run:new_line("method_chaining.java", { on_line = 4, text = '.append("b");', indent = 6 }) - run:new_line("constructor_with_arguments_on_multiple_lines.java", { on_line = 4, text = "}", indent = 2 }) - run:new_line("method_with_arguments_on_multiple_lines.java", { on_line = 4, text = "}", indent = 2 }) - run:new_line("annotation.java", { on_line = 1, text = "abstract public Foo(){}", indent = 2 }) - run:new_line("annotation_2.java", { on_line = 2, text = "Bar.class", indent = 4 }) + run:new_line('issue_2583.java', { on_line = 4, text = 'int x = 1;', indent = 4 }) + run:new_line('method_chaining.java', { on_line = 4, text = '.append("b");', indent = 6 }) + run:new_line( + 'constructor_with_arguments_on_multiple_lines.java', + { on_line = 4, text = '}', indent = 2 } + ) + run:new_line( + 'method_with_arguments_on_multiple_lines.java', + { on_line = 4, text = '}', indent = 2 } + ) + run:new_line('annotation.java', { on_line = 1, text = 'abstract public Foo(){}', indent = 2 }) + run:new_line('annotation_2.java', { on_line = 2, text = 'Bar.class', indent = 4 }) end) end) diff --git a/tests/indent/javascript_spec.lua b/tests/indent/javascript_spec.lua index 5659b22a1..4a7c3bcc3 100644 --- a/tests/indent/javascript_spec.lua +++ b/tests/indent/javascript_spec.lua @@ -1,40 +1,50 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -- local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent", { +local run = Runner:new(it, 'tests/indent', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, - filetype = "javascript", + filetype = 'javascript', }) -describe("indent JavaScript:", function() - describe("whole file:", function() - run:whole_file({ "ecma/" }, { +describe('indent JavaScript:', function() + describe('whole file:', function() + run:whole_file({ 'ecma/' }, { expected_failures = {}, }) end) - describe("new line:", function() - for _, info in ipairs { + describe('new line:', function() + for _, info in ipairs({ { 1, 2 }, { 2, 4 }, { 3, 4 }, - } do - run:new_line("ecma/binary_expression.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/binary_expression.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - run:new_line("ecma/new-line-after-class.js", { on_line = 2, text = "", indent = 0 }) + run:new_line('ecma/new-line-after-class.js', { on_line = 2, text = '', indent = 0 }) - for _, info in ipairs { + for _, info in ipairs({ { 4, 2 }, { 6, 0 }, - } do - run:new_line("ecma/callback.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/callback.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 4 }, { 3, 6 }, @@ -42,11 +52,16 @@ describe("indent JavaScript:", function() { 8, 2 }, { 11, 4 }, { 13, 4 }, - } do - run:new_line("ecma/class.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/class.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 2, 2 }, { 5, 2 }, { 7, 0 }, @@ -61,11 +76,16 @@ describe("indent JavaScript:", function() { 48, 4 }, { 49, 4 }, { 50, 2 }, - } do - run:new_line("ecma/func.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/func.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 2 }, { 3, 2 }, @@ -77,25 +97,40 @@ describe("indent JavaScript:", function() { 13, 0 }, { 16, 0 }, { 19, 2 }, - } do - run:new_line("ecma/if_else.js", { on_line = info[1], text = "hello()", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/if_else.js', + { on_line = info[1], text = 'hello()', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 2, 2 }, { 5, 0 }, - } do - run:new_line("ecma/object.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/object.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 3, 6 }, { 4, 6 }, - } do - run:new_line("ecma/ternary.js", { on_line = info[1], text = "//", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/ternary.js', + { on_line = info[1], text = '//', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 2 }, { 3, 2 }, @@ -103,23 +138,36 @@ describe("indent JavaScript:", function() { 5, 2 }, { 6, 2 }, { 7, 0 }, - } do - run:new_line("ecma/try_catch.js", { on_line = info[1], text = "hello()", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/try_catch.js', + { on_line = info[1], text = 'hello()', indent = info[2] }, + info[3], + info[4] + ) end - for _, info in ipairs { + for _, info in ipairs({ { 1, 2 }, { 2, 0 }, - } do - run:new_line("ecma/variable.js", { on_line = info[1], text = "hello()", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'ecma/variable.js', + { on_line = info[1], text = 'hello()', indent = info[2] }, + info[3], + info[4] + ) end - for _, line in ipairs { 2, 6 } do - run:new_line("ecma/issue-2515.js", { on_line = line, text = "{}", indent = 4 }) + for _, line in ipairs({ 2, 6 }) do + run:new_line('ecma/issue-2515.js', { on_line = line, text = '{}', indent = 4 }) end - for _, info in ipairs { { line = 2, indent = 0 } } do - run:new_line("ecma/array-issue3382.js", { on_line = info.line, text = "foo();", indent = info.indent }) + for _, info in ipairs({ { line = 2, indent = 0 } }) do + run:new_line( + 'ecma/array-issue3382.js', + { on_line = info.line, text = 'foo();', indent = info.indent } + ) end end) end) diff --git a/tests/indent/jsx_spec.lua b/tests/indent/jsx_spec.lua index e75b21f4f..7a32dbcc4 100644 --- a/tests/indent/jsx_spec.lua +++ b/tests/indent/jsx_spec.lua @@ -1,43 +1,49 @@ -local Runner = require("tests.indent.common").Runner -local runner = Runner:new(it, "tests/indent/jsx", { +local Runner = require('tests.indent.common').Runner +local runner = Runner:new(it, 'tests/indent/jsx', { tabstop = 2, shiftwidth = 2, expandtab = true, - filetype = "jsx", + filetype = 'jsx', }) -describe("indent JSX Elements:", function() - describe("whole file:", function() - runner:whole_file(".", { +describe('indent JSX Elements:', function() + describe('whole file:', function() + runner:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - for _, info in ipairs { + describe('new line:', function() + for _, info in ipairs({ { 5, 8 }, { 6, 6 }, { 7, 6 }, { 8, 4 }, { 9, 2 }, - } do - runner:new_line("issue-3986.jsx", { on_line = info[1], text = "text", indent = info[2] }) + }) do + runner:new_line('issue-3986.jsx', { on_line = info[1], text = 'text', indent = info[2] }) end - for _, info in ipairs { + for _, info in ipairs({ { 4, 8 }, { 6, 10 }, { 9, 8 }, { 11, 8 }, - } do - runner:new_line("element_attributes.jsx", { on_line = info[1], text = "disabled", indent = info[2] }) + }) do + runner:new_line( + 'element_attributes.jsx', + { on_line = info[1], text = 'disabled', indent = info[2] } + ) end - for _, info in ipairs { + for _, info in ipairs({ { 5, 10 }, { 7, 8 }, { 11, 10 }, - } do - runner:new_line("jsx_expression.jsx", { on_line = info[1], text = "{disabled}", indent = info[2] }) + }) do + runner:new_line( + 'jsx_expression.jsx', + { on_line = info[1], text = '{disabled}', indent = info[2] } + ) end end) end) diff --git a/tests/indent/julia_spec.lua b/tests/indent/julia_spec.lua index 538685307..b7605a55d 100644 --- a/tests/indent/julia_spec.lua +++ b/tests/indent/julia_spec.lua @@ -1,16 +1,16 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -- local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/julia", { +local run = Runner:new(it, 'tests/indent/julia', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = true, }) -describe("indent Julia:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Julia:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) diff --git a/tests/indent/lua_spec.lua b/tests/indent/lua_spec.lua index 6d99a0fff..ecafc7008 100644 --- a/tests/indent/lua_spec.lua +++ b/tests/indent/lua_spec.lua @@ -1,49 +1,49 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/lua", { +local run = Runner:new(it, 'tests/indent/lua', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Lua:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Lua:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("comment.lua", { on_line = 1, text = "line", indent = "-- " }) - run:new_line("comment.lua", { on_line = 5, text = "multiline", indent = " " }) - run:new_line("func.lua", { on_line = 1, text = "x = x + 1", indent = 2 }) - run:new_line("func.lua", { on_line = 2, text = "y = y + 1", indent = 4 }) - run:new_line("func.lua", { on_line = 4, text = "y = y + 1", indent = 2 }) - run:new_line("func.lua", { on_line = 5, text = "3,", indent = 4 }) - run:new_line("func.lua", { on_line = 9, text = "x = x + 1", indent = 0 }) - run:new_line("func.lua", { on_line = 11, text = "x = x + 1", indent = 2 }) - run:new_line("string.lua", { on_line = 1, text = "x", indent = 0 }) - run:new_line("string.lua", { on_line = 2, text = "x", indent = 0 }) - run:new_line("string.lua", { on_line = 3, text = "x", indent = 2 }) - run:new_line("string.lua", { on_line = 4, text = "x", indent = 4 }) - run:new_line("string.lua", { on_line = 9, text = "x", indent = 0 }) - run:new_line("table.lua", { on_line = 1, text = "b = 0,", indent = 2 }) - run:new_line("table.lua", { on_line = 5, text = "4,", indent = 4 }) - run:new_line("table.lua", { on_line = 7, text = "4,", indent = 4 }) - run:new_line("loop.lua", { on_line = 4, text = "x = x + 1", indent = 2 }) - run:new_line("cond.lua", { on_line = 5, text = "x = x + 1", indent = 2 }) - run:new_line("cond.lua", { on_line = 7, text = "x = x + 1", indent = 2 }) - run:new_line("cond.lua", { on_line = 8, text = "x = x + 1", indent = 4 }) - run:new_line("cond.lua", { on_line = 10, text = "x = x + 1", indent = 2 }) - run:new_line("cond.lua", { on_line = 12, text = "x = x + 1", indent = 0 }) - run:new_line("cond.lua", { on_line = 14, text = "x = x + 1", indent = 2 }) - run:new_line("cond.lua", { on_line = 14, text = "end", indent = 0 }) - run:new_line("no-indent-after-paren-pairs.lua", { on_line = 3, text = "x = x + 1", indent = 0 }) - run:new_line("no-indent-after-paren-pairs.lua", { on_line = 6, text = "x = x + 1", indent = 0 }) - run:new_line("nested-table.lua", { on_line = 5, text = "{}", indent = 4 }) - run:new_line("method_index_expr.lua", { on_line = 1, text = ":test()", indent = 2 }) - run:new_line("method_index_expr.lua", { on_line = 3, text = "local a = 1", indent = 0 }) + describe('new line:', function() + run:new_line('comment.lua', { on_line = 1, text = 'line', indent = '-- ' }) + run:new_line('comment.lua', { on_line = 5, text = 'multiline', indent = ' ' }) + run:new_line('func.lua', { on_line = 1, text = 'x = x + 1', indent = 2 }) + run:new_line('func.lua', { on_line = 2, text = 'y = y + 1', indent = 4 }) + run:new_line('func.lua', { on_line = 4, text = 'y = y + 1', indent = 2 }) + run:new_line('func.lua', { on_line = 5, text = '3,', indent = 4 }) + run:new_line('func.lua', { on_line = 9, text = 'x = x + 1', indent = 0 }) + run:new_line('func.lua', { on_line = 11, text = 'x = x + 1', indent = 2 }) + run:new_line('string.lua', { on_line = 1, text = 'x', indent = 0 }) + run:new_line('string.lua', { on_line = 2, text = 'x', indent = 0 }) + run:new_line('string.lua', { on_line = 3, text = 'x', indent = 2 }) + run:new_line('string.lua', { on_line = 4, text = 'x', indent = 4 }) + run:new_line('string.lua', { on_line = 9, text = 'x', indent = 0 }) + run:new_line('table.lua', { on_line = 1, text = 'b = 0,', indent = 2 }) + run:new_line('table.lua', { on_line = 5, text = '4,', indent = 4 }) + run:new_line('table.lua', { on_line = 7, text = '4,', indent = 4 }) + run:new_line('loop.lua', { on_line = 4, text = 'x = x + 1', indent = 2 }) + run:new_line('cond.lua', { on_line = 5, text = 'x = x + 1', indent = 2 }) + run:new_line('cond.lua', { on_line = 7, text = 'x = x + 1', indent = 2 }) + run:new_line('cond.lua', { on_line = 8, text = 'x = x + 1', indent = 4 }) + run:new_line('cond.lua', { on_line = 10, text = 'x = x + 1', indent = 2 }) + run:new_line('cond.lua', { on_line = 12, text = 'x = x + 1', indent = 0 }) + run:new_line('cond.lua', { on_line = 14, text = 'x = x + 1', indent = 2 }) + run:new_line('cond.lua', { on_line = 14, text = 'end', indent = 0 }) + run:new_line('no-indent-after-paren-pairs.lua', { on_line = 3, text = 'x = x + 1', indent = 0 }) + run:new_line('no-indent-after-paren-pairs.lua', { on_line = 6, text = 'x = x + 1', indent = 0 }) + run:new_line('nested-table.lua', { on_line = 5, text = '{}', indent = 4 }) + run:new_line('method_index_expr.lua', { on_line = 1, text = ':test()', indent = 2 }) + run:new_line('method_index_expr.lua', { on_line = 3, text = 'local a = 1', indent = 0 }) end) end) diff --git a/tests/indent/meson_spec.lua b/tests/indent/meson_spec.lua index bc2372ee0..ba23965a6 100644 --- a/tests/indent/meson_spec.lua +++ b/tests/indent/meson_spec.lua @@ -1,28 +1,28 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/meson", { +local run = Runner:new(it, 'tests/indent/meson', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Meson:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Meson:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("cond.meson", { on_line = 3, text = "foo()", indent = 2 }) - run:new_line("cond.meson", { on_line = 6, text = "foo()", indent = 2 }) - run:new_line("cond.meson", { on_line = 7, text = "foo()", indent = 2 }) - run:new_line("cond.meson", { on_line = 12, text = "foo()", indent = 2 }) - run:new_line("cond.meson", { on_line = 14, text = "foo()", indent = 2 }) - run:new_line("dict.meson", { on_line = 13, text = ",'x':1,", indent = 2 }) - run:new_line("loop.meson", { on_line = 3, text = "foo()", indent = 2 }) - run:new_line("loop.meson", { on_line = 7, text = "foo()", indent = 2 }) - run:new_line("ternary.meson", { on_line = 11, text = "x : y", indent = 2 }) + describe('new line:', function() + run:new_line('cond.meson', { on_line = 3, text = 'foo()', indent = 2 }) + run:new_line('cond.meson', { on_line = 6, text = 'foo()', indent = 2 }) + run:new_line('cond.meson', { on_line = 7, text = 'foo()', indent = 2 }) + run:new_line('cond.meson', { on_line = 12, text = 'foo()', indent = 2 }) + run:new_line('cond.meson', { on_line = 14, text = 'foo()', indent = 2 }) + run:new_line('dict.meson', { on_line = 13, text = ",'x':1,", indent = 2 }) + run:new_line('loop.meson', { on_line = 3, text = 'foo()', indent = 2 }) + run:new_line('loop.meson', { on_line = 7, text = 'foo()', indent = 2 }) + run:new_line('ternary.meson', { on_line = 11, text = 'x : y', indent = 2 }) end) end) diff --git a/tests/indent/nickel_spec.lua b/tests/indent/nickel_spec.lua index d178dab52..0c2458a5b 100644 --- a/tests/indent/nickel_spec.lua +++ b/tests/indent/nickel_spec.lua @@ -1,25 +1,25 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/nickel", { +local run = Runner:new(it, 'tests/indent/nickel', { shiftwidth = 2, expandtab = true, }) -describe("indent Nickel:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Nickel:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("indent-newline.ncl", { on_line = 1, text = "stmt", indent = 2 }) - run:new_line("indent-newline.ncl", { on_line = 2, text = "stmt", indent = 2 }) - run:new_line("indent-newline.ncl", { on_line = 3, text = "stmt", indent = 4 }) - run:new_line("indent-newline.ncl", { on_line = 4, text = "]", indent = 2 }) - run:new_line("indent-newline.ncl", { on_line = 5, text = "stmt", indent = 2 }) - run:new_line("indent-newline.ncl", { on_line = 6, text = "stmt", indent = 4 }) - run:new_line("indent-newline.ncl", { on_line = 7, text = "}", indent = 2 }) - run:new_line("indent-newline.ncl", { on_line = 11, text = "stmt", indent = 0 }) + describe('new line:', function() + run:new_line('indent-newline.ncl', { on_line = 1, text = 'stmt', indent = 2 }) + run:new_line('indent-newline.ncl', { on_line = 2, text = 'stmt', indent = 2 }) + run:new_line('indent-newline.ncl', { on_line = 3, text = 'stmt', indent = 4 }) + run:new_line('indent-newline.ncl', { on_line = 4, text = ']', indent = 2 }) + run:new_line('indent-newline.ncl', { on_line = 5, text = 'stmt', indent = 2 }) + run:new_line('indent-newline.ncl', { on_line = 6, text = 'stmt', indent = 4 }) + run:new_line('indent-newline.ncl', { on_line = 7, text = '}', indent = 2 }) + run:new_line('indent-newline.ncl', { on_line = 11, text = 'stmt', indent = 0 }) end) end) diff --git a/tests/indent/nix_spec.lua b/tests/indent/nix_spec.lua index 709a0a109..bad8b53f7 100644 --- a/tests/indent/nix_spec.lua +++ b/tests/indent/nix_spec.lua @@ -1,30 +1,30 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local runner = Runner:new(it, "tests/indent/nix", { +local runner = Runner:new(it, 'tests/indent/nix', { tabstop = 2, shiftwidth = 2, softtabstop = 2, expandtab = true, }) -describe("indent Nix:", function() - describe("whole file:", function() - runner:whole_file(".", { +describe('indent Nix:', function() + describe('whole file:', function() + runner:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - for _, info in ipairs { + describe('new line:', function() + for _, info in ipairs({ { 14, 2 }, { 16, 2 }, { 48, 4 }, { 112, 6 }, - } do - runner:new_line("general.nix", { on_line = info[1], text = "x = 1;", indent = info[2] }) + }) do + runner:new_line('general.nix', { on_line = info[1], text = 'x = 1;', indent = info[2] }) end - for _, info in ipairs { + for _, info in ipairs({ { 115, 6 }, { 113, 10 }, { 6, 4 }, @@ -33,8 +33,8 @@ describe("indent Nix:", function() { 35, 6 }, { 23, 2 }, { 21, 6 }, - } do - runner:new_line("conds.nix", { on_line = info[1], text = "x = 1;", indent = info[2] }) + }) do + runner:new_line('conds.nix', { on_line = info[1], text = 'x = 1;', indent = info[2] }) end end) end) diff --git a/tests/indent/nu_spec.lua b/tests/indent/nu_spec.lua index 37c02ebea..5dfdb5128 100644 --- a/tests/indent/nu_spec.lua +++ b/tests/indent/nu_spec.lua @@ -1,16 +1,16 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/nu", { +local run = Runner:new(it, 'tests/indent/nu', { tabstop = 2, shiftwidth = 2, softtabstop = -1, expandtab = true, }) -describe("indent Nu:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Nu:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index c3f84e6e2..49983caa2 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -1,76 +1,75 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/php", { +local run = Runner:new(it, 'tests/indent/php', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, }) -describe("indent PHP:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent PHP:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 }) + describe('new line:', function() run:new_line( - "example2.php", - { on_line = 5, text = "indentation with `enter` in insert mode is not correct", indent = 4 } + 'example.php', + { on_line = 11, text = '// new line starts 1 indentation to far', indent = 4 } ) - run:new_line("issue-2497.php", { on_line = 5, text = "$a =", indent = 4 }) - run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 4 }) - run:new_line("issue-3591.php", { on_line = 4, text = "$a =", indent = 8 }) - run:new_line("enum-indent.php", { on_line = 4, text = "case", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 3, text = "true", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 4, text = "return;", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 7, text = "true", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 10, text = "|| false", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 11, text = "$a = 0;", indent = 0 }) - run:new_line("issue-4848.php", { on_line = 13, text = "true", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 16, text = "$a,", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 17, text = "true", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 20, text = "$a,", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 21, text = "return $a;", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 24, text = "return;", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 27, text = "true", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 28, text = "true => null,", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 31, text = "true => null,", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 35, text = "function a() {}", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 37, text = "return;", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 40, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 41, text = "return $a;", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 45, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 46, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 47, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 48, text = "$a;", indent = 0 }) - run:new_line("issue-4848.php", { on_line = 50, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 51, text = "return $a;", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 52, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 53, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 54, text = "$a,", indent = 12 }) - run:new_line("issue-4848.php", { on_line = 55, text = "return $a;", indent = 12 }) - run:new_line("issue-4848.php", { on_line = 56, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 57, text = "$a;", indent = 0 }) - run:new_line("issue-4848.php", { on_line = 59, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 60, text = "return $a;", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 61, text = "->foo()", indent = 4 }) - run:new_line("issue-4848.php", { on_line = 62, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 63, text = "$a,", indent = 12 }) - run:new_line("issue-4848.php", { on_line = 64, text = "return $a;", indent = 12 }) - run:new_line("issue-4848.php", { on_line = 65, text = "$a,", indent = 8 }) - run:new_line("issue-4848.php", { on_line = 66, text = "$a;", indent = 0 }) - run:new_line("issue-6888.php", { on_line = 2, text = "$a;", indent = 0 }) - run:new_line("issue-6888.php", { on_line = 3, text = "case Funday = 2;", indent = 4 }) - run:new_line("issue-6888.php", { on_line = 6, text = "$a;", indent = 0 }) - run:new_line("issue-6888.php", { on_line = 8, text = "$a;", indent = 4 }) - run:new_line("issue-6888.php", { on_line = 11, text = "$a;", indent = 0 }) - run:new_line("property-hooks.php", { on_line = 7, text = "get;", indent = 8 }) - run:new_line("property-hooks.php", { on_line = 8, text = "set;", indent = 8 }) - run:new_line("property-hooks.php", { on_line = 9, text = "$a;", indent = 12 }) - run:new_line("property-hooks.php", { on_line = 11, text = "get;", indent = 8 }) - run:new_line("property-hooks.php", { on_line = 12, text = "get;", indent = 4 }) + run:new_line('issue-2497.php', { on_line = 5, text = '$a =', indent = 4 }) + run:new_line('unfinished-call.php', { on_line = 6, text = '$a =', indent = 4 }) + run:new_line('issue-3591.php', { on_line = 4, text = '$a =', indent = 8 }) + run:new_line('enum-indent.php', { on_line = 4, text = 'case', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 3, text = 'true', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 4, text = 'return;', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 7, text = 'true', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 10, text = '|| false', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 11, text = '$a = 0;', indent = 0 }) + run:new_line('issue-4848.php', { on_line = 13, text = 'true', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 16, text = '$a,', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 17, text = 'true', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 20, text = '$a,', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 21, text = 'return $a;', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 24, text = 'return;', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 27, text = 'true', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 28, text = 'true => null,', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 31, text = 'true => null,', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 35, text = 'function a() {}', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 37, text = 'return;', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 40, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 41, text = 'return $a;', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 45, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 46, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 47, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 48, text = '$a;', indent = 0 }) + run:new_line('issue-4848.php', { on_line = 50, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 51, text = 'return $a;', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 52, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 53, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 54, text = '$a,', indent = 12 }) + run:new_line('issue-4848.php', { on_line = 55, text = 'return $a;', indent = 12 }) + run:new_line('issue-4848.php', { on_line = 56, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 57, text = '$a;', indent = 0 }) + run:new_line('issue-4848.php', { on_line = 59, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 60, text = 'return $a;', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 61, text = '->foo()', indent = 4 }) + run:new_line('issue-4848.php', { on_line = 62, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 63, text = '$a,', indent = 12 }) + run:new_line('issue-4848.php', { on_line = 64, text = 'return $a;', indent = 12 }) + run:new_line('issue-4848.php', { on_line = 65, text = '$a,', indent = 8 }) + run:new_line('issue-4848.php', { on_line = 66, text = '$a;', indent = 0 }) + run:new_line('issue-6888.php', { on_line = 2, text = '$a;', indent = 0 }) + run:new_line('issue-6888.php', { on_line = 3, text = 'case Funday = 2;', indent = 4 }) + run:new_line('issue-6888.php', { on_line = 6, text = '$a;', indent = 0 }) + run:new_line('issue-6888.php', { on_line = 8, text = '$a;', indent = 4 }) + run:new_line('issue-6888.php', { on_line = 11, text = '$a;', indent = 0 }) + run:new_line('property-hooks.php', { on_line = 7, text = 'get;', indent = 8 }) + run:new_line('property-hooks.php', { on_line = 8, text = 'set;', indent = 8 }) + run:new_line('property-hooks.php', { on_line = 9, text = '$a;', indent = 12 }) + run:new_line('property-hooks.php', { on_line = 11, text = 'get;', indent = 8 }) + run:new_line('property-hooks.php', { on_line = 12, text = 'get;', indent = 4 }) end) end) diff --git a/tests/indent/python_spec.lua b/tests/indent/python_spec.lua index 193b9901e..65be126fa 100644 --- a/tests/indent/python_spec.lua +++ b/tests/indent/python_spec.lua @@ -1,101 +1,101 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -local run = Runner:new(it, "tests/indent/python", { +local run = Runner:new(it, 'tests/indent/python', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, }) -describe("indent Python:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Python:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("aligned_indent.py", { on_line = 1, text = "arg3,", indent = 19 }) - run:new_line("aligned_indent_2.py", { on_line = 2, text = "x", indent = 4 }) - run:new_line("aligned_indent_2.py", { on_line = 9, text = "x", indent = 4 }) - run:new_line("aligned_indent_2.py", { on_line = 12, text = "x", indent = 4 }) - run:new_line("basic_blocks.py", { on_line = 1, text = "wait,", indent = 4 }) - run:new_line("basic_blocks.py", { on_line = 6, text = "x += 1", indent = 4 }) - run:new_line("basic_blocks.py", { on_line = 7, text = "x += 1", indent = 4 }) - run:new_line("basic_blocks.py", { on_line = 10, text = "x += 1", indent = 8 }) - run:new_line("basic_blocks.py", { on_line = 14, text = "x += 1", indent = 8 }) - run:new_line("basic_collections.py", { on_line = 3, text = "4,", indent = 4 }) - run:new_line("comprehensions.py", { on_line = 8, text = "if x != 2", indent = 4 }) - run:new_line("control_flow.py", { on_line = 2, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 4, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 6, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 9, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 12, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 15, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 18, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 20, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 22, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 24, text = "c < 6 and", indent = 7 }) - run:new_line("control_flow.py", { on_line = 26, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 28, text = "x = 4", indent = 4 }) - run:new_line("control_flow.py", { on_line = 31, text = "try:", indent = 4 }) - run:new_line("branches.py", { on_line = 25, text = "x > 9 and", indent = 4 }) - run:new_line("branches.py", { on_line = 29, text = "and x > 9", indent = 4 }) - run:new_line("hanging_indent.py", { on_line = 1, text = "arg0,", indent = 4 }) - run:new_line("hanging_indent.py", { on_line = 5, text = "0,", indent = 4 }) - run:new_line("error_state_def.py", { on_line = 6, text = "b,", indent = 11 }) - run:new_line("error_state_tuple.py", { on_line = 7, text = "b,", indent = 1 }) - run:new_line("error_state_tuple_align.py", { on_line = 7, text = "b,", indent = 1 }) - run:new_line("error_state_list.py", { on_line = 5, text = "3,", indent = 6 }) - run:new_line("error_state_dict.py", { on_line = 6, text = "9:10,", indent = 6 }) - run:new_line("error_state_set.py", { on_line = 5, text = "9,", indent = 6 }) - run:new_line("error_state_funcall.py", { on_line = 5, text = "6,", indent = 2 }) - run:new_line("if_else.py", { on_line = 5, text = "else:", indent = 4 }) - run:new_line("if_else.py", { on_line = 5, text = "elif False:", indent = 4 }) + describe('new line:', function() + run:new_line('aligned_indent.py', { on_line = 1, text = 'arg3,', indent = 19 }) + run:new_line('aligned_indent_2.py', { on_line = 2, text = 'x', indent = 4 }) + run:new_line('aligned_indent_2.py', { on_line = 9, text = 'x', indent = 4 }) + run:new_line('aligned_indent_2.py', { on_line = 12, text = 'x', indent = 4 }) + run:new_line('basic_blocks.py', { on_line = 1, text = 'wait,', indent = 4 }) + run:new_line('basic_blocks.py', { on_line = 6, text = 'x += 1', indent = 4 }) + run:new_line('basic_blocks.py', { on_line = 7, text = 'x += 1', indent = 4 }) + run:new_line('basic_blocks.py', { on_line = 10, text = 'x += 1', indent = 8 }) + run:new_line('basic_blocks.py', { on_line = 14, text = 'x += 1', indent = 8 }) + run:new_line('basic_collections.py', { on_line = 3, text = '4,', indent = 4 }) + run:new_line('comprehensions.py', { on_line = 8, text = 'if x != 2', indent = 4 }) + run:new_line('control_flow.py', { on_line = 2, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 4, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 6, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 9, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 12, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 15, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 18, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 20, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 22, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 24, text = 'c < 6 and', indent = 7 }) + run:new_line('control_flow.py', { on_line = 26, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 28, text = 'x = 4', indent = 4 }) + run:new_line('control_flow.py', { on_line = 31, text = 'try:', indent = 4 }) + run:new_line('branches.py', { on_line = 25, text = 'x > 9 and', indent = 4 }) + run:new_line('branches.py', { on_line = 29, text = 'and x > 9', indent = 4 }) + run:new_line('hanging_indent.py', { on_line = 1, text = 'arg0,', indent = 4 }) + run:new_line('hanging_indent.py', { on_line = 5, text = '0,', indent = 4 }) + run:new_line('error_state_def.py', { on_line = 6, text = 'b,', indent = 11 }) + run:new_line('error_state_tuple.py', { on_line = 7, text = 'b,', indent = 1 }) + run:new_line('error_state_tuple_align.py', { on_line = 7, text = 'b,', indent = 1 }) + run:new_line('error_state_list.py', { on_line = 5, text = '3,', indent = 6 }) + run:new_line('error_state_dict.py', { on_line = 6, text = '9:10,', indent = 6 }) + run:new_line('error_state_set.py', { on_line = 5, text = '9,', indent = 6 }) + run:new_line('error_state_funcall.py', { on_line = 5, text = '6,', indent = 2 }) + run:new_line('if_else.py', { on_line = 5, text = 'else:', indent = 4 }) + run:new_line('if_else.py', { on_line = 5, text = 'elif False:', indent = 4 }) run:new_line( - "join_lines.py", - { on_line = 1, text = "+ 1 \\", indent = 4 }, - "fails due two not working query at python/indent.scm:30", + 'join_lines.py', + { on_line = 1, text = '+ 1 \\', indent = 4 }, + 'fails due two not working query at python/indent.scm:30', XFAIL ) run:new_line( - "join_lines.py", - { on_line = 4, text = "+ 1 \\", indent = 4 }, - "fails due two not working query at python/indent.scm:30", + 'join_lines.py', + { on_line = 4, text = '+ 1 \\', indent = 4 }, + 'fails due two not working query at python/indent.scm:30', XFAIL ) - run:new_line("join_lines.py", { on_line = 7, text = "+ 1 \\", indent = 4 }) - run:new_line("nested_collections.py", { on_line = 5, text = "0,", indent = 12 }) - run:new_line("nested_collections.py", { on_line = 6, text = ",0", indent = 12 }) - run:new_line("nested_collections.py", { on_line = 29, text = "[1, 2],", indent = 12 }) - run:new_line("nested_collections.py", { on_line = 39, text = "0,", indent = 5 }) - run:new_line("strings.py", { on_line = 14, text = "x", indent = 4 }) - run:new_line("strings.py", { on_line = 15, text = "x", indent = 0 }) - run:new_line("strings.py", { on_line = 16, text = "x", indent = 8 }) - run:new_line("line_after_indent.py", { on_line = 4, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 8, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 4, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 14, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 20, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 26, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 30, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 34, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 38, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 42, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 46, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 49, text = "x", indent = 0 }) - run:new_line("line_after_indent.py", { on_line = 55, text = "x", indent = 4 }) - run:new_line("line_after_indent.py", { on_line = 63, text = "x", indent = 4 }) - run:new_line("match_case.py", { on_line = 4, text = "pass", indent = 8 }) - run:new_line("match_case.py", { on_line = 5, text = "pass", indent = 12 }) - run:new_line("match_case.py", { on_line = 10, text = "pass", indent = 8 }) - run:new_line("match_case.py", { on_line = 15, text = "pass", indent = 12 }) - run:new_line("break_continue.py", { on_line = 4, text = "pass", indent = 8 }) - run:new_line("break_continue.py", { on_line = 9, text = "pass", indent = 8 }) + run:new_line('join_lines.py', { on_line = 7, text = '+ 1 \\', indent = 4 }) + run:new_line('nested_collections.py', { on_line = 5, text = '0,', indent = 12 }) + run:new_line('nested_collections.py', { on_line = 6, text = ',0', indent = 12 }) + run:new_line('nested_collections.py', { on_line = 29, text = '[1, 2],', indent = 12 }) + run:new_line('nested_collections.py', { on_line = 39, text = '0,', indent = 5 }) + run:new_line('strings.py', { on_line = 14, text = 'x', indent = 4 }) + run:new_line('strings.py', { on_line = 15, text = 'x', indent = 0 }) + run:new_line('strings.py', { on_line = 16, text = 'x', indent = 8 }) + run:new_line('line_after_indent.py', { on_line = 4, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 8, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 4, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 14, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 20, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 26, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 30, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 34, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 38, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 42, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 46, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 49, text = 'x', indent = 0 }) + run:new_line('line_after_indent.py', { on_line = 55, text = 'x', indent = 4 }) + run:new_line('line_after_indent.py', { on_line = 63, text = 'x', indent = 4 }) + run:new_line('match_case.py', { on_line = 4, text = 'pass', indent = 8 }) + run:new_line('match_case.py', { on_line = 5, text = 'pass', indent = 12 }) + run:new_line('match_case.py', { on_line = 10, text = 'pass', indent = 8 }) + run:new_line('match_case.py', { on_line = 15, text = 'pass', indent = 12 }) + run:new_line('break_continue.py', { on_line = 4, text = 'pass', indent = 8 }) + run:new_line('break_continue.py', { on_line = 9, text = 'pass', indent = 8 }) - for _, line in ipairs { 2, 5, 8, 11, 16, 21, 24, 27, 34, 39 } do - run:new_line("return_dedent.py", { on_line = line, text = "x", indent = 0 }) + for _, line in ipairs({ 2, 5, 8, 11, 16, 21, 24, 27, 34, 39 }) do + run:new_line('return_dedent.py', { on_line = line, text = 'x', indent = 0 }) end end) end) diff --git a/tests/indent/ql_spec.lua b/tests/indent/ql_spec.lua index cfdce9077..605aa2365 100644 --- a/tests/indent/ql_spec.lua +++ b/tests/indent/ql_spec.lua @@ -1,24 +1,24 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/ql", { +local run = Runner:new(it, 'tests/indent/ql', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Lua:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Lua:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) end) -describe("new line:", function() - run:new_line("module.ql", { on_line = 1, text = "predicate foo() {}", indent = 2 }) +describe('new line:', function() + run:new_line('module.ql', { on_line = 1, text = 'predicate foo() {}', indent = 2 }) end) -describe("new line:", function() - run:new_line("module.ql", { on_line = 2, text = "predicate foo() {}", indent = 2 }) +describe('new line:', function() + run:new_line('module.ql', { on_line = 2, text = 'predicate foo() {}', indent = 2 }) end) diff --git a/tests/indent/query_spec.lua b/tests/indent/query_spec.lua index ca2ccdef5..f884009a0 100644 --- a/tests/indent/query_spec.lua +++ b/tests/indent/query_spec.lua @@ -1,28 +1,28 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/query", { +local run = Runner:new(it, 'tests/indent/query', { tabstop = 2, shiftwidth = 2, softtabstop = 2, expandtab = true, - lispoptions = "expr:1", + lispoptions = 'expr:1', }) -describe("indent Query:", function() - describe("whole file:", function() - run:whole_file(".", {}) +describe('indent Query:', function() + describe('whole file:', function() + run:whole_file('.', {}) end) - describe("new line:", function() - run:new_line("test.scm", { on_line = 3, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 5, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 12, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 25, text = "(#my-directive!)", indent = 10 }) - run:new_line("test.scm", { on_line = 34, text = '"more"', indent = 2 }) - run:new_line("test.scm", { on_line = 35, text = "(node)", indent = 0 }) - run:new_line("test.scm", { on_line = 40, text = "(node)", indent = 0 }) - run:new_line("test.scm", { on_line = 44, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 46, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 48, text = "(node)", indent = 2 }) - run:new_line("test.scm", { on_line = 50, text = "node_name", indent = 2 }) + describe('new line:', function() + run:new_line('test.scm', { on_line = 3, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 5, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 12, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 25, text = '(#my-directive!)', indent = 10 }) + run:new_line('test.scm', { on_line = 34, text = '"more"', indent = 2 }) + run:new_line('test.scm', { on_line = 35, text = '(node)', indent = 0 }) + run:new_line('test.scm', { on_line = 40, text = '(node)', indent = 0 }) + run:new_line('test.scm', { on_line = 44, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 46, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 48, text = '(node)', indent = 2 }) + run:new_line('test.scm', { on_line = 50, text = 'node_name', indent = 2 }) end) end) diff --git a/tests/indent/r_spec.lua b/tests/indent/r_spec.lua index 08df5e11b..b6e814068 100644 --- a/tests/indent/r_spec.lua +++ b/tests/indent/r_spec.lua @@ -1,42 +1,42 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/r", { +local run = Runner:new(it, 'tests/indent/r', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent R:", function() - describe("whole file:", function() - run:whole_file(".", {}) +describe('indent R:', function() + describe('whole file:', function() + run:whole_file('.', {}) end) - describe("new line:", function() - run:new_line("comment.R", { on_line = 1, text = "# new comment", indent = 0 }) + describe('new line:', function() + run:new_line('comment.R', { on_line = 1, text = '# new comment', indent = 0 }) - run:new_line("cond.R", { on_line = 1, text = "x <- x + 1", indent = 0 }) - run:new_line("cond.R", { on_line = 4, text = "x <- x + 1", indent = 2 }) - run:new_line("cond.R", { on_line = 5, text = "x <- x + 1", indent = 2 }) - run:new_line("cond.R", { on_line = 8, text = "x <- x + 1", indent = 4 }) + run:new_line('cond.R', { on_line = 1, text = 'x <- x + 1', indent = 0 }) + run:new_line('cond.R', { on_line = 4, text = 'x <- x + 1', indent = 2 }) + run:new_line('cond.R', { on_line = 5, text = 'x <- x + 1', indent = 2 }) + run:new_line('cond.R', { on_line = 8, text = 'x <- x + 1', indent = 4 }) - run:new_line("func.R", { on_line = 1, text = "x <- x + 1", indent = 2 }) - run:new_line("func.R", { on_line = 2, text = "a <- a + 1", indent = 4 }) - run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 }) - run:new_line("func.R", { on_line = 6, text = "0,", indent = 6 }) - run:new_line("func.R", { on_line = 16, text = "x <- x + 1", indent = 4 }) + run:new_line('func.R', { on_line = 1, text = 'x <- x + 1', indent = 2 }) + run:new_line('func.R', { on_line = 2, text = 'a <- a + 1', indent = 4 }) + run:new_line('func.R', { on_line = 6, text = '0,', indent = 6 }) + run:new_line('func.R', { on_line = 6, text = '0,', indent = 6 }) + run:new_line('func.R', { on_line = 16, text = 'x <- x + 1', indent = 4 }) - run:new_line("loop.R", { on_line = 1, text = "x <- x + 1", indent = 0 }) - run:new_line("loop.R", { on_line = 3, text = "x <- x + 1", indent = 2 }) - run:new_line("loop.R", { on_line = 8, text = "x <- x + 1", indent = 2 }) - run:new_line("loop.R", { on_line = 14, text = "print('lol')", indent = 4 }) + run:new_line('loop.R', { on_line = 1, text = 'x <- x + 1', indent = 0 }) + run:new_line('loop.R', { on_line = 3, text = 'x <- x + 1', indent = 2 }) + run:new_line('loop.R', { on_line = 8, text = 'x <- x + 1', indent = 2 }) + run:new_line('loop.R', { on_line = 14, text = "print('lol')", indent = 4 }) - run:new_line("pipe.R", { on_line = 1, text = "head(n = 10L) |>", indent = 2 }) - run:new_line("pipe.R", { on_line = 9, text = "head()", indent = 2 }) + run:new_line('pipe.R', { on_line = 1, text = 'head(n = 10L) |>', indent = 2 }) + run:new_line('pipe.R', { on_line = 9, text = 'head()', indent = 2 }) - run:new_line("incomplete_pipe.R", { on_line = 2, text = "head %>%", indent = 2 }) + run:new_line('incomplete_pipe.R', { on_line = 2, text = 'head %>%', indent = 2 }) - run:new_line("aligned_indent.R", { on_line = 1, text = "z,", indent = 17 }) + run:new_line('aligned_indent.R', { on_line = 1, text = 'z,', indent = 17 }) end) end) diff --git a/tests/indent/rescript_spec.lua b/tests/indent/rescript_spec.lua index 5b1f06abd..e97cd1e8b 100644 --- a/tests/indent/rescript_spec.lua +++ b/tests/indent/rescript_spec.lua @@ -1,33 +1,33 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/rescript", { +local run = Runner:new(it, 'tests/indent/rescript', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent ReScript:", function() - describe("whole file:", function() - run:whole_file(".", {}) +describe('indent ReScript:', function() + describe('whole file:', function() + run:whole_file('.', {}) end) - describe("new line:", function() - run:new_line("basic.res", { on_line = 5, text = "x", indent = 0 }) - run:new_line("basic.res", { on_line = 9, text = '"another": here,', indent = 2 }) - run:new_line("basic.res", { on_line = 10, text = "}", indent = 0 }) - run:new_line("basic.res", { on_line = 14, text = "~test: test,", indent = 2 }) - run:new_line("basic.res", { on_line = 18, text = "x", indent = 0 }) + describe('new line:', function() + run:new_line('basic.res', { on_line = 5, text = 'x', indent = 0 }) + run:new_line('basic.res', { on_line = 9, text = '"another": here,', indent = 2 }) + run:new_line('basic.res', { on_line = 10, text = '}', indent = 0 }) + run:new_line('basic.res', { on_line = 14, text = '~test: test,', indent = 2 }) + run:new_line('basic.res', { on_line = 18, text = 'x', indent = 0 }) - run:new_line("complex.res", { on_line = 3, text = "x", indent = 2 }) - run:new_line("complex.res", { on_line = 5, text = "x", indent = 4 }) - run:new_line("complex.res", { on_line = 17, text = "|", indent = 10 }) - run:new_line("complex.res", { on_line = 25, text = "x", indent = 2 }) - run:new_line("complex.res", { on_line = 60, text = "x", indent = 6 }) - run:new_line("complex.res", { on_line = 120, text = "x", indent = 14 }) - run:new_line("complex.res", { on_line = 136, text = "x", indent = 2 }) + run:new_line('complex.res', { on_line = 3, text = 'x', indent = 2 }) + run:new_line('complex.res', { on_line = 5, text = 'x', indent = 4 }) + run:new_line('complex.res', { on_line = 17, text = '|', indent = 10 }) + run:new_line('complex.res', { on_line = 25, text = 'x', indent = 2 }) + run:new_line('complex.res', { on_line = 60, text = 'x', indent = 6 }) + run:new_line('complex.res', { on_line = 120, text = 'x', indent = 14 }) + run:new_line('complex.res', { on_line = 136, text = 'x', indent = 2 }) - run:new_line("conditional.res", { on_line = 6, text = "test: bool,", indent = 2 }) - run:new_line("conditional.res", { on_line = 95, text = "x", indent = 10 }) + run:new_line('conditional.res', { on_line = 6, text = 'test: bool,', indent = 2 }) + run:new_line('conditional.res', { on_line = 95, text = 'x', indent = 10 }) end) end) diff --git a/tests/indent/ruby_spec.lua b/tests/indent/ruby_spec.lua index b669b8938..4dcd4d0fa 100644 --- a/tests/indent/ruby_spec.lua +++ b/tests/indent/ruby_spec.lua @@ -1,22 +1,22 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/ruby", { +local run = Runner:new(it, 'tests/indent/ruby', { shiftwidth = 2, expandtab = true, }) -describe("indent Ruby:", function() - describe("whole file:", function() - run:whole_file(".", { - expected_failures = { "./period-issue-3364.rb" }, +describe('indent Ruby:', function() + describe('whole file:', function() + run:whole_file('.', { + expected_failures = { './period-issue-3364.rb' }, }) end) - describe("new line:", function() - run:new_line("indent-unless.rb", { on_line = 1, text = "stmt", indent = 2 }) - run:new_line("indent-assignment.rb", { on_line = 1, text = "1 +", indent = 2 }) - run:new_line("indent-parenthesized-statements.rb", { on_line = 1, text = "stmt", indent = 2 }) - run:new_line("indent-rescue.rb", { on_line = 1, text = "rescue", indent = 0 }) - run:new_line("indent-ensure.rb", { on_line = 1, text = "ensure", indent = 0 }) + describe('new line:', function() + run:new_line('indent-unless.rb', { on_line = 1, text = 'stmt', indent = 2 }) + run:new_line('indent-assignment.rb', { on_line = 1, text = '1 +', indent = 2 }) + run:new_line('indent-parenthesized-statements.rb', { on_line = 1, text = 'stmt', indent = 2 }) + run:new_line('indent-rescue.rb', { on_line = 1, text = 'rescue', indent = 0 }) + run:new_line('indent-ensure.rb', { on_line = 1, text = 'ensure', indent = 0 }) end) end) diff --git a/tests/indent/rust_spec.lua b/tests/indent/rust_spec.lua index 795765ba5..3671e9ee7 100644 --- a/tests/indent/rust_spec.lua +++ b/tests/indent/rust_spec.lua @@ -1,66 +1,66 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/rust", { +local run = Runner:new(it, 'tests/indent/rust', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, }) -describe("indent Rust:", function() - describe("whole file:", function() - run:whole_file "." +describe('indent Rust:', function() + describe('whole file:', function() + run:whole_file('.') end) - describe("new line:", function() - run:new_line("array.rs", { on_line = 2, text = "0,", indent = 4 }) - run:new_line("array.rs", { on_line = 8, text = "0,", indent = 8 }) - run:new_line("comment.rs", { on_line = 3, text = "a", indent = "/// " }) - run:new_line("comment.rs", { on_line = 10, text = "a", indent = " /// " }) - run:new_line("cond.rs", { on_line = 11, text = "x += 1;", indent = 12 }) - run:new_line("cond.rs", { on_line = 2, text = "x += 1;", indent = 8 }) - run:new_line("cond.rs", { on_line = 4, text = "x += 1;", indent = 8 }) - run:new_line("cond.rs", { on_line = 6, text = "x += 1;", indent = 8 }) - run:new_line("cond.rs", { on_line = 8, text = "x += 1;", indent = 4 }) - run:new_line("if_let_cond.rs", { on_line = 2, text = "let a = 1;", indent = 8 }) - run:new_line("if_let_cond.rs", { on_line = 4, text = "let a = 1;", indent = 8 }) - run:new_line("if_let_cond.rs", { on_line = 6, text = "let a = 1;", indent = 4 }) - run:new_line("enum.rs", { on_line = 2, text = "Q,", indent = 4 }) - run:new_line("enum.rs", { on_line = 4, text = "i32,", indent = 8 }) - run:new_line("enum.rs", { on_line = 8, text = "z: u32,", indent = 8 }) - run:new_line("enum.rs", { on_line = 11, text = "let _x = 1;", indent = 0 }) - run:new_line("func.rs", { on_line = 1, text = "let _x = 1;", indent = 4 }) - run:new_line("func.rs", { on_line = 3, text = "let _x = 1;", indent = 0 }) - run:new_line("func.rs", { on_line = 6, text = "z: i32,", indent = 4 }) - run:new_line("impl.rs", { on_line = 3, text = "const FOO: u32 = 1;", indent = 4 }) - run:new_line("impl.rs", { on_line = 4, text = "let _x = 1;", indent = 8 }) - run:new_line("impl.rs", { on_line = 6, text = "let _x = 1;", indent = 4 }) - run:new_line("impl.rs", { on_line = 7, text = "let _x = 1;", indent = 0 }) - run:new_line("loop.rs", { on_line = 10, text = "x += 1;", indent = 8 }) - run:new_line("loop.rs", { on_line = 2, text = "x += 1;", indent = 8 }) - run:new_line("loop.rs", { on_line = 6, text = "x += 1;", indent = 8 }) - run:new_line("macro.rs", { on_line = 1, text = "() => {},", indent = 4 }) - run:new_line("macro.rs", { on_line = 12, text = "B C", indent = 4 }) - run:new_line("macro.rs", { on_line = 2, text = "struct $c;", indent = 8 }) - run:new_line("match.rs", { on_line = 2, text = "-1 => -1,", indent = 8 }) - run:new_line("match.rs", { on_line = 7, text = "let y = 1;", indent = 12 }) - run:new_line("match.rs", { on_line = 10, text = "let y = 1;", indent = 4 }) - run:new_line("mod.rs", { on_line = 1, text = "const Z: i32 = 1;", indent = 4 }) - run:new_line("mod.rs", { on_line = 2, text = "const Z: i32 = 1;", indent = 4 }) - run:new_line("mod.rs", { on_line = 6, text = "const Z: i32 = 1;", indent = 8 }) - run:new_line("mod.rs", { on_line = 7, text = "const Z: i32 = 1;", indent = 4 }) - run:new_line("string.rs", { on_line = 2, text = "brave new", indent = 0 }) - run:new_line("string.rs", { on_line = 5, text = "brave new \\", indent = 8 }) - run:new_line("string.rs", { on_line = 9, text = "brave new \\", indent = 8 }) - run:new_line("struct.rs", { on_line = 1, text = "z: i32,", indent = 4 }) - run:new_line("struct.rs", { on_line = 2, text = "z: i32,", indent = 4 }) - run:new_line("struct.rs", { on_line = 4, text = "let y = 1;", indent = 0 }) - run:new_line("trait.rs", { on_line = 4, text = "fn baz();", indent = 4 }) - run:new_line("trait.rs", { on_line = 5, text = "let y = 1;", indent = 0 }) - run:new_line("trait.rs", { on_line = 7, text = "fn baz();", indent = 4 }) - run:new_line("trait.rs", { on_line = 8, text = "()", indent = 8 }) - run:new_line("where.rs", { on_line = 17, text = "T: Debug,", indent = 4 }) - run:new_line("where.rs", { on_line = 2, text = "T: Debug,", indent = 4 }) - run:new_line("where.rs", { on_line = 9, text = "T: Debug,", indent = 4 }) + describe('new line:', function() + run:new_line('array.rs', { on_line = 2, text = '0,', indent = 4 }) + run:new_line('array.rs', { on_line = 8, text = '0,', indent = 8 }) + run:new_line('comment.rs', { on_line = 3, text = 'a', indent = '/// ' }) + run:new_line('comment.rs', { on_line = 10, text = 'a', indent = ' /// ' }) + run:new_line('cond.rs', { on_line = 11, text = 'x += 1;', indent = 12 }) + run:new_line('cond.rs', { on_line = 2, text = 'x += 1;', indent = 8 }) + run:new_line('cond.rs', { on_line = 4, text = 'x += 1;', indent = 8 }) + run:new_line('cond.rs', { on_line = 6, text = 'x += 1;', indent = 8 }) + run:new_line('cond.rs', { on_line = 8, text = 'x += 1;', indent = 4 }) + run:new_line('if_let_cond.rs', { on_line = 2, text = 'let a = 1;', indent = 8 }) + run:new_line('if_let_cond.rs', { on_line = 4, text = 'let a = 1;', indent = 8 }) + run:new_line('if_let_cond.rs', { on_line = 6, text = 'let a = 1;', indent = 4 }) + run:new_line('enum.rs', { on_line = 2, text = 'Q,', indent = 4 }) + run:new_line('enum.rs', { on_line = 4, text = 'i32,', indent = 8 }) + run:new_line('enum.rs', { on_line = 8, text = 'z: u32,', indent = 8 }) + run:new_line('enum.rs', { on_line = 11, text = 'let _x = 1;', indent = 0 }) + run:new_line('func.rs', { on_line = 1, text = 'let _x = 1;', indent = 4 }) + run:new_line('func.rs', { on_line = 3, text = 'let _x = 1;', indent = 0 }) + run:new_line('func.rs', { on_line = 6, text = 'z: i32,', indent = 4 }) + run:new_line('impl.rs', { on_line = 3, text = 'const FOO: u32 = 1;', indent = 4 }) + run:new_line('impl.rs', { on_line = 4, text = 'let _x = 1;', indent = 8 }) + run:new_line('impl.rs', { on_line = 6, text = 'let _x = 1;', indent = 4 }) + run:new_line('impl.rs', { on_line = 7, text = 'let _x = 1;', indent = 0 }) + run:new_line('loop.rs', { on_line = 10, text = 'x += 1;', indent = 8 }) + run:new_line('loop.rs', { on_line = 2, text = 'x += 1;', indent = 8 }) + run:new_line('loop.rs', { on_line = 6, text = 'x += 1;', indent = 8 }) + run:new_line('macro.rs', { on_line = 1, text = '() => {},', indent = 4 }) + run:new_line('macro.rs', { on_line = 12, text = 'B C', indent = 4 }) + run:new_line('macro.rs', { on_line = 2, text = 'struct $c;', indent = 8 }) + run:new_line('match.rs', { on_line = 2, text = '-1 => -1,', indent = 8 }) + run:new_line('match.rs', { on_line = 7, text = 'let y = 1;', indent = 12 }) + run:new_line('match.rs', { on_line = 10, text = 'let y = 1;', indent = 4 }) + run:new_line('mod.rs', { on_line = 1, text = 'const Z: i32 = 1;', indent = 4 }) + run:new_line('mod.rs', { on_line = 2, text = 'const Z: i32 = 1;', indent = 4 }) + run:new_line('mod.rs', { on_line = 6, text = 'const Z: i32 = 1;', indent = 8 }) + run:new_line('mod.rs', { on_line = 7, text = 'const Z: i32 = 1;', indent = 4 }) + run:new_line('string.rs', { on_line = 2, text = 'brave new', indent = 0 }) + run:new_line('string.rs', { on_line = 5, text = 'brave new \\', indent = 8 }) + run:new_line('string.rs', { on_line = 9, text = 'brave new \\', indent = 8 }) + run:new_line('struct.rs', { on_line = 1, text = 'z: i32,', indent = 4 }) + run:new_line('struct.rs', { on_line = 2, text = 'z: i32,', indent = 4 }) + run:new_line('struct.rs', { on_line = 4, text = 'let y = 1;', indent = 0 }) + run:new_line('trait.rs', { on_line = 4, text = 'fn baz();', indent = 4 }) + run:new_line('trait.rs', { on_line = 5, text = 'let y = 1;', indent = 0 }) + run:new_line('trait.rs', { on_line = 7, text = 'fn baz();', indent = 4 }) + run:new_line('trait.rs', { on_line = 8, text = '()', indent = 8 }) + run:new_line('where.rs', { on_line = 17, text = 'T: Debug,', indent = 4 }) + run:new_line('where.rs', { on_line = 2, text = 'T: Debug,', indent = 4 }) + run:new_line('where.rs', { on_line = 9, text = 'T: Debug,', indent = 4 }) end) end) diff --git a/tests/indent/smali_spec.lua b/tests/indent/smali_spec.lua index cddc4f9d2..44e4a9881 100644 --- a/tests/indent/smali_spec.lua +++ b/tests/indent/smali_spec.lua @@ -1,25 +1,28 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/smali", { +local run = Runner:new(it, 'tests/indent/smali', { tabstop = 4, shiftwidth = 4, expandtab = false, }) -describe("indent Smali:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Smali:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("field.smali", { on_line = 7, text = 'value1 = "test"', indent = 1 }) - run:new_line("field.smali", { on_line = 10, text = "value2 = Lsome/enum;", indent = 2 }) - run:new_line("array_and_switch.smali", { on_line = 43, text = "1 2 3 4 5 6 200", indent = 2 }) - run:new_line("array_and_switch.smali", { on_line = 48, text = "Label10:", indent = 2 }) - run:new_line("method.smali", { on_line = 7, text = ".registers 10", indent = 1 }) - run:new_line("parameter.smali", { on_line = 20, text = ".annotation runtime Lsome/annotation;", indent = 3 }) - run:new_line("parameter.smali", { on_line = 21, text = 'something = "some value"', indent = 3 }) + describe('new line:', function() + run:new_line('field.smali', { on_line = 7, text = 'value1 = "test"', indent = 1 }) + run:new_line('field.smali', { on_line = 10, text = 'value2 = Lsome/enum;', indent = 2 }) + run:new_line('array_and_switch.smali', { on_line = 43, text = '1 2 3 4 5 6 200', indent = 2 }) + run:new_line('array_and_switch.smali', { on_line = 48, text = 'Label10:', indent = 2 }) + run:new_line('method.smali', { on_line = 7, text = '.registers 10', indent = 1 }) + run:new_line( + 'parameter.smali', + { on_line = 20, text = '.annotation runtime Lsome/annotation;', indent = 3 } + ) + run:new_line('parameter.smali', { on_line = 21, text = 'something = "some value"', indent = 3 }) end) end) diff --git a/tests/indent/sql_spec.lua b/tests/indent/sql_spec.lua index 2fdfc9b1b..9d3a3a8e6 100644 --- a/tests/indent/sql_spec.lua +++ b/tests/indent/sql_spec.lua @@ -1,19 +1,19 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/sql", { +local run = Runner:new(it, 'tests/indent/sql', { tabstop = 4, shiftwidth = 4, softtabstop = 0, expandtab = true, }) -describe("indent SQL:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent SQL:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() end) + describe('new line:', function() end) end) diff --git a/tests/indent/sway_spec.lua b/tests/indent/sway_spec.lua index d37573ae9..d6f4506ef 100644 --- a/tests/indent/sway_spec.lua +++ b/tests/indent/sway_spec.lua @@ -1,20 +1,20 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/sway", { +local run = Runner:new(it, 'tests/indent/sway', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = true, }) -describe("indent Sway:", function() - describe("whole file:", function() - run:whole_file(".", {}) +describe('indent Sway:', function() + describe('whole file:', function() + run:whole_file('.', {}) end) - describe("new line:", function() - run:new_line("main.sw", { on_line = 12, text = "const CONST: u32 = 2;", indent = 0 }) - run:new_line("main.sw", { on_line = 14, text = "let hi = 5;", indent = 4 }) - run:new_line("main.sw", { on_line = 15, text = "let hi = 5;", indent = 8 }) - run:new_line("main.sw", { on_line = 92, text = "let hi = 5;", indent = 12 }) + describe('new line:', function() + run:new_line('main.sw', { on_line = 12, text = 'const CONST: u32 = 2;', indent = 0 }) + run:new_line('main.sw', { on_line = 14, text = 'let hi = 5;', indent = 4 }) + run:new_line('main.sw', { on_line = 15, text = 'let hi = 5;', indent = 8 }) + run:new_line('main.sw', { on_line = 92, text = 'let hi = 5;', indent = 12 }) end) end) diff --git a/tests/indent/swift_spec.lua b/tests/indent/swift_spec.lua index 501cbfa81..8c9b2d063 100644 --- a/tests/indent/swift_spec.lua +++ b/tests/indent/swift_spec.lua @@ -1,22 +1,37 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/swift", { +local run = Runner:new(it, 'tests/indent/swift', { tabstop = 2, shiftwidth = 2, softtabstop = 2, expandtab = true, }) -describe("indent Swift:", function() - describe("whole file:", function() - run:whole_file(".", {}) +describe('indent Swift:', function() + describe('whole file:', function() + run:whole_file('.', {}) end) - describe("new line:", function() - run:new_line("declarations.swift", { on_line = 6, text = "var x = 1", indent = 2 }) - run:new_line("declarations.swift", { on_line = 12, text = "var textInsideInit = true", indent = 4 }) - run:new_line("declarations.swift", { on_line = 19, text = "var textInsideWillSet = 1", indent = 6 }) - run:new_line("declarations.swift", { on_line = 22, text = "var textInsideDidSet = 1", indent = 6 }) - run:new_line("declarations.swift", { on_line = 27, text = "var textInsideOverrideFunc", indent = 4 }) - run:new_line("declarations.swift", { on_line = 33, text = "var InsideProtocol: String { get }", indent = 2 }) + describe('new line:', function() + run:new_line('declarations.swift', { on_line = 6, text = 'var x = 1', indent = 2 }) + run:new_line( + 'declarations.swift', + { on_line = 12, text = 'var textInsideInit = true', indent = 4 } + ) + run:new_line( + 'declarations.swift', + { on_line = 19, text = 'var textInsideWillSet = 1', indent = 6 } + ) + run:new_line( + 'declarations.swift', + { on_line = 22, text = 'var textInsideDidSet = 1', indent = 6 } + ) + run:new_line( + 'declarations.swift', + { on_line = 27, text = 'var textInsideOverrideFunc', indent = 4 } + ) + run:new_line( + 'declarations.swift', + { on_line = 33, text = 'var InsideProtocol: String { get }', indent = 2 } + ) end) end) diff --git a/tests/indent/t32_spec.lua b/tests/indent/t32_spec.lua index 88d26612b..30c6542e0 100644 --- a/tests/indent/t32_spec.lua +++ b/tests/indent/t32_spec.lua @@ -1,137 +1,171 @@ -local Runner = require("tests.indent.common").Runner -local XFAIL = require("tests.indent.common").XFAIL +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL -local runner = Runner:new(it, "tests/indent/t32", { +local runner = Runner:new(it, 'tests/indent/t32', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent t32:", function() - describe("whole file:", function() - runner:whole_file "." +describe('indent t32:', function() + describe('whole file:', function() + runner:whole_file('.') end) - describe("new line:", function() - runner:new_line("if_block.cmm", { on_line = 2, text = "GOTO start", indent = 0 }, "command after IF", XFAIL) + describe('new line:', function() + runner:new_line( + 'if_block.cmm', + { on_line = 2, text = 'GOTO start', indent = 0 }, + 'command after IF', + XFAIL + ) - runner:new_line("if_block.cmm", { on_line = 5, text = "GOTO start", indent = 2 }, "command in IF then block") + runner:new_line( + 'if_block.cmm', + { on_line = 5, text = 'GOTO start', indent = 2 }, + 'command in IF then block' + ) - runner:new_line("if_block.cmm", { on_line = 4, text = "(", indent = 0 }, "block after IF") + runner:new_line('if_block.cmm', { on_line = 4, text = '(', indent = 0 }, 'block after IF') - for ii, test in ipairs { + for ii, test in ipairs({ { 1, 2 }, { 14, 2 }, { 19, 2 }, { 21, 2 }, { 41, 2 }, { 42, 4 }, - } do + }) do runner:new_line( - "if_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command in IF then[" .. ii .. "]" + 'if_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command in IF then[' .. ii .. ']' ) end -- Insertion of a command right before the existing block results in -- incorrect syntax. The parse either detect an error or incorrectly -- assumes "ELSE IF" is a command. - for ii, test in ipairs { + for ii, test in ipairs({ { 26, 2 }, { 30, 2 }, - } do + }) do runner:new_line( - "if_block.cmm", + 'if_block.cmm', { on_line = test[1], text = 'PRINT ""', indent = test[2] }, - "displace block in IF then[" .. ii .. "]", + 'displace block in IF then[' .. ii .. ']', XFAIL ) end - runner:new_line("if_block.cmm", { on_line = 45, text = "&x=1.", indent = 6 }, "command in IF then", XFAIL) + runner:new_line( + 'if_block.cmm', + { on_line = 45, text = '&x=1.', indent = 6 }, + 'command in IF then', + XFAIL + ) - for ii, test in ipairs { + for ii, test in ipairs({ { 16, 2 }, { 21, 2 }, { 23, 2 }, { 44, 4 }, - } do + }) do runner:new_line( - "if_block.cmm", - { on_line = test[1], text = "CONTinue\n", indent = test[2] }, - "command in IF else[" .. ii .. "]" + 'if_block.cmm', + { on_line = test[1], text = 'CONTinue\n', indent = test[2] }, + 'command in IF else[' .. ii .. ']' ) end - runner:new_line("while_block.cmm", { on_line = 2, text = "&x=1.", indent = 2 }, "command after WHILE") + runner:new_line( + 'while_block.cmm', + { on_line = 2, text = '&x=1.', indent = 2 }, + 'command after WHILE' + ) - runner:new_line("while_block.cmm", { on_line = 4, text = "&x=1.", indent = 0 }, "command after WHILE") + runner:new_line( + 'while_block.cmm', + { on_line = 4, text = '&x=1.', indent = 0 }, + 'command after WHILE' + ) - runner:new_line("while_block.cmm", { on_line = 1, text = "(\n", indent = 0 }, "block in WHILE then") + runner:new_line( + 'while_block.cmm', + { on_line = 1, text = '(\n', indent = 0 }, + 'block in WHILE then' + ) - for ii, test in ipairs { + for ii, test in ipairs({ { 5, 2 }, { 12, 2 }, - } do + }) do runner:new_line( - "while_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command in WHILE then block[" .. ii .. "]" + 'while_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command in WHILE then block[' .. ii .. ']' ) end - for ii, test in ipairs { + for ii, test in ipairs({ { 1, 0 }, { 4, 2 }, - } do + }) do runner:new_line( - "repeat_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command after RePeaT[" .. ii .. "]" + 'repeat_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command after RePeaT[' .. ii .. ']' ) end - runner:new_line("repeat_block.cmm", { on_line = 3, text = "(\n", indent = 0 }, "block in RePeaT then") + runner:new_line( + 'repeat_block.cmm', + { on_line = 3, text = '(\n', indent = 0 }, + 'block in RePeaT then' + ) - for ii, test in ipairs { + for ii, test in ipairs({ { 7, 2 }, { 18, 2 }, { 24, 2 }, - } do + }) do runner:new_line( - "repeat_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command in RePeaT then block [" .. ii .. "]" + 'repeat_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command in RePeaT then block [' .. ii .. ']' ) end - runner:new_line("subroutine_block.cmm", { on_line = 1, text = "(\n", indent = 0 }, "block after call label") + runner:new_line( + 'subroutine_block.cmm', + { on_line = 1, text = '(\n', indent = 0 }, + 'block after call label' + ) - for ii, test in ipairs { + for ii, test in ipairs({ { 2, 2 }, { 3, 2 }, { 8, 2 }, { 12, 2 }, { 19, 2 }, - } do + }) do runner:new_line( - "subroutine_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command in subroutine block[" .. ii .. "]" + 'subroutine_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command in subroutine block[' .. ii .. ']' ) end - for ii, test in ipairs { + for ii, test in ipairs({ { 5, 2 }, { 13, 2 }, { 23, 2 }, - } do + }) do runner:new_line( - "subroutine_block.cmm", - { on_line = test[1], text = "&x=1.", indent = test[2] }, - "command after subroutine block[" .. ii .. "]" + 'subroutine_block.cmm', + { on_line = test[1], text = '&x=1.', indent = test[2] }, + 'command after subroutine block[' .. ii .. ']' ) end end) diff --git a/tests/indent/terraform_spec.lua b/tests/indent/terraform_spec.lua index 49fa22c20..3cfcb937b 100644 --- a/tests/indent/terraform_spec.lua +++ b/tests/indent/terraform_spec.lua @@ -1,35 +1,56 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/terraform", { +local run = Runner:new(it, 'tests/indent/terraform', { tabstop = 2, shiftwidth = 2, expandtab = true, }) -describe("indent Terraform:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Terraform:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("no-indent-after-brace.tf", { on_line = 4, text = "# Wow, no indent here please", indent = 0 }) - run:new_line("indent-in-multiline-tuples.tf", { on_line = 4, text = "3,", indent = 4 }) - run:new_line("indent-in-multiline-tuples.tf", { on_line = 3, text = "# as elements", indent = 4 }) - run:new_line("indent-in-multiline-tuples.tf", { on_line = 5, text = "# as outer block", indent = 2 }) - run:new_line("indent-in-multiline-tuples.tf", { on_line = 1, text = "# as outer block", indent = 2 }) - run:new_line("indent-in-multiline-objects.tf", { on_line = 4, text = '3: "baz",', indent = 4 }) - run:new_line("indent-in-multiline-objects.tf", { on_line = 3, text = "# as elements", indent = 4 }) - run:new_line("indent-in-multiline-objects.tf", { on_line = 5, text = "# as outer block", indent = 2 }) - run:new_line("indent-in-multiline-objects.tf", { on_line = 1, text = "# as outer block", indent = 2 }) - run:new_line("multiple-attributes.tf", { on_line = 2, text = "a = 1", indent = 2 }) - run:new_line("multiple-attributes.tf", { on_line = 3, text = "a = 1", indent = 2 }) - run:new_line("multiple-attributes.tf", { on_line = 4, text = "a = 1", indent = 0 }) - run:new_line("nested_blocks.tf", { on_line = 3, text = "a = 1", indent = 4 }) - run:new_line("nested_blocks.tf", { on_line = 4, text = "a = 1", indent = 2 }) - run:new_line("function_call.tf", { on_line = 4, text = "c,", indent = 4 }) - run:new_line("function_call.tf", { on_line = 5, text = "a = 1", indent = 2 }) + describe('new line:', function() + run:new_line( + 'no-indent-after-brace.tf', + { on_line = 4, text = '# Wow, no indent here please', indent = 0 } + ) + run:new_line('indent-in-multiline-tuples.tf', { on_line = 4, text = '3,', indent = 4 }) + run:new_line( + 'indent-in-multiline-tuples.tf', + { on_line = 3, text = '# as elements', indent = 4 } + ) + run:new_line( + 'indent-in-multiline-tuples.tf', + { on_line = 5, text = '# as outer block', indent = 2 } + ) + run:new_line( + 'indent-in-multiline-tuples.tf', + { on_line = 1, text = '# as outer block', indent = 2 } + ) + run:new_line('indent-in-multiline-objects.tf', { on_line = 4, text = '3: "baz",', indent = 4 }) + run:new_line( + 'indent-in-multiline-objects.tf', + { on_line = 3, text = '# as elements', indent = 4 } + ) + run:new_line( + 'indent-in-multiline-objects.tf', + { on_line = 5, text = '# as outer block', indent = 2 } + ) + run:new_line( + 'indent-in-multiline-objects.tf', + { on_line = 1, text = '# as outer block', indent = 2 } + ) + run:new_line('multiple-attributes.tf', { on_line = 2, text = 'a = 1', indent = 2 }) + run:new_line('multiple-attributes.tf', { on_line = 3, text = 'a = 1', indent = 2 }) + run:new_line('multiple-attributes.tf', { on_line = 4, text = 'a = 1', indent = 0 }) + run:new_line('nested_blocks.tf', { on_line = 3, text = 'a = 1', indent = 4 }) + run:new_line('nested_blocks.tf', { on_line = 4, text = 'a = 1', indent = 2 }) + run:new_line('function_call.tf', { on_line = 4, text = 'c,', indent = 4 }) + run:new_line('function_call.tf', { on_line = 5, text = 'a = 1', indent = 2 }) end) end) diff --git a/tests/indent/tiger_spec.lua b/tests/indent/tiger_spec.lua index c1f252fd8..b41019c12 100644 --- a/tests/indent/tiger_spec.lua +++ b/tests/indent/tiger_spec.lua @@ -1,113 +1,233 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local runner = Runner:new(it, "tests/indent/tiger", { +local runner = Runner:new(it, 'tests/indent/tiger', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Tiger:", function() - describe("whole file:", function() - runner:whole_file "." +describe('indent Tiger:', function() + describe('whole file:', function() + runner:whole_file('.') end) - describe("new line:", function() - runner:new_line("classes.tig", { on_line = 1, text = "var a := 0", indent = 2 }, "class declaration beginning") - runner:new_line("classes.tig", { on_line = 2, text = "var a := 0", indent = 2 }, "class declaration after field") - runner:new_line("classes.tig", { on_line = 4, text = "var a := 0", indent = 2 }, "class declaration after method") - runner:new_line("classes.tig", { on_line = 5, text = "var a := 0", indent = 0 }, "after class declaration") - runner:new_line("classes.tig", { on_line = 7, text = "var a := 0", indent = 2 }, "class type beginning") - runner:new_line("classes.tig", { on_line = 8, text = "var a := 0", indent = 2 }, "class type after field") - runner:new_line("classes.tig", { on_line = 10, text = "self.a := 0", indent = 4 }, "inside method") - runner:new_line("classes.tig", { on_line = 13, text = "var a := 0", indent = 2 }, "class type after method") - runner:new_line("classes.tig", { on_line = 14, text = "var a := 0", indent = 0 }, "after class type") + describe('new line:', function() + runner:new_line( + 'classes.tig', + { on_line = 1, text = 'var a := 0', indent = 2 }, + 'class declaration beginning' + ) + runner:new_line( + 'classes.tig', + { on_line = 2, text = 'var a := 0', indent = 2 }, + 'class declaration after field' + ) + runner:new_line( + 'classes.tig', + { on_line = 4, text = 'var a := 0', indent = 2 }, + 'class declaration after method' + ) + runner:new_line( + 'classes.tig', + { on_line = 5, text = 'var a := 0', indent = 0 }, + 'after class declaration' + ) + runner:new_line( + 'classes.tig', + { on_line = 7, text = 'var a := 0', indent = 2 }, + 'class type beginning' + ) + runner:new_line( + 'classes.tig', + { on_line = 8, text = 'var a := 0', indent = 2 }, + 'class type after field' + ) + runner:new_line( + 'classes.tig', + { on_line = 10, text = 'self.a := 0', indent = 4 }, + 'inside method' + ) + runner:new_line( + 'classes.tig', + { on_line = 13, text = 'var a := 0', indent = 2 }, + 'class type after method' + ) + runner:new_line( + 'classes.tig', + { on_line = 14, text = 'var a := 0', indent = 0 }, + 'after class type' + ) - runner:new_line("control-flow.tig", { on_line = 2, text = "true", indent = 4 }, "if condition") - runner:new_line("control-flow.tig", { on_line = 4, text = "true", indent = 4 }, "if consequence") - runner:new_line("control-flow.tig", { on_line = 4, text = "true", indent = 4 }, "if alternative") - runner:new_line("control-flow.tig", { on_line = 10, text = "start := 0", indent = 4 }, "for index start") - runner:new_line("control-flow.tig", { on_line = 12, text = "the_end", indent = 4 }, "for index end") - runner:new_line("control-flow.tig", { on_line = 14, text = "break", indent = 4 }, "for body") - runner:new_line("control-flow.tig", { on_line = 18, text = "true", indent = 4 }, "while condition") - runner:new_line("control-flow.tig", { on_line = 20, text = "break", indent = 4 }, "while body") - - runner:new_line("functions.tig", { on_line = 1, text = "parameter: int,", indent = 2 }, "parameter list beginning") - runner:new_line("functions.tig", { on_line = 2, text = "parameter: int,", indent = 2 }, "parameter list middle") - runner:new_line("functions.tig", { on_line = 4, text = ",parameter: int", indent = 2 }, "parameter list end") - runner:new_line("functions.tig", { on_line = 5, text = "var a := 0", indent = 0 }, "after parameter list") - runner:new_line("functions.tig", { on_line = 7, text = "print(a)", indent = 2 }, "function body") - runner:new_line("functions.tig", { on_line = 9, text = "a,", indent = 6 }, "function call beginning") - runner:new_line("functions.tig", { on_line = 10, text = "a,", indent = 6 }, "function call middle") - runner:new_line("functions.tig", { on_line = 12, text = ",a", indent = 6 }, "function call end") - runner:new_line("functions.tig", { on_line = 13, text = "; print(a)", indent = 4 }, "after function call") - runner:new_line("functions.tig", { on_line = 14, text = "var a := 12", indent = 0 }, "after function declaration") - - runner:new_line("groupings.tig", { on_line = 2, text = "var b := 0", indent = 2 }, "let declarations") - runner:new_line("groupings.tig", { on_line = 3, text = "a := a + 1", indent = 2 }, "after 'in'") - runner:new_line("groupings.tig", { on_line = 4, text = "a := a + 1;", indent = 4 }, "sequence") - runner:new_line("groupings.tig", { on_line = 8, text = "a := a + 1;", indent = 2 }, "after sequence") - runner:new_line("groupings.tig", { on_line = 10, text = "+ 1", indent = 0 }, "after 'end'") + runner:new_line('control-flow.tig', { on_line = 2, text = 'true', indent = 4 }, 'if condition') + runner:new_line( + 'control-flow.tig', + { on_line = 4, text = 'true', indent = 4 }, + 'if consequence' + ) + runner:new_line( + 'control-flow.tig', + { on_line = 4, text = 'true', indent = 4 }, + 'if alternative' + ) + runner:new_line( + 'control-flow.tig', + { on_line = 10, text = 'start := 0', indent = 4 }, + 'for index start' + ) + runner:new_line( + 'control-flow.tig', + { on_line = 12, text = 'the_end', indent = 4 }, + 'for index end' + ) + runner:new_line('control-flow.tig', { on_line = 14, text = 'break', indent = 4 }, 'for body') + runner:new_line( + 'control-flow.tig', + { on_line = 18, text = 'true', indent = 4 }, + 'while condition' + ) + runner:new_line('control-flow.tig', { on_line = 20, text = 'break', indent = 4 }, 'while body') runner:new_line( - "values-and-expressions.tig", - { on_line = 4, text = "field: record,", indent = 4 }, - "record type beginning" + 'functions.tig', + { on_line = 1, text = 'parameter: int,', indent = 2 }, + 'parameter list beginning' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 5, text = "field: record,", indent = 4 }, - "record type middle" + 'functions.tig', + { on_line = 2, text = 'parameter: int,', indent = 2 }, + 'parameter list middle' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 7, text = ",field: record", indent = 4 }, - "record type end" - ) - runner:new_line("values-and-expressions.tig", { on_line = 8, text = "var a := 0", indent = 2 }, "after record type") - runner:new_line( - "values-and-expressions.tig", - { on_line = 10, text = "0", indent = 4 }, - "variable declaration init value" + 'functions.tig', + { on_line = 4, text = ',parameter: int', indent = 2 }, + 'parameter list end' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 11, text = "+ a", indent = 4 }, - "variable declaration init follow-up" - ) - runner:new_line("values-and-expressions.tig", { on_line = 13, text = "a", indent = 4 }, "array index") - runner:new_line("values-and-expressions.tig", { on_line = 14, text = "+ a", indent = 4 }, "array index follow-up") - runner:new_line("values-and-expressions.tig", { on_line = 15, text = "+ a", indent = 2 }, "after array value") - runner:new_line("values-and-expressions.tig", { on_line = 18, text = "a", indent = 4 }, "array expression size") - runner:new_line( - "values-and-expressions.tig", - { on_line = 20, text = "of", indent = 4 }, - "array expression after size" + 'functions.tig', + { on_line = 5, text = 'var a := 0', indent = 0 }, + 'after parameter list' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 21, text = "a", indent = 4 }, - "array expression init value" + 'functions.tig', + { on_line = 7, text = 'print(a)', indent = 2 }, + 'function body' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 25, text = "field = 0,", indent = 4 }, - "record expression beginning" + 'functions.tig', + { on_line = 9, text = 'a,', indent = 6 }, + 'function call beginning' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 26, text = "field = 0,", indent = 4 }, - "record expression middle" + 'functions.tig', + { on_line = 10, text = 'a,', indent = 6 }, + 'function call middle' + ) + runner:new_line('functions.tig', { on_line = 12, text = ',a', indent = 6 }, 'function call end') + runner:new_line( + 'functions.tig', + { on_line = 13, text = '; print(a)', indent = 4 }, + 'after function call' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 28, text = ",field = 0", indent = 4 }, - "record expression end" + 'functions.tig', + { on_line = 14, text = 'var a := 12', indent = 0 }, + 'after function declaration' + ) + + runner:new_line( + 'groupings.tig', + { on_line = 2, text = 'var b := 0', indent = 2 }, + 'let declarations' + ) + runner:new_line('groupings.tig', { on_line = 3, text = 'a := a + 1', indent = 2 }, "after 'in'") + runner:new_line('groupings.tig', { on_line = 4, text = 'a := a + 1;', indent = 4 }, 'sequence') + runner:new_line( + 'groupings.tig', + { on_line = 8, text = 'a := a + 1;', indent = 2 }, + 'after sequence' + ) + runner:new_line('groupings.tig', { on_line = 10, text = '+ 1', indent = 0 }, "after 'end'") + + runner:new_line( + 'values-and-expressions.tig', + { on_line = 4, text = 'field: record,', indent = 4 }, + 'record type beginning' ) runner:new_line( - "values-and-expressions.tig", - { on_line = 29, text = "a := 0", indent = 2 }, - "after record expression" + 'values-and-expressions.tig', + { on_line = 5, text = 'field: record,', indent = 4 }, + 'record type middle' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 7, text = ',field: record', indent = 4 }, + 'record type end' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 8, text = 'var a := 0', indent = 2 }, + 'after record type' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 10, text = '0', indent = 4 }, + 'variable declaration init value' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 11, text = '+ a', indent = 4 }, + 'variable declaration init follow-up' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 13, text = 'a', indent = 4 }, + 'array index' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 14, text = '+ a', indent = 4 }, + 'array index follow-up' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 15, text = '+ a', indent = 2 }, + 'after array value' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 18, text = 'a', indent = 4 }, + 'array expression size' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 20, text = 'of', indent = 4 }, + 'array expression after size' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 21, text = 'a', indent = 4 }, + 'array expression init value' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 25, text = 'field = 0,', indent = 4 }, + 'record expression beginning' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 26, text = 'field = 0,', indent = 4 }, + 'record expression middle' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 28, text = ',field = 0', indent = 4 }, + 'record expression end' + ) + runner:new_line( + 'values-and-expressions.tig', + { on_line = 29, text = 'a := 0', indent = 2 }, + 'after record expression' ) end) end) diff --git a/tests/indent/usd_spec.lua b/tests/indent/usd_spec.lua index c4e8198aa..85e9b9f78 100644 --- a/tests/indent/usd_spec.lua +++ b/tests/indent/usd_spec.lua @@ -1,21 +1,21 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/usd", { +local run = Runner:new(it, 'tests/indent/usd', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = true, }) -describe("indent USD:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent USD:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("prim.usd", { on_line = 3, text = "active = false", indent = 4 }) - run:new_line("prim.usd", { on_line = 5, text = "custom int foo = 10", indent = 4 }) + describe('new line:', function() + run:new_line('prim.usd', { on_line = 3, text = 'active = false', indent = 4 }) + run:new_line('prim.usd', { on_line = 5, text = 'custom int foo = 10', indent = 4 }) end) end) diff --git a/tests/indent/vue_spec.lua b/tests/indent/vue_spec.lua index 09527e4b0..ec9466d5e 100644 --- a/tests/indent/vue_spec.lua +++ b/tests/indent/vue_spec.lua @@ -1,24 +1,29 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -- local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent", { +local run = Runner:new(it, 'tests/indent', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent Vue:", function() - describe("whole file:", function() - run:whole_file({ "vue/" }, {}) +describe('indent Vue:', function() + describe('whole file:', function() + run:whole_file({ 'vue/' }, {}) end) - describe("new line:", function() - for _, info in ipairs { + describe('new line:', function() + for _, info in ipairs({ { 1, 2 }, { 3, 0 }, - } do - run:new_line("vue/template_indent.vue", { on_line = info[1], text = "Foo", indent = info[2] }, info[3], info[4]) + }) do + run:new_line( + 'vue/template_indent.vue', + { on_line = info[1], text = 'Foo', indent = info[2] }, + info[3], + info[4] + ) end end) end) diff --git a/tests/indent/wgsl_spec.lua b/tests/indent/wgsl_spec.lua index e1bf618f8..9a30cff4b 100644 --- a/tests/indent/wgsl_spec.lua +++ b/tests/indent/wgsl_spec.lua @@ -1,43 +1,43 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/wgsl", { +local run = Runner:new(it, 'tests/indent/wgsl', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent WGSL:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent WGSL:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("basic.wgsl", { on_line = 47, text = "c: u32,", indent = 2 }) - run:new_line("basic.wgsl", { on_line = 52, text = "c: u32,", indent = 2 }) - run:new_line("basic.wgsl", { on_line = 56, text = "c: u32,", indent = 2 }) - run:new_line("basic.wgsl", { on_line = 59, text = "c: u32,", indent = 2 }) - run:new_line("type_constructor_or_function_call_expression.wgsl", { + describe('new line:', function() + run:new_line('basic.wgsl', { on_line = 47, text = 'c: u32,', indent = 2 }) + run:new_line('basic.wgsl', { on_line = 52, text = 'c: u32,', indent = 2 }) + run:new_line('basic.wgsl', { on_line = 56, text = 'c: u32,', indent = 2 }) + run:new_line('basic.wgsl', { on_line = 59, text = 'c: u32,', indent = 2 }) + run:new_line('type_constructor_or_function_call_expression.wgsl', { on_line = 3, - text = "b", + text = 'b', indent = 4, }) - run:new_line("type_constructor_or_function_call_expression.wgsl", { + run:new_line('type_constructor_or_function_call_expression.wgsl', { on_line = 4, - text = "c", + text = 'c', indent = 4, }) - run:new_line("type_constructor_or_function_call_expression.wgsl", { + run:new_line('type_constructor_or_function_call_expression.wgsl', { on_line = 8, - text = "b", + text = 'b', indent = 4, }) - run:new_line("type_constructor_or_function_call_expression.wgsl", { + run:new_line('type_constructor_or_function_call_expression.wgsl', { on_line = 9, - text = "c", + text = 'c', indent = 4, }) end) diff --git a/tests/indent/yaml_spec.lua b/tests/indent/yaml_spec.lua index 91c60c227..001bc01f1 100644 --- a/tests/indent/yaml_spec.lua +++ b/tests/indent/yaml_spec.lua @@ -1,20 +1,20 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/yaml", { +local run = Runner:new(it, 'tests/indent/yaml', { shiftwidth = 2, expandtab = true, }) -describe("indent YAML:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent YAML:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("indent-sequence-items.yaml", { on_line = 2, text = "key3: value3", indent = 2 }) - run:new_line("autoindent-mapping-pair.yaml", { on_line = 1, text = "key3: value3", indent = 2 }) + describe('new line:', function() + run:new_line('indent-sequence-items.yaml', { on_line = 2, text = 'key3: value3', indent = 2 }) + run:new_line('autoindent-mapping-pair.yaml', { on_line = 1, text = 'key3: value3', indent = 2 }) end) end) diff --git a/tests/indent/yang_spec.lua b/tests/indent/yang_spec.lua index 618d260c6..44e1dbce5 100644 --- a/tests/indent/yang_spec.lua +++ b/tests/indent/yang_spec.lua @@ -1,23 +1,23 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner -local run = Runner:new(it, "tests/indent/yang", { +local run = Runner:new(it, 'tests/indent/yang', { tabstop = 2, shiftwidth = 2, softtabstop = 0, expandtab = true, }) -describe("indent YANG:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent YANG:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("module.yang", { on_line = 12, text = "// Aligned indentation ended", indent = 2 }) - run:new_line("module.yang", { on_line = 37, text = "// Test", indent = 4 }) - run:new_line("module.yang", { on_line = 40, text = "// Test", indent = 4 }) - run:new_line("module.yang", { on_line = 52, text = "Aligned string!", indent = 11 }) + describe('new line:', function() + run:new_line('module.yang', { on_line = 12, text = '// Aligned indentation ended', indent = 2 }) + run:new_line('module.yang', { on_line = 37, text = '// Test', indent = 4 }) + run:new_line('module.yang', { on_line = 40, text = '// Test', indent = 4 }) + run:new_line('module.yang', { on_line = 52, text = 'Aligned string!', indent = 11 }) end) end) diff --git a/tests/indent/yuck_spec.lua b/tests/indent/yuck_spec.lua index 6ce15de6f..b20ac8dac 100644 --- a/tests/indent/yuck_spec.lua +++ b/tests/indent/yuck_spec.lua @@ -1,19 +1,19 @@ -local Runner = require("tests.indent.common").Runner -local run = Runner:new(it, "tests/indent/yuck", { +local Runner = require('tests.indent.common').Runner +local run = Runner:new(it, 'tests/indent/yuck', { tabstop = 2, shiftwidth = 2, expandtab = true, }) -describe("indent yuck", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent yuck', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new line:", function() - run:new_line("indent.yuck", { on_line = 13, text = ":box1 parameter", indent = 4 }) - run:new_line("indent.yuck", { on_line = 17, text = ")", indent = 0 }) + describe('new line:', function() + run:new_line('indent.yuck', { on_line = 13, text = ':box1 parameter', indent = 4 }) + run:new_line('indent.yuck', { on_line = 17, text = ')', indent = 0 }) end) end) diff --git a/tests/indent/zig_spec.lua b/tests/indent/zig_spec.lua index c064d9ab9..4ad17446f 100644 --- a/tests/indent/zig_spec.lua +++ b/tests/indent/zig_spec.lua @@ -1,22 +1,22 @@ -local Runner = require("tests.indent.common").Runner +local Runner = require('tests.indent.common').Runner --local XFAIL = require("tests.indent.common").XFAIL -local run = Runner:new(it, "tests/indent/zig", { +local run = Runner:new(it, 'tests/indent/zig', { tabstop = 4, shiftwidth = 4, softtabstop = 4, expandtab = true, }) -describe("indent Zig:", function() - describe("whole file:", function() - run:whole_file(".", { +describe('indent Zig:', function() + describe('whole file:', function() + run:whole_file('.', { expected_failures = {}, }) end) - describe("new lines:", function() - run:new_line("pr-3269.zig", { on_line = 5, text = "return;", indent = 4 }) - run:new_line("pr-3269.zig", { on_line = 6, text = "", indent = 0 }) + describe('new lines:', function() + run:new_line('pr-3269.zig', { on_line = 5, text = 'return;', indent = 4 }) + run:new_line('pr-3269.zig', { on_line = 6, text = '', indent = 0 }) end) end) diff --git a/tests/query/highlights/lua/test.lua b/tests/query/highlights/lua/test.lua index 55818bb74..2261d2e4e 100644 --- a/tests/query/highlights/lua/test.lua +++ b/tests/query/highlights/lua/test.lua @@ -14,5 +14,5 @@ next(a) -- ^ @function.builtin -- Checking for incorrect hlgroup of injected luap -string.match(s, "\0%d[^\n]+") --- ^ @!constant +string.match(s, '\0%d[^\n]+') +-- ^ !constant diff --git a/tests/query/highlights_spec.lua b/tests/query/highlights_spec.lua index 3bb03d49d..b6a52124a 100644 --- a/tests/query/highlights_spec.lua +++ b/tests/query/highlights_spec.lua @@ -1,39 +1,39 @@ -local highlighter = require "vim.treesitter.highlighter" -local parsers = require "nvim-treesitter.parsers" +local highlighter = require('vim.treesitter.highlighter') local ts = vim.treesitter local COMMENT_NODES = { - markdown = "html_block", - haskell = "haddock", + markdown = 'html_block', + haskell = 'haddock', } local function check_assertions(file) local buf = vim.fn.bufadd(file) vim.fn.bufload(file) - local lang = parsers.get_buf_lang(buf) + local ft = vim.bo[buf].filetype + local lang = vim.treesitter.language.get_lang(ft) or ft assert.same( 1, - vim.fn.executable "highlight-assertions", + vim.fn.executable('highlight-assertions'), '"highlight-assertions" not executable!' .. ' Get it via "cargo install --git https://github.com/theHamsta/highlight-assertions"' ) - local comment_node = COMMENT_NODES[lang] or "comment" + local comment_node = COMMENT_NODES[lang] or 'comment' local assertions = vim.fn.json_decode( vim.fn.system( "highlight-assertions -p '" - .. vim.api.nvim_get_runtime_file("parser/" .. lang .. ".so", false)[1] + .. vim.api.nvim_get_runtime_file('parser/' .. lang .. '.so', false)[1] .. "' -s '" .. file .. "' -c " .. comment_node ) ) - local parser = parsers.get_parser(buf, lang) + local parser = ts.get_parser(buf, lang) parser:parse(true) local self = highlighter.new(parser, {}) - assert.True(#assertions > 0, "No assertions detected!") + assert.True(#assertions > 0, 'No assertions detected!') for _, assertion in ipairs(assertions) do local row = assertion.position.row local col = assertion.position.column @@ -46,7 +46,7 @@ local function check_assertions(file) return end - local root = state.tstree:root() + local root = tstree:root() local root_start_row, _, root_end_row, _ = root:range() -- Only worry about trees within the line range @@ -72,21 +72,22 @@ local function check_assertions(file) assert.is.number(col) if hl and ts.is_in_node_range(node, row, col) then local c = query._query.captures[capture] -- name of the capture in the query - if c ~= nil and c ~= "spell" and c ~= "conceal" then + if c ~= nil and c ~= 'spell' and c ~= 'conceal' then captures[c] = true highlights[c] = true end end end - end, true) - if assertion.expected_capture_name:match "^!" then + end) + if assertion.expected_capture_name:match('^!') then assert.Falsy( - captures[assertion.expected_capture_name:sub(2)] or highlights[assertion.expected_capture_name:sub(2)], - "Error in at " + captures[assertion.expected_capture_name:sub(2)] + or highlights[assertion.expected_capture_name:sub(2)], + 'Error in at ' .. file - .. ":" + .. ':' .. (row + 1) - .. ":" + .. ':' .. (col + 1) .. ': expected "' .. assertion.expected_capture_name @@ -98,11 +99,11 @@ local function check_assertions(file) else assert.True( captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name], - "Error in at " + 'Error in at ' .. file - .. ":" + .. ':' .. (row + 1) - .. ":" + .. ':' .. (col + 1) .. ': expected "' .. assertion.expected_capture_name @@ -115,8 +116,8 @@ local function check_assertions(file) end end -describe("highlight queries", function() - local files = vim.fn.split(vim.fn.glob "tests/query/highlights/**/*.*") +describe('highlight queries', function() + local files = vim.fn.split(vim.fn.glob('tests/query/highlights/**/*.*')) for _, file in ipairs(files) do it(file, function() check_assertions(file) diff --git a/tests/query/injection_spec.lua b/tests/query/injection_spec.lua index 95ad12eec..91096fee4 100644 --- a/tests/query/injection_spec.lua +++ b/tests/query/injection_spec.lua @@ -1,24 +1,30 @@ -require "nvim-treesitter.highlight" -- yes, this is necessary to set the hlmap -local configs = require "nvim-treesitter.configs" -local parsers = require "nvim-treesitter.parsers" +local config = require('nvim-treesitter.config') local ts = vim.treesitter local function check_assertions(file) local buf = vim.fn.bufadd(file) vim.fn.bufload(file) - local lang = parsers.get_buf_lang(buf) + local ft = vim.bo[buf].filetype + local lang = vim.treesitter.language.get_lang(ft) or ft assert.same( 1, - vim.fn.executable "highlight-assertions", + vim.fn.executable('highlight-assertions'), '"highlight-assertions" not executable!' .. ' Get it via "cargo install --git https://github.com/theHamsta/highlight-assertions"' ) local assertions = vim.fn.json_decode( vim.fn.system( - "highlight-assertions -p '" .. configs.get_parser_install_dir() .. "/" .. lang .. ".so'" .. " -s '" .. file .. "'" + "highlight-assertions -p '" + .. config.get_install_dir('parser') + .. '/' + .. lang + .. ".so'" + .. " -s '" + .. file + .. "'" ) ) - local parser = parsers.get_parser(buf, lang) + local parser = ts.get_parser(buf, lang) local self = parser local top_level_root = parser:parse(true)[1]:root() @@ -27,7 +33,7 @@ local function check_assertions(file) local row = assertion.position.row local col = assertion.position.column - local neg_assert = assertion.expected_capture_name:match "^!" + local neg_assert = assertion.expected_capture_name:match('^!') assertion.expected_capture_name = neg_assert and assertion.expected_capture_name:sub(2) or assertion.expected_capture_name local found = false @@ -48,11 +54,11 @@ local function check_assertions(file) if neg_assert then assert.False( found, - "Error in at " + 'Error in at ' .. file - .. ":" + .. ':' .. (row + 1) - .. ":" + .. ':' .. (col + 1) .. ': expected "' .. assertion.expected_capture_name @@ -61,11 +67,11 @@ local function check_assertions(file) else assert.True( found, - "Error in at " + 'Error in at ' .. file - .. ":" + .. ':' .. (row + 1) - .. ":" + .. ':' .. (col + 1) .. ': expected "' .. assertion.expected_capture_name @@ -75,8 +81,8 @@ local function check_assertions(file) end end -describe("injections", function() - local files = vim.fn.split(vim.fn.glob "tests/query/injections/**/*.*") +describe('injections', function() + local files = vim.fn.split(vim.fn.glob('tests/query/injections/**/*.*')) for _, file in ipairs(files) do it(file, function() check_assertions(file) diff --git a/tests/unit/ts_utils_spec.lua b/tests/unit/ts_utils_spec.lua deleted file mode 100644 index 397fa7eaf..000000000 --- a/tests/unit/ts_utils_spec.lua +++ /dev/null @@ -1,114 +0,0 @@ -local tsutils = require "nvim-treesitter.ts_utils" - -describe("update_selection", function() - local function get_updated_selection(case) - vim.api.nvim_buf_set_lines(0, 0, -1, false, case.lines) - tsutils.update_selection(0, case.node, case.selection_mode) - vim.cmd "normal! y" - return vim.fn.getreg '"' - end - - it("charwise1", function() - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 0, 2, 1 }, - selection_mode = "v", - }, - "foo\n\nb" - ) - it("charwise2", function() end) - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 1, 2, 1 }, - selection_mode = "v", - }, - "oo\n\nb" - ) - it("charwise3", function() end) - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 2, 2, 1 }, - selection_mode = "v", - }, - "o\n\nb" - ) - it("charwise4", function() end) - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 3, 2, 1 }, - selection_mode = "v", - }, - "\n\nb" - ) - end) - it("linewise", function() - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 3, 2, 1 }, - selection_mode = "V", - }, - "foo\n\nbar\n" - ) - end) - it("blockwise", function() - assert.equal( - get_updated_selection { - lines = { "foo", "", "bar" }, - node = { 0, 3, 2, 1 }, - selection_mode = "", - }, - "foo\n\nbar" - ) - end) -end) - -describe("swap_nodes", function() - local function swap(case) - vim.api.nvim_buf_set_lines(0, 0, -1, false, case.lines) - vim.opt.filetype = case.filetype - local a = vim.treesitter.get_node { - bufnr = 0, - pos = { case.a[1], case.a[2] }, - } - local b = vim.treesitter.get_node { - bufnr = 0, - pos = { case.b[1], case.b[2] }, - } - tsutils.swap_nodes(a, b, 0, true) - end - - it("works on adjacent nodes", function() - swap { - filetype = "python", - lines = { "print(1)" }, - a = { 0, 0 }, - b = { 0, 5 }, - } - - it("swaps text", function() end) - assert.same(vim.api.nvim_buf_get_lines(0, 0, -1, false), { "(1)print" }) - - it("moves the cursor", function() end) - assert.same(vim.api.nvim_win_get_cursor(0), { 1, 3 }) - end) - - it("works with multiline nodes", function() - swap { - filetype = "lua", - lines = { "x = { [[", "]], [[", ".....]]}" }, - a = { 0, 6 }, - b = { 1, 4 }, - } - - it("swaps text", function() end) - assert.same(vim.api.nvim_buf_get_lines(0, 0, -1, false), { "x = { [[", ".....]], [[", "]]}" }) - - it("moves the cursor", function() end) - assert.same(vim.api.nvim_win_get_cursor(0), { 2, 9 }) - end) -end) From 5817ff01b523a0dce5e7a42374ac137cb6490577 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 20 May 2023 17:29:03 +0200 Subject: [PATCH 005/434] feat(locals)!: refactor `locals.lua` into standalone Co-authored-by: TheLeoP --- README.md | 4 + SUPPORTED_LANGUAGES.md | 554 ++++++++++++++++----------------- TODO.md | 4 +- lua/nvim-treesitter/locals.lua | 220 ++++++++----- lua/nvim-treesitter/query.lua | 165 ---------- scripts/update-readme.lua | 1 + 6 files changed, 419 insertions(+), 529 deletions(-) delete mode 100644 lua/nvim-treesitter/query.lua diff --git a/README.md b/README.md index 715ec50ed..635b1ed15 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a388c9c9a..aef22b34d 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -6,288 +6,288 @@ 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 Language | Tier | Queries | CLI | NPM | Maintainer -------- |:----:|:-------:|:---:|:---:| ---------- -[ada](https://github.com/briot/tree-sitter-ada) | | `HF  ` | | | @briot -[agda](https://github.com/tree-sitter/tree-sitter-agda) | | `HF  ` | | | @Decodetalkers -[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJ` | | ✓ | @dlvandenberg -[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  ` | | | @aheber -[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJ` | | | @ObserverOfTime -[asm](https://github.com/RubixDev/tree-sitter-asm) | community | `H  J` | | | @RubixDev -[astro](https://github.com/virchau13/tree-sitter-astro) | | `HFIJ` | | | @virchau13 -[authzed](https://github.com/mleonidas/tree-sitter-authzed) | community | `H  J` | | | @mattpolzin -[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/vito/tree-sitter-bass) | | `HFIJ` | | | @amaanq -[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF J` | | | @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` | | | @NoahTheDuke -[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) | community | `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/gdamore/tree-sitter-d) | stable | `HFIJ` | | | @amaanq -[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 -[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | community | `H  J` | | | @ColinKennedy -[djot](https://github.com/treeman/tree-sitter-djot) | community | `HFIJ` | | | @NoahTheDuke -[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | | `H  J` | | | @camdencheek -[dot](https://github.com/rydesun/tree-sitter-dot) | | `H IJ` | | | @rydesun -[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ` | | | @amaanq -[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HF J` | | | @ObserverOfTime -[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J` | | | @glehmann -[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H   ` | | | @RubixDev -[eds](https://github.com/uyha/tree-sitter-eds) | community | `HF  ` | | | @uyha -[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 -[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) | | `HF J` | | ✓ | @alexmozaidze -[fidl](https://github.com/google/tree-sitter-fidl) | community | `HF J` | | | @chaopeng -[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 -[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | community | `H  J` | | | @godofavacyn -[git_config](https://github.com/the-mikedavis/tree-sitter-git-config)[^git_config] | | `HF J` | | | @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 -[gn](https://github.com/amaanq/tree-sitter-gn) | stable | `HFIJ` | | | @amaanq -[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | community | `H  J` | | | @dpezto -[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 J` | | | @pierpo -[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J` | | | @camdencheek -[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H   ` | | | @amaanq -[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J` | | | @qvalentin -[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/murtaza64/tree-sitter-groovy) | community | `HFIJ` | | | @murtaza64 -[gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) | stable | `H   ` | | | @theHamsta -[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` | | | @mrcjkb -[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 -[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J` | | | @qvalentin -[hjson](https://github.com/winston0410/tree-sitter-hjson) | | `HFIJ` | | ✓ | @winston0410 -[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJ` | | ✓ | @theHamsta -[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | community | `H  J` | | | @Freed-Wu -[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `HF 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, @NTBBloodbath -[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ` | | | @pfeiferj -[hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) | community | `HFIJ` | | | @luckasRanarison -[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J` | | | @cathaysa -[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF  ` | | | @theHamsta -[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJ` | | | @yorickpeterse -[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 -[just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJ` | | | @Hubro -[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 -[koto](https://github.com/koto-lang/tree-sitter-koto) | community | `HF J` | | | @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) | | `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 -[leo](https://github.com/r001/tree-sitter-leo) | community | `H IJ` | | | @r001 -[linkerscript](https://github.com/amaanq/tree-sitter-linkerscript) | stable | `HFIJ` | | | @amaanq -[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | community | `H  J` | | | @hankthetank27 -[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | community | `HFI ` | | | @toots -[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) | | `HFIJ` | | | @Decodetalkers -[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   ` | ✓ | | @artagnon -[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J` | | | @Freed-Wu -[nasm](https://github.com/naclsn/tree-sitter-nasm) | stable | `H  J` | | | @ObserverOfTime -[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I ` | | | -[nim](https://github.com/alaviss/tree-sitter-nim) | community | `HF J` | | | @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) | | `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 -[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J` | | | @ColinKennedy -[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/tree-sitter-perl/tree-sitter-perl) | | `HF J` | | | @RabbiVeesh, @LeoNerd -[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | | `HFIJ` | | | @tk-shirasaka -[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | | `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 -[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | community | `H   ` | | | @RabbiVeesh, @LeoNerd -[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 -[printf](https://github.com/ObserverOfTime/tree-sitter-printf) | stable | `H   ` | | | @ObserverOfTime -[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `HF  ` | | | @elianiva -[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J` | | | @MichaHoffmann -[properties](https://github.com/ObserverOfTime/tree-sitter-properties)[^properties] | stable | `H  J` | | | @ObserverOfTime -[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 -[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  J` | | | @postsolar -[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 J` | | | @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) | | `HFIJ` | | | @Fymyte -[rbs](https://github.com/joker1007/tree-sitter-rbs) | community | `HFIJ` | | | @joker1007 -[re2c](https://github.com/amaanq/tree-sitter-re2c) | stable | `HFIJ` | | | @amaanq -[readline](https://github.com/ribru17/tree-sitter-readline) | community | `HFIJ` | | | @ribru17 -[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 -[roc](https://github.com/nat-418/tree-sitter-roc) | community | `H  J` | | | @nat-418 -[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 -[slang](https://github.com/theHamsta/tree-sitter-slang)[^slang] | unstable | `HFIJ` | | ✓ | @theHamsta -[slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJ` | | | @hunger -[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | community | `HFIJ` | | | @amaanq -[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H   ` | | | @amaanq, @keynmol -[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJ` | | | -[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `HF  ` | | | @amaanq -[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H   ` | | | @aheber -[sosl](https://github.com/aheber/tree-sitter-sfapex) | | `H   ` | | | @aheber -[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  J` | | | @Sarrus1 -[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 -[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | stable | `HFIJ` | | | @ObserverOfTime -[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJ` | | | @amaanq -[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J` | | | @amaanq -[styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ` | | | @mskelton -[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJ` | | | @madskjeldgaard -[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ` | | | @connorlay -[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | stable | `HFIJ` | | | @amaanq -[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 -[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | stable | `HFI ` | | | @lewis6991 -[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJ` | ✓ | | @euclidianAce -[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J` | | | @vrischmann -[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ` | | | @MichaHoffmann -[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | community | `HFI ` | | | @Porter -[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 -[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | community | `H  J` | | | @Freed-Wu -[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unstable | `H   ` | | | @arnarg -[toml](https://github.com/tree-sitter-grammars/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 -[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/ObserverOfTime/tree-sitter-udev) | stable | `H  J` | | | @ObserverOfTime -[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) | | `HFIJ` | | | @amaanq -[v](https://github.com/vlang/v-analyzer) | | `HFIJ` | | | @kkharji, @amaanq -[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF  ` | | | @Prince781 -[vento](https://github.com/ventojs/tree-sitter-vento) | community | `H  J` | | | @wrapperup, @oscarotero -[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/tree-sitter-grammars/tree-sitter-vue) | stable | `HFIJ` | | | @WhyNotHugo, @lucario387 -[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/tree-sitter-wing) | community | `HF  ` | | | @gshpychka, @MarkMcCulloh -[wit](https://github.com/liamwh/tree-sitter-wit) | community | `H  J` | | | @liamwh -[xcompose](https://github.com/ObserverOfTime/tree-sitter-xcompose) | stable | `H  J` | | | @ObserverOfTime -[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HFIJ` | | | @ObserverOfTime -[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | stable | `HFIJ` | | | @amaanq -[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ` | | | @Hubro -[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJ` | | | @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) | | `HFIJ` | | | @maxxnino +[ada](https://github.com/briot/tree-sitter-ada) | | `HF  L` | | | @briot +[agda](https://github.com/tree-sitter/tree-sitter-agda) | | `HF   ` | | | @Decodetalkers +[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJL` | | ✓ | @dlvandenberg +[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  L` | | | @aheber +[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJL` | | | @ObserverOfTime +[asm](https://github.com/RubixDev/tree-sitter-asm) | community | `H  J ` | | | @RubixDev +[astro](https://github.com/virchau13/tree-sitter-astro) | | `HFIJL` | | | @virchau13 +[authzed](https://github.com/mleonidas/tree-sitter-authzed) | community | `H  J ` | | | @mattpolzin +[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/vito/tree-sitter-bass) | | `HFIJL` | | | @amaanq +[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF J ` | | | @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` | | | @NoahTheDuke +[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) | community | `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/gdamore/tree-sitter-d) | stable | `HFIJL` | | | @amaanq +[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 +[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) | | `H  J ` | | | @camdencheek +[dot](https://github.com/rydesun/tree-sitter-dot) | | `H IJ ` | | | @rydesun +[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ ` | | | @amaanq +[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HF JL` | | | @ObserverOfTime +[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J ` | | | @glehmann +[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H    ` | | | @RubixDev +[eds](https://github.com/uyha/tree-sitter-eds) | community | `HF   ` | | | @uyha +[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 +[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) | | `HF JL` | | ✓ | @alexmozaidze +[fidl](https://github.com/google/tree-sitter-fidl) | community | `HF J ` | | | @chaopeng +[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 +[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | community | `H  J ` | | | @godofavacyn +[git_config](https://github.com/the-mikedavis/tree-sitter-git-config)[^git_config] | | `HF J ` | | | @amaanq +[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | | `H  J ` | | | @gbprod +[gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) | | `H  JL` | | | @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 +[gn](https://github.com/amaanq/tree-sitter-gn) | stable | `HFIJL` | | | @amaanq +[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | community | `H  J ` | | | @dpezto +[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 JL` | | | @pierpo +[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J ` | | | @camdencheek +[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H    ` | | | @amaanq +[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | | | @qvalentin +[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/murtaza64/tree-sitter-groovy) | community | `HFIJL` | | | @murtaza64 +[gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) | stable | `H    ` | | | @theHamsta +[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 ` | | | @mrcjkb +[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 +[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `H  J ` | | | @qvalentin +[hjson](https://github.com/winston0410/tree-sitter-hjson) | | `HFIJL` | | ✓ | @winston0410 +[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJL` | | ✓ | @theHamsta +[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | community | `H  J ` | | | @Freed-Wu +[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `HF 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, @NTBBloodbath +[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj +[hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) | community | `HFIJ ` | | | @luckasRanarison +[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J ` | | | @cathaysa +[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF   ` | | | @theHamsta +[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | | | @yorickpeterse +[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  JL` | | | @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 +[just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJL` | | | @Hubro +[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 +[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) | | `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 +[leo](https://github.com/r001/tree-sitter-leo) | community | `H IJ ` | | | @r001 +[linkerscript](https://github.com/amaanq/tree-sitter-linkerscript) | stable | `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) | | `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) | | `HFIJ ` | | | @Decodetalkers +[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   L` | ✓ | | @artagnon +[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | | @Freed-Wu +[nasm](https://github.com/naclsn/tree-sitter-nasm) | stable | `H  J ` | | | @ObserverOfTime +[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `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) | | `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 +[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J ` | | | @ColinKennedy +[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/tree-sitter-perl/tree-sitter-perl) | | `HF J ` | | | @RabbiVeesh, @LeoNerd +[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | | `HFIJL` | | | @tk-shirasaka +[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | | `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 +[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | community | `H    ` | | | @RabbiVeesh, @LeoNerd +[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 +[printf](https://github.com/ObserverOfTime/tree-sitter-printf) | stable | `H    ` | | | @ObserverOfTime +[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `HF   ` | | | @elianiva +[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J ` | | | @MichaHoffmann +[properties](https://github.com/ObserverOfTime/tree-sitter-properties)[^properties] | stable | `H  JL` | | | @ObserverOfTime +[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 +[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  JL` | | | @postsolar +[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 J ` | | | @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) | | `HFIJL` | | | @Fymyte +[rbs](https://github.com/joker1007/tree-sitter-rbs) | community | `HFIJ ` | | | @joker1007 +[re2c](https://github.com/amaanq/tree-sitter-re2c) | stable | `HFIJL` | | | @amaanq +[readline](https://github.com/ribru17/tree-sitter-readline) | community | `HFIJ ` | | | @ribru17 +[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 +[roc](https://github.com/nat-418/tree-sitter-roc) | community | `H  JL` | | | @nat-418 +[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 +[slang](https://github.com/theHamsta/tree-sitter-slang)[^slang] | unstable | `HFIJL` | | ✓ | @theHamsta +[slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJL` | | | @hunger +[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | community | `HFIJL` | | | @amaanq +[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H    ` | | | @amaanq, @keynmol +[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJL` | | | +[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `HF   ` | | | @amaanq +[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | | | @aheber +[sosl](https://github.com/aheber/tree-sitter-sfapex) | | `H    ` | | | @aheber +[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  JL` | | | @Sarrus1 +[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 +[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | stable | `HFIJL` | | | @ObserverOfTime +[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJL` | | | @amaanq +[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J ` | | | @amaanq +[styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ ` | | | @mskelton +[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJL` | | | @madskjeldgaard +[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ ` | | | @connorlay +[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | stable | `HFIJL` | | | @amaanq +[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 +[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | stable | `HFI  ` | | | @lewis6991 +[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce +[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J ` | | | @vrischmann +[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann +[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | community | `HFI  ` | | | @Porter +[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 +[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | community | `H  J ` | | | @Freed-Wu +[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unstable | `H    ` | | | @arnarg +[toml](https://github.com/tree-sitter-grammars/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 +[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/ObserverOfTime/tree-sitter-udev) | stable | `H  JL` | | | @ObserverOfTime +[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) | | `HFIJL` | | | @amaanq +[v](https://github.com/vlang/v-analyzer) | | `HFIJL` | | | @kkharji, @amaanq +[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF   ` | | | @Prince781 +[vento](https://github.com/ventojs/tree-sitter-vento) | community | `H  J ` | | | @wrapperup, @oscarotero +[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/tree-sitter-grammars/tree-sitter-vue) | stable | `HFIJ ` | | | @WhyNotHugo, @lucario387 +[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/tree-sitter-wing) | community | `HF  L` | | | @gshpychka, @MarkMcCulloh +[wit](https://github.com/liamwh/tree-sitter-wit) | community | `H  J ` | | | @liamwh +[xcompose](https://github.com/ObserverOfTime/tree-sitter-xcompose) | stable | `H  JL` | | | @ObserverOfTime +[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HFIJL` | | | @ObserverOfTime +[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | stable | `HFIJL` | | | @amaanq +[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ ` | | | @Hubro +[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `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) | | `HFIJL` | | | @maxxnino [^gdscript]: Godot [^git_config]: git_config [^glimmer]: Glimmer and Ember diff --git a/TODO.md b/TODO.md index 5b5dba199..9c2300eb1 100644 --- a/TODO.md +++ b/TODO.md @@ -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) diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index fa8496469..c8ebe0b0d 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -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['local.definition'] then - table.insert(defs, loc['local.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['local.scope'] and loc['local.scope'].node then - table.insert(scopes, loc['local.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['local.reference'] and loc['local.reference'].node then - table.insert(refs, loc['local.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 @@ -129,8 +73,8 @@ function M.iter_scope_tree(node, bufnr) end -- Gets a table of all nodes and their 'kinds' from a locals list ----@param local_def any: the local list result ----@return table: a list of node entries +---@param local_def TSLocal[] the local list result +---@return TSLocal[] a list of node entries function M.get_local_nodes(local_def) local result = {} @@ -145,9 +89,9 @@ end -- The accumulator function is given -- * The table of the node -- * The node --- * The full definition match `@definition.var.something` -> 'var.something' --- * The last definition match `@definition.var.something` -> 'something' ----@param local_def any The locals result +-- * The full definition match `@local.definition.var.something` -> 'var.something' +-- * The last definition match `@local.definition.var.something` -> 'something' +---@param local_def TSLocal The locals result ---@param accumulator function The accumulator function ---@param full_match? string The full match path to append to ---@param last_match? string The last match @@ -181,14 +125,108 @@ local function memoize(fn, hash_fn) return function(...) local key = hash_fn(...) if cache[key] == nil then - local v = fn(...) ---@type any - cache[key] = v ~= nil and v or vim.NIL + local v = { fn(...) } ---@type any + + for k, value in pairs(v) do + if value == nil then + value[k] = vim.NIL + end + end + + cache[key] = v end local v = cache[key] - return v ~= vim.NIL and v or nil + + for k, value in pairs(v) do + if value == vim.NIL then + value[k] = nil + end + end + + return unpack(v) end end +---@param bufnr integer: the buffer +---@return TSNode|nil root: root node of the buffer +local function get_root(bufnr) + local parser = ts.get_parser(bufnr) + if not parser then + return + end + parser:parse() + return parser:trees()[1]:root() +end + +---@param bufnr integer: the buffer +---@return Query|nil query: `locals` query +---@return TSNode|nil root: root node of the bufferocal function get_query(bufnr) +local function get_query(bufnr) + local root = get_root(bufnr) + + local ft = vim.bo[bufnr].filetype + local lang = ts.language.get_lang(ft) or ft + + local query = (ts.query.get(lang, 'locals')) + + return query, root +end + +---@alias TSScope "parent"|"local"|"global" + +---@class TSLocal +---@field kind string +---@field node TSNode +---@field scope TSScope + +-- Return all locals for the buffer +-- +-- memoized by buffer tick +-- +---@param bufnr integer buffer +---@return TSLocal[] definitions +---@return TSLocal[] references +---@return TSNode[] scopes +M.get = memoize(function(bufnr) + local query, root = get_query(bufnr) + if not query or not root then + return {}, {}, {} + end + + local definitions = {} + local scopes = {} + local references = {} + for id, node, metadata in query:iter_captures(root, bufnr) do + local kind = query.captures[id] + + local scope = 'local' ---@type string + for k, v in pairs(metadata) do + if type(k) == 'string' and vim.endswith(k, 'local.scope') then + scope = v + end + end + + if node and vim.startswith(kind, 'local.definition') then + table.insert(definitions, { kind = kind, node = node, scope = scope }) + end + + if node and kind == 'local.scope' then + table.insert(scopes, node) + end + + if node and kind == 'local.reference' then + table.insert(references, { kind = kind, node = node, scope = scope }) + end + end + + return definitions, references, scopes +end, function(bufnr) + local root = get_root(bufnr) + if not root then + return tostring(bufnr) + end + return tostring(root:id()) +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. @@ -202,11 +240,14 @@ end -- is called very frequently, which is why this lookup must be fast as possible. -- ---@param bufnr integer: the buffer ----@return table result: a table for looking up definitions +---@return TSLocal[] 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) @@ -221,7 +262,11 @@ M.get_definitions_lookup_table = memoize(function(bufnr) return result end, function(bufnr) - return tostring(bufnr) + local root = get_root(bufnr) + if not root then + return tostring(bufnr) + end + return tostring(root:id()) end) -- Gets all the scopes of a definition based on the scope type @@ -233,7 +278,7 @@ end) -- ---@param node TSNode: the definition node ---@param bufnr integer: the buffer ----@param scope_type string: the scope type +---@param scope_type TSScope: the scope type function M.get_definition_scopes(node, bufnr, scope_type) local scopes = {} local scope_count = 1 ---@type integer|nil @@ -248,8 +293,8 @@ function M.get_definition_scopes(node, bufnr, scope_type) end local i = 0 - for scope in M.iter_scope_tree(node, bufnr) do - table.insert(scopes, scope) + for scope_node in M.iter_scope_tree(node, bufnr) do + table.insert(scopes, scope_node) i = i + 1 if scope_count and i >= scope_count then @@ -284,7 +329,8 @@ end -- Finds usages of a node in a given scope. ---@param node TSNode the node to find usages for ----@param scope_node TSNode the node to look within +---@param scope_node TSNode|nil the node to look within +---@param bufnr integer|nil the bufnr to look into ---@return TSNode[]: a list of nodes function M.find_usages(node, scope_node, bufnr) bufnr = bufnr or api.nvim_get_current_buf() @@ -297,17 +343,19 @@ 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 - if - match.reference - and match.reference.node - and ts.get_node_text(match.reference.node, bufnr) == node_text - then - local def_node, _, kind = M.find_definition(match.reference.node, bufnr) + local query, _ = get_query(bufnr) + if not query then + return {} + end - if kind == nil or def_node == node then - table.insert(usages, match.reference.node) - end + for id, node_capture in query:iter_captures(scope_node, bufnr) do + local kind = query.captures[id] + if + node_capture + and kind == 'local.reference' + and ts.get_node_text(node_capture, bufnr) == node_text + then + table.insert(usages, node_capture) end end @@ -322,7 +370,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 +387,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 +407,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 +437,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 diff --git a/lua/nvim-treesitter/query.lua b/lua/nvim-treesitter/query.lua deleted file mode 100644 index f7e5205f7..000000000 --- a/lua/nvim-treesitter/query.lua +++ /dev/null @@ -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, { all = false }) - - 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 diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index 825d84037..6c23c1af6 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -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 From eb1b6ec542ecc0d62d54f7b6889e2958a543499b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 23 Feb 2024 13:36:52 +0100 Subject: [PATCH 006/434] feat!: drop luarocks release --- .github/workflows/release.yml | 24 ------------- contrib/nvim-treesitter-luarocks.template | 41 ----------------------- contrib/nvim-treesitter-scm-1.rockspec | 36 -------------------- 3 files changed, 101 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 contrib/nvim-treesitter-luarocks.template delete mode 100644 contrib/nvim-treesitter-scm-1.rockspec diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 11f3ffc14..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "release" -on: - push: - tags: # Will upload to luarocks.org - - "*" - pull_request: # Will test a local install without uploading to luarocks.org - paths: - - 'contrib/*.rockspec' - - .github/workflows/release.yml - -jobs: - luarocks-upload: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: nvim-neorocks/luarocks-tag-release@v5 - env: - LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} - with: - name: nvim-treesitter - detailed_description: | - The goal of nvim-treesitter is both to provide a simple and easy way to use the interface for tree-sitter in Neovim - and to provide some basic functionality such as highlighting based on it. - template: contrib/nvim-treesitter-luarocks.template diff --git a/contrib/nvim-treesitter-luarocks.template b/contrib/nvim-treesitter-luarocks.template deleted file mode 100644 index 8109f5f2b..000000000 --- a/contrib/nvim-treesitter-luarocks.template +++ /dev/null @@ -1,41 +0,0 @@ -local git_ref = '$git_ref' -local modrev = '$modrev' -local specrev = '-1' - -local repo_url = '$repo_url' - -rockspec_format = '3.0' -package = '$package' -version = modrev .. specrev - -description = { - summary = 'Nvim Treesitter configurations and abstraction layer', - detailed = $detailed_description, - labels = { 'neovim' }, - homepage = 'https://github.com/nvim-treesitter/nvim-treesitter', - license = 'Apache-2.0', -} - -dependencies = { - 'lua >= 5.1', -} - --- source = file:///. - -source = { - url = repo_url .. '/archive/' .. git_ref .. '.zip', - dir = '$repo_name-' .. '$archive_dir_suffix', -} - -build = { - type = 'make', - build_pass = false, - install_variables = { - INST_PREFIX='$(PREFIX)', - INST_BINDIR='$(BINDIR)', - INST_LIBDIR='$(LIBDIR)', - INST_LUADIR='$(LUADIR)', - INST_CONFDIR='$(CONFDIR)', - }, - copy_directories = $copy_directories, -} diff --git a/contrib/nvim-treesitter-scm-1.rockspec b/contrib/nvim-treesitter-scm-1.rockspec deleted file mode 100644 index a901c5b12..000000000 --- a/contrib/nvim-treesitter-scm-1.rockspec +++ /dev/null @@ -1,36 +0,0 @@ -local MODREV, SPECREV = 'scm', '-1' -rockspec_format = '3.0' -package = 'nvim-treesitter' -version = MODREV .. SPECREV - -description = { - summary = 'Nvim Treesitter configurations and abstraction layer', - labels = { 'neovim' }, - homepage = 'https://github.com/nvim-treesitter/nvim-treesitter', - license = 'Apache-2.0', -} - -dependencies = { - 'lua >= 5.1', -} - -source = { - url = 'git://github.com/nvim-treesitter/nvim-treesitter', -} - -build = { - type = 'make', - install_variables = { - INST_PREFIX='$(PREFIX)', - INST_BINDIR='$(BINDIR)', - INST_LIBDIR='$(LIBDIR)', - INST_LUADIR='$(LUADIR)', - INST_CONFDIR='$(CONFDIR)', - }, - copy_directories = { - 'autoload', - 'doc', - 'plugin', - 'queries' - } -} From 5aa2984a028731bf60d53a7f9773997dfc84e4f7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 20 May 2023 17:38:33 +0200 Subject: [PATCH 007/434] refactor: use vim.fs.joinpath --- .github/workflows/update-lockfile.yml | 2 +- .github/workflows/update-readme.yml | 2 +- lua/nvim-treesitter/config.lua | 6 ++--- lua/nvim-treesitter/install.lua | 32 +++++++++++++-------------- lua/nvim-treesitter/shell_cmds.lua | 11 +++++---- lua/nvim-treesitter/utils.lua | 12 ---------- scripts/write-lockfile.lua | 2 +- 7 files changed, 28 insertions(+), 39 deletions(-) delete mode 100644 lua/nvim-treesitter/utils.lua diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml index df0f61347..992e1c0d2 100644 --- a/.github/workflows/update-lockfile.yml +++ b/.github/workflows/update-lockfile.yml @@ -22,7 +22,7 @@ jobs: - name: Prepare env: - NVIM_TAG: stable + NVIM_TAG: nightly run: | wget https://github.com/josephburnett/jd/releases/download/v1.7.1/jd-amd64-linux mv jd-amd64-linux /tmp/jd diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index de416a873..557a3f3c6 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -21,7 +21,7 @@ jobs: - name: Prepare env: - NVIM_TAG: stable + NVIM_TAG: nightly run: | bash ./scripts/ci-install.sh diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index e43ad13c2..01880a8bc 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -1,5 +1,3 @@ -local utils = require('nvim-treesitter.utils') - local M = {} ---@class TSConfig @@ -15,7 +13,7 @@ local config = { auto_install = false, ensure_install = {}, ignore_install = {}, - install_dir = utils.join_path(vim.fn.stdpath('data'), 'site'), + install_dir = vim.fs.joinpath(vim.fn.stdpath('data'), 'site'), } ---Setup call for users to override configuration configurations. @@ -62,7 +60,7 @@ end ---@param dir_name string ---@return string function M.get_install_dir(dir_name) - local dir = utils.join_path(config.install_dir, dir_name) + local dir = vim.fs.joinpath(config.install_dir, dir_name) if not vim.loop.fs_stat(dir) then local ok, error = pcall(vim.fn.mkdir, dir, 'p', '0755') diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 745c2dd1f..0db61137c 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,7 +1,7 @@ local api = vim.api +local fs = vim.fs local uv = vim.loop -local utils = require('nvim-treesitter.utils') local parsers = require('nvim-treesitter.parsers') local config = require('nvim-treesitter.config') local shell = require('nvim-treesitter.shell_cmds') @@ -208,7 +208,7 @@ end ---@return string|nil local function get_revision(lang) if #lockfile == 0 then - local filename = utils.get_package_path('lockfile.json') + local filename = shell.get_package_path('lockfile.json') local file = assert(io.open(filename, 'r')) lockfile = vim.json.decode(file:read('*all')) file:close() @@ -227,7 +227,7 @@ end ---@param lang string ---@return string|nil local function get_installed_revision(lang) - local lang_file = utils.join_path(config.get_install_dir('parser-info'), lang .. '.revision') + local lang_file = fs.joinpath(config.get_install_dir('parser-info'), lang .. '.revision') local file = assert(io.open(lang_file, 'r')) local revision = file:read('*a') file:close() @@ -291,7 +291,7 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene local repo = get_parser_install_info(lang) local project_name = 'tree-sitter-' .. lang - local maybe_local_path = vim.fs.normalize(repo.url) + local maybe_local_path = fs.normalize(repo.url) local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 if from_local_path then repo.url = maybe_local_path @@ -302,16 +302,16 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene if from_local_path then compile_location = repo.url if repo.location then - compile_location = utils.join_path(compile_location, repo.location) + compile_location = fs.joinpath(compile_location, repo.location) end else local repo_location = project_name if repo.location then - repo_location = utils.join_path(repo_location, repo.location) + repo_location = fs.joinpath(repo_location, repo.location) end - compile_location = utils.join_path(cache_dir, repo_location) + compile_location = fs.joinpath(cache_dir, repo_location) end - local parser_lib_name = utils.join_path(install_dir, lang) .. '.so' + local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar @@ -370,7 +370,7 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene vim.list_extend(command_list, { { cmd = function() - vim.fn.delete(utils.join_path(cache_dir, project_name), 'rf') + vim.fn.delete(fs.joinpath(cache_dir, project_name), 'rf') end, }, }) @@ -415,14 +415,14 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene shell.select_compile_command(repo, cc, compile_location), { cmd = function() - uv.fs_copyfile(utils.join_path(compile_location, 'parser.so'), parser_lib_name) + uv.fs_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) end, }, { cmd = function() local file = assert( io.open( - utils.join_path(config.get_install_dir('parser-info') or '', lang .. '.revision'), + fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision'), 'w' ) ) @@ -435,7 +435,7 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene vim.list_extend(command_list, { { cmd = function() - vim.fn.delete(utils.join_path(cache_dir, project_name), 'rf') + vim.fn.delete(fs.joinpath(cache_dir, project_name), 'rf') end, }, }) @@ -485,8 +485,8 @@ function M.install(languages, options) for _, lang in ipairs(languages) do install_lang(lang, cache_dir, install_dir, force, with_sync, generate_from_grammar) uv.fs_symlink( - utils.get_package_path('runtime', 'queries', lang), - utils.join_path(config.get_install_dir('queries'), lang), + shell.get_package_path('runtime', 'queries', lang), + fs.joinpath(config.get_install_dir('queries'), lang), { dir = true, junction = true } -- needed on Windows (non-junction links require admin) ) end @@ -555,8 +555,8 @@ function M.uninstall(languages) vim.log.levels.ERROR ) else - local parser = utils.join_path(parser_dir, lang) .. '.so' - local queries = utils.join_path(query_dir, lang) + local parser = fs.joinpath(parser_dir, lang) .. '.so' + local queries = fs.joinpath(query_dir, lang) uninstall(lang, parser, queries) end end diff --git a/lua/nvim-treesitter/shell_cmds.lua b/lua/nvim-treesitter/shell_cmds.lua index 2dc7f8748..4c631512d 100644 --- a/lua/nvim-treesitter/shell_cmds.lua +++ b/lua/nvim-treesitter/shell_cmds.lua @@ -1,5 +1,4 @@ local uv = vim.loop -local utils = require('nvim-treesitter.utils') local iswin = uv.os_uname().sysname == 'Windows_NT' @@ -91,7 +90,7 @@ function M.select_compile_command(repo, cc, compile_location) err = 'Error during compilation', opts = { args = { - '--makefile=' .. utils.get_package_path('scripts', 'compile_parsers.makefile'), + '--makefile=' .. M.get_package_path('scripts', 'compile_parsers.makefile'), 'CC=' .. cc, }, cwd = compile_location, @@ -110,7 +109,7 @@ function M.select_download_commands(repo, project_name, cache_dir, revision, pre local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 local is_github = repo.url:find('github.com', 1, true) local is_gitlab = repo.url:find('gitlab.com', 1, true) - local project_dir = utils.join_path(cache_dir, project_name) + local project_dir = vim.fs.joinpath(cache_dir, project_name) revision = revision or repo.branch or 'master' @@ -183,7 +182,7 @@ function M.select_download_commands(repo, project_name, cache_dir, revision, pre { cmd = function() uv.fs_rename( - utils.join_path(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), + vim.fs.joinpath(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), project_dir ) end, @@ -228,6 +227,10 @@ function M.select_download_commands(repo, project_name, cache_dir, revision, pre end end +function M.get_package_path(...) + return vim.fs.joinpath(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) +end + --TODO(clason): only needed for iter_cmd_sync -> replace with uv.spawn? -- Convert path for cmd.exe on Windows (needed when shellslash is set) diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua deleted file mode 100644 index f9e5a2b86..000000000 --- a/lua/nvim-treesitter/utils.lua +++ /dev/null @@ -1,12 +0,0 @@ -local M = {} - ---TODO(clason): replace by vim.fs._join_paths -function M.join_path(...) - return (table.concat({ ... }, '/'):gsub('//+', '/')) -end - -function M.get_package_path(...) - return M.join_path(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) -end - -return M diff --git a/scripts/write-lockfile.lua b/scripts/write-lockfile.lua index a264af83c..5dac838d6 100755 --- a/scripts/write-lockfile.lua +++ b/scripts/write-lockfile.lua @@ -2,7 +2,7 @@ vim.opt.runtimepath:append('.') -- Load previous lockfile -local filename = require('nvim-treesitter.utils').get_package_path('lockfile.json') +local filename = require('nvim-treesitter.shell_cmds').get_package_path('lockfile.json') local file = assert(io.open(filename, 'r')) local lockfile = vim.json.decode(file:read('*a')) file:close() From cde679e435ade757733772236abf299fc06da231 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 22 May 2023 14:35:25 +0100 Subject: [PATCH 008/434] refactor: rewrite installation using jobs and async Replace sync variants with callback support --- README.md | 3 - TODO.md | 2 +- doc/nvim-treesitter.txt | 14 +- lua/nvim-treesitter/async.lua | 110 ++++ lua/nvim-treesitter/config.lua | 27 +- lua/nvim-treesitter/health.lua | 22 +- lua/nvim-treesitter/install.lua | 885 +++++++++++++++++------------ lua/nvim-treesitter/job.lua | 122 ++++ lua/nvim-treesitter/log.lua | 133 +++++ lua/nvim-treesitter/parsers.lua | 5 +- lua/nvim-treesitter/shell_cmds.lua | 258 --------- lua/nvim-treesitter/util.lua | 28 + plugin/nvim-treesitter.lua | 28 +- scripts/update-readme.lua | 13 +- scripts/write-lockfile.lua | 10 +- 15 files changed, 951 insertions(+), 709 deletions(-) create mode 100644 lua/nvim-treesitter/async.lua create mode 100644 lua/nvim-treesitter/job.lua create mode 100644 lua/nvim-treesitter/log.lua delete mode 100644 lua/nvim-treesitter/shell_cmds.lua create mode 100644 lua/nvim-treesitter/util.lua diff --git a/README.md b/README.md index 635b1ed15..523940b63 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,6 @@ require'nvim-treesitter'.setup { -- List of parsers to ignore installing ignore_install = { }, - -- Install parsers synchronously (only applied to `ensure_install`) - sync_install = false, - -- Automatically install missing parsers when entering buffer auto_install = false, diff --git a/TODO.md b/TODO.md index 9c2300eb1..d61d179d6 100644 --- a/TODO.md +++ b/TODO.md @@ -7,7 +7,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [ ] **`query_predicates.lua`:** upstream/remove - [ ] **`parsers.lua`:** modularize? - [ ] **`parsers.lua`:** assign tiers -- [ ] **`install.lua`:** fix messages, add sync support (@lewis6991) - [ ] **`install.lua`:** simplify compilation: - hardcode one compiler + args per platform - provide `install.compile_command` for overriding (function that takes files, ...?) @@ -32,5 +31,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [X] install parsers to standard directory by default - [X] remove bundled queries from runtimepath; copy on parser install - [X] general refactor and cleanup +- [X] rewrite installation using async module (drop support for sync; use callback instead) - [X] switch to upstream injection format - [X] remove locals from highlighting (cf. https://github.com/nvim-treesitter/nvim-treesitter/issues/3944#issuecomment-1458782497) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 7054121b5..a7c6bfa69 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -38,16 +38,13 @@ To install supported parsers and queries, put this in your `init.lua` file: >lua require'nvim-treesitter.configs'.setup { - -- A directory to install the parsers into. + -- A directory to install the parsers and queries to. -- Defaults to the `stdpath('data')/site` dir. install_dir = "/some/path/to/store/parsers", -- A list of parser names, or "core", "stable", "community", "unstable" ensure_install = { "core", "rust" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - -- Automatically install missing parsers when entering buffer auto_install = false, @@ -66,10 +63,6 @@ COMMANDS *nvim-treesitter-commands* Install one or more treesitter parsers. You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to force the reinstallation of already installed parsers. - *:TSInstallSync* -:TSInstallSync {language} ... ~ - -Perform the |:TSInstall| operation synchronously. *:TSInstallInfo* :TSInstallInfo ~ @@ -83,11 +76,6 @@ Update the installed parser for one more {language} or all installed parsers if {language} is omitted. The specified parser is installed if it is not already installed. - *:TSUpdateSync* -:TSUpdateSync {language} ... ~ - -Perform the |:TSUpdate| operation synchronously. - *:TSUninstall* :TSUninstall {language} ... ~ diff --git a/lua/nvim-treesitter/async.lua b/lua/nvim-treesitter/async.lua new file mode 100644 index 000000000..57a670ef6 --- /dev/null +++ b/lua/nvim-treesitter/async.lua @@ -0,0 +1,110 @@ +local co = coroutine + +local M = {} + +---Executes a future with a callback when it is done +--- @param func function +--- @param callback function +--- @param ... unknown +local function execute(func, callback, ...) + local thread = co.create(func) + + local function step(...) + local ret = { co.resume(thread, ...) } + --- @type boolean, any + local stat, nargs_or_err = unpack(ret) + + if not stat then + error( + string.format( + 'The coroutine failed with this message: %s\n%s', + nargs_or_err, + debug.traceback(thread) + ) + ) + end + + if co.status(thread) == 'dead' then + if callback then + callback(unpack(ret, 3, table.maxn(ret))) + end + return + end + + --- @type function, any[] + local fn, args = ret[3], { unpack(ret, 4, table.maxn(ret)) } + args[nargs_or_err] = step + fn(unpack(args, 1, nargs_or_err)) + end + + step(...) +end + +--- Creates an async function with a callback style function. +--- @generic F: function +--- @param func F +--- @param argc integer +--- @return F +function M.wrap(func, argc) + --- @param ... unknown + --- @return unknown + return function(...) + return co.yield(argc, func, ...) + end +end + +---Use this to create a function which executes in an async context but +---called from a non-async context. Inherently this cannot return anything +---since it is non-blocking +--- @generic F: function +--- @param func async F +--- @param nargs? integer +--- @return F +function M.sync(func, nargs) + nargs = nargs or 0 + return function(...) + local callback = select(nargs + 1, ...) + execute(func, callback, unpack({ ... }, 1, nargs)) + end +end + +--- @param n integer max number of concurrent jobs +--- @param interrupt_check? function +--- @param thunks function[] +--- @return any +function M.join(n, interrupt_check, thunks) + return co.yield(1, function(finish) + if #thunks == 0 then + return finish() + end + + local remaining = { select(n + 1, unpack(thunks)) } + local to_go = #thunks + + local ret = {} --- @type any[] + + local function cb(...) + ret[#ret + 1] = { ... } + to_go = to_go - 1 + if to_go == 0 then + finish(ret) + elseif not interrupt_check or not interrupt_check() then + if #remaining > 0 then + local next_task = table.remove(remaining) + next_task(cb) + end + end + end + + for i = 1, math.min(n, #thunks) do + thunks[i](cb) + end + end, 1) +end + +---An async function that when called will yield to the Neovim scheduler to be +---able to call the API. +--- @type fun() +M.main = M.wrap(vim.schedule, 1) + +return M diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 01880a8bc..b8a9f6e91 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -1,7 +1,6 @@ local M = {} ---@class TSConfig ----@field sync_install boolean ---@field auto_install boolean ---@field ensure_install string[] ---@field ignore_install string[] @@ -9,7 +8,6 @@ local M = {} ---@type TSConfig local config = { - sync_install = false, auto_install = false, ensure_install = {}, ignore_install = {}, @@ -38,7 +36,11 @@ function M.setup(user_data) and not vim.list_contains(M.installed_parsers(), lang) and not vim.list_contains(config.ignore_install, lang) then - require('nvim-treesitter.install').install(lang) + require('nvim-treesitter.install').install(lang, nil, function() + -- Need to pcall since 'FileType' can be triggered multiple times + -- per buffer + pcall(vim.treesitter.start, args.buf, lang) + end) end end, }) @@ -48,9 +50,7 @@ function M.setup(user_data) local to_install = M.norm_languages(config.ensure_install, { ignored = true, installed = true }) if #to_install > 0 then - require('nvim-treesitter.install').install(to_install, { - with_sync = config.sync_install, - }) + require('nvim-treesitter.install').install(to_install) end end end @@ -63,9 +63,10 @@ function M.get_install_dir(dir_name) local dir = vim.fs.joinpath(config.install_dir, dir_name) if not vim.loop.fs_stat(dir) then - local ok, error = pcall(vim.fn.mkdir, dir, 'p', '0755') + local ok, err = pcall(vim.fn.mkdir, dir, 'p', '0755') if not ok then - vim.notify(error, vim.log.levels.ERROR) + local log = require('nvim-treesitter.log') + log.error(err --[[@as string]]) end end return dir @@ -105,35 +106,37 @@ function M.norm_languages(languages, skip) end languages = parsers.get_available() end + --TODO(clason): skip and warn on unavailable parser for i, tier in ipairs(parsers.tiers) do if vim.list_contains(languages, tier) then languages = vim.iter.filter(function(l) return l ~= tier - end, languages) + end, languages) --[[@as string[] ]] vim.list_extend(languages, parsers.get_available(i)) end end + --TODO(clason): support skipping tiers if skip and skip.ignored then local ignored = config.ignore_install languages = vim.iter.filter(function(v) return not vim.list_contains(ignored, v) - end, languages) + end, languages) --[[@as string[] ]] end if skip and skip.installed then local installed = M.installed_parsers() languages = vim.iter.filter(function(v) return not vim.list_contains(installed, v) - end, languages) + end, languages) --[[@as string[] ]] end if skip and skip.missing then local installed = M.installed_parsers() languages = vim.iter.filter(function(v) return vim.list_contains(installed, v) - end, languages) + end, languages) --[[@as string[] ]] end return languages diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index e8c945f6c..1e17bb00b 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -1,6 +1,6 @@ -local shell = require('nvim-treesitter.shell_cmds') local install = require('nvim-treesitter.install') local config = require('nvim-treesitter.config') +local util = require('nvim-treesitter.util') local tsq = vim.treesitter.query local M = {} @@ -62,7 +62,7 @@ local function install_health() vim.health.ok('`git` executable found.') end - local cc = shell.select_executable(install.compilers) + local cc = install.select_executable(install.compilers) if not cc then vim.health.error('`cc` executable not found.', { 'Check that any of ' @@ -118,6 +118,7 @@ local function query_status(lang, query_group) end function M.check() + --- @type {[1]: string, [2]: string, [3]: string}[] local error_collection = {} -- Installation dependency checks install_health() @@ -144,22 +145,19 @@ function M.check() if #error_collection > 0 then vim.health.start('The following errors have been detected:') for _, p in ipairs(error_collection) do - local lang, type, err = unpack(p) + local lang, type, err = p[1], p[2], p[3] local lines = {} table.insert(lines, lang .. '(' .. type .. '): ' .. err) local files = tsq.get_files(lang, type) if #files > 0 then table.insert(lines, lang .. '(' .. type .. ') is concatenated from the following files:') for _, file in ipairs(files) do - local fd = io.open(file, 'r') - if fd then - local ok, file_err = pcall(tsq.parse, lang, fd:read('*a')) - if ok then - table.insert(lines, '| [OK]:"' .. file .. '"') - else - table.insert(lines, '| [ERR]:"' .. file .. '", failed to load: ' .. file_err) - end - fd:close() + local query = util.read_file(file) + local ok, file_err = pcall(tsq.parse, lang, query) + if ok then + table.insert(lines, '| [OK]:"' .. file .. '"') + else + table.insert(lines, '| [ERR]:"' .. file .. '", failed to load: ' .. file_err) end end end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 0db61137c..ab9543673 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -2,9 +2,27 @@ local api = vim.api local fs = vim.fs local uv = vim.loop -local parsers = require('nvim-treesitter.parsers') +local a = require('nvim-treesitter.async') local config = require('nvim-treesitter.config') -local shell = require('nvim-treesitter.shell_cmds') +local job = require('nvim-treesitter.job') +local log = require('nvim-treesitter.log') +local parsers = require('nvim-treesitter.parsers') +local util = require('nvim-treesitter.util') + +--- @type fun(path: string, new_path: string, flags?: table): string? +local uv_copyfile = a.wrap(uv.fs_copyfile, 4) + +--- @type fun(path: string, mode: integer): string? +local uv_mkdir = a.wrap(uv.fs_mkdir, 3) + +--- @type fun(path: string, new_path: string): string? +local uv_rename = a.wrap(uv.fs_rename, 3) + +--- @type fun(path: string, new_path: string, flags?: table): string? +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 = {} @@ -14,182 +32,26 @@ local M = {} ---@type table local lockfile = {} +local max_jobs = 50 + +local iswin = uv.os_uname().sysname == 'Windows_NT' +local ismac = uv.os_uname().sysname == 'Darwin' + +--- @diagnostic disable-next-line:missing-parameter M.compilers = { uv.os_getenv('CC'), 'cc', 'gcc', 'clang', 'cl', 'zig' } -M.prefer_git = uv.os_uname().sysname == 'Windows_NT' -M.command_extra_args = {} -M.ts_generate_args = nil - -local started_commands = 0 -local finished_commands = 0 -local failed_commands = 0 -local stdout_output = {} -local stderr_output = {} - ---- ---- JOB API functions ---- - -local function reset_progress_counter() - if started_commands ~= finished_commands then - return - end - started_commands = 0 - finished_commands = 0 - failed_commands = 0 - stdout_output = {} - stderr_output = {} -end - -local function get_job_status() - return '[nvim-treesitter] [' - .. finished_commands - .. '/' - .. started_commands - .. (failed_commands > 0 and ', failed: ' .. failed_commands or '') - .. ']' -end - ----@param cmd Command ----@return string command -local function get_command(cmd) - local options = '' - if cmd.opts and cmd.opts.args then - if M.command_extra_args[cmd.cmd] then - vim.list_extend(cmd.opts.args, M.command_extra_args[cmd.cmd]) - end - for _, opt in ipairs(cmd.opts.args) do - options = string.format('%s %s', options, opt) - end - end - - local command = string.format('%s %s', cmd.cmd, options) - if cmd.opts and cmd.opts.cwd then - command = shell.make_directory_change_for_command(cmd.opts.cwd, command) - end - return command -end - ----@param cmd_list Command[] ----@return boolean -local function iter_cmd_sync(cmd_list) - for _, cmd in ipairs(cmd_list) do - if cmd.info then - vim.notify(cmd.info) - end - - if type(cmd.cmd) == 'function' then - cmd.cmd() - else - local ret = vim.fn.system(get_command(cmd)) - if vim.v.shell_error ~= 0 then - vim.notify(ret) - api.nvim_err_writeln( - (cmd.err and cmd.err .. '\n' or '') - .. 'Failed to execute the following command:\n' - .. vim.inspect(cmd) - ) - return false - end - end - end - - return true -end - -local function iter_cmd(cmd_list, i, lang, success_message) - if i == 1 then - started_commands = started_commands + 1 - end - if i == #cmd_list + 1 then - finished_commands = finished_commands + 1 - return vim.notify(get_job_status() .. ' ' .. success_message) - end - - local attr = cmd_list[i] - if attr.info then - vim.notify(get_job_status() .. ' ' .. attr.info) - end - - if attr.opts and attr.opts.args and M.command_extra_args[attr.cmd] then - vim.list_extend(attr.opts.args, M.command_extra_args[attr.cmd]) - end - - if type(attr.cmd) == 'function' then - local ok, err = pcall(attr.cmd) - if ok then - iter_cmd(cmd_list, i + 1, lang, success_message) - else - failed_commands = failed_commands + 1 - finished_commands = finished_commands + 1 - return api.nvim_err_writeln( - (attr.err or ('Failed to execute the following command:\n' .. vim.inspect(attr))) - .. '\n' - .. vim.inspect(err) - ) - end - else - local handle - local stdout = uv.new_pipe(false) - local stderr = uv.new_pipe(false) - attr.opts.stdio = { nil, stdout, stderr } - ---@type userdata - handle = uv.spawn( - attr.cmd, - attr.opts, - vim.schedule_wrap(function(code) - if code ~= 0 then - stdout:read_stop() - stderr:read_stop() - end - stdout:close() - stderr:close() - handle:close() - if code ~= 0 then - failed_commands = failed_commands + 1 - finished_commands = finished_commands + 1 - if stdout_output[handle] and stdout_output[handle] ~= '' then - vim.notify(stdout_output[handle]) - end - - local err_msg = stderr_output[handle] or '' - api.nvim_err_writeln( - 'nvim-treesitter[' - .. lang - .. ']: ' - .. (attr.err or ('Failed to execute the following command:\n' .. vim.inspect(attr))) - .. '\n' - .. err_msg - ) - return - end - iter_cmd(cmd_list, i + 1, lang, success_message) - end) - ) - uv.read_start(stdout, function(_, data) - if data then - stdout_output[handle] = (stdout_output[handle] or '') .. data - end - end) - uv.read_start(stderr, function(_, data) - if data then - stderr_output[handle] = (stderr_output[handle] or '') .. data - end - end) - end -end --- --- PARSER INFO --- ---@param lang string ----@param validate boolean|nil +---@param validate? boolean ---@return InstallInfo local function get_parser_install_info(lang, validate) local parser_config = parsers.configs[lang] if not parser_config then - error('Parser not available for language "' .. lang .. '"') + log.error('Parser not available for language "' .. lang .. '"') end local install_info = parser_config.install_info @@ -204,14 +66,18 @@ local function get_parser_install_info(lang, validate) return install_info end +--- @param ... string +--- @return string +function M.get_package_path(...) + return fs.joinpath(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) +end + ---@param lang string ----@return string|nil -local function get_revision(lang) +---@return string? +local function get_target_revision(lang) if #lockfile == 0 then - local filename = shell.get_package_path('lockfile.json') - local file = assert(io.open(filename, 'r')) - lockfile = vim.json.decode(file:read('*all')) - file:close() + local filename = M.get_package_path('lockfile.json') + lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] end local install_info = get_parser_install_info(lang) @@ -225,19 +91,16 @@ local function get_revision(lang) end ---@param lang string ----@return string|nil +---@return string? local function get_installed_revision(lang) local lang_file = fs.joinpath(config.get_install_dir('parser-info'), lang .. '.revision') - local file = assert(io.open(lang_file, 'r')) - local revision = file:read('*a') - file:close() - return revision + return util.read_file(lang_file) end ---@param lang string ---@return boolean local function needs_update(lang) - local revision = get_revision(lang) + local revision = get_target_revision(lang) return not revision or revision ~= get_installed_revision(lang) end @@ -254,7 +117,7 @@ function M.info() for _, lang in pairs(parser_list) do local parser = (lang .. string.rep(' ', max_len - #lang + 1)) - local output + local output --- @type string[] if vim.list_contains(installed, lang) then output = { parser .. '[✓] installed', 'DiagnosticOk' } elseif #api.nvim_get_runtime_file('parser/' .. lang .. '.*', true) > 0 then @@ -270,13 +133,311 @@ end --- PARSER MANAGEMENT FUNCTIONS --- +--- @param repo InstallInfo +--- @param project_name string +--- @param cache_dir string +--- @param from_local_path boolean +--- @return string +local function get_compile_location(repo, cache_dir, project_name, from_local_path) + ---@type string compile_location only needed for typescript installs. + if from_local_path then + local compile_location = repo.url + if repo.location then + compile_location = fs.joinpath(compile_location, repo.location) + end + return compile_location + end + + local repo_location = project_name + if repo.location then + repo_location = fs.joinpath(repo_location, repo.location) + end + return fs.joinpath(cache_dir, repo_location) +end + +local function cc_err() + log.error('No C compiler found! "' .. table.concat( + vim.tbl_filter( + ---@param c string + ---@return boolean + function(c) + return type(c) == 'string' + end, + M.compilers + ), + '", "' + ) .. '" are not executable.') +end + +--- @param logger Logger +--- @param repo InstallInfo +--- @param compile_location string +local function do_generate_from_grammar(logger, repo, compile_location) + if repo.generate_requires_npm then + if vim.fn.executable('npm') ~= 1 then + logger:error('NPM requires to be installed from grammar.js') + end + + logger:info('Installing NPM dependencies') + local r = job.run({ 'npm', 'install' }, { cwd = compile_location }) + a.main() + if r.exit_code > 0 then + logger:error('Error during `npm install`') + end + end + + logger:info('Generating source files from grammar.js...') + + local r = job.run({ + vim.fn.exepath('tree-sitter'), + 'generate', + '--no-bindings', + '--abi', + tostring(vim.treesitter.language_version), + }, { cwd = compile_location }) + a.main() + if r.exit_code > 0 then + logger:error('Error during "tree-sitter generate"') + end +end + +---@param logger Logger +---@param repo InstallInfo +---@param project_name string +---@param cache_dir string +---@param revision string +---@param project_dir string +local function do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) + local is_github = repo.url:find('github.com', 1, true) + local url = repo.url:gsub('.git$', '') + + local dir_rev = revision + if is_github and revision:find('^v%d') then + dir_rev = revision:sub(2) + end + + local temp_dir = project_dir .. '-tmp' + + util.delete(temp_dir) + + logger:info('Downloading ' .. project_name .. '...') + local target = is_github and url .. '/archive/' .. revision .. '.tar.gz' + or url .. '/-/archive/' .. revision .. '/' .. project_name .. '-' .. revision .. '.tar.gz' + + local r = job.run({ + 'curl', + '--silent', + '--show-error', + '-L', -- follow redirects + target, + '--output', + project_name .. '.tar.gz', + }, { + cwd = cache_dir, + }) + a.main() + if r.exit_code > 0 then + logger:error( + 'Error during download, please verify your internet connection: ' .. vim.inspect(r.stderr) + ) + end + + logger:debug('Creating temporary directory: ' .. temp_dir) + --TODO(clason): use vim.fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created + local err = uv_mkdir(temp_dir, 493) + a.main() + if err then + logger:error('Could not create %s-tmp: %s', project_name, err) + end + + logger:info('Extracting ' .. project_name .. '...') + r = job.run({ + 'tar', + '-xzf', + project_name .. '.tar.gz', + '-C', + project_name .. '-tmp', + }, { + cwd = cache_dir, + }) + + a.main() + if r.exit_code > 0 then + logger:error('Error during tarball extraction: ' .. vim.inspect(r.stderr)) + end + + err = uv_unlink(project_dir .. '.tar.gz') + if err then + logger:error('Could not remove tarball: ' .. err) + end + a.main() + + err = uv_rename(fs.joinpath(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), project_dir) + a.main() + + if err then + logger:error('Could not rename temp: ' .. err) + end + + util.delete(temp_dir) +end + +---@param logger Logger +---@param repo InstallInfo +---@param project_name string +---@param cache_dir string +---@param revision string +---@param project_dir string +local function do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) + logger:info('Downloading ' .. project_name .. '...') + + local r = job.run({ + 'git', + 'clone', + '--filter=blob:none', + repo.url, + project_name, + }, { + cwd = cache_dir, + }) + + a.main() + + if r.exit_code > 0 then + logger:error( + 'Error during download, please verify your internet connection: ' .. vim.inspect(r.stderr) + ) + end + + logger:info('Checking out locked revision') + r = job.run({ + 'git', + 'checkout', + revision, + }, { + cwd = project_dir, + }) + + a.main() + + if r.exit_code > 0 then + logger:error('Error while checking out revision: ' .. vim.inspect(r.stderr)) + end +end + +---@param executables string[] +---@return string? +function M.select_executable(executables) + return vim.tbl_filter( + ---@param c string + ---@return boolean + function(c) + return c ~= vim.NIL and vim.fn.executable(c) == 1 + end, + 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 { + 'c++', + '-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', + } + + if + #vim.tbl_filter( + --- @param file string + --- @return boolean + function(file) + local ext = vim.fn.fnamemodify(file, ':e') + return ext == 'cc' or ext == 'cpp' or ext == 'cxx' + end, + repo.files + ) > 0 + then + table.insert(args, '-lstdc++') + end + + if not iswin then + table.insert(args, '-fPIC') + end + + return args +end + +---@param repo InstallInfo +---@return boolean +local function can_download_tar(repo) + local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 + local is_github = repo.url:find('github.com', 1, true) + local is_gitlab = repo.url:find('gitlab.com', 1, true) + 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 repo InstallInfo +---@param cc string +---@param compile_location string +---@return JobResult +local function do_compile(repo, cc, compile_location) + local make = M.select_executable({ 'gmake', 'make' }) + + local cmd --- @type string[] + if cc:find('cl$') or cc:find('cl.exe$') or not repo.use_makefile or iswin or not make then + local args = vim.tbl_flatten(select_compiler_args(repo, cc)) + cmd = vim.list_extend({ cc }, args) + else + cmd = { + make, + '--makefile=' .. M.get_package_path('scripts', 'compile_parsers.makefile'), + 'CC=' .. cc, + } + end + + local r = job.run(cmd, { cwd = compile_location }) + a.main() + return r +end + ---@param lang string ---@param cache_dir string ---@param install_dir string ---@param force boolean ----@param with_sync boolean ---@param generate_from_grammar boolean -local function install_lang(lang, cache_dir, install_dir, force, with_sync, generate_from_grammar) +local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) if vim.list_contains(config.installed_parsers(), lang) then if not force then local yesno = @@ -288,278 +449,260 @@ local function install_lang(lang, cache_dir, install_dir, force, with_sync, gene end end + local cc = M.select_executable(M.compilers) + if not cc then + cc_err() + return + end + local repo = get_parser_install_info(lang) local project_name = 'tree-sitter-' .. lang + + local logger = log.new('install/' .. lang) + + generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar + + if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then + logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') + end + + if generate_from_grammar and vim.fn.executable('node') ~= 1 then + logger:error('Node JS not found: `node` is not executable') + end + + local revision = repo.revision or get_target_revision(lang) + local maybe_local_path = fs.normalize(repo.url) local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 if from_local_path then repo.url = maybe_local_path end - ---@type string compile_location only needed for typescript installs. - local compile_location - if from_local_path then - compile_location = repo.url - if repo.location then - compile_location = fs.joinpath(compile_location, repo.location) + if not from_local_path then + util.delete(fs.joinpath(cache_dir, project_name)) + local project_dir = fs.joinpath(cache_dir, project_name) + + revision = revision or repo.branch or 'master' + + if can_download_tar(repo) then + do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) + else + do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) end - else - local repo_location = project_name - if repo.location then - repo_location = fs.joinpath(repo_location, repo.location) - end - compile_location = fs.joinpath(cache_dir, repo_location) end + + local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path) + + if generate_from_grammar then + do_generate_from_grammar(logger, repo, compile_location) + end + + logger:info('Compiling parser') + local r = do_compile(repo, cc, compile_location) + if r.exit_code > 0 then + logger:error('Error during compilation: ' .. vim.inspect(r.stderr)) + end + local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' - generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - - if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then - api.nvim_err_writeln('tree-sitter CLI not found: `tree-sitter` is not executable') - if repo.requires_generate_from_grammar then - api.nvim_err_writeln( - 'tree-sitter CLI is needed because the parser for `' - .. lang - .. '` needs to be generated from grammar' - ) - end - return - else - if not M.ts_generate_args then - M.ts_generate_args = { 'generate', '--no-bindings', '--abi', vim.treesitter.language_version } - end - end - if generate_from_grammar and vim.fn.executable('node') ~= 1 then - api.nvim_err_writeln('Node JS not found: `node` is not executable') - return - end - local cc = shell.select_executable(M.compilers) - if not cc then - api.nvim_err_writeln( - 'No C compiler found! "' - .. table.concat( - vim.tbl_filter(function(c) ---@param c string - return type(c) == 'string' - end, M.compilers), - '", "' - ) - .. '" are not executable.' - ) - return + local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) + a.main() + if err then + logger:error(err) end - local revision = repo.revision - if not revision then - revision = get_revision(lang) - end + local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') + util.write_file(revfile, revision or '') - ---@class Command - ---@field cmd string - ---@field info string - ---@field err string - ---@field opts CmdOpts - - ---@class CmdOpts - ---@field args string[] - ---@field cwd string - - ---@type Command[] - local command_list = {} if not from_local_path then - vim.list_extend(command_list, { - { - cmd = function() - vim.fn.delete(fs.joinpath(cache_dir, project_name), 'rf') - end, - }, - }) - vim.list_extend( - command_list, - shell.select_download_commands(repo, project_name, cache_dir, revision, M.prefer_git) - ) - end - if generate_from_grammar then - if repo.generate_requires_npm then - if vim.fn.executable('npm') ~= 1 then - api.nvim_err_writeln('`' .. lang .. '` requires NPM to be installed from grammar.js') - return - end - vim.list_extend(command_list, { - { - cmd = 'npm', - info = 'Installing NPM dependencies of ' .. lang .. ' parser', - err = 'Error during `npm install` (required for parser generation of ' - .. lang - .. ' with npm dependencies)', - opts = { - args = { 'install' }, - cwd = compile_location, - }, - }, - }) - end - vim.list_extend(command_list, { - { - cmd = vim.fn.exepath('tree-sitter'), - info = 'Generating source files from grammar.js...', - err = 'Error during "tree-sitter generate"', - opts = { - args = M.ts_generate_args, - cwd = compile_location, - }, - }, - }) - end - vim.list_extend(command_list, { - shell.select_compile_command(repo, cc, compile_location), - { - cmd = function() - uv.fs_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) - end, - }, - { - cmd = function() - local file = assert( - io.open( - fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision'), - 'w' - ) - ) - file:write(revision or '') - file:close() - end, - }, - }) - if not from_local_path then - vim.list_extend(command_list, { - { - cmd = function() - vim.fn.delete(fs.joinpath(cache_dir, project_name), 'rf') - end, - }, - }) + util.delete(fs.joinpath(cache_dir, project_name)) end - if with_sync then - if iter_cmd_sync(command_list) == true then - vim.notify('Parser for ' .. lang .. ' has been installed') + local queries = fs.joinpath(config.get_install_dir('queries'), lang) + local queries_src = M.get_package_path('runtime', 'queries', lang) + uv_unlink(queries) + err = uv_symlink(queries_src, queries, { dir = true, junction = true }) + a.main() + if err then + logger:error(err) + end + logger:info('Parser installed') +end + +--- Throttles a function using the first argument as an ID +--- +--- If function is already running then the function will be scheduled to run +--- again once the running call has finished. +--- +--- fn#1 _/‾\__/‾\_/‾\_____________________________ +--- throttled#1 _/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\/‾‾‾‾‾‾‾‾‾‾\____________ +-- +--- fn#2 ______/‾\___________/‾\___________________ +--- throttled#2 ______/‾‾‾‾‾‾‾‾‾‾\__/‾‾‾‾‾‾‾‾‾‾\__________ +--- +--- +--- @generic F: function +--- @param fn F Function to throttle +--- @return F throttled function. +local function throttle_by_id(fn) + local scheduled = {} --- @type table + local running = {} --- @type table + return function(id, ...) + if scheduled[id] then + -- If fn is already scheduled, then drop + return + end + if not running[id] then + scheduled[id] = true + end + if running[id] then + return + end + while scheduled[id] do + scheduled[id] = nil + running[id] = true + fn(id, ...) + running[id] = nil end - else - iter_cmd(command_list, 1, lang, 'Parser for ' .. lang .. ' has been installed') end end +-- Async functions must not be interleaved +local install_lang_throttled = throttle_by_id(install_lang) + ---@class InstallOptions ----@field with_sync boolean ---@field force boolean ---@field generate_from_grammar boolean ---@field skip table --- Install a parser ----@param languages? string[]|string ----@param options? InstallOptions -function M.install(languages, options) +--- Install a parser +--- @param languages? string[]|string +--- @param options? InstallOptions +--- @param _callback? fun() +local function install(languages, options, _callback) options = options or {} - local with_sync = options.with_sync local force = options.force local generate_from_grammar = options.generate_from_grammar local skip = options.skip - reset_progress_counter() - if vim.fn.executable('git') == 0 then - api.nvim_err_writeln('Git is required on your system to run this command') + log.error('Git is required on your system to run this command') return end local cache_dir = vim.fn.stdpath('cache') local install_dir = config.get_install_dir('parser') - if languages == 'all' then + if not languages or type(languages) == 'string' then + languages = { languages } + end + + if languages[1] == 'all' then force = true end languages = config.norm_languages(languages, skip) + local tasks = {} --- @type fun()[] + local done = 0 for _, lang in ipairs(languages) do - install_lang(lang, cache_dir, install_dir, force, with_sync, generate_from_grammar) - uv.fs_symlink( - shell.get_package_path('runtime', 'queries', lang), - fs.joinpath(config.get_install_dir('queries'), lang), - { dir = true, junction = true } -- needed on Windows (non-junction links require admin) - ) + tasks[#tasks + 1] = a.sync(function() + a.main() + install_lang_throttled(lang, cache_dir, install_dir, force, generate_from_grammar) + done = done + 1 + end) + end + + a.join(max_jobs, nil, tasks) + if #tasks > 1 then + a.main() + log.info('Installed %d/%d parsers', done, #tasks) end end +M.install = a.sync(install, 2) + ---@class UpdateOptions ----@field with_sync boolean ---@param languages? string[]|string ----@param options? UpdateOptions -function M.update(languages, options) - options = options or {} - - reset_progress_counter() +---@param _options? UpdateOptions +---@param _callback function +M.update = a.sync(function(languages, _options, _callback) M.lockfile = {} - languages = config.norm_languages(languages or 'all', { ignored = true, missing = true }) + if not languages or #languages == 0 then + languages = 'all' + end + languages = config.norm_languages(languages, { ignored = true, missing = true }) languages = vim.iter.filter(needs_update, languages) --- @type string[] if #languages > 0 then - M.install(languages, { - force = true, - with_sync = options.with_sync, - }) + install(languages, { force = true }) else - vim.notify('All parsers are up-to-date') + log.info('All parsers are up-to-date') end -end +end, 2) --- @param lang string --- @param parser string --- @param queries string -local function uninstall(lang, parser, queries) +local function uninstall_lang(lang, parser, queries) + local logger = log.new('uninstall/' .. lang) + logger:debug('Uninstalling ' .. lang) if vim.fn.filereadable(parser) ~= 1 then return end - iter_cmd({ - { - cmd = function() - uv.fs_unlink(parser) - end, - }, - { - cmd = function() - uv.fs_unlink(queries) - end, - }, - }, 1, lang, 'Parser for ' .. lang .. ' has been uninstalled') + logger:debug('Unlinking ' .. parser) + local perr = uv_unlink(parser) + a.main() + + if perr then + log.error(perr) + end + + logger:debug('Unlinking ' .. queries) + local qerr = uv_unlink(queries) + a.main() + + if qerr then + logger:error(qerr) + end + + logger:info('Parser uninstalled') end --- @param languages string[]|string -function M.uninstall(languages) - reset_progress_counter() - +--- @param _options? UpdateOptions +--- @param _callback fun() +M.uninstall = a.sync(function(languages, _options, _callback) languages = config.norm_languages(languages or 'all', { missing = true }) local parser_dir = config.get_install_dir('parser') local query_dir = config.get_install_dir('queries') local installed = config.installed_parsers() + local tasks = {} --- @type fun()[] + local done = 0 for _, lang in ipairs(languages) do if not vim.list_contains(installed, lang) then - vim.notify( - 'Parser for ' .. lang .. ' is is not managed by nvim-treesitter', - vim.log.levels.ERROR - ) + log.warn('Parser for ' .. lang .. ' is is not managed by nvim-treesitter') else local parser = fs.joinpath(parser_dir, lang) .. '.so' local queries = fs.joinpath(query_dir, lang) - uninstall(lang, parser, queries) + tasks[#tasks + 1] = a.sync(function() + uninstall_lang(lang, parser, queries) + done = done + 1 + end) end end -end + + a.join(max_jobs, nil, tasks) + if #tasks > 1 then + a.main() + log.info('Uninstalled %d/%d parsers', done, #tasks) + end +end, 2) return M diff --git a/lua/nvim-treesitter/job.lua b/lua/nvim-treesitter/job.lua new file mode 100644 index 000000000..9c2788cb0 --- /dev/null +++ b/lua/nvim-treesitter/job.lua @@ -0,0 +1,122 @@ +-- Interface with Neovim job control and provide a simple job sequencing structure +local uv = vim.loop +local a = require('nvim-treesitter.async') +local log = require('nvim-treesitter.log') + +local M = { JobResult = {}, Opts = {} } + +--- @class JobResult +--- @field exit_code integer +--- @field signal integer | string +--- @field stdout string[] +--- @field stderr string[] + +--- @class JobOpts +--- @field cwd string +--- @field timeout integer +--- @field env string[] +--- @field on_stderr fun(_: string) +--- @field on_stdout fun(_: string) + +--- Wrapper for vim.loop.spawn. Takes a command, options, and callback just like +--- vim.loop.spawn, but ensures that all output from the command has been +--- flushed before calling the callback. +--- @param cmd string +--- @param options uv.aliases.spawn_options +--- @param callback fun(exit_code: integer, signal: integer|string) +local function spawn(cmd, options, callback) + local handle --- @type uv_process_t? + local timer --- @type uv_timer_t + log.trace('running job: (cwd=%s) %s %s', options.cwd, cmd, table.concat(options.args, ' ')) + handle = uv.spawn(cmd, options, function(exit_code, signal) + ---@cast handle -nil + + handle:close() + if timer then + timer:stop() + timer:close() + end + + callback(exit_code, signal) + end) + + --- @type integer? + --- @diagnostic disable-next-line:undefined-field + local timeout = options.timeout + + if timeout then + timer = assert(uv.new_timer()) + timer:start(timeout, 0, function() + timer:stop() + timer:close() + if handle and handle:is_active() then + log.warn('Killing %s due to timeout!', cmd) + handle:kill('sigint') + handle:close() + for _, pipe in + pairs(options.stdio --[[@as uv_pipe_t[] ]]) + do + pipe:close() + end + callback(-9999, 'sigint') + end + end) + end +end + +--- Main exposed function for the jobs module. Takes a task and options and +--- returns an async function that will run the task with the given opts via +--- vim.loop.spawn +--- @param task string[] +--- @param opts JobOpts +--- @param callback fun(_: JobResult) +--- @type fun(task: string|string[], opts: JobOpts): JobResult +M.run = a.wrap(function(task, opts, callback) + local stdout_data = {} + local stderr_data = {} + + local stdout = assert(uv.new_pipe(false)) + local stderr = assert(uv.new_pipe(false)) + + spawn(task[1], { + args = { unpack(task, 2) }, + stdio = { nil, stdout, stderr }, + cwd = opts.cwd, + timeout = opts.timeout and 1000 * opts.timeout or nil, + env = opts.env, + hide = true, + }, function(exit_code, signal) + callback({ + exit_code = exit_code, + signal = signal, + stdout = stdout_data, + stderr = stderr_data, + }) + end) + + for kind, pipe in pairs({ stdout = stdout, stderr = stderr }) do + pipe:read_start(function(err, data) + if kind == 'stderr' and opts.on_stderr and data then + opts.on_stderr(data) + end + if kind == 'stdout' and opts.on_stdout and data then + opts.on_stdout(data) + end + if data then + log.trace('%s -> %s', kind, data) + end + if err then + log.error(err) + end + if data ~= nil then + local output = kind == 'stdout' and stdout_data or stderr_data + table.insert(output, vim.trim(data)) + else + pipe:read_stop() + pipe:close() + end + end) + end +end, 3) + +return M diff --git a/lua/nvim-treesitter/log.lua b/lua/nvim-treesitter/log.lua new file mode 100644 index 000000000..83f0b41c2 --- /dev/null +++ b/lua/nvim-treesitter/log.lua @@ -0,0 +1,133 @@ +local api = vim.api + +-- TODO(lewis6991): write these out to a file +local messages = {} --- @type {[1]: string, [2]: string?, [3]: string}[] + +local sev_to_hl = { + trace = 'DiagnosticHint', + debug = 'Normal', + info = 'MoreMsg', + warn = 'WarningMsg', + error = 'ErrorMsg', +} + +---@param ctx string? +---@param m string +---@param ... any +local function trace(ctx, m, ...) + messages[#messages + 1] = { 'trace', ctx, string.format(m, ...) } +end + +---@param ctx string? +---@param m string +---@param ... any +local function debug(ctx, m, ...) + messages[#messages + 1] = { 'debug', ctx, string.format(m, ...) } +end + +---@param ctx string? +---@return string +local function mkpfx(ctx) + return ctx and string.format('[nvim-treesitter/%s]', ctx) or '[nvim-treesitter]' +end + +---@param ctx string? +---@param m string +---@param ... any +local function info(ctx, m, ...) + local m1 = string.format(m, ...) + messages[#messages + 1] = { 'info', ctx, m1 } + api.nvim_echo({ { mkpfx(ctx) .. ': ' .. m1, sev_to_hl.info } }, true, {}) +end + +---@param ctx string? +---@param m string +---@param ... any +local function warn(ctx, m, ...) + local m1 = string.format(m, ...) + messages[#messages + 1] = { 'warn', ctx, m1 } + api.nvim_echo({ { mkpfx(ctx) .. ' warning: ' .. m1, sev_to_hl.warn } }, true, {}) +end + +---@param ctx string? +---@param m string +---@param ... any +local function lerror(ctx, m, ...) + local m1 = string.format(m, ...) + messages[#messages + 1] = { 'error', ctx, m1 } + error(mkpfx(ctx) .. ' error: ' .. m1) +end + +--- @class NTSLogModule +--- @field trace fun(fmt: string, ...: any) +--- @field debug fun(fmt: string, ...: any) +--- @field info fun(fmt: string, ...: any) +--- @field warn fun(fmt: string, ...: any) +--- @field error fun(fmt: string, ...: any) +local M = {} + +--- @class Logger +--- @field ctx? string +local Logger = {} + +M.Logger = Logger + +--- @param ctx? string +--- @return Logger +function M.new(ctx) + return setmetatable({ ctx = ctx }, { __index = Logger }) +end + +---@param m string +---@param ... any +function Logger:trace(m, ...) + trace(self.ctx, m, ...) +end + +---@param m string +---@param ... any +function Logger:debug(m, ...) + debug(self.ctx, m, ...) +end + +---@param m string +---@param ... any +function Logger:info(m, ...) + info(self.ctx, m, ...) +end + +---@param m string +---@param ... any +function Logger:warn(m, ...) + warn(self.ctx, m, ...) +end + +---@param m string +---@param ... any +function Logger:error(m, ...) + lerror(self.ctx, m, ...) +end + +local noctx_logger = M.new() + +setmetatable(M, { + __index = function(t, k) + --- @diagnostic disable-next-line:no-unknown + t[k] = function(...) + return noctx_logger[k](noctx_logger, ...) + end + return t[k] + end, +}) + +function M.show() + for _, l in ipairs(messages) do + local sev, ctx, msg = l[1], l[2], l[3] + local hl = sev_to_hl[sev] + local text = ctx and string.format('%s(%s): %s', sev, ctx, msg) + or string.format('%s: %s', sev, msg) + api.nvim_echo({ { text, hl } }, false, {}) + end +end + +return M diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 69e9500fe..114ab40c6 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2818,17 +2818,18 @@ M.configs = { ---@param tier integer? only get parsers of specified tier ---@return string[] function M.get_available(tier) + --- @type string[] local parsers = vim.tbl_keys(M.configs) table.sort(parsers) if tier then parsers = vim.iter.filter(function(p) return M.configs[p].tier == tier - end, parsers) + end, parsers) --[[@as string[] ]] end if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then parsers = vim.iter.filter(function(p) return not M.configs[p].install_info.requires_generate_from_grammar - end, parsers) + end, parsers) --[[@as string[] ]] end return parsers end diff --git a/lua/nvim-treesitter/shell_cmds.lua b/lua/nvim-treesitter/shell_cmds.lua deleted file mode 100644 index 4c631512d..000000000 --- a/lua/nvim-treesitter/shell_cmds.lua +++ /dev/null @@ -1,258 +0,0 @@ -local uv = vim.loop - -local iswin = uv.os_uname().sysname == 'Windows_NT' - -local M = {} - ----@param executables string[] ----@return string|nil -function M.select_executable(executables) - return vim.tbl_filter(function(c) ---@param c string - return c ~= vim.NIL and vim.fn.executable(c) == 1 - end, executables)[1] -end - --- Returns the compiler arguments based on the compiler and OS ----@param repo InstallInfo ----@param compiler string ----@return string[] -function M.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', - } - elseif compiler:find('zig$') or compiler:find('zig.exe$') then - return { - 'c++', - '-o', - 'parser.so', - repo.files, - '-lc', - '-Isrc', - '-shared', - '-Os', - } - else - local args = { - '-o', - 'parser.so', - '-I./src', - repo.files, - '-Os', - } - if uv.os_uname().sysname == 'Darwin' then - table.insert(args, '-bundle') - else - table.insert(args, '-shared') - end - if - #vim.tbl_filter(function(file) ---@param file string - local ext = vim.fn.fnamemodify(file, ':e') - return ext == 'cc' or ext == 'cpp' or ext == 'cxx' - end, repo.files) > 0 - then - table.insert(args, '-lstdc++') - end - if not iswin then - table.insert(args, '-fPIC') - end - return args - end -end - --- Returns the compile command based on the OS and user options ----@param repo InstallInfo ----@param cc string ----@param compile_location string ----@return Command -function M.select_compile_command(repo, cc, compile_location) - local make = M.select_executable({ 'gmake', 'make' }) - if cc:find('cl$') or cc:find('cl.exe$') or not repo.use_makefile or iswin or not make then - return { - cmd = cc, - info = 'Compiling...', - err = 'Error during compilation', - opts = { - args = vim.tbl_flatten(M.select_compiler_args(repo, cc)), - cwd = compile_location, - }, - } - else - return { - cmd = make, - info = 'Compiling...', - err = 'Error during compilation', - opts = { - args = { - '--makefile=' .. M.get_package_path('scripts', 'compile_parsers.makefile'), - 'CC=' .. cc, - }, - cwd = compile_location, - }, - } - end -end - ----@param repo InstallInfo ----@param project_name string ----@param cache_dir string ----@param revision string|nil ----@param prefer_git boolean ----@return table -function M.select_download_commands(repo, project_name, cache_dir, revision, prefer_git) - local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 - local is_github = repo.url:find('github.com', 1, true) - local is_gitlab = repo.url:find('gitlab.com', 1, true) - local project_dir = vim.fs.joinpath(cache_dir, project_name) - - revision = revision or repo.branch or 'master' - - if can_use_tar and (is_github or is_gitlab) and not prefer_git then - local url = repo.url:gsub('.git$', '') - - local dir_rev = revision - if is_github and revision:find('^v%d') then - dir_rev = revision:sub(2) - end - - local temp_dir = project_dir .. '-tmp' - - return { - { - cmd = function() - vim.fn.delete(temp_dir, 'rf') - end, - }, - { - cmd = 'curl', - info = 'Downloading ' .. project_name .. '...', - err = 'Error during download, please verify your internet connection', - opts = { - args = { - '--silent', - '-L', -- follow redirects - is_github and url .. '/archive/' .. revision .. '.tar.gz' - or url - .. '/-/archive/' - .. revision - .. '/' - .. project_name - .. '-' - .. revision - .. '.tar.gz', - '--output', - project_name .. '.tar.gz', - }, - cwd = cache_dir, - }, - }, - { - cmd = function() - --TODO(clason): use vim.fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created - uv.fs_mkdir(temp_dir, 493) - end, - info = 'Creating temporary directory', - err = 'Could not create ' .. project_name .. '-tmp', - }, - { - cmd = 'tar', - info = 'Extracting ' .. project_name .. '...', - err = 'Error during tarball extraction.', - opts = { - args = { - '-xvzf', - project_name .. '.tar.gz', - '-C', - project_name .. '-tmp', - }, - cwd = cache_dir, - }, - }, - { - cmd = function() - uv.fs_unlink(project_dir .. '.tar.gz') - end, - }, - { - cmd = function() - uv.fs_rename( - vim.fs.joinpath(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), - project_dir - ) - end, - }, - { - cmd = function() - vim.fn.delete(temp_dir, 'rf') - end, - }, - } - else - local git_dir = project_dir - local clone_error = 'Error during download, please verify your internet connection' - - return { - { - cmd = 'git', - info = 'Downloading ' .. project_name .. '...', - err = clone_error, - opts = { - args = { - 'clone', - repo.url, - project_name, - }, - cwd = cache_dir, - }, - }, - { - cmd = 'git', - info = 'Checking out locked revision', - err = 'Error while checking out revision', - opts = { - args = { - 'checkout', - revision, - }, - cwd = git_dir, - }, - }, - } - end -end - -function M.get_package_path(...) - return vim.fs.joinpath(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) -end - ---TODO(clason): only needed for iter_cmd_sync -> replace with uv.spawn? - --- Convert path for cmd.exe on Windows (needed when shellslash is set) ----@param p string ----@return string -local function cmdpath(p) - return vim.o.shellslash and p:gsub('/', '\\') or p -end - ----@param dir string ----@param command string ----@return string command -function M.make_directory_change_for_command(dir, command) - if iswin then - if string.find(vim.o.shell, 'cmd') ~= nil then - return string.format('pushd %s & %s & popd', cmdpath(dir), command) - else - return string.format('pushd %s ; %s ; popd', cmdpath(dir), command) - end - else - return string.format('cd %s;\n %s', dir, command) - end -end - -return M diff --git a/lua/nvim-treesitter/util.lua b/lua/nvim-treesitter/util.lua new file mode 100644 index 000000000..276eafdd7 --- /dev/null +++ b/lua/nvim-treesitter/util.lua @@ -0,0 +1,28 @@ +local uv = vim.loop + +local M = {} + +--- @param filename string +--- @return string +function M.read_file(filename) + local file = assert(io.open(filename, 'r')) + local r = file:read('*a') + file:close() + return r +end + +--- @param filename string +--- @param content string +function M.write_file(filename, content) + local file = assert(io.open(filename, 'w')) + file:write(content) + file:close() +end + +--- Recursively delete a directory +--- @param name string +function M.delete(name) + vim.fs.rm(name, { recursive = true, force = true }) +end + +return M diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 3ab264d41..fcf44d537 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -45,19 +45,6 @@ end, { desc = 'Install treesitter parsers from grammar', }) -api.nvim_create_user_command('TSInstallSync', function(args) - require('nvim-treesitter.install').install(args.fargs, { - with_sync = true, - force = args.bang, - }) -end, { - nargs = '+', - bang = true, - bar = true, - complete = complete_available_parsers, - desc = 'Install treesitter parsers synchronously', -}) - api.nvim_create_user_command('TSUpdate', function(args) require('nvim-treesitter.install').update(args.fargs) end, { @@ -67,15 +54,6 @@ end, { desc = 'Update installed treesitter parsers', }) -api.nvim_create_user_command('TSUpdateSync', function(args) - require('nvim-treesitter.install').update(args.fargs, { with_sync = true }) -end, { - nargs = '*', - bar = true, - complete = complete_installed_parsers, - desc = 'Update installed treesitter parsers synchronously', -}) - api.nvim_create_user_command('TSUninstall', function(args) require('nvim-treesitter.install').uninstall(args.fargs) end, { @@ -84,3 +62,9 @@ end, { complete = complete_installed_parsers, desc = 'Uninstall treesitter parsers', }) + +api.nvim_create_user_command('TSLog', function() + require('nvim-treesitter.log').show() +end, { + desc = 'View log messages', +}) diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index 6c23c1af6..9dd9f9183 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -65,9 +65,8 @@ for _, v in ipairs(sorted_parsers) do end generated_text = generated_text .. footnotes -local readme = assert(io.open('SUPPORTED_LANGUAGES.md', 'r')) -local readme_text = readme:read('*a') -readme:close() +local readme = 'SUPPORTED_LANGUAGES.md' +local readme_text = require('nvim-treesitter.util').read_file(readme) local new_readme_text = string.gsub( readme_text, @@ -75,12 +74,10 @@ local new_readme_text = string.gsub( '\n' .. generated_text .. '' ) -readme = assert(io.open('SUPPORTED_LANGUAGES.md', 'w')) -readme:write(new_readme_text) -readme:close() +require('nvim-treesitter.util').write_file(readme, new_readme_text) if string.find(readme_text, generated_text, 1, true) then - print('README.md is up-to-date\n') + print(readme .. ' is up-to-date\n') else - print('New README.md was written\n') + print('New ' .. readme .. ' was written\n') end diff --git a/scripts/write-lockfile.lua b/scripts/write-lockfile.lua index 5dac838d6..0b1d0504e 100755 --- a/scripts/write-lockfile.lua +++ b/scripts/write-lockfile.lua @@ -2,10 +2,8 @@ vim.opt.runtimepath:append('.') -- Load previous lockfile -local filename = require('nvim-treesitter.shell_cmds').get_package_path('lockfile.json') -local file = assert(io.open(filename, 'r')) -local lockfile = vim.json.decode(file:read('*a')) -file:close() +local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') +local lockfile = vim.json.decode(require('nvim-treesitter.util').read_file(filename)) ---@type string? local skip_lang_string = os.getenv('SKIP_LOCKFILE_UPDATE_FOR_LANGS') @@ -47,6 +45,4 @@ end vim.print(lockfile) -- write new lockfile -file = assert(io.open(filename, 'w')) -file:write(vim.json.encode(lockfile)) -file:close() +require('nvim-treesitter.util').write_file(filename, vim.json.encode(lockfile)) From 9c0a99819c99d70d28334dc6ea1c3ac773e4fed1 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 29 May 2023 16:52:20 +0200 Subject: [PATCH 009/434] ci: remove update-lockfile shell script --- .github/workflows/test-queries.yml | 42 +++++++++---------- .github/workflows/tests.yml | 15 +++---- .github/workflows/update-lockfile.yml | 7 +--- .github/workflows/update-readme.yml | 2 +- TODO.md | 3 +- plugin/query_predicates.lua | 12 +++--- scripts/check-queries.lua | 25 ++++++----- scripts/install-parsers.lua | 15 +++++++ scripts/minimal_init.lua | 5 ++- scripts/pre-push | 10 ----- scripts/run_tests.sh | 2 +- ...write-lockfile.lua => update-lockfile.lua} | 13 +++--- scripts/update-lockfile.sh | 20 --------- scripts/update-readme.lua | 14 +++---- tests/indent/common.lua | 2 +- 15 files changed, 84 insertions(+), 103 deletions(-) create mode 100755 scripts/install-parsers.lua delete mode 100755 scripts/pre-push rename scripts/{write-lockfile.lua => update-lockfile.lua} (75%) delete mode 100755 scripts/update-lockfile.sh diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index 5e9be1e38..bb11db3dc 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -1,12 +1,12 @@ name: Test queries on: - push: - branches: - - "master" + # push: + # branches: + # - "main" pull_request: branches: - - "master" + - "main" # Cancel any in-progress CI runs for a PR if it is updated concurrency: @@ -24,29 +24,29 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-14] cc: [gcc, clang] - nvim_tag: [v0.10.4] + nvim_tag: [nightly] exclude: - os: ubuntu-latest cc: clang - nvim_tag: v0.10.4 + nvim_tag: nightly - os: macos-14 cc: gcc - nvim_tag: v0.10.4 - - - os: windows-latest - cc: clang - nvim_tag: v0.10.4 - - include: - - os: windows-latest - cc: cl nvim_tag: nightly - - os: ubuntu-latest + - 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: @@ -69,8 +69,8 @@ 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', @@ -78,11 +78,7 @@ jobs: './lua/nvim-treesitter/shell_command_selectors.lua') }} - name: Compile parsers - run: $NVIM --headless -c "lua require'nvim-treesitter.install'.prefer_git=false" -c "TSInstallSync all" -c "q" - - - name: Post compile Windows - if: runner.os == 'Windows' - run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser + run: $NVIM -l ./scripts/install-parsers.lua - name: Check query files run: $NVIM -l ./scripts/check-queries.lua diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e09a5f295..86c7ad630 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,12 @@ name: Tests on: - push: - branches: - - "master" + # push: + # branches: + # - "main" pull_request: branches: - - "master" + - "main" # Cancel any in-progress CI runs for a PR if it is updated concurrency: @@ -39,7 +39,8 @@ jobs: - name: Install and prepare Neovim env: - NVIM_TAG: v0.10.4 + NVIM_TAG: nightly + TREE_SITTER_CLI_TAG: v0.20.8 run: | bash ./scripts/ci-install.sh @@ -57,8 +58,8 @@ jobs: './lua/nvim-treesitter/shell_selectors.lua') }} - name: Compile parsers Unix like - run: | - nvim --headless -c "TSInstallSync all" -c "q" + if: ${{ runner.os != 'Windows' && steps.parsers-cache.outputs.cache-hit != 'true' }} + run: nvim -l ./scripts/install-parsers.lua - name: Tests run: PATH=/usr/local/bin:$PATH ./scripts/run_tests.sh diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml index 992e1c0d2..70d2c0c0a 100644 --- a/.github/workflows/update-lockfile.yml +++ b/.github/workflows/update-lockfile.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: master + ref: main - uses: actions/create-github-app-token@v2 id: app-token @@ -34,10 +34,7 @@ jobs: SKIP_LOCKFILE_UPDATE_FOR_LANGS: "bp,devicetree,dhall,elm,enforce,git_config,nickel,rescript,rust,slint,sql,t32,templ,typespec,verilog,wit" run: | cp lockfile.json /tmp/old_lockfile.json - nvim -l scripts/write-lockfile.lua - # Pretty print - cp lockfile.json /tmp/lockfile.json - cat /tmp/lockfile.json | jq --sort-keys > lockfile.json + nvim -l ./scripts/update-lockfile.lua UPDATED_PARSERS=$(/tmp/jd -f merge /tmp/old_lockfile.json lockfile.json | jq -r 'keys | join(", ")') echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 557a3f3c6..849bb9814 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -3,7 +3,7 @@ name: Update README on: push: branches: - - master + - main workflow_dispatch: jobs: diff --git a/TODO.md b/TODO.md index d61d179d6..e5d9448a2 100644 --- a/TODO.md +++ b/TODO.md @@ -5,8 +5,9 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO - [ ] **`query_predicates.lua`:** upstream/remove -- [ ] **`parsers.lua`:** modularize? +- [ ] **`parsers.lua`:** add dependencies (and "query-only" langs like ecma, jsx, html_tags, ...) - [ ] **`parsers.lua`:** assign tiers +- [ ] **`parsers.lua`:** modularize? - [ ] **`install.lua`:** simplify compilation: - hardcode one compiler + args per platform - provide `install.compile_command` for overriding (function that takes files, ...?) diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua index abffea2f0..8c7685faf 100644 --- a/plugin/query_predicates.lua +++ b/plugin/query_predicates.lua @@ -1,6 +1,6 @@ local query = vim.treesitter.query --- register custom predicates +-- register custom predicates (overwrite existing; needed for CI) ---@param match (TSNode|nil)[] ---@param pred string[] @@ -13,7 +13,7 @@ query.add_predicate('kind-eq?', function(match, _, _, pred) local types = { unpack(pred, 3) } return vim.list_contains(types, node:type()) -end) +end, true) -- register custom directives @@ -43,7 +43,7 @@ query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, m local parts = vim.split(type_attr_value, '/', {}) metadata['injection.language'] = parts[#parts] end -end) +end, true) local injection_aliases = { ex = 'elixir', @@ -68,7 +68,7 @@ query.add_directive('set-lang-from-info-string!', function(match, _, bufnr, pred local injection_alias = vim.treesitter.get_node_text(node, bufnr) local filetype = vim.filetype.match({ filename = 'a.' .. injection_alias }) metadata['injection.language'] = filetype or injection_aliases[injection_alias] or injection_alias -end) +end, true) query.add_directive('downcase!', function(match, _, bufnr, pred, metadata) local text, key, value ---@type string|string[], string, string|integer @@ -95,7 +95,7 @@ query.add_directive('downcase!', function(match, _, bufnr, pred, metadata) else metadata[key] = string.lower(text) end -end) +end, true) -- Trim blank lines from end of the region -- Arguments are the captures to trim. @@ -138,4 +138,4 @@ query.add_directive('trim!', function(match, _, bufnr, pred, metadata) metadata[id].range = { start_row, start_col, end_row, end_col } end end -end) +end, true) diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index f5d6d463b..fd9d538ac 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -93,17 +93,20 @@ local ok, result = pcall(do_check) local allowed_to_fail = vim.split(vim.env.ALLOWED_INSTALLATION_FAILURES or '', ',', true) for k, v in pairs(require('nvim-treesitter.parsers').configs) do - if #vim.api.nvim_get_runtime_file('parser/' .. k .. '.*', false) == 0 then - -- On CI all parsers that can be installed from C files should be installed - if - vim.env.CI - and not v.install_info.requires_generate_from_grammar - and not vim.list_contains(allowed_to_fail, k) - then - io_print('Error: parser for ' .. k .. ' is not installed') - vim.cmd('cq') - else - io_print('Warning: parser for ' .. k .. ' is not installed') + if v.install_info then + -- skip "query only" languages + if #vim.api.nvim_get_runtime_file('parser/' .. k .. '.*', false) == 0 then + -- On CI all parsers that can be installed from C files should be installed + if + vim.env.CI + and not v.install_info.requires_generate_from_grammar + and not vim.list_contains(allowed_to_fail, k) + then + io_print('Error: parser for ' .. k .. ' is not installed') + vim.cmd('cq') + else + io_print('Warning: parser for ' .. k .. ' is not installed') + end end end end diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua new file mode 100755 index 000000000..ab06e538f --- /dev/null +++ b/scripts/install-parsers.lua @@ -0,0 +1,15 @@ +#!/usr/bin/env -S nvim -l + +vim.opt.runtimepath:append('.') + +-- needed on CI +vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') + +local done = false +require('nvim-treesitter.install').install('all', {}, function() + done = true +end) + +vim.wait(6000000, function() + return done +end) diff --git a/scripts/minimal_init.lua b/scripts/minimal_init.lua index c826ddbf2..2af5f8ecb 100644 --- a/scripts/minimal_init.lua +++ b/scripts/minimal_init.lua @@ -2,11 +2,12 @@ vim.opt.runtimepath:append('.') vim.cmd.runtime({ 'plugin/plenary.vim', bang = true }) vim.cmd.runtime({ 'plugin/nvim-treesitter.lua', bang = true }) vim.cmd.runtime({ 'plugin/query_predicates.lua', bang = true }) +vim.cmd.runtime({ 'plugin/filetypes.lua', bang = true }) vim.filetype.add({ extension = { conf = 'hocon', - cmm = 't32', + hurl = 'hurl', ncl = 'nickel', tig = 'tiger', w = 'wing', @@ -20,6 +21,6 @@ require('nvim-treesitter').setup() vim.api.nvim_create_autocmd('FileType', { callback = function(args) pcall(vim.treesitter.start) - vim.bo[args.buffer].indentexpr = 'v:lua.require"nvim-treesitter".indentexpr()' + vim.bo[args.buf].indentexpr = 'v:lua.require"nvim-treesitter".indentexpr()' end, }) diff --git a/scripts/pre-push b/scripts/pre-push deleted file mode 100755 index 8d425b3b6..000000000 --- a/scripts/pre-push +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# Can be used as a pre-push hook -# Just symlink this file to .git/hooks/pre-push - -echo "Running linter..." -luacheck . - -echo "Checking formatting..." -stylua --check . diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index c6660a7f6..7ae6b22c5 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -4,7 +4,7 @@ HERE="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" cd $HERE/.. run() { - nvim --headless --noplugin -u scripts/minimal_init.lua \ + nvim --headless --noplugin -u scripts/minimal_init.lua \ -c "PlenaryBustedDirectory $1 { minimal_init = './scripts/minimal_init.lua' }" } diff --git a/scripts/write-lockfile.lua b/scripts/update-lockfile.lua similarity index 75% rename from scripts/write-lockfile.lua rename to scripts/update-lockfile.lua index 0b1d0504e..dfd3e933f 100755 --- a/scripts/write-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -1,18 +1,18 @@ #!/usr/bin/env -S nvim -l vim.opt.runtimepath:append('.') +local util = require('nvim-treesitter.util') -- Load previous lockfile local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') -local lockfile = vim.json.decode(require('nvim-treesitter.util').read_file(filename)) +local lockfile = vim.json.decode(util.read_file(filename)) ---@type string? -local skip_lang_string = os.getenv('SKIP_LOCKFILE_UPDATE_FOR_LANGS') +local skip_lang_string = os.getenv('LOCKFILE_SKIP') local skip_langs = skip_lang_string and vim.split(skip_lang_string, ',') or {} vim.print('Skipping languages: ', skip_langs) local sorted_parsers = {} -local configs = require('nvim-treesitter.parsers').configs -for k, v in pairs(configs) do +for k, v in pairs(require('nvim-treesitter.parsers').configs) do table.insert(sorted_parsers, { name = k, parser = v }) end table.sort(sorted_parsers, function(a, b) @@ -42,7 +42,6 @@ for _, v in ipairs(sorted_parsers) do print('Skipping ' .. v.name) end end -vim.print(lockfile) --- write new lockfile -require('nvim-treesitter.util').write_file(filename, vim.json.encode(lockfile)) +lockfile = vim.fn.system('jq --sort-keys', vim.json.encode(lockfile)) +util.write_file(filename, lockfile) diff --git a/scripts/update-lockfile.sh b/scripts/update-lockfile.sh deleted file mode 100755 index d950b321a..000000000 --- a/scripts/update-lockfile.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -make_ignored() { - if [ -n "$1" ] - then - while read -r lang; do - if [ "$lang" != "$1" ] - then - printf "%s," "$lang" - fi - done < <(jq 'keys|@sh' -c lockfile.json) - fi -} - -TO_IGNORE=$(make_ignored $1) - -SKIP_LOCKFILE_UPDATE_FOR_LANGS="$TO_IGNORE" nvim -l ./scripts/write-lockfile.lua -# Pretty print -cp lockfile.json /tmp/lockfile.json -cat /tmp/lockfile.json | jq --sort-keys > lockfile.json diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index 9dd9f9183..ded0d6bcb 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -1,21 +1,19 @@ #!/usr/bin/env -S nvim -l vim.opt.runtimepath:append('.') - +local util = require('nvim-treesitter.util') +local parsers = require('nvim-treesitter.parsers') ---@class Parser ---@field name string ---@field parser ParserInfo -local parsers = require('nvim-treesitter.parsers').configs local sorted_parsers = {} -for k, v in pairs(parsers) do +for k, v in pairs(parsers.configs) do table.insert(sorted_parsers, { name = k, parser = v }) end table.sort(sorted_parsers, function(a, b) return a.name < b.name end) -local tiers = require('nvim-treesitter.parsers').tiers - local generated_text = [[ Language | Tier | Queries | CLI | NPM | Maintainer -------- |:----:|:-------:|:---:|:---:| ---------- @@ -38,7 +36,7 @@ for _, v in ipairs(sorted_parsers) do end -- tier - generated_text = generated_text .. (p.tier and tiers[p.tier] or '') .. ' | ' + generated_text = generated_text .. (p.tier and parsers.tiers[p.tier] or '') .. ' | ' -- queries generated_text = generated_text @@ -66,7 +64,7 @@ end generated_text = generated_text .. footnotes local readme = 'SUPPORTED_LANGUAGES.md' -local readme_text = require('nvim-treesitter.util').read_file(readme) +local readme_text = util.read_file(readme) local new_readme_text = string.gsub( readme_text, @@ -74,7 +72,7 @@ local new_readme_text = string.gsub( '\n' .. generated_text .. '' ) -require('nvim-treesitter.util').write_file(readme, new_readme_text) +util.write_file(readme, new_readme_text) if string.find(readme_text, generated_text, 1, true) then print(readme .. ' is up-to-date\n') diff --git a/tests/indent/common.lua b/tests/indent/common.lua index 5c291070e..f33a5908b 100644 --- a/tests/indent/common.lua +++ b/tests/indent/common.lua @@ -74,7 +74,7 @@ assert:register( local function compare_indent(before, after, xfail) assert:add_formatter(format_indent) if xfail then - io.stdout:write('Warning! Known failure of this test! Please help to fix it! ') + -- io.stdout:write('Warning! Known failure of this test! Please help to fix it! ') assert.is_not.same_indent(before, after) else assert.is.same_indent(before, after) From cd2c826972f7bd6fd8f0c076fb9bfabe3f82209e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 31 May 2023 09:19:16 +0200 Subject: [PATCH 010/434] fix: install dependencies --- SUPPORTED_LANGUAGES.md | 23 +++-- TODO.md | 7 +- lua/nvim-treesitter/config.lua | 13 ++- lua/nvim-treesitter/health.lua | 26 ++++-- lua/nvim-treesitter/install.lua | 159 ++++++++++++++++---------------- lua/nvim-treesitter/parsers.lua | 57 +++++++++++- scripts/update-lockfile.lua | 22 ++--- scripts/update-readme.lua | 31 +++++-- 8 files changed, 207 insertions(+), 131 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index aef22b34d..18780fd6f 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -58,13 +58,14 @@ Language | Tier | Queries | CLI | NPM | Maintainer [dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HF JL` | | | @ObserverOfTime [earthfile](https://github.com/glehmann/tree-sitter-earthfile) | community | `H  J ` | | | @glehmann [ebnf](https://github.com/RubixDev/ebnf) | unstable | `H    ` | | | @RubixDev +ecma (queries only)[^ecma] | | `HFIJL` | | | @steelsojka [eds](https://github.com/uyha/tree-sitter-eds) | community | `HF   ` | | | @uyha [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 ` | | | +[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unstable | `H  J ` | | | [erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `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 @@ -100,9 +101,9 @@ Language | Tier | Queries | CLI | NPM | Maintainer [graphql](https://github.com/bkegley/tree-sitter-graphql) | | `H IJ ` | | | @bkegley [groovy](https://github.com/murtaza64/tree-sitter-groovy) | community | `HFIJL` | | | @murtaza64 [gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) | stable | `H    ` | | | @theHamsta -[hack](https://github.com/slackhq/tree-sitter-hack) | | `H    ` | | | +[hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H    ` | | | [hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJL` | | | @amaanq -[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | | `HF J ` | | | @mrcjkb +[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | community | `HF J ` | | | @mrcjkb [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 @@ -113,6 +114,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer [hocon](https://github.com/antosha417/tree-sitter-hocon) | | `HF 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 +html_tags (queries only)[^html_tags] | | `H IJ ` | | | @TravonteD [htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | | | @ObserverOfTime [http](https://github.com/rest-nvim/tree-sitter-http) | | `H  J ` | | | @amaanq, @NTBBloodbath [hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj @@ -128,8 +130,9 @@ Language | Tier | Queries | CLI | NPM | Maintainer [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 +[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) | | `HFIJL` | | ✓ | @WhyNotHugo [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF  L` | | | @nawordar +jsx (queries only)[^jsx] | | `HFIJ ` | | | @steelsojka [julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | | | @theHamsta [just](https://github.com/IndianBoy42/tree-sitter-just) | community | `HFIJL` | | | @Hubro [kconfig](https://github.com/amaanq/tree-sitter-kconfig) | stable | `HFIJL` | | | @amaanq @@ -160,7 +163,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer [mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   L` | ✓ | | @artagnon [muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | | @Freed-Wu [nasm](https://github.com/naclsn/tree-sitter-nasm) | stable | `H  J ` | | | @ObserverOfTime -[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I  ` | | | +[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unstable | `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) | | `HFI  ` | | | @alemuller @@ -173,7 +176,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer [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) | | `     ` | | | +[org](https://github.com/milisims/tree-sitter-org) | unstable | `     ` | | | [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 @@ -221,7 +224,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer [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 +[scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFI  ` | | | @elianiva [slang](https://github.com/theHamsta/tree-sitter-slang)[^slang] | unstable | `HFIJL` | | ✓ | @theHamsta [slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJL` | | | @hunger [smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | community | `HFIJL` | | | @amaanq @@ -249,7 +252,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer [tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | stable | `HFI  ` | | | @lewis6991 [teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce [templ](https://github.com/vrischmann/tree-sitter-templ) | community | `H  J ` | | | @vrischmann -[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann +[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/duskmoon314/tree-sitter-thrift) | | `HFIJL` | | | @amaanq, @duskmoon314 [tiger](https://github.com/ambroisie/tree-sitter-tiger) | | `HFIJL` | | | @ambroisie @@ -288,11 +291,13 @@ Language | Tier | Queries | CLI | NPM | Maintainer [yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `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) | | `HFIJL` | | | @maxxnino +[^ecma]: queries required by javascript, typescript, tsx, qmljs [^gdscript]: Godot [^git_config]: git_config [^glimmer]: Glimmer and Ember [^godot_resource]: Godot Resources -[^jsonc]: JSON with comments +[^html_tags]: queries required by html, astro, vue, svelte +[^jsx]: queries required by javascript, tsx [^luap]: Lua patterns [^markdown]: basic highlighting [^markdown_inline]: needed for full highlighting diff --git a/TODO.md b/TODO.md index e5d9448a2..fbca7f499 100644 --- a/TODO.md +++ b/TODO.md @@ -5,14 +5,9 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO - [ ] **`query_predicates.lua`:** upstream/remove -- [ ] **`parsers.lua`:** add dependencies (and "query-only" langs like ecma, jsx, html_tags, ...) - [ ] **`parsers.lua`:** assign tiers - [ ] **`parsers.lua`:** modularize? -- [ ] **`install.lua`:** simplify compilation: - - hardcode one compiler + args per platform - - provide `install.compile_command` for overriding (function that takes files, ...?) - - allow using repo makefile (norg!)? - - ...or switch to makefile completely? +- [ ] **`install.lua`:** drop norg (and makefile); document c++11 requirement - [ ] **`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? diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index b8a9f6e91..c77ee1358 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -74,12 +74,11 @@ end ---@return string[] function M.installed_parsers() - local install_dir = M.get_install_dir('parser') + local install_dir = M.get_install_dir('queries') local installed = {} --- @type string[] for f in vim.fs.dir(install_dir) do - local lang = assert(f:match('(.*)%..*')) - installed[#installed + 1] = lang + installed[#installed + 1] = f end return installed @@ -139,6 +138,14 @@ function M.norm_languages(languages, skip) end, languages) --[[@as string[] ]] end + if not (skip and skip.dependencies) then + for _, lang in pairs(languages) do + if parsers.configs[lang].requires then + vim.list_extend(languages, parsers.configs[lang].requires) + end + end + end + return languages end diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 1e17bb00b..037887c59 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -1,4 +1,5 @@ local install = require('nvim-treesitter.install') +local parsers = require('nvim-treesitter.parsers') local config = require('nvim-treesitter.config') local util = require('nvim-treesitter.util') local tsq = vim.treesitter.query @@ -123,14 +124,25 @@ function M.check() -- Installation dependency checks install_health() -- Parser installation checks + local languages = config.installed_parsers() local parser_installation = { 'Parser/Features' .. string.rep(' ', 9) .. 'H L F I J' } - for _, parser_name in pairs(config.installed_parsers()) do - local out = ' - ' .. parser_name .. string.rep(' ', 20 - #parser_name) - for _, query_group in pairs(M.bundled_queries) do - local status, err = query_status(parser_name, query_group) - out = out .. status .. ' ' - if err then - table.insert(error_collection, { parser_name, query_group, err }) + for _, lang in pairs(languages) do + local parser = parsers.configs[lang] + local out = ' - ' .. lang .. string.rep(' ', 20 - #lang) + if parser.install_info then + for _, query_group in pairs(M.bundled_queries) do + local status, err = query_status(lang, query_group) + out = out .. status .. ' ' + if err then + table.insert(error_collection, { lang, query_group, err }) + end + end + end + if parser.requires then + for _, p in pairs(parser.requires) do + if not vim.list_contains(languages, p) then + table.insert(error_collection, { lang, 'queries', 'dependency ' .. p .. ' missing' }) + end end end table.insert(parser_installation, vim.fn.trim(out, ' ', 2)) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index ab9543673..3fba73db4 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -449,74 +449,76 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g end end - local cc = M.select_executable(M.compilers) - if not cc then - cc_err() - return - end + local logger = log.new('install/' .. lang) + local err local repo = get_parser_install_info(lang) - - local project_name = 'tree-sitter-' .. lang - - local logger = log.new('install/' .. lang) - - generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - - if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then - logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') - end - - if generate_from_grammar and vim.fn.executable('node') ~= 1 then - logger:error('Node JS not found: `node` is not executable') - end - - local revision = repo.revision or get_target_revision(lang) - - local maybe_local_path = fs.normalize(repo.url) - local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 - if from_local_path then - repo.url = maybe_local_path - end - - if not from_local_path then - util.delete(fs.joinpath(cache_dir, project_name)) - local project_dir = fs.joinpath(cache_dir, project_name) - - revision = revision or repo.branch or 'master' - - if can_download_tar(repo) then - do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) - else - do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) + if repo then + local cc = M.select_executable(M.compilers) + if not cc then + cc_err() + return end - end - local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path) + local project_name = 'tree-sitter-' .. lang - if generate_from_grammar then - do_generate_from_grammar(logger, repo, compile_location) - end + generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - logger:info('Compiling parser') - local r = do_compile(repo, cc, compile_location) - if r.exit_code > 0 then - logger:error('Error during compilation: ' .. vim.inspect(r.stderr)) - end + if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then + logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') + end - local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' + if generate_from_grammar and vim.fn.executable('node') ~= 1 then + logger:error('Node JS not found: `node` is not executable') + end - local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) - a.main() - if err then - logger:error(err) - end + local revision = repo.revision or get_target_revision(lang) - local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') - util.write_file(revfile, revision or '') + local maybe_local_path = fs.normalize(repo.url) + local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 + if from_local_path then + repo.url = maybe_local_path + end - if not from_local_path then - util.delete(fs.joinpath(cache_dir, project_name)) + if not from_local_path then + util.delete(fs.joinpath(cache_dir, project_name)) + local project_dir = fs.joinpath(cache_dir, project_name) + + revision = revision or repo.branch or 'master' + + if can_download_tar(repo) then + do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) + else + do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) + end + end + + local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path) + + if generate_from_grammar then + do_generate_from_grammar(logger, repo, compile_location) + end + + logger:info('Compiling parser') + local r = do_compile(repo, cc, compile_location) + if r.exit_code > 0 then + logger:error('Error during compilation: ' .. vim.inspect(r.stderr)) + end + + local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' + + err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) + a.main() + if err then + logger:error(err) + end + + local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') + util.write_file(revfile, revision or '') + + if not from_local_path then + util.delete(fs.joinpath(cache_dir, project_name)) + end end local queries = fs.joinpath(config.get_install_dir('queries'), lang) @@ -527,7 +529,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g if err then logger:error(err) end - logger:info('Parser installed') + logger:info('Language installed') end --- Throttles a function using the first argument as an ID @@ -617,7 +619,7 @@ local function install(languages, options, _callback) a.join(max_jobs, nil, tasks) if #tasks > 1 then a.main() - log.info('Installed %d/%d parsers', done, #tasks) + log.info('Installed %d/%d languages', done, #tasks) end end @@ -650,34 +652,35 @@ end, 2) local function uninstall_lang(lang, parser, queries) local logger = log.new('uninstall/' .. lang) logger:debug('Uninstalling ' .. lang) - if vim.fn.filereadable(parser) ~= 1 then - return + + if vim.fn.filereadable(parser) == 1 then + logger:debug('Unlinking ' .. parser) + local perr = uv_unlink(parser) + a.main() + + if perr then + log.error(perr) + end end - logger:debug('Unlinking ' .. parser) - local perr = uv_unlink(parser) - a.main() + if vim.fn.isdirectory(queries) == 1 then + logger:debug('Unlinking ' .. queries) + local qerr = uv_unlink(queries) + a.main() - if perr then - log.error(perr) + if qerr then + logger:error(qerr) + end end - logger:debug('Unlinking ' .. queries) - local qerr = uv_unlink(queries) - a.main() - - if qerr then - logger:error(qerr) - end - - logger:info('Parser uninstalled') + logger:info('Language uninstalled') end --- @param languages string[]|string --- @param _options? UpdateOptions --- @param _callback fun() M.uninstall = a.sync(function(languages, _options, _callback) - languages = config.norm_languages(languages or 'all', { missing = true }) + languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) local parser_dir = config.get_install_dir('parser') local query_dir = config.get_install_dir('queries') @@ -701,7 +704,7 @@ M.uninstall = a.sync(function(languages, _options, _callback) a.join(max_jobs, nil, tasks) if #tasks > 1 then a.main() - log.info('Uninstalled %d/%d parsers', done, #tasks) + log.info('Uninstalled %d/%d languages', done, #tasks) end end, 2) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 114ab40c6..3a9a36aaf 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -12,6 +12,7 @@ ---@field install_info InstallInfo ---@field filetype string[] ---@field maintainers string[] +---@field requires string[] ---@field tier integer|nil ---@field readme_note string|nil @@ -44,6 +45,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@dlvandenberg' }, + requires = { 'html', 'html_tags' }, tier = 4, }, @@ -63,6 +65,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ObserverOfTime' }, + requires = { 'cpp' }, }, asm = { @@ -80,6 +83,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@virchau13' }, + requires = { 'html', 'html_tags' }, }, authzed = { @@ -309,6 +313,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + requires = { 'c' }, }, css = { @@ -326,6 +331,7 @@ M.configs = { location = 'csv', }, maintainers = { '@amaanq' }, + requires = { 'tsv' }, tier = 2, }, @@ -336,6 +342,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + requires = { 'cpp' }, }, cue = { @@ -476,6 +483,12 @@ M.configs = { tier = 4, }, + ecma = { + maintainers = { '@steelsojka' }, + readme_note = 'queries required by javascript, typescript, tsx, qmljs', + tier = 3, + }, + editorconfig = { install_info = { url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', @@ -539,6 +552,7 @@ M.configs = { url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', files = { 'src/parser.c' }, }, + tier = 4, }, enforce = { @@ -796,6 +810,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + requires = { 'c' }, }, gn = { @@ -925,6 +940,7 @@ M.configs = { url = 'https://github.com/slackhq/tree-sitter-hack', files = { 'src/parser.c', 'src/scanner.c' }, }, + tier = 4, }, hare = { @@ -941,6 +957,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@mrcjkb' }, + tier = 3, }, haskell_persistent = { @@ -985,6 +1002,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@winston0410' }, + requires = { 'json' }, }, hlsl = { @@ -994,6 +1012,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + requires = { 'cpp' }, }, hlsplaylist = { @@ -1023,12 +1042,18 @@ M.configs = { tier = 4, }, + html_tags = { + maintainers = { '@TravonteD' }, + readme_note = 'queries required by html, astro, vue, svelte', + }, + html = { install_info = { url = 'https://github.com/tree-sitter/tree-sitter-html', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, + requires = { 'html_tags' }, }, htmldjango = { @@ -1118,6 +1143,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@fab4100' }, + requires = { 'c' }, }, janet_simple = { @@ -1151,6 +1177,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@steelsojka' }, + requires = { 'ecma', 'jsx' }, }, jinja = { @@ -1214,7 +1241,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@WhyNotHugo' }, - readme_note = 'JSON with comments', + requires = { 'json' }, }, jsonnet = { @@ -1225,6 +1252,11 @@ M.configs = { maintainers = { '@nawordar' }, }, + jsx = { + maintainers = { '@steelsojka' }, + readme_note = 'queries required by javascript, tsx', + }, + julia = { install_info = { url = 'https://github.com/tree-sitter/tree-sitter-julia', @@ -1370,8 +1402,8 @@ M.configs = { url = 'https://github.com/MunifTanjim/tree-sitter-lua', files = { 'src/parser.c', 'src/scanner.c' }, }, - tier = 1, maintainers = { '@muniftanjim' }, + tier = 1, }, luadoc = { @@ -1397,6 +1429,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + requires = { 'lua' }, }, m68k = { @@ -1423,6 +1456,7 @@ M.configs = { }, maintainers = { '@MDeiml' }, readme_note = 'basic highlighting', + requires = { 'markdown_inline' }, tier = 1, }, @@ -1475,8 +1509,8 @@ M.configs = { files = { 'src/parser.c' }, requires_generate_from_grammar = true, }, - tier = 4, maintainers = { '@artagnon' }, + tier = 4, }, muttrc = { @@ -1511,6 +1545,7 @@ M.configs = { url = 'https://github.com/nickel-lang/tree-sitter-nickel', files = { 'src/parser.c', 'src/scanner.c' }, }, + tier = 4, }, nim = { @@ -1519,6 +1554,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@aMOPel' }, + requires = { 'nim_format_string' }, tier = 3, }, @@ -1553,8 +1589,8 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.cc' }, use_makefile = true, }, - tier = 4, maintainers = { '@JoeyGrajciar', '@vhyrro' }, + tier = 4, }, nqc = { @@ -1581,6 +1617,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + requires = { 'c' }, }, objdump = { @@ -1608,6 +1645,7 @@ M.configs = { location = 'grammars/interface', }, maintainers = { '@undu' }, + requires = { 'ocaml' }, }, ocamllex = { @@ -1826,6 +1864,7 @@ M.configs = { location = 'psv', }, maintainers = { '@amaanq' }, + requires = { 'tsv' }, tier = 2, }, @@ -1895,6 +1934,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Decodetalkers' }, + requires = { 'ecma' }, }, query = { @@ -2120,6 +2160,8 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@elianiva' }, + requires = { 'css' }, + tier = 3, }, sflog = { @@ -2314,6 +2356,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + requires = { 'html_tags' }, tier = 2, }, @@ -2421,6 +2464,8 @@ M.configs = { location = 'dialects/terraform', }, maintainers = { '@MichaHoffmann' }, + requires = { 'hcl' }, + tier = 3, }, textproto = { @@ -2501,6 +2546,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@steelsojka' }, + requires = { 'ecma', 'jsx', 'typescript' }, }, turtle = { @@ -2527,6 +2573,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@steelsojka' }, + requires = { 'ecma' }, }, typespec = { @@ -2684,6 +2731,7 @@ M.configs = { branch = 'main', }, maintainers = { '@WhyNotHugo', '@lucario387' }, + requires = { 'html_tags' }, tier = 2, }, @@ -2737,6 +2785,7 @@ M.configs = { location = 'xml', }, maintainers = { '@ObserverOfTime' }, + requires = { 'dtd' }, tier = 2, }, diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua index dfd3e933f..497f1bc0f 100755 --- a/scripts/update-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -21,21 +21,12 @@ end) -- check for new revisions for _, v in ipairs(sorted_parsers) do - if skip_langs and not vim.list_contains(skip_langs, v.name) then - local sha ---@type string + if not vim.list_contains(skip_langs, v.name) and v.parser.install_info then + local cmd = 'git ls-remote ' .. v.parser.install_info.url if v.parser.install_info.branch then - sha = vim.split( - vim.fn.systemlist( - 'git ls-remote ' - .. v.parser.install_info.url - .. ' | grep refs/heads/' - .. v.parser.install_info.branch - )[1], - '\t' - )[1] - else - sha = vim.split(vim.fn.systemlist('git ls-remote ' .. v.parser.install_info.url)[1], '\t')[1] + cmd = cmd .. ' | grep refs/heads/' .. v.parser.install_info.branch end + local sha = vim.split(vim.fn.systemlist(cmd)[1], '\t')[1] lockfile[v.name] = { revision = sha } print(v.name .. ': ' .. sha) else @@ -43,5 +34,8 @@ for _, v in ipairs(sorted_parsers) do end end -lockfile = vim.fn.system('jq --sort-keys', vim.json.encode(lockfile)) +lockfile = vim.json.encode(lockfile) +if vim.fn.executable('jq') == 1 then + lockfile = vim.fn.system('jq --sort-keys', lockfile) +end util.write_file(filename, lockfile) diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index ded0d6bcb..2133ad0c6 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -23,14 +23,23 @@ local footnotes = '' for _, v in ipairs(sorted_parsers) do local p = v.parser -- language - generated_text = generated_text - .. '[' - .. v.name - .. '](' - .. p.install_info.url - .. ')' - .. (p.readme_note and '[^' .. v.name .. ']' or '') - .. ' | ' + if p.install_info then + generated_text = generated_text + .. '[' + .. v.name + .. '](' + .. p.install_info.url + .. ')' + .. (p.readme_note and '[^' .. v.name .. ']' or '') + .. ' | ' + else + generated_text = generated_text + .. v.name + .. ' (queries only)' + .. (p.readme_note and '[^' .. v.name .. ']' or '') + .. ' | ' + end + if p.readme_note then footnotes = footnotes .. '[^' .. v.name .. ']: ' .. p.readme_note .. '\n' end @@ -50,11 +59,13 @@ for _, v in ipairs(sorted_parsers) do -- CLI generated_text = generated_text - .. (p.install_info.requires_generate_from_grammar and '✓' or '') + .. (p.install_info and p.install_info.requires_generate_from_grammar and '✓' or '') .. ' | ' -- NPM - generated_text = generated_text .. (p.install_info.generate_requires_npm and '✓' or '') .. ' | ' + generated_text = generated_text + .. (p.install_info and p.install_info.generate_requires_npm and '✓' or '') + .. ' | ' -- Maintainer generated_text = generated_text From 37957d6bcf88999d41240f81610d29d48364c452 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 3 Jun 2023 12:08:14 +0200 Subject: [PATCH 011/434] refactor: use `vim.uv` --- .github/workflows/test-queries.yml | 1 - lua/nvim-treesitter/config.lua | 2 +- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/install.lua | 2 +- lua/nvim-treesitter/job.lua | 8 ++-- lua/nvim-treesitter/util.lua | 2 +- runtime/queries/bass/injections.scm | 3 -- scripts/check-queries.lua | 72 +++++++++++------------------ scripts/update-readme.lua | 10 ++-- 9 files changed, 40 insertions(+), 62 deletions(-) diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index bb11db3dc..3b1717791 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -52,7 +52,6 @@ jobs: env: CC: ${{ matrix.cc }} NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }} - ALLOWED_INSTALLATION_FAILURES: ${{ matrix.os == 'windows-latest' && 'rnoweb' }} steps: - uses: actions/checkout@v4 - uses: tree-sitter/setup-action/cli@v1 diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index c77ee1358..9d9e1d3af 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -62,7 +62,7 @@ end function M.get_install_dir(dir_name) local dir = vim.fs.joinpath(config.install_dir, dir_name) - if not vim.loop.fs_stat(dir) then + if not vim.uv.fs_stat(dir) then local ok, err = pcall(vim.fn.mkdir, dir, 'p', '0755') if not ok then local log = require('nvim-treesitter.log') diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 037887c59..3573e7f5a 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -104,7 +104,7 @@ local function install_health() end end - vim.health.start('OS Info:\n' .. vim.inspect(vim.loop.os_uname())) + vim.health.start('OS Info:\n' .. vim.inspect(vim.uv.os_uname())) end local function query_status(lang, query_group) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 3fba73db4..84bc99024 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,6 +1,6 @@ local api = vim.api local fs = vim.fs -local uv = vim.loop +local uv = vim.uv local a = require('nvim-treesitter.async') local config = require('nvim-treesitter.config') diff --git a/lua/nvim-treesitter/job.lua b/lua/nvim-treesitter/job.lua index 9c2788cb0..460a543bf 100644 --- a/lua/nvim-treesitter/job.lua +++ b/lua/nvim-treesitter/job.lua @@ -1,5 +1,5 @@ -- Interface with Neovim job control and provide a simple job sequencing structure -local uv = vim.loop +local uv = vim.uv local a = require('nvim-treesitter.async') local log = require('nvim-treesitter.log') @@ -18,8 +18,8 @@ local M = { JobResult = {}, Opts = {} } --- @field on_stderr fun(_: string) --- @field on_stdout fun(_: string) ---- Wrapper for vim.loop.spawn. Takes a command, options, and callback just like ---- vim.loop.spawn, but ensures that all output from the command has been +--- Wrapper for vim.uv.spawn. Takes a command, options, and callback just like +--- vim.uv.spawn, but ensures that all output from the command has been --- flushed before calling the callback. --- @param cmd string --- @param options uv.aliases.spawn_options @@ -66,7 +66,7 @@ end --- Main exposed function for the jobs module. Takes a task and options and --- returns an async function that will run the task with the given opts via ---- vim.loop.spawn +--- vim.uv.spawn --- @param task string[] --- @param opts JobOpts --- @param callback fun(_: JobResult) diff --git a/lua/nvim-treesitter/util.lua b/lua/nvim-treesitter/util.lua index 276eafdd7..3087e9422 100644 --- a/lua/nvim-treesitter/util.lua +++ b/lua/nvim-treesitter/util.lua @@ -1,4 +1,4 @@ -local uv = vim.loop +local uv = vim.uv local M = {} diff --git a/runtime/queries/bass/injections.scm b/runtime/queries/bass/injections.scm index 1c2fe3cc9..2f0e58eb6 100644 --- a/runtime/queries/bass/injections.scm +++ b/runtime/queries/bass/injections.scm @@ -1,5 +1,2 @@ ((comment) @injection.content (#set! injection.language "comment")) - -((block_comment) @injection.content - (#set! injection.language "comment")) diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index fd9d538ac..3f5a9aa70 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -39,6 +39,7 @@ local function do_check() local timings = {} local parsers = require('nvim-treesitter.config').installed_parsers() local query_types = require('nvim-treesitter.health').bundled_queries + local configs = require('nvim-treesitter.parsers').configs local captures = extract_captures() local errors = {} @@ -46,30 +47,32 @@ local function do_check() io_print('::group::Check parsers') for _, lang in pairs(parsers) do - timings[lang] = {} - for _, query_type in pairs(query_types) do - local before = vim.loop.hrtime() - local ok, query = pcall(vim.treesitter.query.get, lang, query_type) - local after = vim.loop.hrtime() - local duration = after - before - table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) - io_print( - 'Checking ' .. lang .. ' ' .. query_type .. string.format(' (%.02fms)', duration * 1e-6) - ) - if not ok then - local err_msg = lang .. ' (' .. query_type .. '): ' .. query - errors[#errors + 1] = err_msg - else - if query then - for _, capture in ipairs(query.captures) do - local is_valid = ( - vim.startswith(capture, '_') -- Helpers. - or vim.list_contains(captures[query_type], capture) - ) - if not is_valid then - local error = - string.format('(x) Invalid capture @%s in %s for %s.', capture, query_type, lang) - errors[#errors + 1] = error + if configs[lang].install_info then + timings[lang] = {} + for _, query_type in pairs(query_types) do + local before = vim.uv.hrtime() + local ok, query = pcall(vim.treesitter.query.get, lang, query_type) + local after = vim.uv.hrtime() + local duration = after - before + table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) + io_print( + 'Checking ' .. lang .. ' ' .. query_type .. string.format(' (%.02fms)', duration * 1e-6) + ) + if not ok then + local err_msg = lang .. ' (' .. query_type .. '): ' .. query + errors[#errors + 1] = err_msg + else + if query then + for _, capture in ipairs(query.captures) do + local is_valid = ( + vim.startswith(capture, '_') -- Helpers. + or vim.list_contains(captures[query_type], capture) + ) + if not is_valid then + local error = + string.format('(x) Invalid capture @%s in %s for %s.', capture, query_type, lang) + errors[#errors + 1] = error + end end end end @@ -90,27 +93,6 @@ local function do_check() end local ok, result = pcall(do_check) -local allowed_to_fail = vim.split(vim.env.ALLOWED_INSTALLATION_FAILURES or '', ',', true) - -for k, v in pairs(require('nvim-treesitter.parsers').configs) do - if v.install_info then - -- skip "query only" languages - if #vim.api.nvim_get_runtime_file('parser/' .. k .. '.*', false) == 0 then - -- On CI all parsers that can be installed from C files should be installed - if - vim.env.CI - and not v.install_info.requires_generate_from_grammar - and not vim.list_contains(allowed_to_fail, k) - then - io_print('Error: parser for ' .. k .. ' is not installed') - vim.cmd('cq') - else - io_print('Warning: parser for ' .. k .. ' is not installed') - end - end - end -end - if ok then io_print('::group::Timings') table.sort(result, function(a, b) diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index 2133ad0c6..fb9a9b32c 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -50,11 +50,11 @@ for _, v in ipairs(sorted_parsers) do -- queries generated_text = generated_text .. '`' - .. (vim.loop.fs_stat('runtime/queries/' .. v.name .. '/highlights.scm') and 'H' or ' ') - .. (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 ' ') + .. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/highlights.scm') and 'H' or ' ') + .. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/folds.scm') and 'F' or ' ') + .. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/indents.scm') and 'I' or ' ') + .. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/injections.scm') and 'J' or ' ') + .. (vim.uv.fs_stat('runtime/queries/' .. v.name .. '/locals.scm') and 'L' or ' ') .. '` | ' -- CLI From 5a70048116f8fb7489aa68e347d9dfe57dc39498 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Jun 2023 11:02:28 +0200 Subject: [PATCH 012/434] feat: drop `TSInstallInfo` in favor of better `checkhealth` also fixes the hole in install.compilers --- doc/nvim-treesitter.txt | 10 +-- lua/nvim-treesitter/health.lua | 104 ++++++++++++++++++-------------- lua/nvim-treesitter/install.lua | 39 +++--------- plugin/nvim-treesitter.lua | 4 -- 4 files changed, 70 insertions(+), 87 deletions(-) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index a7c6bfa69..8b530550c 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -31,7 +31,7 @@ Install the parser for your language To get a list of supported languages >vim - :TSInstallInfo + :TSInstall < To install supported parsers and queries, put this in your `init.lua` file: @@ -50,9 +50,10 @@ To install supported parsers and queries, put this in your `init.lua` file: -- List of parsers to ignore installing (for "core" etc.) ignore_install = { "javascript" }, + } < -See |nvim-treesitter-commands| for a list of all available commands. +To check installed parsers and queries, use `:checkhealth nvim-treesitter`. ============================================================================== COMMANDS *nvim-treesitter-commands* @@ -64,11 +65,6 @@ Install one or more treesitter parsers. You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to force the reinstallation of already installed parsers. - *:TSInstallInfo* -:TSInstallInfo ~ - -List information about currently installed parsers - *:TSUpdate* :TSUpdate {language} ... ~ diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 3573e7f5a..4d5e39c43 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -3,6 +3,7 @@ local parsers = require('nvim-treesitter.parsers') local config = require('nvim-treesitter.config') local util = require('nvim-treesitter.util') local tsq = vim.treesitter.query +local health = vim.health local M = {} @@ -22,89 +23,109 @@ local function ts_cli_version() end local function install_health() - vim.health.start('Installation') + health.start('Requirements') if vim.fn.has('nvim-0.10') ~= 1 then - vim.health.error('Nvim-treesitter requires Neovim Nightly') + health.error('Nvim-treesitter requires Neovim Nightly') end if vim.fn.executable('tree-sitter') == 0 then - vim.health.warn( + health.warn( '`tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar,' .. ' not required for :TSInstall)' ) else - vim.health.ok( + health.ok( '`tree-sitter` found ' .. (ts_cli_version() or '(unknown version)') - .. ' (parser generator, only needed for :TSInstallFromGrammar)' + .. ' (only needed for `:TSInstallFromGrammar`)' ) end if vim.fn.executable('node') == 0 then - vim.health.warn( - '`node` executable not found (only needed for :TSInstallFromGrammar,' - .. ' not required for :TSInstall)' - ) + health.warn('`node` executable not found (only needed for `:TSInstallFromGrammar`.') else local handle = assert(io.popen('node --version')) local result = handle:read('*a') handle:close() local version = vim.split(result, '\n')[1] - vim.health.ok('`node` found ' .. version .. ' (only needed for :TSInstallFromGrammar)') + health.ok('`node` found ' .. version .. ' (only needed for `:TSInstallFromGrammar`)') end if vim.fn.executable('git') == 0 then - vim.health.error('`git` executable not found.', { - 'Install it with your package manager.', - 'Check that your `$PATH` is set correctly.', - }) + health.error( + '`git` executable not found.', + 'Install it with your package manager and check that your `$PATH` is set correctly.' + ) else - vim.health.ok('`git` executable found.') + health.ok('`git` executable found.') end local cc = install.select_executable(install.compilers) if not cc then - vim.health.error('`cc` executable not found.', { + health.error('`cc` executable not found.', { 'Check that any of ' - .. vim.inspect(install.compilers) + .. table.concat(install.compilers, ', ') .. ' is in your $PATH' - .. ' or set the environment variable CC or `require"nvim-treesitter.install".compilers` explicitly!', + .. ' or set `$CC` or `require"nvim-treesitter.install".compilers` explicitly.', }) else local version = vim.fn.systemlist(cc .. (cc == 'cl' and '' or ' --version'))[1] - vim.health.ok( + health.ok( '`' .. cc - .. '` executable found. Selected from ' - .. vim.inspect(install.compilers) + .. '` 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 - vim.health.ok( + health.ok( 'Neovim was compiled with tree-sitter runtime ABI version ' .. vim.treesitter.language_version .. ' (required >=' .. NVIM_TREESITTER_MINIMUM_ABI - .. '). Parsers must be compatible with runtime ABI.' + .. ').' ) else - vim.health.error( + 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 are recent tree-sitter runtime when building' + .. '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 - vim.health.start('OS Info:\n' .. vim.inspect(vim.uv.os_uname())) + health.start('OS Info') + for k, v in pairs(vim.uv.os_uname()) do + health.info(k .. ': ' .. v) + end + + local installdir = config.get_install_dir('') + health.start('Install directory for parsers and queries') + health.info(installdir) + if vim.uv.fs_access(installdir, 'w') then + health.ok('is writable.') + else + health.error('is not writable.') + end + if + vim.iter(vim.api.nvim_list_runtime_paths()):any(function(p) + if installdir == p .. '/' then + return true + end + end) + then + health.ok('is in runtimepath.') + else + health.error('is not in runtimepath.') + end end local function query_status(lang, query_group) @@ -123,12 +144,13 @@ function M.check() local error_collection = {} -- Installation dependency checks install_health() + -- Parser installation checks + health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J') local languages = config.installed_parsers() - local parser_installation = { 'Parser/Features' .. string.rep(' ', 9) .. 'H L F I J' } for _, lang in pairs(languages) do local parser = parsers.configs[lang] - local out = ' - ' .. lang .. string.rep(' ', 20 - #lang) + local out = lang .. string.rep(' ', 22 - #lang) if parser.install_info then for _, query_group in pairs(M.bundled_queries) do local status, err = query_status(lang, query_group) @@ -145,35 +167,27 @@ function M.check() end end end - table.insert(parser_installation, vim.fn.trim(out, ' ', 2)) + health.info(vim.fn.trim(out, ' ', 2)) end - local legend = [[ + health.start(' Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[J]ections') - Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[J]ections - x) errors found in the query, try to run :TSUpdate {lang}]] - table.insert(parser_installation, legend) - -- Finally call the report function - vim.health.start(table.concat(parser_installation, '\n')) if #error_collection > 0 then - vim.health.start('The following errors have been detected:') + health.start('The following errors have been detected in query files:') for _, p in ipairs(error_collection) do - local lang, type, err = p[1], p[2], p[3] + local lang, type = p[1], p[2] local lines = {} - table.insert(lines, lang .. '(' .. type .. '): ' .. err) + table.insert(lines, lang .. '(' .. type .. '): ') local files = tsq.get_files(lang, type) if #files > 0 then - table.insert(lines, lang .. '(' .. type .. ') is concatenated from the following files:') for _, file in ipairs(files) do local query = util.read_file(file) - local ok, file_err = pcall(tsq.parse, lang, query) - if ok then - table.insert(lines, '| [OK]:"' .. file .. '"') - else - table.insert(lines, '| [ERR]:"' .. file .. '", failed to load: ' .. file_err) + local _, file_err = pcall(tsq.parse, lang, query) + if file_err then + table.insert(lines, file) end end end - vim.health.error(table.concat(lines, '\n')) + health.error(table.concat(lines, '')) end end end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 84bc99024..77242d730 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,4 +1,3 @@ -local api = vim.api local fs = vim.fs local uv = vim.uv @@ -38,7 +37,10 @@ local iswin = uv.os_uname().sysname == 'Windows_NT' local ismac = uv.os_uname().sysname == 'Darwin' --- @diagnostic disable-next-line:missing-parameter -M.compilers = { uv.os_getenv('CC'), 'cc', 'gcc', 'clang', 'cl', 'zig' } +M.compilers = { 'cc', 'gcc', 'clang', 'cl', 'zig' } +if uv.os_getenv('CC') then + table.insert(M.compilers, 1, uv.os_getenv('CC')) +end --- --- PARSER INFO @@ -104,31 +106,6 @@ local function needs_update(lang) return not revision or revision ~= get_installed_revision(lang) end -function M.info() - local installed = config.installed_parsers() - local parser_list = parsers.get_available() - - local max_len = 0 - for _, lang in pairs(parser_list) do - if #lang > max_len then - max_len = #lang - end - end - - for _, lang in pairs(parser_list) do - local parser = (lang .. string.rep(' ', max_len - #lang + 1)) - local output --- @type string[] - if vim.list_contains(installed, lang) then - output = { parser .. '[✓] installed', 'DiagnosticOk' } - elseif #api.nvim_get_runtime_file('parser/' .. lang .. '.*', true) > 0 then - output = { parser .. '[·] not installed (but available from runtimepath)', 'DiagnosticInfo' } - else - output = { parser .. '[✗] not installed' } - end - api.nvim_echo({ output }, false, {}) - end -end - --- --- PARSER MANAGEMENT FUNCTIONS --- @@ -157,7 +134,7 @@ end local function cc_err() log.error('No C compiler found! "' .. table.concat( - vim.tbl_filter( + vim.iter.filter( ---@param c string ---@return boolean function(c) @@ -328,11 +305,11 @@ end ---@param executables string[] ---@return string? function M.select_executable(executables) - return vim.tbl_filter( + return vim.iter.filter( ---@param c string ---@return boolean function(c) - return c ~= vim.NIL and vim.fn.executable(c) == 1 + return vim.fn.executable(c) == 1 end, executables )[1] @@ -378,7 +355,7 @@ local function select_compiler_args(repo, compiler) } if - #vim.tbl_filter( + #vim.iter.filter( --- @param file string --- @return boolean function(file) diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index fcf44d537..0bcbe07c3 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -18,10 +18,6 @@ local function complete_installed_parsers(arglead) end -- create user commands -api.nvim_create_user_command('TSInstallInfo', function() - require('nvim-treesitter.install').info() -end, { nargs = 0, desc = 'List available treesitter parsers' }) - api.nvim_create_user_command('TSInstall', function(args) require('nvim-treesitter.install').install(args.fargs, { force = args.bang }) end, { From 68508631deac327167874d9792a7e8ec03a498f1 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 6 Jun 2023 20:20:42 +0200 Subject: [PATCH 013/434] fix: expand tiers in ignore_install --- lua/nvim-treesitter/config.lua | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 9d9e1d3af..5a7c8e8ec 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -91,14 +91,12 @@ end function M.norm_languages(languages, skip) if not languages then return {} - end - local parsers = require('nvim-treesitter.parsers') - - -- Turn into table - if type(languages) == 'string' then + elseif type(languages) == 'string' then languages = { languages } end + local parsers = require('nvim-treesitter.parsers') + if vim.list_contains(languages, 'all') then if skip and skip.missing then return M.installed_parsers() @@ -107,18 +105,24 @@ function M.norm_languages(languages, skip) end --TODO(clason): skip and warn on unavailable parser - for i, tier in ipairs(parsers.tiers) do - if vim.list_contains(languages, tier) then - languages = vim.iter.filter(function(l) - return l ~= tier - end, languages) --[[@as string[] ]] - vim.list_extend(languages, parsers.get_available(i)) + -- keep local to avoid leaking parsers module + local function expand_tiers(list) + for i, tier in ipairs(parsers.tiers) do + if vim.list_contains(list, tier) then + list = vim.iter.filter(function(l) + return l ~= tier + end, list) --[[@as string[] ]] + vim.list_extend(list, parsers.get_available(i)) + end end + + return list end - --TODO(clason): support skipping tiers + languages = expand_tiers(languages) + if skip and skip.ignored then - local ignored = config.ignore_install + local ignored = expand_tiers(config.ignore_install) languages = vim.iter.filter(function(v) return not vim.list_contains(ignored, v) end, languages) --[[@as string[] ]] From c5152f3e8303d5cb241fc3eb3f339755719c45ad Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 7 Jun 2023 22:30:26 +0100 Subject: [PATCH 014/434] refactor: use vim.system (#4923) --- lua/nvim-treesitter/async.lua | 44 ++++++------ lua/nvim-treesitter/health.lua | 13 +--- lua/nvim-treesitter/install.lua | 73 ++++++++++--------- lua/nvim-treesitter/job.lua | 122 -------------------------------- lua/nvim-treesitter/parsers.lua | 2 +- scripts/update-lockfile.lua | 65 ++++++++++------- 6 files changed, 103 insertions(+), 216 deletions(-) delete mode 100644 lua/nvim-treesitter/job.lua diff --git a/lua/nvim-treesitter/async.lua b/lua/nvim-treesitter/async.lua index 57a670ef6..8a5e7c8af 100644 --- a/lua/nvim-treesitter/async.lua +++ b/lua/nvim-treesitter/async.lua @@ -3,15 +3,15 @@ local co = coroutine local M = {} ---Executes a future with a callback when it is done ---- @param func function ---- @param callback function ---- @param ... unknown +---@param func function +---@param callback function +---@param ... unknown local function execute(func, callback, ...) local thread = co.create(func) local function step(...) local ret = { co.resume(thread, ...) } - --- @type boolean, any + ---@type boolean, any local stat, nargs_or_err = unpack(ret) if not stat then @@ -31,7 +31,7 @@ local function execute(func, callback, ...) return end - --- @type function, any[] + ---@type function, any[] local fn, args = ret[3], { unpack(ret, 4, table.maxn(ret)) } args[nargs_or_err] = step fn(unpack(args, 1, nargs_or_err)) @@ -41,13 +41,15 @@ local function execute(func, callback, ...) end --- Creates an async function with a callback style function. ---- @generic F: function ---- @param func F ---- @param argc integer ---- @return F +---@generic F: function +---@param func F +---@param argc integer +---@return F function M.wrap(func, argc) - --- @param ... unknown - --- @return unknown + vim.validate('func', func, 'function') + vim.validate('argc', argc, 'number') + ---@param ... unknown + ---@return unknown return function(...) return co.yield(argc, func, ...) end @@ -56,10 +58,10 @@ end ---Use this to create a function which executes in an async context but ---called from a non-async context. Inherently this cannot return anything ---since it is non-blocking ---- @generic F: function ---- @param func async F ---- @param nargs? integer ---- @return F +---@generic F: function +---@param func async F +---@param nargs? integer +---@return F function M.sync(func, nargs) nargs = nargs or 0 return function(...) @@ -68,10 +70,10 @@ function M.sync(func, nargs) end end ---- @param n integer max number of concurrent jobs ---- @param interrupt_check? function ---- @param thunks function[] ---- @return any +---@param n integer max number of concurrent jobs +---@param interrupt_check? function +---@param thunks function[] +---@return any function M.join(n, interrupt_check, thunks) return co.yield(1, function(finish) if #thunks == 0 then @@ -81,7 +83,7 @@ function M.join(n, interrupt_check, thunks) local remaining = { select(n + 1, unpack(thunks)) } local to_go = #thunks - local ret = {} --- @type any[] + local ret = {} ---@type any[] local function cb(...) ret[#ret + 1] = { ... } @@ -104,7 +106,7 @@ end ---An async function that when called will yield to the Neovim scheduler to be ---able to call the API. ---- @type fun() +---@type fun() M.main = M.wrap(vim.schedule, 1) return M diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 4d5e39c43..099e766da 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -12,12 +12,7 @@ local NVIM_TREESITTER_MINIMUM_ABI = 13 ---@return string|nil local function ts_cli_version() if vim.fn.executable('tree-sitter') == 1 then - local handle = io.popen('tree-sitter -V') - if not handle then - return - end - local result = handle:read('*a') - handle:close() + local result = assert(vim.system({ 'tree-sitter', '-V' }):wait().stdout) return vim.split(result, '\n')[1]:match('[^tree%psitter ].*') end end @@ -45,9 +40,7 @@ local function install_health() if vim.fn.executable('node') == 0 then health.warn('`node` executable not found (only needed for `:TSInstallFromGrammar`.') else - local handle = assert(io.popen('node --version')) - local result = handle:read('*a') - handle:close() + local result = assert(vim.system({ 'node', '--version' }):wait().stdout) local version = vim.split(result, '\n')[1] health.ok('`node` found ' .. version .. ' (only needed for `:TSInstallFromGrammar`)') end @@ -70,7 +63,7 @@ local function install_health() .. ' or set `$CC` or `require"nvim-treesitter.install".compilers` explicitly.', }) else - local version = vim.fn.systemlist(cc .. (cc == 'cl' and '' or ' --version'))[1] + local version = assert(vim.system({ cc, cc == 'cl' and '' or '--version' }):wait().stdout) health.ok( '`' .. cc diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 77242d730..097a5ab0e 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -3,7 +3,6 @@ local uv = vim.uv local a = require('nvim-treesitter.async') local config = require('nvim-treesitter.config') -local job = require('nvim-treesitter.job') local log = require('nvim-treesitter.log') local parsers = require('nvim-treesitter.parsers') local util = require('nvim-treesitter.util') @@ -42,6 +41,20 @@ 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 SystemCompleted]] + a.main() + if r.stdout and r.stdout ~= '' then + log.trace('stdout -> %s', r.stdout) + end + if r.stderr and r.stderr ~= '' then + log.trace('stderr -> %s', r.stderr) + end + + return r +end + --- --- PARSER INFO --- @@ -156,24 +169,22 @@ local function do_generate_from_grammar(logger, repo, compile_location) end logger:info('Installing NPM dependencies') - local r = job.run({ 'npm', 'install' }, { cwd = compile_location }) - a.main() - if r.exit_code > 0 then + local r = system({ 'npm', 'install' }, { cwd = compile_location }) + if r.code > 0 then logger:error('Error during `npm install`') end end logger:info('Generating source files from grammar.js...') - local r = job.run({ + local r = system({ vim.fn.exepath('tree-sitter'), 'generate', '--no-bindings', '--abi', tostring(vim.treesitter.language_version), }, { cwd = compile_location }) - a.main() - if r.exit_code > 0 then + if r.code > 0 then logger:error('Error during "tree-sitter generate"') end end @@ -201,7 +212,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, local target = is_github and url .. '/archive/' .. revision .. '.tar.gz' or url .. '/-/archive/' .. revision .. '/' .. project_name .. '-' .. revision .. '.tar.gz' - local r = job.run({ + local r = system({ 'curl', '--silent', '--show-error', @@ -212,11 +223,8 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, }, { cwd = cache_dir, }) - a.main() - if r.exit_code > 0 then - logger:error( - 'Error during download, please verify your internet connection: ' .. vim.inspect(r.stderr) - ) + if r.code > 0 then + logger:error('Error during download, please verify your internet connection: %s', r.stderr) end logger:debug('Creating temporary directory: ' .. temp_dir) @@ -228,7 +236,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, end logger:info('Extracting ' .. project_name .. '...') - r = job.run({ + r = system({ 'tar', '-xzf', project_name .. '.tar.gz', @@ -238,14 +246,13 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, cwd = cache_dir, }) - a.main() - if r.exit_code > 0 then - logger:error('Error during tarball extraction: ' .. vim.inspect(r.stderr)) + if r.code > 0 then + logger:error('Error during tarball extraction: %s', r.stderr) end err = uv_unlink(project_dir .. '.tar.gz') if err then - logger:error('Could not remove tarball: ' .. err) + logger:error('Could not remove tarball: %s', err) end a.main() @@ -253,7 +260,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, a.main() if err then - logger:error('Could not rename temp: ' .. err) + logger:error('Could not rename temp: %s', err) end util.delete(temp_dir) @@ -268,7 +275,7 @@ end local function do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) logger:info('Downloading ' .. project_name .. '...') - local r = job.run({ + local r = system({ 'git', 'clone', '--filter=blob:none', @@ -278,16 +285,12 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision, cwd = cache_dir, }) - a.main() - - if r.exit_code > 0 then - logger:error( - 'Error during download, please verify your internet connection: ' .. vim.inspect(r.stderr) - ) + if r.code > 0 then + logger:error('Error during download, please verify your internet connection: ' .. r.stderr) end logger:info('Checking out locked revision') - r = job.run({ + r = system({ 'git', 'checkout', revision, @@ -295,10 +298,8 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision, cwd = project_dir, }) - a.main() - - if r.exit_code > 0 then - logger:error('Error while checking out revision: ' .. vim.inspect(r.stderr)) + if r.code > 0 then + logger:error('Error while checking out revision: %s', r.stderr) end end @@ -388,7 +389,7 @@ end ---@param repo InstallInfo ---@param cc string ---@param compile_location string ----@return JobResult +---@return SystemCompleted local function do_compile(repo, cc, compile_location) local make = M.select_executable({ 'gmake', 'make' }) @@ -404,9 +405,7 @@ local function do_compile(repo, cc, compile_location) } end - local r = job.run(cmd, { cwd = compile_location }) - a.main() - return r + return system(cmd, { cwd = compile_location }) end ---@param lang string @@ -478,8 +477,8 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g logger:info('Compiling parser') local r = do_compile(repo, cc, compile_location) - if r.exit_code > 0 then - logger:error('Error during compilation: ' .. vim.inspect(r.stderr)) + if r.code > 0 then + logger:error('Error during compilation: %s', r.stderr) end local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' diff --git a/lua/nvim-treesitter/job.lua b/lua/nvim-treesitter/job.lua deleted file mode 100644 index 460a543bf..000000000 --- a/lua/nvim-treesitter/job.lua +++ /dev/null @@ -1,122 +0,0 @@ --- Interface with Neovim job control and provide a simple job sequencing structure -local uv = vim.uv -local a = require('nvim-treesitter.async') -local log = require('nvim-treesitter.log') - -local M = { JobResult = {}, Opts = {} } - ---- @class JobResult ---- @field exit_code integer ---- @field signal integer | string ---- @field stdout string[] ---- @field stderr string[] - ---- @class JobOpts ---- @field cwd string ---- @field timeout integer ---- @field env string[] ---- @field on_stderr fun(_: string) ---- @field on_stdout fun(_: string) - ---- Wrapper for vim.uv.spawn. Takes a command, options, and callback just like ---- vim.uv.spawn, but ensures that all output from the command has been ---- flushed before calling the callback. ---- @param cmd string ---- @param options uv.aliases.spawn_options ---- @param callback fun(exit_code: integer, signal: integer|string) -local function spawn(cmd, options, callback) - local handle --- @type uv_process_t? - local timer --- @type uv_timer_t - log.trace('running job: (cwd=%s) %s %s', options.cwd, cmd, table.concat(options.args, ' ')) - handle = uv.spawn(cmd, options, function(exit_code, signal) - ---@cast handle -nil - - handle:close() - if timer then - timer:stop() - timer:close() - end - - callback(exit_code, signal) - end) - - --- @type integer? - --- @diagnostic disable-next-line:undefined-field - local timeout = options.timeout - - if timeout then - timer = assert(uv.new_timer()) - timer:start(timeout, 0, function() - timer:stop() - timer:close() - if handle and handle:is_active() then - log.warn('Killing %s due to timeout!', cmd) - handle:kill('sigint') - handle:close() - for _, pipe in - pairs(options.stdio --[[@as uv_pipe_t[] ]]) - do - pipe:close() - end - callback(-9999, 'sigint') - end - end) - end -end - ---- Main exposed function for the jobs module. Takes a task and options and ---- returns an async function that will run the task with the given opts via ---- vim.uv.spawn ---- @param task string[] ---- @param opts JobOpts ---- @param callback fun(_: JobResult) ---- @type fun(task: string|string[], opts: JobOpts): JobResult -M.run = a.wrap(function(task, opts, callback) - local stdout_data = {} - local stderr_data = {} - - local stdout = assert(uv.new_pipe(false)) - local stderr = assert(uv.new_pipe(false)) - - spawn(task[1], { - args = { unpack(task, 2) }, - stdio = { nil, stdout, stderr }, - cwd = opts.cwd, - timeout = opts.timeout and 1000 * opts.timeout or nil, - env = opts.env, - hide = true, - }, function(exit_code, signal) - callback({ - exit_code = exit_code, - signal = signal, - stdout = stdout_data, - stderr = stderr_data, - }) - end) - - for kind, pipe in pairs({ stdout = stdout, stderr = stderr }) do - pipe:read_start(function(err, data) - if kind == 'stderr' and opts.on_stderr and data then - opts.on_stderr(data) - end - if kind == 'stdout' and opts.on_stdout and data then - opts.on_stdout(data) - end - if data then - log.trace('%s -> %s', kind, data) - end - if err then - log.error(err) - end - if data ~= nil then - local output = kind == 'stdout' and stdout_data or stderr_data - table.insert(output, vim.trim(data)) - else - pipe:read_stop() - pipe:close() - end - end) - end -end, 3) - -return M diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3a9a36aaf..357d11650 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -20,7 +20,7 @@ local M = {} M.tiers = { 'core', 'stable', 'community', 'unstable' } ----@type ParserInfo[] +---@type table M.configs = { ada = { install_info = { diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua index 497f1bc0f..e07cf416f 100755 --- a/scripts/update-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -4,38 +4,53 @@ local util = require('nvim-treesitter.util') -- Load previous lockfile local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') -local lockfile = vim.json.decode(util.read_file(filename)) +-- local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] ----@type string? -local skip_lang_string = os.getenv('LOCKFILE_SKIP') -local skip_langs = skip_lang_string and vim.split(skip_lang_string, ',') or {} -vim.print('Skipping languages: ', skip_langs) +---@type table +local new_lockfile = {} -local sorted_parsers = {} -for k, v in pairs(require('nvim-treesitter.parsers').configs) do - table.insert(sorted_parsers, { name = k, parser = v }) -end -table.sort(sorted_parsers, function(a, b) - return a.name < b.name -end) +local parsers = require('nvim-treesitter.parsers').configs + +local jobs = {} --- @type table -- check for new revisions -for _, v in ipairs(sorted_parsers) do - if not vim.list_contains(skip_langs, v.name) and v.parser.install_info then - local cmd = 'git ls-remote ' .. v.parser.install_info.url - if v.parser.install_info.branch then - cmd = cmd .. ' | grep refs/heads/' .. v.parser.install_info.branch - end - local sha = vim.split(vim.fn.systemlist(cmd)[1], '\t')[1] - lockfile[v.name] = { revision = sha } - print(v.name .. ': ' .. sha) +for k, p in pairs(parsers) do + if not p.install_info then + print('Skipping ' .. k) else - print('Skipping ' .. v.name) + jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) + end + + if #vim.tbl_keys(jobs) % 100 == 0 or next(parsers, k) == nil then + for name, job in pairs(jobs) do + local stdout = vim.split(job:wait().stdout, '\n') + jobs[name] = nil + + local branch = parsers[name].install_info.branch + + local line = 1 + if branch then + for j, l in ipairs(stdout) do + if l:find(vim.pesc(branch)) then + line = j + break + end + end + end + + local sha = vim.split(stdout[line], '\t')[1] + new_lockfile[name] = { revision = sha } + print(name .. ': ' .. sha) + end end end -lockfile = vim.json.encode(lockfile) +assert(#vim.tbl_keys(jobs) == 0) + +local lockfile_json = vim.json.encode(new_lockfile) --[[@as string]] if vim.fn.executable('jq') == 1 then - lockfile = vim.fn.system('jq --sort-keys', lockfile) + lockfile_json = + assert(vim.system({ 'jq', '--sort-keys' }, { stdin = lockfile_json }):wait().stdout) end -util.write_file(filename, lockfile) + +util.write_file(filename, lockfile_json) From f0a984347c0e9c1e6efc493bbfb9b062041a9855 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 8 Jun 2023 13:25:31 +0200 Subject: [PATCH 015/434] feat!: drop makefile support, norg parser Norg install_info and queries are maintained by neorg. All other parsers are compatible with C++11, so fix that as standard. (Can be bumped if all supported platforms support C++14.) Remove Makefile support, as it's no longer needed. --- README.md | 1 + SUPPORTED_LANGUAGES.md | 1 - TODO.md | 1 - lockfile.json | 3 -- lua/nvim-treesitter/install.lua | 15 ++------- lua/nvim-treesitter/parsers.lua | 11 ------- scripts/compile_parsers.makefile | 52 -------------------------------- 7 files changed, 3 insertions(+), 81 deletions(-) delete mode 100644 scripts/compile_parsers.makefile diff --git a/README.md b/README.md index 523940b63..4f2970883 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ If Neovim does not detect your language's filetype by default, you can use [Neov You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`. Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`. +**Note:** Parsers using external scanner need to be written in C. C++ scanners are no longer supported. ## Adding queries diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 18780fd6f..0dd2c1e9f 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -168,7 +168,6 @@ jsx (queries only)[^jsx] | | `HFIJ ` | | | @steelsojka [nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | community | `H  J ` | | | @aMOPel [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 [objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J ` | | | @ColinKennedy diff --git a/TODO.md b/TODO.md index fbca7f499..bf817fc4b 100644 --- a/TODO.md +++ b/TODO.md @@ -7,7 +7,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [ ] **`query_predicates.lua`:** upstream/remove - [ ] **`parsers.lua`:** assign tiers - [ ] **`parsers.lua`:** modularize? -- [ ] **`install.lua`:** drop norg (and makefile); document c++11 requirement - [ ] **`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? diff --git a/lockfile.json b/lockfile.json index 3f87966c6..4967a911c 100644 --- a/lockfile.json +++ b/lockfile.json @@ -527,9 +527,6 @@ "nix": { "revision": "cfc53fd287d23ab7281440a8526c73542984669b" }, - "norg": { - "revision": "d89d95af13d409f30a6c7676387bde311ec4a2c8" - }, "nqc": { "revision": "14e6da1627aaef21d2b2aa0c37d04269766dcc1d" }, diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 097a5ab0e..9f99f0cfe 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -391,19 +391,8 @@ end ---@param compile_location string ---@return SystemCompleted local function do_compile(repo, cc, compile_location) - local make = M.select_executable({ 'gmake', 'make' }) - - local cmd --- @type string[] - if cc:find('cl$') or cc:find('cl.exe$') or not repo.use_makefile or iswin or not make then - local args = vim.tbl_flatten(select_compiler_args(repo, cc)) - cmd = vim.list_extend({ cc }, args) - else - cmd = { - make, - '--makefile=' .. M.get_package_path('scripts', 'compile_parsers.makefile'), - 'CC=' .. cc, - } - end + local args = vim.tbl_flatten(select_compiler_args(repo, cc)) + local cmd = vim.list_extend({ cc }, args) return system(cmd, { cwd = compile_location }) end diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 357d11650..7f0041e36 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -6,7 +6,6 @@ ---@field generate_requires_npm boolean|nil ---@field requires_generate_from_grammar boolean|nil ---@field location string|nil ----@field use_makefile boolean|nil ---@class ParserInfo ---@field install_info InstallInfo @@ -1583,16 +1582,6 @@ M.configs = { maintainers = { '@leo60228' }, }, - norg = { - install_info = { - url = 'https://github.com/nvim-neorg/tree-sitter-norg', - files = { 'src/parser.c', 'src/scanner.cc' }, - use_makefile = true, - }, - maintainers = { '@JoeyGrajciar', '@vhyrro' }, - tier = 4, - }, - nqc = { install_info = { url = 'https://github.com/amaanq/tree-sitter-nqc', diff --git a/scripts/compile_parsers.makefile b/scripts/compile_parsers.makefile deleted file mode 100644 index 020b45285..000000000 --- a/scripts/compile_parsers.makefile +++ /dev/null @@ -1,52 +0,0 @@ -CFLAGS ?= -Os -std=c99 -fPIC -CXX_STANDARD ?= c++14 -CXXFLAGS ?= -Os -std=$(CXX_STANDARD) -fPIC -LDFLAGS ?= -SRC_DIR ?= ./src -DEST_DIR ?= ./dest - -ifeq ($(OS),Windows_NT) - SHELL := powershell.exe - .SHELLFLAGS := -NoProfile -command - CP := Copy-Item -Recurse -ErrorAction SilentlyContinue - MKDIR := New-Item -ItemType directory -ErrorAction SilentlyContinue - TARGET := parser.dll - rmf = Write-Output $(1) | foreach { if (Test-Path $$_) { Remove-Item -Force } } -else - CP := cp - MKDIR := mkdir -p - TARGET := parser.so - rmf = rm -rf $(1) -endif - -ifneq ($(wildcard $(SRC_DIR)/*.cc),) - LDFLAGS += -lstdc++ -endif - -OBJECTS := parser.o - -ifneq ($(wildcard $(SRC_DIR)/scanner.*),) - OBJECTS += scanner.o -endif - -all: $(TARGET) - -$(TARGET): $(OBJECTS) - $(CC) $(OBJECTS) -o $(TARGET) -shared $(LDFLAGS) - -%.o: $(SRC_DIR)/%.c - $(CC) -c $(CFLAGS) -I$(SRC_DIR) -o $@ $< - -%.o: $(SRC_DIR)/%.cc - $(CC) -c $(CXXFLAGS) -I$(SRC_DIR) -o $@ $< - -clean: - $(call rmf,$(TARGET) $(OBJECTS)) - -$(DEST_DIR): - @$(MKDIR) $(DEST_DIR) - -install: $(TARGET) $(DEST_DIR) - $(CP) $(TARGET) $(DEST_DIR)/ - -.PHONY: clean From bae77b87b1262ff101b06f9a8de0b2049edcefa1 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 10 Jun 2023 17:12:35 +0200 Subject: [PATCH 016/434] feat: add parser tiers Tier 1: Stable Tier 2: Core (maintained by org members) Tier 3: Community (maintained by external contributors, to varying degree) Tier 4: Unsupported (lacking active maintainer or declared experimental); skipped in lockfile update and ignored for automatic install by default --- README.md | 4 +- SUPPORTED_LANGUAGES.md | 445 ++++++++++++++++---------------- TODO.md | 7 +- lua/nvim-treesitter/config.lua | 2 +- lua/nvim-treesitter/install.lua | 7 +- lua/nvim-treesitter/parsers.lua | 179 +++++++++++-- scripts/update-lockfile.lua | 7 +- 7 files changed, 397 insertions(+), 254 deletions(-) diff --git a/README.md b/README.md index 4f2970883..48857e877 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ require('lazy').setup( ```lua require'nvim-treesitter'.setup { - -- A list of parser names or tiers ('core', 'stable', 'community', 'unstable') + -- A list of parser names or tiers ('stable', 'core', 'community', 'unsupported') ensure_install = { }, -- List of parsers to ignore installing - ignore_install = { }, + ignore_install = { 'unsupported' }, -- Automatically install missing parsers when entering buffer auto_install = false, diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 0dd2c1e9f..dea60f0b4 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -3,7 +3,7 @@ The following is a list of languages for which a parser can be installed through `:TSInstall`. Legend: -- **Tier:** _core_, _stable_, _community_, or _unstable_ +- **Tier:** _stable_, _core_, _community_, or _unsupported_ - **CLI:** `:TSInstall` requires `tree-sitter` CLI installed - **NPM:** `:TSInstallFromGrammar` requires `node` installed - **Queries** available for **H**ighlights, **I**ndents, **F**olds, In**J**ections, **L**ocals @@ -12,287 +12,286 @@ Legend: Language | Tier | Queries | CLI | NPM | Maintainer -------- |:----:|:-------:|:---:|:---:| ---------- -[ada](https://github.com/briot/tree-sitter-ada) | | `HF  L` | | | @briot -[agda](https://github.com/tree-sitter/tree-sitter-agda) | | `HF   ` | | | @Decodetalkers -[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJL` | | ✓ | @dlvandenberg +[ada](https://github.com/briot/tree-sitter-ada) | community | `HF  L` | | | @briot +[agda](https://github.com/tree-sitter/tree-sitter-agda) | community | `HF   ` | | | @Decodetalkers +[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unsupported | `HFIJL` | | ✓ | @dlvandenberg [apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  L` | | | @aheber -[arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) | | `HFIJL` | | | @ObserverOfTime +[arduino](https://github.com/ObserverOfTime/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) | | `HFIJL` | | | @virchau13 +[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) | | `H  J ` | | | -[bash](https://github.com/tree-sitter/tree-sitter-bash) | | `HF JL` | | | @TravonteD -[bass](https://github.com/vito/tree-sitter-bass) | | `HFIJL` | | | @amaanq -[beancount](https://github.com/polarmutex/tree-sitter-beancount) | | `HF J ` | | | @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` | | | @NoahTheDuke -[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 +[awk](https://github.com/Beaglefoot/tree-sitter-awk) | unsupported | `H  J ` | | | +[bash](https://github.com/tree-sitter/tree-sitter-bash) | community | `HF JL` | | | @TravonteD +[bass](https://github.com/vito/tree-sitter-bass) | core | `HFIJL` | | | @amaanq +[beancount](https://github.com/polarmutex/tree-sitter-beancount) | community | `HF J ` | | | @polarmutex +[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | core | `HFI  ` | | | @theHamsta, @clason +[bicep](https://github.com/amaanq/tree-sitter-bicep) | core | `HFIJL` | | | @amaanq +[bitbake](https://github.com/amaanq/tree-sitter-bitbake) | core | `HFIJL` | | | @amaanq +[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) | 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) | community | `HF JL` | | | @Luxed +[cairo](https://github.com/amaanq/tree-sitter-cairo) | core | `HFIJL` | | | @amaanq +[capnp](https://github.com/amaanq/tree-sitter-capnp) | core | `HFIJL` | | | @amaanq +[chatito](https://github.com/ObserverOfTime/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) | unsupported | `HFI  ` | | | @uyha +[comment](https://github.com/stsewd/tree-sitter-comment) | core | `H    ` | | | @stsewd +[commonlisp](https://github.com/theHamsta/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/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/gdamore/tree-sitter-d) | stable | `HFIJL` | | | @amaanq -[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 +[cpon](https://github.com/amaanq/tree-sitter-cpon) | core | `HFIJL` | | | @amaanq +[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | stable | `HFIJL` | | ✓ | @theHamsta +[css](https://github.com/tree-sitter/tree-sitter-css) | community | `HFIJ ` | | | @TravonteD +[csv](https://github.com/amaanq/tree-sitter-csv) | core | `H    ` | | | @amaanq +[cuda](https://github.com/theHamsta/tree-sitter-cuda) | core | `HFIJL` | | ✓ | @theHamsta +[cue](https://github.com/eonpatapon/tree-sitter-cue) | core | `HFIJL` | | | @amaanq +[d](https://github.com/gdamore/tree-sitter-d) | core | `HFIJL` | | | @amaanq +[dart](https://github.com/UserNobody14/tree-sitter-dart) | unsupported | `HFIJL` | | | @akinsho +[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | community | `HFIJL` | | | @jedrzejboczar +[dhall](https://github.com/jbellerb/tree-sitter-dhall) | core | `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) | | `H  J ` | | | @camdencheek -[dot](https://github.com/rydesun/tree-sitter-dot) | | `H IJ ` | | | @rydesun -[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ ` | | | @amaanq -[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HF JL` | | | @ObserverOfTime +[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/amaanq/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) | unstable | `H    ` | | | @RubixDev -ecma (queries only)[^ecma] | | `HFIJL` | | | @steelsojka +[ebnf](https://github.com/RubixDev/ebnf) | unsupported | `H    ` | | | @RubixDev +ecma (queries only)[^ecma] | core | `HFIJL` | | | @steelsojka [eds](https://github.com/uyha/tree-sitter-eds) | community | `HF   ` | | | @uyha -[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) | unstable | `H  J ` | | | -[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `HF   ` | | | @filmor +[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) | unsupported | `H  J ` | | | @zweimach +[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | core | `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) | | `HF JL` | | ✓ | @alexmozaidze +[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/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 +[firrtl](https://github.com/amaanq/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) | core | `HFIJL` | | | @amaanq +[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | core | `HFI  ` | | | @amaanq +[fsh](https://github.com/mgramigna/tree-sitter-fsh) | community | `H    ` | | | @mgramigna +[func](https://github.com/amaanq/tree-sitter-func) | core | `H    ` | | | @amaanq +[fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) | 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)[^git_config] | | `HF J ` | | | @amaanq -[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | | `H  J ` | | | @gbprod -[gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) | | `H  JL` | | | @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 -[gn](https://github.com/amaanq/tree-sitter-gn) | stable | `HFIJL` | | | @amaanq +[git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | core | `HF J ` | | | @amaanq +[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | community | `H  J ` | | | @gbprod +[gitattributes](https://github.com/ObserverOfTime/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) | core | `H    ` | | | @theHamsta +[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | core | `HFIJL` | | | @amaanq +[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | community | `HFI L` | | | @NullVoxPopuli +[glsl](https://github.com/theHamsta/tree-sitter-glsl) | core | `HFIJL` | | ✓ | @theHamsta +[gn](https://github.com/amaanq/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) | | `HFIJL` | | | @theHamsta, @WinWisely268 -[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | | `HF JL` | | | @pierpo -[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | | `H  J ` | | | @camdencheek -[gosum](https://github.com/amaanq/tree-sitter-go-sum) | | `H    ` | | | @amaanq +[go](https://github.com/tree-sitter/tree-sitter-go) | stable | `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/amaanq/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) | | `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 +[gowork](https://github.com/omertuc/tree-sitter-go-work) | community | `H  J ` | | | @omertuc +[gpg](https://github.com/ObserverOfTime/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/theHamsta/tree-sitter-gstlaunch) | stable | `H    ` | | | @theHamsta -[hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H    ` | | | -[hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJL` | | | @amaanq +[gstlaunch](https://github.com/theHamsta/tree-sitter-gstlaunch) | core | `H    ` | | | @theHamsta +[hack](https://github.com/slackhq/tree-sitter-hack) | unsupported | `H    ` | | | +[hare](https://github.com/amaanq/tree-sitter-hare) | core | `HFIJL` | | | @amaanq [haskell](https://github.com/tree-sitter/tree-sitter-haskell) | community | `HF J ` | | | @mrcjkb -[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 +[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | community | `HF   ` | | | @lykahb +[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | community | `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) | | `HFIJL` | | ✓ | @winston0410 -[hlsl](https://github.com/theHamsta/tree-sitter-hlsl) | | `HFIJL` | | ✓ | @theHamsta +[hjson](https://github.com/winston0410/tree-sitter-hjson) | community | `HFIJL` | | ✓ | @winston0410 +[hlsl](https://github.com/theHamsta/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) | | `HF 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 -html_tags (queries only)[^html_tags] | | `H IJ ` | | | @TravonteD -[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | | | @ObserverOfTime -[http](https://github.com/rest-nvim/tree-sitter-http) | | `H  J ` | | | @amaanq, @NTBBloodbath +[hocon](https://github.com/antosha417/tree-sitter-hocon) | unsupported | `HF J ` | | ✓ | @antosha417 +[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unsupported | `HF  L` | | | @urbit-pilled +[html](https://github.com/tree-sitter/tree-sitter-html) | community | `HFIJL` | | | @TravonteD +html_tags (queries only)[^html_tags] | community | `H IJ ` | | | @TravonteD +[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unsupported | `HFIJ ` | | | @ObserverOfTime +[http](https://github.com/rest-nvim/tree-sitter-http) | core | `H  J ` | | | @amaanq, @NTBBloodbath [hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj [hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) | community | `HFIJ ` | | | @luckasRanarison [idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J ` | | | @cathaysa -[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF   ` | | | @theHamsta +[ini](https://github.com/justinmk/tree-sitter-ini) | unsupported | `HF   ` | | | @theHamsta [inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | | | @yorickpeterse -[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  JL` | | | @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) | | `HFIJL` | | ✓ | @WhyNotHugo -[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF  L` | | | @nawordar -jsx (queries only)[^jsx] | | `HFIJ ` | | | @steelsojka -[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | | | @theHamsta +[ispc](https://github.com/fab4100/tree-sitter-ispc) | community | `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) | community | `HFIJL` | | | @p00f +[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | core | `HFIJL` | | | @steelsojka +[jq](https://github.com/flurie/tree-sitter-jq) | core | `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.git) | community | `HFIJL` | | ✓ | @WhyNotHugo +[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | community | `HF  L` | | | @nawordar +jsx (queries only)[^jsx] | core | `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/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 +[kconfig](https://github.com/amaanq/tree-sitter-kconfig) | core | `HFIJL` | | | @amaanq +[kdl](https://github.com/amaanq/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) | | `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 +[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | community | `H  JL` | | | @traxys +[latex](https://github.com/latex-lsp/tree-sitter-latex) | core | `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/amaanq/tree-sitter-linkerscript) | stable | `HFIJL` | | | @amaanq +[linkerscript](https://github.com/amaanq/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) | | `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) | | `HFIJ ` | | | @Decodetalkers -[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H   L` | ✓ | | @artagnon +[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | community | `H    ` | | | @benwilliamgraham +[lua](https://github.com/MunifTanjim/tree-sitter-lua) | stable | `HFIJL` | | | @muniftanjim +[luadoc](https://github.com/amaanq/tree-sitter-luadoc) | core | `H    ` | | | @amaanq +[luap](https://github.com/amaanq/tree-sitter-luap)[^luap] | core | `H    ` | | | @amaanq +[luau](https://github.com/amaanq/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) | core | `HF J ` | | | @lewis6991 +[markdown](https://github.com/MDeiml/tree-sitter-markdown)[^markdown] | stable | `HFIJ ` | | | @MDeiml +[markdown_inline](https://github.com/MDeiml/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/Decodetalkers/tree-sitter-meson) | community | `HFIJ ` | | | @Decodetalkers +[mlir](https://github.com/artagnon/tree-sitter-mlir) | unsupported | `H   L` | ✓ | | @artagnon [muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | | @Freed-Wu -[nasm](https://github.com/naclsn/tree-sitter-nasm) | stable | `H  J ` | | | @ObserverOfTime -[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unstable | `H I  ` | | | +[nasm](https://github.com/naclsn/tree-sitter-nasm) | core | `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) | | `HFI  ` | | | @alemuller -[nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF JL` | | | @leo60228 -[nqc](https://github.com/amaanq/tree-sitter-nqc) | stable | `HFIJL` | | | @amaanq -[objc](https://github.com/amaanq/tree-sitter-objc) | | `HFIJL` | | | @amaanq +[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/amaanq/tree-sitter-nqc) | core | `HFIJL` | | | @amaanq +[objc](https://github.com/amaanq/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) | | `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) | unstable | `     ` | | | -[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/tree-sitter-perl/tree-sitter-perl) | | `HF J ` | | | @RabbiVeesh, @LeoNerd -[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | | `HFIJL` | | | @tk-shirasaka -[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | | `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 +[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | community | `HFIJL` | | | @undu +[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | community | `HFIJL` | | | @undu +[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | ✓ | | @undu +[odin](https://github.com/amaanq/tree-sitter-odin) | core | `HFIJL` | | | @amaanq +[org](https://github.com/milisims/tree-sitter-org) | unsupported | `     ` | | | +[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | community | `HFIJL` | | | @Isopod +[passwd](https://github.com/ath3/tree-sitter-passwd) | community | `H    ` | | | @amaanq +[pem](https://github.com/ObserverOfTime/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] | community | `HFIJL` | | | @tk-shirasaka +[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | community | `HFIJL` | | | @tk-shirasaka +[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unsupported | `H    ` | | ✓ | @mikehaertl +[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | community | `H  J ` | | | @leo60228 +[po](https://github.com/erasin/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/ObserverOfTime/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | | | @ObserverOfTime -[pony](https://github.com/amaanq/tree-sitter-pony) | | `HFIJL` | | | @amaanq, @mfelsche -[printf](https://github.com/ObserverOfTime/tree-sitter-printf) | stable | `H    ` | | | @ObserverOfTime -[prisma](https://github.com/victorhqc/tree-sitter-prisma) | | `HF   ` | | | @elianiva -[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J ` | | | @MichaHoffmann -[properties](https://github.com/ObserverOfTime/tree-sitter-properties)[^properties] | stable | `H  JL` | | | @ObserverOfTime -[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 +[poe_filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter)[^poe_filter] | unsupported | `HFIJ ` | | | @ObserverOfTime +[pony](https://github.com/amaanq/tree-sitter-pony) | core | `HFIJL` | | | @amaanq, @mfelsche +[printf](https://github.com/ObserverOfTime/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) | unsupported | `H  J ` | | | @MichaHoffmann +[properties](https://github.com/ObserverOfTime/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) | core | `H  J ` | | | @matthias-Q +[psv](https://github.com/amaanq/tree-sitter-csv) | core | `H    ` | | | @amaanq +[pug](https://github.com/zealot128/tree-sitter-pug) | unsupported | `H  J ` | | | @zealot128 +[puppet](https://github.com/amaanq/tree-sitter-puppet) | core | `HFIJL` | | | @amaanq [purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  JL` | | | @postsolar -[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 J ` | | | @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) | | `HFIJL` | | | @Fymyte +[pymanifest](https://github.com/ObserverOfTime/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) | community | `HFIJL` | | | @pwntester +[qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) | core | `H  J ` | | | @amaanq +[qmljs](https://github.com/yuja/tree-sitter-qmljs) | community | `HF J ` | | | @Decodetalkers +[query](https://github.com/nvim-treesitter/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/amaanq/tree-sitter-re2c) | stable | `HFIJL` | | | @amaanq +[re2c](https://github.com/amaanq/tree-sitter-re2c) | core | `HFIJL` | | | @amaanq [readline](https://github.com/ribru17/tree-sitter-readline) | community | `HFIJ ` | | | @ribru17 -[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 +[regex](https://github.com/tree-sitter/tree-sitter-regex) | stable | `H    ` | | | @theHamsta +[rego](https://github.com/FallenAngel97/tree-sitter-rego) | community | `H  J ` | | | @FallenAngel97 +[requirements](https://github.com/ObserverOfTime/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/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 +[ron](https://github.com/amaanq/tree-sitter-ron) | core | `HFIJL` | | | @amaanq +[rst](https://github.com/stsewd/tree-sitter-rst) | core | `H  JL` | | | @stsewd +[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | community | `HFIJL` | | | @TravonteD +[rust](https://github.com/tree-sitter/tree-sitter-rust) | core | `HFIJL` | | | @amaanq +[scala](https://github.com/tree-sitter/tree-sitter-scala) | community | `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 ` | | | +[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/theHamsta/tree-sitter-slang)[^slang] | unstable | `HFIJL` | | ✓ | @theHamsta +[slang](https://github.com/theHamsta/tree-sitter-slang)[^slang] | unsupported | `HFIJL` | | ✓ | @theHamsta [slint](https://github.com/slint-ui/tree-sitter-slint) | community | `HFIJL` | | | @hunger -[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | community | `HFIJL` | | | @amaanq -[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H    ` | | | @amaanq, @keynmol -[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJL` | | | -[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | | `HF   ` | | | @amaanq +[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | core | `HFIJL` | | | @amaanq +[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | core | `H    ` | | | @amaanq, @keynmol +[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unsupported | `HFIJL` | | | +[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | core | `HF   ` | | | @amaanq [soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | | | @aheber -[sosl](https://github.com/aheber/tree-sitter-sfapex) | | `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) | | `HFIJL` | | | @BonaBeavis -[sql](https://github.com/derekstride/tree-sitter-sql) | | `H IJ ` | | | @derekstride -[squirrel](https://github.com/amaanq/tree-sitter-squirrel) | | `HFIJL` | | | @amaanq -[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | stable | `HFIJL` | | | @ObserverOfTime -[starlark](https://github.com/amaanq/tree-sitter-starlark) | | `HFIJL` | | | @amaanq -[strace](https://github.com/sigmaSd/tree-sitter-strace) | stable | `H  J ` | | | @amaanq +[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/amaanq/tree-sitter-squirrel) | core | `HFIJL` | | | @amaanq +[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | core | `HFIJL` | | | @ObserverOfTime +[starlark](https://github.com/amaanq/tree-sitter-starlark) | core | `HFIJL` | | | @amaanq +[strace](https://github.com/sigmaSd/tree-sitter-strace) | core | `H  J ` | | | @amaanq [styled](https://github.com/mskelton/tree-sitter-styled) | community | `HFIJ ` | | | @mskelton -[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | | `HFIJL` | | | @madskjeldgaard -[surface](https://github.com/connorlay/tree-sitter-surface) | | `HFIJ ` | | | @connorlay -[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | stable | `HFIJL` | | | @amaanq -[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 +[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.git) | community | `HFIJL` | | | @xasc -[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | | `HFIJL` | | | @amaanq -[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | stable | `HFI  ` | | | @lewis6991 -[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce +[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | core | `HFIJL` | | | @amaanq +[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/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 +[thrift](https://github.com/duskmoon314/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.git) | unstable | `H    ` | | | @arnarg -[toml](https://github.com/tree-sitter-grammars/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 +[todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) | unsupported | `H    ` | | | @arnarg +[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | community | `HFIJL` | | ✓ | @tk-shirasaka +[tsv](https://github.com/amaanq/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 [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/ObserverOfTime/tree-sitter-udev) | stable | `H  JL` | | | @ObserverOfTime -[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) | | `HFIJL` | | | @amaanq -[v](https://github.com/vlang/v-analyzer) | | `HFIJL` | | | @kkharji, @amaanq -[vala](https://github.com/vala-lang/tree-sitter-vala) | | `HF   ` | | | @Prince781 +[udev](https://github.com/ObserverOfTime/tree-sitter-udev) | core | `H  JL` | | | @ObserverOfTime +[ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) | community | `HFIJL` | | | @Philipp-M, @amaanq +[unison](https://github.com/kylegoetz/tree-sitter-unison) | unsupported | `H  J ` | ✓ | | @tapegram +[usd](https://github.com/ColinKennedy/tree-sitter-usd) | community | `HFI L` | | | @ColinKennedy +[uxntal](https://github.com/amaanq/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) | | `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/tree-sitter-grammars/tree-sitter-vue) | stable | `HFIJ ` | | | @WhyNotHugo, @lucario387 -[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | | `HFI  ` | | | @szebniok -[wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) | | `HFI  ` | | ✓ | @theHamsta +[verilog](https://github.com/tree-sitter/tree-sitter-verilog) | community | `HF JL` | | | @zegervdv +[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | community | `H    ` | | | @caarlos0 +[vim](https://github.com/neovim/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/theHamsta/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/ObserverOfTime/tree-sitter-xcompose) | stable | `H  JL` | | | @ObserverOfTime -[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | stable | `HFIJL` | | | @ObserverOfTime -[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | stable | `HFIJL` | | | @amaanq -[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ ` | | | @Hubro -[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJL` | | | @Philipp-M, @amaanq +[xcompose](https://github.com/ObserverOfTime/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/Philipp-M/tree-sitter-yuck) | community | `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) | | `HFIJL` | | | @maxxnino +[zig](https://github.com/maxxnino/tree-sitter-zig) | community | `HFIJL` | | | @maxxnino [^ecma]: queries required by javascript, typescript, tsx, qmljs [^gdscript]: Godot -[^git_config]: git_config [^glimmer]: Glimmer and Ember [^godot_resource]: Godot Resources [^html_tags]: queries required by html, astro, vue, svelte diff --git a/TODO.md b/TODO.md index bf817fc4b..ff2b05001 100644 --- a/TODO.md +++ b/TODO.md @@ -4,16 +4,15 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO -- [ ] **`query_predicates.lua`:** upstream/remove -- [ ] **`parsers.lua`:** assign tiers -- [ ] **`parsers.lua`:** modularize? - [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`? +- [ ] **`parsers.lua`:** include revision? () - [ ] **update-lockfile:** 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 - [ ] **textobjects:** include simple(!) function, queries? (check Helix) -- [ ] **downstream:** adapt to breaking changes (`nvim-treesitter-textobjects`, `nvim-treesitter-refactor`) +- [ ] **downstream:** adapt to breaking changes (`nvim-treesitter-refactor`) ## DONE diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 5a7c8e8ec..7ffb23a46 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -10,7 +10,7 @@ local M = {} local config = { auto_install = false, ensure_install = {}, - ignore_install = {}, + ignore_install = { 'unsupported' }, install_dir = vim.fs.joinpath(vim.fn.stdpath('data'), 'site'), } diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 9f99f0cfe..11dfe1a90 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -95,11 +95,6 @@ local function get_target_revision(lang) lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] end - local install_info = get_parser_install_info(lang) - if install_info.revision then - return install_info.revision - end - if lockfile[lang] then return lockfile[lang].revision end @@ -437,7 +432,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g logger:error('Node JS not found: `node` is not executable') end - local revision = repo.revision or get_target_revision(lang) + local revision = get_target_revision(lang) local maybe_local_path = fs.normalize(repo.url) local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 7f0041e36..a057498f4 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1,23 +1,21 @@ ---@class InstallInfo ---@field url string ---@field branch string|nil ----@field revision string|nil ---@field files string[] ---@field generate_requires_npm boolean|nil ---@field requires_generate_from_grammar boolean|nil ---@field location string|nil ---@class ParserInfo ----@field install_info InstallInfo ----@field filetype string[] ----@field maintainers string[] ----@field requires string[] ----@field tier integer|nil ----@field readme_note string|nil +---@field install_info InstallInfo? +---@field maintainers string[]? +---@field requires string[]? +---@field tier integer +---@field readme_note string|nil? local M = {} -M.tiers = { 'core', 'stable', 'community', 'unstable' } +M.tiers = { 'stable', 'core', 'community', 'unsupported' } ---@type table M.configs = { @@ -27,6 +25,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@briot' }, + tier = 3, }, agda = { @@ -35,6 +34,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Decodetalkers' }, + tier = 3, }, angular = { @@ -65,6 +65,7 @@ M.configs = { }, maintainers = { '@ObserverOfTime' }, requires = { 'cpp' }, + tier = 2, }, asm = { @@ -83,6 +84,7 @@ M.configs = { }, maintainers = { '@virchau13' }, requires = { 'html', 'html_tags' }, + tier = 3, }, authzed = { @@ -99,6 +101,7 @@ M.configs = { url = 'https://github.com/Beaglefoot/tree-sitter-awk', files = { 'src/parser.c', 'src/scanner.c' }, }, + tier = 4, }, bash = { @@ -107,6 +110,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, + tier = 3, }, bass = { @@ -115,6 +119,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, beancount = { @@ -123,6 +128,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@polarmutex' }, + tier = 3, }, bibtex = { @@ -131,7 +137,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta', '@clason' }, - tier = 3, + tier = 2, }, bicep = { @@ -140,6 +146,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, bitbake = { @@ -200,6 +207,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 3, }, cairo = { @@ -226,6 +234,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, chatito = { @@ -234,6 +243,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, + tier = 2, }, circom = { @@ -251,6 +261,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@NoahTheDuke' }, + tier = 3, }, cmake = { @@ -259,6 +270,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@uyha' }, + tier = 4, }, comment = { @@ -277,6 +289,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + tier = 2, }, cooklang = { @@ -303,6 +316,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, cpp = { @@ -313,6 +327,7 @@ M.configs = { }, maintainers = { '@theHamsta' }, requires = { 'c' }, + tier = 1, }, css = { @@ -321,6 +336,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, + tier = 3, }, csv = { @@ -342,6 +358,7 @@ M.configs = { }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, + tier = 2, }, cue = { @@ -350,6 +367,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, cylc = { @@ -376,6 +394,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@akinsho' }, + tier = 4, }, desktop = { @@ -393,6 +412,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@jedrzejboczar' }, + tier = 3, }, dhall = { @@ -401,6 +421,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, diff = { @@ -409,6 +430,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@gbprod' }, + tier = 3, }, disassembly = { @@ -435,6 +457,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@camdencheek' }, + tier = 3, }, dot = { @@ -443,6 +466,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@rydesun' }, + tier = 3, }, doxygen = { @@ -485,7 +509,7 @@ M.configs = { ecma = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, typescript, tsx, qmljs', - tier = 3, + tier = 2, }, editorconfig = { @@ -512,6 +536,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@connorlay' }, + tier = 3, }, elixir = { @@ -520,6 +545,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@connorlay' }, + tier = 3, }, elm = { @@ -528,6 +554,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@zweimach' }, + tier = 4, }, elsa = { @@ -536,6 +563,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@glapa-grossklag', '@amaanq' }, + tier = 2, }, elvish = { @@ -544,6 +572,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@elves' }, + tier = 3, }, embedded_template = { @@ -569,6 +598,7 @@ M.configs = { files = { 'src/parser.c', 'src/parser.c' }, }, maintainers = { '@filmor' }, + tier = 3, }, facility = { @@ -596,6 +626,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@alexmozaidze' }, + tier = 3, }, fidl = { @@ -613,6 +644,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, fish = { @@ -621,6 +653,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ram02z' }, + tier = 3, }, foam = { @@ -629,7 +662,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@FoamScience' }, - tier = 4, + tier = 3, }, forth = { @@ -647,6 +680,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, fsh = { @@ -655,6 +689,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@mgramigna' }, + tier = 3, }, fsharp = { @@ -673,6 +708,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, fusion = { @@ -681,6 +717,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@jirgn' }, + tier = 3, }, gap = { @@ -711,6 +748,7 @@ M.configs = { }, maintainers = { '@PrestonKnopp' }, readme_note = 'Godot', + tier = 3, }, gdshader = { @@ -728,6 +766,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@gbprod' }, + tier = 3, }, gitattributes = { @@ -736,6 +775,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, + tier = 2, }, gitcommit = { @@ -744,6 +784,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@gbprod' }, + tier = 3, }, git_config = { @@ -752,7 +793,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - readme_note = 'git_config', + tier = 2, }, gitignore = { @@ -761,6 +802,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, + tier = 2, }, gleam = { @@ -769,6 +811,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, glimmer = { @@ -778,6 +821,7 @@ M.configs = { }, maintainers = { '@NullVoxPopuli' }, readme_note = 'Glimmer and Ember', + tier = 3, }, glimmer_javascript = { @@ -810,6 +854,7 @@ M.configs = { }, maintainers = { '@theHamsta' }, requires = { 'c' }, + tier = 2, }, gn = { @@ -837,6 +882,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta', '@WinWisely268' }, + tier = 1, }, goctl = { @@ -855,6 +901,7 @@ M.configs = { }, maintainers = { '@pierpo' }, readme_note = 'Godot Resources', + tier = 3, }, gomod = { @@ -863,6 +910,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@camdencheek' }, + tier = 3, }, gosum = { @@ -871,6 +919,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, gowork = { @@ -879,6 +928,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@omertuc' }, + tier = 3, }, graphql = { @@ -887,6 +937,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@bkegley' }, + tier = 3, }, gotmpl = { @@ -948,6 +999,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, haskell = { @@ -964,8 +1016,8 @@ M.configs = { url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', files = { 'src/parser.c', 'src/scanner.c' }, }, - filetype = 'haskell.persistent', maintainers = { '@lykahb' }, + tier = 3, }, hcl = { @@ -974,6 +1026,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@MichaHoffmann' }, + tier = 3, }, heex = { @@ -982,6 +1035,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@connorlay' }, + tier = 3, }, helm = { @@ -1002,6 +1056,7 @@ M.configs = { }, maintainers = { '@winston0410' }, requires = { 'json' }, + tier = 3, }, hlsl = { @@ -1012,6 +1067,7 @@ M.configs = { }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, + tier = 2, }, hlsplaylist = { @@ -1030,6 +1086,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@antosha417' }, + tier = 4, }, hoon = { @@ -1044,6 +1101,7 @@ M.configs = { html_tags = { maintainers = { '@TravonteD' }, readme_note = 'queries required by html, astro, vue, svelte', + tier = 3, }, html = { @@ -1053,6 +1111,7 @@ M.configs = { }, maintainers = { '@TravonteD' }, requires = { 'html_tags' }, + tier = 3, }, htmldjango = { @@ -1070,6 +1129,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@NTBBloodbath' }, + tier = 2, }, hurl = { @@ -1143,6 +1203,7 @@ M.configs = { }, maintainers = { '@fab4100' }, requires = { 'c' }, + tier = 3, }, janet_simple = { @@ -1151,6 +1212,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@sogaiu' }, + tier = 3, }, java = { @@ -1159,6 +1221,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@p00f' }, + tier = 3, }, javadoc = { @@ -1177,6 +1240,7 @@ M.configs = { }, maintainers = { '@steelsojka' }, requires = { 'ecma', 'jsx' }, + tier = 2, }, jinja = { @@ -1207,6 +1271,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, + tier = 2, }, jsdoc = { @@ -1215,6 +1280,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@steelsojka' }, + tier = 2, }, json = { @@ -1223,6 +1289,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@steelsojka' }, + tier = 2, }, json5 = { @@ -1231,6 +1298,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Joakker' }, + tier = 3, }, jsonc = { @@ -1241,6 +1309,7 @@ M.configs = { }, maintainers = { '@WhyNotHugo' }, requires = { 'json' }, + tier = 3, }, jsonnet = { @@ -1249,11 +1318,13 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@nawordar' }, + tier = 3, }, jsx = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, tsx', + tier = 2, }, julia = { @@ -1298,6 +1369,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, kotlin = { @@ -1306,6 +1378,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@SalBakraa' }, + tier = 3, }, koto = { @@ -1332,6 +1405,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@traxys' }, + tier = 3, }, latex = { @@ -1341,7 +1415,7 @@ M.configs = { requires_generate_from_grammar = true, }, maintainers = { '@theHamsta', '@clason' }, - tier = 3, + tier = 2, }, ledger = { @@ -1350,6 +1424,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@cbarrete' }, + tier = 3, }, leo = { @@ -1367,6 +1442,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@benwilliamgraham' }, + tier = 3, }, linkerscript = { @@ -1411,6 +1487,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, luap = { @@ -1420,6 +1497,7 @@ M.configs = { }, maintainers = { '@amaanq' }, readme_note = 'Lua patterns', + tier = 2, }, luau = { @@ -1429,6 +1507,7 @@ M.configs = { }, maintainers = { '@amaanq' }, requires = { 'lua' }, + tier = 2, }, m68k = { @@ -1437,6 +1516,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@grahambates' }, + tier = 3, }, make = { @@ -1445,6 +1525,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@lewis6991' }, + tier = 2, }, markdown = { @@ -1476,6 +1557,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@acristoffers' }, + tier = 3, }, menhir = { @@ -1484,6 +1566,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Kerl13' }, + tier = 3, }, mermaid = { @@ -1500,6 +1583,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Decodetalkers' }, + tier = 3, }, mlir = { @@ -1572,6 +1656,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@alemuller' }, + tier = 3, }, nix = { @@ -1580,6 +1665,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@leo60228' }, + tier = 3, }, nqc = { @@ -1607,6 +1693,7 @@ M.configs = { }, maintainers = { '@amaanq' }, requires = { 'c' }, + tier = 2, }, objdump = { @@ -1625,6 +1712,7 @@ M.configs = { location = 'grammars/ocaml', }, maintainers = { '@undu' }, + tier = 3, }, ocaml_interface = { @@ -1635,6 +1723,7 @@ M.configs = { }, maintainers = { '@undu' }, requires = { 'ocaml' }, + tier = 3, }, ocamllex = { @@ -1644,6 +1733,7 @@ M.configs = { requires_generate_from_grammar = true, }, maintainers = { '@undu' }, + tier = 3, }, odin = { @@ -1652,6 +1742,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, pascal = { @@ -1660,6 +1751,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Isopod' }, + tier = 3, }, passwd = { @@ -1668,6 +1760,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 3, }, pem = { @@ -1686,6 +1779,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, + tier = 3, }, php = { @@ -1697,6 +1791,7 @@ M.configs = { maintainers = { '@tk-shirasaka', '@calebdw' }, requires = { 'php_only' }, readme_note = 'PHP with embedded HTML', + tier = 3, }, php_only = { @@ -1707,6 +1802,7 @@ M.configs = { }, maintainers = { '@tk-shirasaka', '@calebdw' }, readme_note = 'PHP without embedded HTML', + tier = 3, }, phpdoc = { @@ -1725,6 +1821,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@leo60228' }, + tier = 3, }, po = { @@ -1733,6 +1830,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, pod = { @@ -1761,6 +1859,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq', '@mfelsche' }, + tier = 2, }, powershell = { @@ -1788,6 +1887,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@elianiva' }, + tier = 3, }, problog = { @@ -1827,6 +1927,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@treywood' }, + tier = 3, }, promql = { @@ -1844,6 +1945,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@matthias-Q' }, + tier = 2, }, psv = { @@ -1872,6 +1974,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, purescript = { @@ -1899,6 +2002,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stsewd', '@theHamsta' }, + tier = 1, }, ql = { @@ -1907,6 +2011,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@pwntester' }, + tier = 3, }, qmldir = { @@ -1915,6 +2020,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, qmljs = { @@ -1924,6 +2030,7 @@ M.configs = { }, maintainers = { '@Decodetalkers' }, requires = { 'ecma' }, + tier = 3, }, query = { @@ -1968,6 +2075,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Fymyte' }, + tier = 3, }, razor = { @@ -2012,6 +2120,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, + tier = 1, }, rego = { @@ -2020,6 +2129,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@FallenAngel97' }, + tier = 3, }, requirements = { @@ -2047,6 +2157,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@bamonroe' }, + tier = 3, }, robot = { @@ -2082,6 +2193,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, rst = { @@ -2090,6 +2202,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stsewd' }, + tier = 2, }, ruby = { @@ -2098,6 +2211,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, + tier = 3, }, runescript = { @@ -2115,6 +2229,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, scala = { @@ -2123,6 +2238,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stevanmilic' }, + tier = 3, }, scfg = { @@ -2198,7 +2314,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, snakemake = { @@ -2216,6 +2332,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@keynmol' }, + tier = 2, }, solidity = { @@ -2224,7 +2341,9 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, + soql = { install_info = { url = 'https://github.com/aheber/tree-sitter-sfapex', @@ -2242,6 +2361,7 @@ M.configs = { location = 'sosl', }, maintainers = { '@aheber', '@xixiafinland' }, + tier = 3, }, sourcepawn = { @@ -2259,6 +2379,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@GordianDziwis' }, + tier = 3, }, sql = { @@ -2268,6 +2389,7 @@ M.configs = { branch = 'gh-pages', }, maintainers = { '@derekstride' }, + tier = 3, }, squirrel = { @@ -2276,6 +2398,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, ssh_config = { @@ -2293,6 +2416,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, strace = { @@ -2319,6 +2443,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@madskjeldgaard' }, + tier = 3, }, superhtml = { @@ -2337,6 +2462,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@connorlay' }, + tier = 3, }, svelte = { @@ -2365,6 +2491,7 @@ M.configs = { requires_generate_from_grammar = true, }, maintainers = { '@alex-pinkus' }, + tier = 3, }, sxhkdrc = { @@ -2373,6 +2500,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@RaafatTurki' }, + tier = 3, }, systemtap = { @@ -2399,6 +2527,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, tact = { @@ -2417,6 +2546,7 @@ M.configs = { requires_generate_from_grammar = true, }, maintainers = { '@euclidianAce' }, + tier = 3, }, templ = { @@ -2472,6 +2602,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@duskmoon314' }, + tier = 2, }, tiger = { @@ -2480,6 +2611,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ambroisie' }, + tier = 3, }, tlaplus = { @@ -2488,6 +2620,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ahelwer', '@susliko' }, + tier = 3, }, tmux = { @@ -2515,6 +2648,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@tk-shirasaka' }, + tier = 3, }, tsv = { @@ -2536,6 +2670,7 @@ M.configs = { }, maintainers = { '@steelsojka' }, requires = { 'ecma', 'jsx', 'typescript' }, + tier = 2, }, turtle = { @@ -2544,6 +2679,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@GordianDziwis' }, + tier = 3, }, twig = { @@ -2552,6 +2688,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@gbprod' }, + tier = 3, }, typescript = { @@ -2563,6 +2700,7 @@ M.configs = { }, maintainers = { '@steelsojka' }, requires = { 'ecma' }, + tier = 2, }, typespec = { @@ -2607,6 +2745,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Philipp-M', '@amaanq' }, + tier = 3, }, unison = { @@ -2625,6 +2764,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ColinKennedy' }, + tier = 3, }, uxntal = { @@ -2633,6 +2773,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, + tier = 2, }, v = { @@ -2642,6 +2783,7 @@ M.configs = { location = 'tree_sitter_v', }, maintainers = { '@kkharji', '@amaanq' }, + tier = 3, }, vala = { @@ -2650,6 +2792,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Prince781' }, + tier = 3, }, vento = { @@ -2667,6 +2810,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@zhangwwpeng' }, + tier = 3, }, vhdl = { @@ -2684,6 +2828,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@caarlos0' }, + tier = 3, }, vim = { @@ -2739,6 +2884,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@szebniok' }, + tier = 3, }, wgsl_bevy = { @@ -2748,6 +2894,7 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@theHamsta' }, + tier = 2, }, wit = { @@ -2803,6 +2950,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@Hubro' }, + tier = 3, }, yuck = { @@ -2811,6 +2959,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Philipp-M', '@amaanq' }, + tier = 3, }, zathurarc = { diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua index e07cf416f..0c9288b6a 100755 --- a/scripts/update-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -4,7 +4,7 @@ local util = require('nvim-treesitter.util') -- Load previous lockfile local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') --- local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] +local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] ---@type table local new_lockfile = {} @@ -15,9 +15,10 @@ local jobs = {} --- @type table -- check for new revisions for k, p in pairs(parsers) do - if not p.install_info then + if p.tier == 4 then + new_lockfile[k] = old_lockfile[k] print('Skipping ' .. k) - else + elseif p.install_info then jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) end From 041f117fb182acb56831a204c286622fb43574c1 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 12 Jun 2023 15:58:43 +0100 Subject: [PATCH 017/434] fix: filter languages through parser.configs --- lua/nvim-treesitter/config.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 7ffb23a46..c216a0b15 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -86,7 +86,7 @@ end ---Normalize languages ---@param languages? string[]|string ----@param skip? table +---@param skip? { ignored: boolean, missing: boolean, installed: boolean, dependencies: boolean } ---@return string[] function M.norm_languages(languages, skip) if not languages then @@ -103,7 +103,6 @@ function M.norm_languages(languages, skip) end languages = parsers.get_available() end - --TODO(clason): skip and warn on unavailable parser -- keep local to avoid leaking parsers module local function expand_tiers(list) @@ -142,6 +141,11 @@ function M.norm_languages(languages, skip) end, languages) --[[@as string[] ]] end + languages = vim.iter.filter(function(v) + -- TODO(lewis6991): warn of any unknown parsers? + return parsers.configs[v] ~= nil + end, languages) --[[@as string[] ]] + if not (skip and skip.dependencies) then for _, lang in pairs(languages) do if parsers.configs[lang].requires then From 934b751f9d1075ef31cdbcd5e1342fe96396c74d Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 12 Jun 2023 16:18:25 +0100 Subject: [PATCH 018/434] fix: check queries in needs_update() --- lua/nvim-treesitter/install.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 11dfe1a90..af95fdeed 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -111,7 +111,16 @@ end ---@return boolean local function needs_update(lang) local revision = get_target_revision(lang) - return not revision or revision ~= get_installed_revision(lang) + if revision then + return revision ~= get_installed_revision(lang) + end + + -- No revision. Check the queries link to the same place + + local queries = fs.joinpath(config.get_install_dir('queries'), lang) + local queries_src = M.get_package_path('runtime', 'queries', lang) + + return uv.fs_realpath(queries) ~= uv.fs_realpath(queries_src) end --- From b4c9c81a80818dd6499e0777278b1c318d1aac9a Mon Sep 17 00:00:00 2001 From: TheLeoP Date: Thu, 15 Jun 2023 06:43:05 -0500 Subject: [PATCH 019/434] fix: check if config has install_info in filter --- lua/nvim-treesitter/parsers.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a057498f4..026c8d1d6 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -3015,7 +3015,8 @@ function M.get_available(tier) end if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then parsers = vim.iter.filter(function(p) - return not M.configs[p].install_info.requires_generate_from_grammar + return M.configs[p].install_info + and not M.configs[p].install_info.requires_generate_from_grammar end, parsers) --[[@as string[] ]] end return parsers From dd6ec132684fccb32de3713ad94b8aa4f8795fe6 Mon Sep 17 00:00:00 2001 From: TheLeoP Date: Thu, 15 Jun 2023 07:40:39 -0500 Subject: [PATCH 020/434] fix: always normalize paths Not doing this results in paths with a mix of '\\' and '/' for Windows. This isn't a problem when dealing with Neovim/luv APIs, but it is a problem when comparing strings. --- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/install.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 099e766da..1d6400977 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -110,7 +110,7 @@ local function install_health() end if vim.iter(vim.api.nvim_list_runtime_paths()):any(function(p) - if installdir == p .. '/' then + if installdir == vim.fs.normalize(p) .. '/' then return true end end) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index af95fdeed..ff5cff036 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -562,7 +562,7 @@ local function install(languages, options, _callback) return end - local cache_dir = vim.fn.stdpath('cache') + local cache_dir = vim.fs.normalize(vim.fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') if not languages or type(languages) == 'string' then From f13420ccff1dfca4a2e42c43f56f66b240dd1d2e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 24 Jun 2023 14:33:45 +0200 Subject: [PATCH 021/434] fix: remove upstreamed directives `#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype` --- plugin/query_predicates.lua | 102 +----------------------- runtime/queries/authzed/injections.scm | 24 ------ runtime/queries/hcl/injections.scm | 3 +- runtime/queries/hurl/injections.scm | 3 +- runtime/queries/markdown/injections.scm | 5 +- runtime/queries/php_only/injections.scm | 6 +- runtime/queries/ruby/injections.scm | 3 +- 7 files changed, 11 insertions(+), 135 deletions(-) diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua index 8c7685faf..7cd8fb618 100644 --- a/plugin/query_predicates.lua +++ b/plugin/query_predicates.lua @@ -30,12 +30,13 @@ local mimetype_aliases = { ---@param pred string[] ---@return boolean|nil query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, metadata) - local capture_id = pred[2] - local node = match[capture_id] + local id = pred[2] + local node = match[id] if not node then return end - local type_attr_value = vim.treesitter.get_node_text(node, bufnr) + + local type_attr_value = vim.treesitter.get_node_text(node, bufnr, { metadata = metadata[id] }) local configured = mimetype_aliases[type_attr_value] if configured then metadata['injection.language'] = configured @@ -44,98 +45,3 @@ query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, m metadata['injection.language'] = parts[#parts] end end, true) - -local injection_aliases = { - ex = 'elixir', - pl = 'perl', - sh = 'bash', - uxn = 'uxntal', - ts = 'typescript', -} - ----@param match (TSNode|nil)[] ----@param _ string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_directive('set-lang-from-info-string!', function(match, _, bufnr, pred, metadata) - local capture_id = pred[2] - local node = match[capture_id] - if not node then - return - end - - local injection_alias = vim.treesitter.get_node_text(node, bufnr) - local filetype = vim.filetype.match({ filename = 'a.' .. injection_alias }) - metadata['injection.language'] = filetype or injection_aliases[injection_alias] or injection_alias -end, true) - -query.add_directive('downcase!', function(match, _, bufnr, pred, metadata) - local text, key, value ---@type string|string[], string, string|integer - - if #pred == 3 then - -- (#downcase! @capture "key") - key = pred[3] - value = metadata[pred[2]][key] - else - -- (#downcase! "key") - key = pred[2] - value = metadata[key] - end - - if type(value) == 'string' then - text = value - else - local node = match[value] - text = vim.treesitter.get_node_text(node, bufnr) or '' - end - - if #pred == 3 then - metadata[pred[2]][key] = string.lower(text) - else - metadata[key] = string.lower(text) - end -end, true) - --- Trim blank lines from end of the region --- Arguments are the captures to trim. ----@param match (TSNode|nil)[] ----@param _ string ----@param bufnr integer ----@param pred string[] ----@param metadata table ----TODO(clason): upstream -query.add_directive('trim!', function(match, _, bufnr, pred, metadata) - for _, id in ipairs({ select(2, unpack(pred)) }) do - local node = match[id] - if not node then - return - end - - local start_row, start_col, end_row, end_col = node:range() - - -- Don't trim if region ends in middle of a line - if end_col ~= 0 then - return - end - - while true do - -- As we only care when end_col == 0, always inspect one line above end_row. - local end_line = vim.api.nvim_buf_get_lines(bufnr, end_row - 1, end_row, true)[1] - - if end_line ~= '' then - break - end - - end_row = end_row - 1 - end - - -- If this produces an invalid range, we just skip it. - if start_row < end_row or (start_row == end_row and start_col <= end_col) then - if not metadata[id] then - metadata[id] = {} - end - metadata[id].range = { start_row, start_col, end_row, end_col } - end - end -end, true) diff --git a/runtime/queries/authzed/injections.scm b/runtime/queries/authzed/injections.scm index 298a8d070..2f0e58eb6 100644 --- a/runtime/queries/authzed/injections.scm +++ b/runtime/queries/authzed/injections.scm @@ -1,26 +1,2 @@ ((comment) @injection.content (#set! injection.language "comment")) - -((function_call - name: (ident) @_name - . - (simplexpr) - . - (simplexpr - (string - (string_fragment) @injection.content)+)) - (#any-of? @_name "replace" "search" "matches" "captures") - (#set! injection.language "regex") - (#set! injection.combined)) - -((function_call - name: (ident) @_name - . - (simplexpr) - . - (simplexpr - (string - (string_fragment) @injection.content)+)) - (#eq? @_name "jq") - (#set! injection.language "jq") - (#set! injection.combined)) diff --git a/runtime/queries/hcl/injections.scm b/runtime/queries/hcl/injections.scm index b68f4caea..5cb940c87 100644 --- a/runtime/queries/hcl/injections.scm +++ b/runtime/queries/hcl/injections.scm @@ -3,5 +3,4 @@ (heredoc_template (template_literal) @injection.content - (heredoc_identifier) @injection.language - (#downcase! @injection.language)) + (heredoc_identifier) @injection.language) diff --git a/runtime/queries/hurl/injections.scm b/runtime/queries/hurl/injections.scm index 41abb387b..bd5385663 100644 --- a/runtime/queries/hurl/injections.scm +++ b/runtime/queries/hurl/injections.scm @@ -9,7 +9,6 @@ (#set! injection.language "xml")) (multiline_string - (multiline_string_type) @_lang + (multiline_string_type) @injection.language (multiline_string_content) @injection.content - (#set-lang-from-info-string! @_lang) (#set! injection.combined)) diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm index 8ed205296..1f33c30b6 100644 --- a/runtime/queries/markdown/injections.scm +++ b/runtime/queries/markdown/injections.scm @@ -1,8 +1,7 @@ (fenced_code_block (info_string - (language) @_lang) - (code_fence_content) @injection.content - (#set-lang-from-info-string! @_lang)) + (language) @injection.language) + (code_fence_content) @injection.content) ((html_block) @injection.content (#set! injection.language "html") diff --git a/runtime/queries/php_only/injections.scm b/runtime/queries/php_only/injections.scm index 368177643..42ee2d67d 100644 --- a/runtime/queries/php_only/injections.scm +++ b/runtime/queries/php_only/injections.scm @@ -4,14 +4,12 @@ (heredoc (heredoc_body) @injection.content (heredoc_end) @injection.language - (#set! injection.include-children) - (#downcase! @injection.language)) + (#set! injection.include-children)) (nowdoc (nowdoc_body) @injection.content (heredoc_end) @injection.language - (#set! injection.include-children) - (#downcase! @injection.language)) + (#set! injection.include-children)) ; regex ((function_call_expression diff --git a/runtime/queries/ruby/injections.scm b/runtime/queries/ruby/injections.scm index 12b2c32a5..e998e2bd7 100644 --- a/runtime/queries/ruby/injections.scm +++ b/runtime/queries/ruby/injections.scm @@ -3,8 +3,7 @@ (heredoc_body (heredoc_content) @injection.content - (heredoc_end) @injection.language - (#downcase! @injection.language)) + (heredoc_end) @injection.language) (regex (string_content) @injection.content From 26302f412f6fe1ff968802888a8b8419accd6462 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 4 Jul 2023 22:42:25 +0100 Subject: [PATCH 022/434] fix: add stricter cc options (#5063) --- lua/nvim-treesitter/install.lua | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index ff5cff036..f4112d880 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -307,6 +307,21 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision, end end +--- @type table> +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) @@ -359,6 +374,13 @@ local function select_compiler_args(repo, compiler) 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 #vim.iter.filter( --- @param file string @@ -370,11 +392,17 @@ local function select_compiler_args(repo, compiler) repo.files ) > 0 then - table.insert(args, '-lstdc++') + add_cc_arg('-lstdc++') end if not iswin then - table.insert(args, '-fPIC') + 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 From b5a3f5c2860e08200a491ac902d6612abc0ddafe Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 7 Aug 2023 11:03:02 +0100 Subject: [PATCH 023/434] fix: cleanup diagnostics --- lua/nvim-treesitter/config.lua | 5 +- lua/nvim-treesitter/install.lua | 83 ++++++++++++++------------------- 2 files changed, 39 insertions(+), 49 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index c216a0b15..cd4a3a178 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -29,7 +29,8 @@ function M.setup(user_data) if config.auto_install then vim.api.nvim_create_autocmd('FileType', { callback = function(args) - local ft = vim.bo[args.buf].filetype + local buf = args.buf --- @type integer + local ft = vim.bo[buf].filetype local lang = vim.treesitter.language.get_lang(ft) or ft if require('nvim-treesitter.parsers').configs[lang] @@ -39,7 +40,7 @@ function M.setup(user_data) require('nvim-treesitter.install').install(lang, nil, function() -- Need to pcall since 'FileType' can be triggered multiple times -- per buffer - pcall(vim.treesitter.start, args.buf, lang) + pcall(vim.treesitter.start, buf, lang) end) end end, diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index f4112d880..54ef4cd39 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -1,3 +1,4 @@ +local fn = vim.fn local fs = vim.fs local uv = vim.uv @@ -60,31 +61,21 @@ end --- ---@param lang string ----@param validate? boolean ----@return InstallInfo -local function get_parser_install_info(lang, validate) +---@return InstallInfo? +local function get_parser_install_info(lang) local parser_config = parsers.configs[lang] if not parser_config then log.error('Parser not available for language "' .. lang .. '"') end - local install_info = parser_config.install_info - - if validate then - vim.validate({ - url = { install_info.url, 'string' }, - files = { install_info.files, 'table' }, - }) - end - - return install_info + return parser_config.install_info end --- @param ... string --- @return string function M.get_package_path(...) - return fs.joinpath(vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) + return fs.joinpath(fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) end ---@param lang string @@ -163,12 +154,18 @@ local function cc_err() ) .. '" are not executable.') end +--- @param x string +--- @return boolean +local function executable(x) + return fn.executable(x) == 1 +end + --- @param logger Logger --- @param repo InstallInfo --- @param compile_location string local function do_generate_from_grammar(logger, repo, compile_location) if repo.generate_requires_npm then - if vim.fn.executable('npm') ~= 1 then + if not executable('npm') then logger:error('NPM requires to be installed from grammar.js') end @@ -182,7 +179,7 @@ local function do_generate_from_grammar(logger, repo, compile_location) logger:info('Generating source files from grammar.js...') local r = system({ - vim.fn.exepath('tree-sitter'), + fn.exepath('tree-sitter'), 'generate', '--no-bindings', '--abi', @@ -232,7 +229,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, end logger:debug('Creating temporary directory: ' .. temp_dir) - --TODO(clason): use vim.fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created + --TODO(clason): use fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created local err = uv_mkdir(temp_dir, 493) a.main() if err then @@ -325,14 +322,7 @@ end ---@param executables string[] ---@return string? function M.select_executable(executables) - return vim.iter.filter( - ---@param c string - ---@return boolean - function(c) - return vim.fn.executable(c) == 1 - end, - executables - )[1] + return vim.iter.filter(executable, executables)[1] end -- Returns the compiler arguments based on the compiler and OS @@ -386,7 +376,7 @@ local function select_compiler_args(repo, compiler) --- @param file string --- @return boolean function(file) - local ext = vim.fn.fnamemodify(file, ':e') + local ext = fn.fnamemodify(file, ':e') return ext == 'cc' or ext == 'cpp' or ext == 'cxx' end, repo.files @@ -411,9 +401,9 @@ end ---@param repo InstallInfo ---@return boolean local function can_download_tar(repo) - local can_use_tar = vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 - local is_github = repo.url:find('github.com', 1, true) - local is_gitlab = repo.url:find('gitlab.com', 1, true) + local can_use_tar = executable('tar') and executable('curl') + local is_github = repo.url:find('github.com', 1, true) ~= nil + local is_gitlab = repo.url:find('gitlab.com', 1, true) ~= nil return can_use_tar and (is_github or is_gitlab) and not iswin end @@ -432,13 +422,13 @@ end ---@param lang string ---@param cache_dir string ---@param install_dir string ----@param force boolean ----@param generate_from_grammar boolean +---@param force? boolean +---@param generate_from_grammar? boolean local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) if vim.list_contains(config.installed_parsers(), lang) then if not force then local yesno = - vim.fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') + fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') print('\n ') if yesno:sub(1, 1) ~= 'y' then return @@ -447,7 +437,6 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g end local logger = log.new('install/' .. lang) - local err local repo = get_parser_install_info(lang) if repo then @@ -461,18 +450,18 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then + if generate_from_grammar and not executable('tree-sitter') then logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') end - if generate_from_grammar and vim.fn.executable('node') ~= 1 then + if generate_from_grammar and not executable('node') then logger:error('Node JS not found: `node` is not executable') end local revision = get_target_revision(lang) local maybe_local_path = fs.normalize(repo.url) - local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1 + local from_local_path = fn.isdirectory(maybe_local_path) == 1 if from_local_path then repo.url = maybe_local_path end @@ -504,7 +493,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' - err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) + local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) a.main() if err then logger:error(err) @@ -521,7 +510,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g local queries = fs.joinpath(config.get_install_dir('queries'), lang) local queries_src = M.get_package_path('runtime', 'queries', lang) uv_unlink(queries) - err = uv_symlink(queries_src, queries, { dir = true, junction = true }) + local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) a.main() if err then logger:error(err) @@ -542,14 +531,14 @@ end --- --- --- @generic F: function ---- @param fn F Function to throttle +--- @param f F Function to throttle --- @return F throttled function. -local function throttle_by_id(fn) +local function throttle_by_id(f) local scheduled = {} --- @type table local running = {} --- @type table return function(id, ...) if scheduled[id] then - -- If fn is already scheduled, then drop + -- If f is already scheduled, then drop return end if not running[id] then @@ -561,7 +550,7 @@ local function throttle_by_id(fn) while scheduled[id] do scheduled[id] = nil running[id] = true - fn(id, ...) + f(id, ...) running[id] = nil end end @@ -571,9 +560,9 @@ end local install_lang_throttled = throttle_by_id(install_lang) ---@class InstallOptions ----@field force boolean ----@field generate_from_grammar boolean ----@field skip table +---@field force? boolean +---@field generate_from_grammar? boolean +---@field skip? table --- Install a parser --- @param languages? string[]|string @@ -585,12 +574,12 @@ local function install(languages, options, _callback) local generate_from_grammar = options.generate_from_grammar local skip = options.skip - if vim.fn.executable('git') == 0 then + if not executable('git') then log.error('Git is required on your system to run this command') return end - local cache_dir = vim.fs.normalize(vim.fn.stdpath('cache')) + local cache_dir = vim.fs.normalize(fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') if not languages or type(languages) == 'string' then From 673fdccd212098818a64ab47a62b89993ccc77cf Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Fri, 11 Aug 2023 22:38:31 +0900 Subject: [PATCH 024/434] tests: remove set ft --- tests/indent/cpp_spec.lua | 1 - tests/indent/javascript_spec.lua | 1 - tests/indent/jsx_spec.lua | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/indent/cpp_spec.lua b/tests/indent/cpp_spec.lua index 8e97c805e..fe26a81b3 100644 --- a/tests/indent/cpp_spec.lua +++ b/tests/indent/cpp_spec.lua @@ -7,7 +7,6 @@ local run = Runner:new(it, 'tests/indent', { shiftwidth = 4, softtabstop = 0, expandtab = true, - filetype = 'cpp', }) describe('indent C++:', function() diff --git a/tests/indent/javascript_spec.lua b/tests/indent/javascript_spec.lua index 4a7c3bcc3..0536c1a0b 100644 --- a/tests/indent/javascript_spec.lua +++ b/tests/indent/javascript_spec.lua @@ -6,7 +6,6 @@ local run = Runner:new(it, 'tests/indent', { shiftwidth = 2, softtabstop = 0, expandtab = true, - filetype = 'javascript', }) describe('indent JavaScript:', function() diff --git a/tests/indent/jsx_spec.lua b/tests/indent/jsx_spec.lua index 7a32dbcc4..8dcecfe5b 100644 --- a/tests/indent/jsx_spec.lua +++ b/tests/indent/jsx_spec.lua @@ -3,7 +3,6 @@ local runner = Runner:new(it, 'tests/indent/jsx', { tabstop = 2, shiftwidth = 2, expandtab = true, - filetype = 'jsx', }) describe('indent JSX Elements:', function() From abcbe65b6e76b66af2f76ddf03502a5b0af1cf5f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 13 Aug 2023 12:56:11 +0200 Subject: [PATCH 025/434] docs(readme): document 'location' key --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 48857e877..4e98772b1 100644 --- a/README.md +++ b/README.md @@ -131,15 +131,16 @@ If you have a parser that is not on the list of supported languages (either as a 3. Add the following snippet to your `init.lua`: ```lua -local parser_config = require "nvim-treesitter.parsers".configs +local parser_config = require('nvim-treesitter.parsers').configs parser_config.zimbu = { install_info = { - url = "~/projects/tree-sitter-zimbu", -- local path or git repo - files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc + url = '~/projects/tree-sitter-zimbu', -- local path or git repo + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c or src/scanner.cc -- optional entries: - branch = "develop", -- only needed if different from default branch - generate_requires_npm = false, -- if stand-alone parser without npm dependencies - requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c + branch = 'develop', -- only needed if different from default branch + location= 'parser', -- only needed if the parser is in subdirectory of a "monorepo" + requires_generate_from_grammar = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_requires_npm = true, -- only needed if parser has npm dependencies }, } ``` From 3966b8808b36ce263111c7e177b4364d32e67a2d Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Mon, 4 Sep 2023 16:19:33 +0900 Subject: [PATCH 026/434] fix!: indents now rely on treesitter highlight - Apply suggestions from Lewis to only parse visible lines - Fix failed tests --- tests/query/highlights_spec.lua | 63 ++++++++++++--------------------- tests/query/injection_spec.lua | 9 +++-- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/tests/query/highlights_spec.lua b/tests/query/highlights_spec.lua index b6a52124a..0529af4a4 100644 --- a/tests/query/highlights_spec.lua +++ b/tests/query/highlights_spec.lua @@ -1,4 +1,3 @@ -local highlighter = require('vim.treesitter.highlighter') local ts = vim.treesitter local COMMENT_NODES = { @@ -7,16 +6,16 @@ local COMMENT_NODES = { } local function check_assertions(file) - local buf = vim.fn.bufadd(file) - vim.fn.bufload(file) - local ft = vim.bo[buf].filetype - local lang = vim.treesitter.language.get_lang(ft) or ft assert.same( 1, vim.fn.executable('highlight-assertions'), '"highlight-assertions" not executable!' .. ' Get it via "cargo install --git https://github.com/theHamsta/highlight-assertions"' ) + local buf = vim.fn.bufadd(file) + vim.fn.bufload(file) + local ft = vim.bo[buf].filetype + local lang = vim.treesitter.language.get_lang(ft) or ft local comment_node = COMMENT_NODES[lang] or 'comment' local assertions = vim.fn.json_decode( vim.fn.system( @@ -28,21 +27,21 @@ local function check_assertions(file) .. comment_node ) ) - local parser = ts.get_parser(buf, lang) + assert.True(#assertions > 0, 'No assertions detected!') + + local parser = ts.get_parser(buf) + parser:parse(true) - local self = highlighter.new(parser, {}) - - assert.True(#assertions > 0, 'No assertions detected!') for _, assertion in ipairs(assertions) do local row = assertion.position.row local col = assertion.position.column + assert.is.number(row) + assert.is.number(col) local captures = {} - local highlights = {} - self:prepare_highlight_states(row, row + 1) - self:for_each_highlight_state(function(state) - if not state.tstree then + parser:for_each_tree(function(tstree, tree) + if not tstree then return end @@ -54,36 +53,24 @@ local function check_assertions(file) return end - local query = state.highlighter_query - - -- Some injected languages may not have highlight queries. - if not query:query() then + local query = ts.query.get(tree:lang(), 'highlights') + if not query then return end - local iter = query:query():iter_captures(root, self.bufnr, row, row + 1) - - for capture, node, _ in iter do - local hl = query:get_hl_from_capture(capture) - assert.is.truthy(hl) - - assert.Truthy(node) - assert.is.number(row) - assert.is.number(col) - if hl and ts.is_in_node_range(node, row, col) then - local c = query._query.captures[capture] -- name of the capture in the query - if c ~= nil and c ~= 'spell' and c ~= 'conceal' then - captures[c] = true - highlights[c] = true + for id, node, _ in query:iter_captures(root, buf, row, row + 1) do + if ts.is_in_node_range(node, row, col) then + local capture = query.captures[id] + if capture ~= nil and capture ~= 'conceal' and capture ~= 'spell' then + captures[capture] = true end end end end) if assertion.expected_capture_name:match('^!') then assert.Falsy( - captures[assertion.expected_capture_name:sub(2)] - or highlights[assertion.expected_capture_name:sub(2)], - 'Error in at ' + captures[assertion.expected_capture_name:sub(2)], + 'Error in ' .. file .. ':' .. (row + 1) @@ -93,13 +80,11 @@ local function check_assertions(file) .. assertion.expected_capture_name .. '", captures: ' .. vim.inspect(vim.tbl_keys(captures)) - .. '", highlights: ' - .. vim.inspect(vim.tbl_keys(highlights)) ) else assert.True( - captures[assertion.expected_capture_name] or highlights[assertion.expected_capture_name], - 'Error in at ' + captures[assertion.expected_capture_name], + 'Error in ' .. file .. ':' .. (row + 1) @@ -109,8 +94,6 @@ local function check_assertions(file) .. assertion.expected_capture_name .. '", captures: ' .. vim.inspect(vim.tbl_keys(captures)) - .. '", highlights: ' - .. vim.inspect(vim.tbl_keys(highlights)) ) end end diff --git a/tests/query/injection_spec.lua b/tests/query/injection_spec.lua index 91096fee4..e90925e20 100644 --- a/tests/query/injection_spec.lua +++ b/tests/query/injection_spec.lua @@ -26,7 +26,6 @@ local function check_assertions(file) ) local parser = ts.get_parser(buf, lang) - local self = parser local top_level_root = parser:parse(true)[1]:root() for _, assertion in ipairs(assertions) do @@ -37,7 +36,7 @@ local function check_assertions(file) assertion.expected_capture_name = neg_assert and assertion.expected_capture_name:sub(2) or assertion.expected_capture_name local found = false - self:for_each_tree(function(tstree, tree) + parser:for_each_tree(function(tstree, tree) if not tstree then return end @@ -50,11 +49,11 @@ local function check_assertions(file) if assertion.expected_capture_name == tree:lang() then found = true end - end, true) + end) if neg_assert then assert.False( found, - 'Error in at ' + 'Error in ' .. file .. ':' .. (row + 1) @@ -67,7 +66,7 @@ local function check_assertions(file) else assert.True( found, - 'Error in at ' + 'Error in ' .. file .. ':' .. (row + 1) From 1bec16362f642a2f86d122ae34131be6b0dbfbc6 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 11 Sep 2023 11:20:09 +0100 Subject: [PATCH 027/434] feat: allow a custom revision in install_info --- lua/nvim-treesitter/install.lua | 5 +++++ lua/nvim-treesitter/parsers.lua | 1 + 2 files changed, 6 insertions(+) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 54ef4cd39..aaa921f07 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -81,6 +81,11 @@ end ---@param lang string ---@return string? local function get_target_revision(lang) + local info = get_parser_install_info(lang) + if info and info.revision then + return info.revision + end + if #lockfile == 0 then local filename = M.get_package_path('lockfile.json') lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 026c8d1d6..25efd5d9d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1,6 +1,7 @@ ---@class InstallInfo ---@field url string ---@field branch string|nil +---@field revision string|nil Used to override lockfile revision ---@field files string[] ---@field generate_requires_npm boolean|nil ---@field requires_generate_from_grammar boolean|nil From efbc2a4b72a83da8c21c41b905daa58e4d7f4e81 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 13 Sep 2023 10:43:36 +0100 Subject: [PATCH 028/434] fix: remove downcase! directive use --- runtime/queries/bash/injections.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/queries/bash/injections.scm b/runtime/queries/bash/injections.scm index 9b86e351a..e1095773b 100644 --- a/runtime/queries/bash/injections.scm +++ b/runtime/queries/bash/injections.scm @@ -4,10 +4,9 @@ ((regex) @injection.content (#set! injection.language "regex")) -((heredoc_redirect +(heredoc_redirect (heredoc_body) @injection.content (heredoc_end) @injection.language) - (#downcase! @injection.language)) ; printf 'format' ((command From 59f5d64a613f45faa036d9456cf7351c024f1be8 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 13 Sep 2023 10:46:02 +0100 Subject: [PATCH 029/434] fix: update vim.system types --- lua/nvim-treesitter/install.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index aaa921f07..44e7e048f 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -44,7 +44,7 @@ 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 SystemCompleted]] + local r = a.wrap(vim.system, 3)(cmd, opts) --[[@as vim.SystemCompleted]] a.main() if r.stdout and r.stdout ~= '' then log.trace('stdout -> %s', r.stdout) @@ -416,7 +416,7 @@ end ---@param repo InstallInfo ---@param cc string ---@param compile_location string ----@return SystemCompleted +---@return vim.SystemCompleted local function do_compile(repo, cc, compile_location) local args = vim.tbl_flatten(select_compiler_args(repo, cc)) local cmd = vim.list_extend({ cc }, args) From 5f2c6c0c833734914080ae061e2a7d44bc606180 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 13 Sep 2023 10:53:03 +0100 Subject: [PATCH 030/434] refactor: pull out predicate function --- lua/nvim-treesitter/install.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 44e7e048f..b6e3c3de3 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -145,18 +145,16 @@ local function get_compile_location(repo, cache_dir, project_name, from_local_pa return fs.joinpath(cache_dir, repo_location) end +local function istring(c) + return type(c) == 'string' +end + local function cc_err() - log.error('No C compiler found! "' .. table.concat( - vim.iter.filter( - ---@param c string - ---@return boolean - function(c) - return type(c) == 'string' - end, - M.compilers - ), - '", "' - ) .. '" are not executable.') + log.error( + 'No C compiler found! "' + .. table.concat(vim.iter.filter(istring, M.compilers), '", "') + .. '" are not executable.' + ) end --- @param x string From 178c6a84c17e182caf12f3b65e281a31f9a3b9da Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 24 Sep 2023 11:44:00 +0200 Subject: [PATCH 031/434] docs: update CONTRIBUTING.md --- CONTRIBUTING.md | 65 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 473a26cb5..b7ecb5690 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,22 +9,53 @@ The main goal of `nvim-treesitter` is to provide a framework to easily install p Depending on which part of the plugin you want to contribute to, please read the appropriate section. -## Style Checks and Tests +## Parsers -We haven't implemented any functional tests yet. Feel free to contribute. -However, we check code style with `luacheck` and `stylua`! -Please install luacheck and activate our `pre-push` hook to automatically check style before -every push: +To add a new parser, edit the following files: -```bash -luarocks install luacheck -cargo install stylua -ln -s ../../scripts/pre-push .git/hooks/pre-push +1. In `lua/parsers.lua`, add an entry to the `M.configs` table of the following form: + +```lua +zimbu = { + install_info = { + url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- local path or git repo + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c or src/scanner.cc + -- optional entries: + branch = 'develop', -- only needed if different from default branch + location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" + revision = 'v2.1', -- tag or commit hash; bypasses automated updates + requires_generate_from_grammar = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_requires_npm = true, -- only needed if parser has npm dependencies + }, + maintainers = { '@me' }, -- the _query_ maintainers + tier = 3, -- community-contributed parser + -- optional entries: + requires = { 'vim' }, -- if the queries inherit from another language + readme_note = "an example language", -- if the +} ``` -## Parser configurations +**Note:** The "maintainers" here refers to the person maintaining the **queries** in `nvim-treesitter`, not the parser maintainers (who likely don't use Neovim). The maintainers' duty is to review issues and PRs related to the query and to keep them updated with respect to parser changes. -Contributing to parser configurations is basically modifying one of the `runtime/queries/*/*.scm`. +2. In `lockfile.json`, add an entry for the current commit your queries are compatible with: + +```json + "zimbu": { + "revision": "0d08703e4c3f426ec61695d7617415fff97029bd" + }, +``` + +3. If the parser name is not the same as the Vim filetype, add an entry to the `filetypes` table in `plugin/filetypes.lua`: + +```lua + zimbu = { 'zu' }, +``` + +**Note: We only support external scanners written in C (preferably) and C++03 for portability reasons.** + +## Queries + +Contributing to queries for an existing parser is basically modifying one of the `runtime/queries/*/*.scm`. Each of these `scheme` files contains a _tree-sitter query_ for a given purpose. Before going any further, we highly suggest that you [read more about tree-sitter queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries). @@ -40,19 +71,15 @@ For now these are the types of queries used by `nvim-treesitter`: For these types there is a _norm_ you will have to follow so that features work fine. Here are some global advices: -- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages), - you can debug and experiment with your queries there. -- If not, you should consider installing the [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/tree/master/cli), - you should then be able to open a local playground using `tree-sitter build-wasm && tree-sitter web-ui` within the - parsers repo. - Examples of queries can be found in [runtime/queries/](runtime/queries/) -- Matches in the bottom will override queries that are above of them. +- Note that (unlike tree-sitter) all matching patterns are applied, with the last one determining the visible highlight. +- If the [parser is included in `nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/SUPPORTED_LANGUAGES.md`) and installed with `:TSInstall`, you can use Neovim's developer tools (`:checkhealth`, `:InspectTree`, `:EditQuery`, `:Inspect`) to test your queries. #### Inheriting languages If your language is an extension of a language (TypeScript is an extension of JavaScript for example), you can include the queries from your base language by adding the following _as the first -line of your file_. +line of your file_: ```query ; inherits: lang1,(optionallang) @@ -298,7 +325,7 @@ Note that nvim-treesitter uses more specific subcaptures for definitions and @local.reference ; identifier reference ``` -#### Definition Scope +#### Definition scope You can set the scope of a definition by setting the `scope` property on the definition. From e77506bde3e6198dbf2ccc0e2e148e73aede2589 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 26 Jan 2024 13:09:44 +0100 Subject: [PATCH 032/434] feat: improve check-queries --- scripts/check-queries.lua | 97 ++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 58 deletions(-) diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 3f5a9aa70..bfde0f8a3 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -1,18 +1,15 @@ #!/usr/bin/env -S nvim -l vim.opt.runtimepath:append('.') --- Equivalent to print(), but this will ensure consistent output regardless of --- operating system. -local function io_print(text) - if not text then - text = '' - end - io.write(text, '\n') -end +local query_types = require('nvim-treesitter.health').bundled_queries +local configs = require('nvim-treesitter.parsers').configs +local parsers = #_G.arg > 0 and { unpack(_G.arg) } + or require('nvim-treesitter.config').installed_parsers() -local function extract_captures() - local captures = {} - local current_query +-- Extract captures from documentation for validation +local captures = {} +do + local current_query ---@type string for line in io.lines('CONTRIBUTING.md') do if vim.startswith(line, '### ') then @@ -22,45 +19,33 @@ local function extract_captures() captures[current_query] = {} end - table.insert(captures[current_query], vim.split(line:sub(2), ' ', true)[1]) + table.insert(captures[current_query], vim.split(line:sub(2), ' ')[1]) end end -- Complete captures for injections. - local parsers = vim.tbl_keys(require('nvim-treesitter.parsers').configs) - for _, lang in pairs(parsers) do + for _, lang in pairs(vim.tbl_keys(configs)) do table.insert(captures['injections'], lang) end - - return captures end -local function do_check() - local timings = {} - local parsers = require('nvim-treesitter.config').installed_parsers() - local query_types = require('nvim-treesitter.health').bundled_queries - local configs = require('nvim-treesitter.parsers').configs - - local captures = extract_captures() - local errors = {} - - io_print('::group::Check parsers') +-- Check queries for each installed parser in parsers +local errors = {} ---@type string[] +local timings = {} ---@type number[][] +do + print('::group::Check parsers') for _, lang in pairs(parsers) do - if configs[lang].install_info then + if configs[lang] and configs[lang].install_info then timings[lang] = {} for _, query_type in pairs(query_types) do local before = vim.uv.hrtime() local ok, query = pcall(vim.treesitter.query.get, lang, query_type) - local after = vim.uv.hrtime() - local duration = after - before + local duration = vim.uv.hrtime() - before table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) - io_print( - 'Checking ' .. lang .. ' ' .. query_type .. string.format(' (%.02fms)', duration * 1e-6) - ) + print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6)) if not ok then - local err_msg = lang .. ' (' .. query_type .. '): ' .. query - errors[#errors + 1] = err_msg + errors[#errors + 1] = string.format('%s (%s): %s', lang, query_type, query) else if query then for _, capture in ipairs(query.captures) do @@ -69,9 +54,8 @@ local function do_check() or vim.list_contains(captures[query_type], capture) ) if not is_valid then - local error = - string.format('(x) Invalid capture @%s in %s for %s.', capture, query_type, lang) - errors[#errors + 1] = error + errors[#errors + 1] = + string.format('%s (%s): invalid capture "@%s"', lang, query_type, capture) end end end @@ -80,37 +64,34 @@ local function do_check() end end - io_print('::endgroup::') - - if #errors > 0 then - io_print('\nCheck failed!\nErrors:') - for _, err in ipairs(errors) do - print(err) - end - error() - end - return timings + print('::endgroup::') end -local ok, result = pcall(do_check) -if ok then - io_print('::group::Timings') - table.sort(result, function(a, b) +-- Output +if #errors > 0 then + print('::group::Errors') + for _, err in ipairs(errors) do + print(err) + end + print('::endgroup::') + print('Check failed!\n') + vim.cmd.cq() +else + print('::group::Timings') + table.sort(timings, function(a, b) return a.duration < b.duration end) - for i, val in ipairs(result) do - io_print( + for i, val in ipairs(timings) do + print( string.format( '%i. %.02fms %s %s', - #result - i + 1, + #timings - i + 1, val.duration * 1e-6, val.lang, val.query_type ) ) end - io_print('::endgroup::') - io_print('Check successful!') -else - vim.cmd('cq') + print('::endgroup::') + print('Check successful!') end From 885c2960ef4be1c75b1391c1a458a811912f44a9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 28 Jan 2024 10:50:38 +0100 Subject: [PATCH 033/434] fix: better output for update-lockfile --- scripts/update-lockfile.lua | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua index 0c9288b6a..d77baed61 100755 --- a/scripts/update-lockfile.lua +++ b/scripts/update-lockfile.lua @@ -1,17 +1,15 @@ #!/usr/bin/env -S nvim -l vim.opt.runtimepath:append('.') local util = require('nvim-treesitter.util') +local parsers = require('nvim-treesitter.parsers').configs -- Load previous lockfile local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] ----@type table -local new_lockfile = {} - -local parsers = require('nvim-treesitter.parsers').configs - -local jobs = {} --- @type table +local jobs = {} ---@type table +local new_lockfile = {} ---@type table +local updates = {} ---@type string[] -- check for new revisions for k, p in pairs(parsers) do @@ -19,6 +17,7 @@ for k, p in pairs(parsers) do new_lockfile[k] = old_lockfile[k] print('Skipping ' .. k) elseif p.install_info then + print('Updating ' .. k) jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) end @@ -41,17 +40,25 @@ for k, p in pairs(parsers) do local sha = vim.split(stdout[line], '\t')[1] new_lockfile[name] = { revision = sha } - print(name .. ': ' .. sha) + if new_lockfile[name].revision ~= old_lockfile[name].revision then + updates[#updates + 1] = name + end end end end assert(#vim.tbl_keys(jobs) == 0) -local lockfile_json = vim.json.encode(new_lockfile) --[[@as string]] -if vim.fn.executable('jq') == 1 then - lockfile_json = - assert(vim.system({ 'jq', '--sort-keys' }, { stdin = lockfile_json }):wait().stdout) -end +if #updates > 0 then + -- write new lockfile + local lockfile_json = vim.json.encode(new_lockfile) --[[@as string]] + if vim.fn.executable('jq') == 1 then + lockfile_json = + assert(vim.system({ 'jq', '--sort-keys' }, { stdin = lockfile_json }):wait().stdout) + end + util.write_file(filename, lockfile_json) -util.write_file(filename, lockfile_json) + print(string.format('\nUpdated parsers: %s', table.concat(updates, ', '))) +else + print('\nAll parsers up to date!') +end From be5f9b0eaa522d99323b4bd8153dac1ee887f2f2 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Fri, 16 Feb 2024 01:55:07 -0600 Subject: [PATCH 034/434] fix: update add_predicate and add_directive calls for upstream (#6106) Update custom predicates and directives to handle multiple nodes per capture ID per changes upstream. --- plugin/query_predicates.lua | 49 ++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua index 7cd8fb618..06bf957f8 100644 --- a/plugin/query_predicates.lua +++ b/plugin/query_predicates.lua @@ -1,19 +1,44 @@ local query = vim.treesitter.query +local predicates = { + ---@param match TSQueryMatch + ---@param pred string[] + ---@param any boolean + ---@return boolean + ['kind-eq'] = function(match, pred, any) + local nodes = match[pred[2]] + if not nodes or #nodes == 0 then + return true + end + + local types = { unpack(pred, 3) } + for _, node in ipairs(nodes) do + local res = vim.list_contains(types, node:type()) + if any and res then + return true + elseif not any and not res then + return false + end + end + return not any + end, +} + -- register custom predicates (overwrite existing; needed for CI) ----@param match (TSNode|nil)[] +---@param match TSQueryMatch ---@param pred string[] ---@return boolean|nil query.add_predicate('kind-eq?', function(match, _, _, pred) - local node = match[pred[2]] - if not node then - return true - end + return predicates['kind-eq'](match, pred, false) +end, { force = true }) - local types = { unpack(pred, 3) } - return vim.list_contains(types, node:type()) -end, true) +---@param match TSQueryMatch +---@param pred string[] +---@return boolean|nil +query.add_predicate('any-kind-eq?', function(match, _, _, pred) + return predicates['kind-eq'](match, pred, true) +end, { force = true }) -- register custom directives @@ -24,7 +49,7 @@ local mimetype_aliases = { ['text/ecmascript'] = 'javascript', } ----@param match (TSNode|nil)[] +---@param match TSQueryMatch ---@param _ string ---@param bufnr integer ---@param pred string[] @@ -32,10 +57,6 @@ local mimetype_aliases = { query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, metadata) local id = pred[2] local node = match[id] - if not node then - return - end - local type_attr_value = vim.treesitter.get_node_text(node, bufnr, { metadata = metadata[id] }) local configured = mimetype_aliases[type_attr_value] if configured then @@ -44,4 +65,4 @@ query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, m local parts = vim.split(type_attr_value, '/', {}) metadata['injection.language'] = parts[#parts] end -end, true) +end, { force = true }) From 039fe9095d07910e71ec41ef38e0bffa378293e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Huy=20Ho=C3=A0ng?= Date: Sun, 18 Feb 2024 20:56:53 +0900 Subject: [PATCH 035/434] fix(format): update scripts to support nightly (#6126) No need for assert as the use is contained within the script only --- scripts/format-queries.lua | 39 ++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index 8639daf2b..f924b8064 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -14,25 +14,40 @@ else end ts.query.add_predicate('kind-eq?', function(match, _, _, pred) - local cap = match[pred[2]] - local node = type(cap) == 'table' and cap[1] or cap - if not node then + local nodes = match[pred[2]] + local types = { unpack(pred, 3) } + + if not nodes or #nodes == 0 then return true end - local types = { unpack(pred, 3) } - return vim.tbl_contains(types, node:type()) -end, true) + for _, node in pairs(nodes) do + if not vim.tbl_contains(types, node:type()) then + return false + end + end + return true +end, { + force = true, + all = true, +}) ts.query.add_predicate('is-start-of-line?', function(match, _, _, pred) - local cap = match[pred[2]] - local node = type(cap) == 'table' and cap[1] or cap - if not node then + local nodes = match[pred[2]] + if not nodes or #nodes == 0 then return true end - local start_row, start_col = node:start() - return vim.fn.indent(start_row + 1) == start_col -end) + for _, node in pairs(nodes) do + local start_row, start_col = node:start() + if vim.fn.indent(start_row + 1) ~= start_col then + return false + end + end + return true +end, { + force = true, + all = true, +}) --- Control the indent here. Change to \t if uses tab instead local indent_str = ' ' From 429e6f446b7f2e3201fa940b897414db73047634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Huy=20Ho=C3=A0ng?= Date: Tue, 27 Feb 2024 01:00:55 +0900 Subject: [PATCH 036/434] doc: better clarification of highlights/injections --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7ecb5690..55c0bc284 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,8 @@ For these types there is a _norm_ you will have to follow so that features work Here are some global advices: - Examples of queries can be found in [runtime/queries/](runtime/queries/) -- Note that (unlike tree-sitter) all matching patterns are applied, with the last one determining the visible highlight. +- For highlights, all matching patterns are applied, with the last one determining the visible capture & highlight. +- For injections, try your best to ensure that each captured node is only matched by a single pattern. - If the [parser is included in `nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/SUPPORTED_LANGUAGES.md`) and installed with `:TSInstall`, you can use Neovim's developer tools (`:checkhealth`, `:InspectTree`, `:EditQuery`, `:Inspect`) to test your queries. #### Inheriting languages From a8f5641ab3c8fbdfd1e454821ab34fc7db2c2651 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 24 Mar 2024 10:30:37 +0100 Subject: [PATCH 037/434] feat(install)!: remove support for C++ scanners --- CONTRIBUTING.md | 4 ++-- README.md | 2 +- lua/nvim-treesitter/install.lua | 16 +--------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 55c0bc284..c989b585c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ To add a new parser, edit the following files: zimbu = { install_info = { url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- local path or git repo - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c or src/scanner.cc + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c -- optional entries: branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" @@ -51,7 +51,7 @@ zimbu = { zimbu = { 'zu' }, ``` -**Note: We only support external scanners written in C (preferably) and C++03 for portability reasons.** +**Note: We only support external scanners written in C for portability reasons.** ## Queries diff --git a/README.md b/README.md index 4e98772b1..08794576c 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ local parser_config = require('nvim-treesitter.parsers').configs parser_config.zimbu = { install_info = { url = '~/projects/tree-sitter-zimbu', -- local path or git repo - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c or src/scanner.cc + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c -- optional entries: branch = 'develop', -- only needed if different from default branch location= 'parser', -- only needed if the parser is in subdirectory of a "monorepo" diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index b6e3c3de3..d9d2a16a2 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -347,7 +347,7 @@ local function select_compiler_args(repo, compiler) if compiler:find('zig$') or compiler:find('zig.exe$') then return { - 'c++', + 'cc', '-o', 'parser.so', repo.files, @@ -374,20 +374,6 @@ local function select_compiler_args(repo, compiler) end end - if - #vim.iter.filter( - --- @param file string - --- @return boolean - function(file) - local ext = fn.fnamemodify(file, ':e') - return ext == 'cc' or ext == 'cpp' or ext == 'cxx' - end, - repo.files - ) > 0 - then - add_cc_arg('-lstdc++') - end - if not iswin then add_cc_arg('-Wall') add_cc_arg('-Wextra') From 421e2fb7b254ea4878e3faeb86506fa87cd2548f Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 19 Apr 2024 10:11:06 +0100 Subject: [PATCH 038/434] feat: improve logging of failed installs --- lua/nvim-treesitter/install.lua | 162 +++++++++++++++++--------------- lua/nvim-treesitter/log.lua | 83 +++++----------- 2 files changed, 109 insertions(+), 136 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index d9d2a16a2..5927619d3 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -166,16 +166,17 @@ end --- @param logger Logger --- @param repo InstallInfo --- @param compile_location string +--- @return string? err local function do_generate_from_grammar(logger, repo, compile_location) if repo.generate_requires_npm then if not executable('npm') then - logger:error('NPM requires to be installed from grammar.js') + return logger:error('NPM requires to be installed from grammar.js') end logger:info('Installing NPM dependencies') local r = system({ 'npm', 'install' }, { cwd = compile_location }) if r.code > 0 then - logger:error('Error during `npm install`') + return logger:error('Error during `npm install`: %s', r.stderr) end end @@ -189,7 +190,7 @@ local function do_generate_from_grammar(logger, repo, compile_location) tostring(vim.treesitter.language_version), }, { cwd = compile_location }) if r.code > 0 then - logger:error('Error during "tree-sitter generate"') + return logger:error('Error during "tree-sitter generate": %s', r.stderr) end end @@ -199,6 +200,7 @@ end ---@param cache_dir string ---@param revision string ---@param project_dir string +---@return string? err local function do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) local is_github = repo.url:find('github.com', 1, true) local url = repo.url:gsub('.git$', '') @@ -228,7 +230,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, cwd = cache_dir, }) if r.code > 0 then - logger:error('Error during download, please verify your internet connection: %s', r.stderr) + return logger:error('Error during download, please verify your internet connection: %s', r.stderr) end logger:debug('Creating temporary directory: ' .. temp_dir) @@ -236,7 +238,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, local err = uv_mkdir(temp_dir, 493) a.main() if err then - logger:error('Could not create %s-tmp: %s', project_name, err) + return logger:error('Could not create %s-tmp: %s', project_name, err) end logger:info('Extracting ' .. project_name .. '...') @@ -251,12 +253,12 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, }) if r.code > 0 then - logger:error('Error during tarball extraction: %s', r.stderr) + return logger:error('Error during tarball extraction: %s', r.stderr) end err = uv_unlink(project_dir .. '.tar.gz') if err then - logger:error('Could not remove tarball: %s', err) + return logger:error('Could not remove tarball: %s', err) end a.main() @@ -264,7 +266,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, a.main() if err then - logger:error('Could not rename temp: %s', err) + return logger:error('Could not rename temp: %s', err) end util.delete(temp_dir) @@ -276,6 +278,7 @@ end ---@param cache_dir string ---@param revision string ---@param project_dir string +---@return string? err local function do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) logger:info('Downloading ' .. project_name .. '...') @@ -290,7 +293,7 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision, }) if r.code > 0 then - logger:error('Error during download, please verify your internet connection: ' .. r.stderr) + return logger:error('Error during download, please verify your internet connection: ', r.stderr) end logger:info('Checking out locked revision') @@ -303,7 +306,7 @@ local function do_download_git(logger, repo, project_name, cache_dir, revision, }) if r.code > 0 then - logger:error('Error while checking out revision: %s', r.stderr) + return logger:error('Error while checking out revision: %s', r.stderr) end end @@ -411,20 +414,9 @@ end ---@param lang string ---@param cache_dir string ---@param install_dir string ----@param force? boolean ---@param generate_from_grammar? boolean -local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) - if vim.list_contains(config.installed_parsers(), lang) then - if not force then - local yesno = - fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') - print('\n ') - if yesno:sub(1, 1) ~= 'y' then - return - end - end - end - +---@return string? err +local function install_lang0(lang, cache_dir, install_dir, generate_from_grammar) local logger = log.new('install/' .. lang) local repo = get_parser_install_info(lang) @@ -440,11 +432,11 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar if generate_from_grammar and not executable('tree-sitter') then - logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') + return logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') end if generate_from_grammar and not executable('node') then - logger:error('Node JS not found: `node` is not executable') + return logger:error('Node JS not found: `node` is not executable') end local revision = get_target_revision(lang) @@ -461,23 +453,26 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g revision = revision or repo.branch or 'master' - if can_download_tar(repo) then - do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) - else - do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) + local do_download = can_download_tar(repo) and do_download_tar or do_download_git + local err = do_download(logger, repo, project_name, cache_dir, revision, project_dir) + if err then + return err end end local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path) if generate_from_grammar then - do_generate_from_grammar(logger, repo, compile_location) + local err = do_generate_from_grammar(logger, repo, compile_location) + if err then + return err + end end logger:info('Compiling parser') local r = do_compile(repo, cc, compile_location) if r.code > 0 then - logger:error('Error during compilation: %s', r.stderr) + return logger:error('Error during compilation: %s', r.stderr) end local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' @@ -485,7 +480,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name) a.main() if err then - logger:error(err) + return logger:error(err) end local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') @@ -502,51 +497,55 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) a.main() if err then - logger:error(err) + return logger:error(err) end logger:info('Language installed') end ---- Throttles a function using the first argument as an ID ---- ---- If function is already running then the function will be scheduled to run ---- again once the running call has finished. ---- ---- fn#1 _/‾\__/‾\_/‾\_____________________________ ---- throttled#1 _/‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\/‾‾‾‾‾‾‾‾‾‾\____________ --- ---- fn#2 ______/‾\___________/‾\___________________ ---- throttled#2 ______/‾‾‾‾‾‾‾‾‾‾\__/‾‾‾‾‾‾‾‾‾‾\__________ ---- ---- ---- @generic F: function ---- @param f F Function to throttle ---- @return F throttled function. -local function throttle_by_id(f) - local scheduled = {} --- @type table - local running = {} --- @type table - return function(id, ...) - if scheduled[id] then - -- If f is already scheduled, then drop - return - end - if not running[id] then - scheduled[id] = true - end - if running[id] then - return - end - while scheduled[id] do - scheduled[id] = nil - running[id] = true - f(id, ...) - running[id] = nil +--- @alias InstallStatus +--- | 'installing' +--- | 'installed' +--- | 'failed' +--- | 'timeout' + +local install_status = {} --- @type table + +local INSTALL_TIMEOUT = 60000 + +---@param lang string +---@param cache_dir string +---@param install_dir string +---@param force? boolean +---@param generate_from_grammar? boolean +---@return InstallStatus status +local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) + if not force and vim.list_contains(config.installed_parsers(), lang) then + local yesno = + fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') + print('\n ') + if yesno:sub(1, 1) ~= 'y' then + install_status[lang] = 'installed' + return 'installed' end end -end --- Async functions must not be interleaved -local install_lang_throttled = throttle_by_id(install_lang) + if install_status[lang] then + if install_status[lang] == 'installing' then + vim.wait(INSTALL_TIMEOUT, function() + return install_status[lang] ~= 'installing' + end) + install_status[lang] = 'timeout' + end + else + install_status[lang] = 'installing' + local err = install_lang0(lang, cache_dir, install_dir, generate_from_grammar) + install_status[lang] = err and 'failed' or 'installed' + end + + local status = install_status[lang] + assert(status and status ~= 'installing') + return status +end ---@class InstallOptions ---@field force? boolean @@ -586,8 +585,10 @@ local function install(languages, options, _callback) for _, lang in ipairs(languages) do tasks[#tasks + 1] = a.sync(function() a.main() - install_lang_throttled(lang, cache_dir, install_dir, force, generate_from_grammar) - done = done + 1 + local status = install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) + if status ~= 'failed' then + done = done + 1 + end end) end @@ -621,12 +622,14 @@ M.update = a.sync(function(languages, _options, _callback) end end, 2) +--- @param logger Logger --- @param lang string --- @param parser string --- @param queries string -local function uninstall_lang(lang, parser, queries) - local logger = log.new('uninstall/' .. lang) +--- @return string? err +local function uninstall_lang(logger, lang, parser, queries) logger:debug('Uninstalling ' .. lang) + install_status[lang] = nil if vim.fn.filereadable(parser) == 1 then logger:debug('Unlinking ' .. parser) @@ -634,7 +637,7 @@ local function uninstall_lang(lang, parser, queries) a.main() if perr then - log.error(perr) + return logger:error(perr) end end @@ -644,7 +647,7 @@ local function uninstall_lang(lang, parser, queries) a.main() if qerr then - logger:error(qerr) + return logger:error(qerr) end end @@ -664,14 +667,17 @@ M.uninstall = a.sync(function(languages, _options, _callback) local tasks = {} --- @type fun()[] local done = 0 for _, lang in ipairs(languages) do + local logger = log.new('uninstall/' .. lang) if not vim.list_contains(installed, lang) then log.warn('Parser for ' .. lang .. ' is is not managed by nvim-treesitter') else local parser = fs.joinpath(parser_dir, lang) .. '.so' local queries = fs.joinpath(query_dir, lang) tasks[#tasks + 1] = a.sync(function() - uninstall_lang(lang, parser, queries) - done = done + 1 + local err = uninstall_lang(logger, lang, parser, queries) + if not err then + done = done + 1 + end end) end end diff --git a/lua/nvim-treesitter/log.lua b/lua/nvim-treesitter/log.lua index 83f0b41c2..faf131094 100644 --- a/lua/nvim-treesitter/log.lua +++ b/lua/nvim-treesitter/log.lua @@ -1,4 +1,4 @@ -local api = vim.api +local echo = vim.api.nvim_echo -- TODO(lewis6991): write these out to a file local messages = {} --- @type {[1]: string, [2]: string?, [3]: string}[] @@ -11,69 +11,28 @@ local sev_to_hl = { error = 'ErrorMsg', } ----@param ctx string? ----@param m string ----@param ... any -local function trace(ctx, m, ...) - messages[#messages + 1] = { 'trace', ctx, string.format(m, ...) } -end - ----@param ctx string? ----@param m string ----@param ... any -local function debug(ctx, m, ...) - messages[#messages + 1] = { 'debug', ctx, string.format(m, ...) } -end - ---@param ctx string? ---@return string local function mkpfx(ctx) return ctx and string.format('[nvim-treesitter/%s]', ctx) or '[nvim-treesitter]' end ----@param ctx string? ----@param m string ----@param ... any -local function info(ctx, m, ...) - local m1 = string.format(m, ...) - messages[#messages + 1] = { 'info', ctx, m1 } - api.nvim_echo({ { mkpfx(ctx) .. ': ' .. m1, sev_to_hl.info } }, true, {}) -end - ----@param ctx string? ----@param m string ----@param ... any -local function warn(ctx, m, ...) - local m1 = string.format(m, ...) - messages[#messages + 1] = { 'warn', ctx, m1 } - api.nvim_echo({ { mkpfx(ctx) .. ' warning: ' .. m1, sev_to_hl.warn } }, true, {}) -end - ----@param ctx string? ----@param m string ----@param ... any -local function lerror(ctx, m, ...) - local m1 = string.format(m, ...) - messages[#messages + 1] = { 'error', ctx, m1 } - error(mkpfx(ctx) .. ' error: ' .. m1) -end - ---- @class NTSLogModule ---- @field trace fun(fmt: string, ...: any) ---- @field debug fun(fmt: string, ...: any) ---- @field info fun(fmt: string, ...: any) ---- @field warn fun(fmt: string, ...: any) ---- @field error fun(fmt: string, ...: any) +---@class TSLogModule +---@field trace fun(fmt: string, ...: any) +---@field debug fun(fmt: string, ...: any) +---@field info fun(fmt: string, ...: any) +---@field warn fun(fmt: string, ...: any) +---@field error fun(fmt: string, ...: any) local M = {} ---- @class Logger ---- @field ctx? string +---@class Logger +---@field ctx? string local Logger = {} M.Logger = Logger ---- @param ctx? string ---- @return Logger +---@param ctx? string +---@return Logger function M.new(ctx) return setmetatable({ ctx = ctx }, { __index = Logger }) end @@ -81,31 +40,39 @@ end ---@param m string ---@param ... any function Logger:trace(m, ...) - trace(self.ctx, m, ...) + messages[#messages + 1] = { 'trace', self.ctx, m:format(...) } end ---@param m string ---@param ... any function Logger:debug(m, ...) - debug(self.ctx, m, ...) + messages[#messages + 1] = { 'debug', self.ctx, m:format(...) } end ---@param m string ---@param ... any function Logger:info(m, ...) - info(self.ctx, m, ...) + local m1 = m:format(...) + messages[#messages + 1] = { 'info', self.ctx, m1 } + echo({ { mkpfx(self.ctx) .. ': ' .. m1, sev_to_hl.info } }, true, {}) end ---@param m string ---@param ... any function Logger:warn(m, ...) - warn(self.ctx, m, ...) + local m1 = m:format(...) + messages[#messages + 1] = { 'warn', self.ctx, m1 } + echo({ { mkpfx(self.ctx) .. ' warning: ' .. m1, sev_to_hl.warn } }, true, {}) end ---@param m string ---@param ... any +---@return string function Logger:error(m, ...) - lerror(self.ctx, m, ...) + local m1 = m:format(...) + messages[#messages + 1] = { 'error', self.ctx, m1 } + echo({ { mkpfx(self.ctx) .. ' error: ' .. m1, sev_to_hl.error } }, true, {}) + return m1 end local noctx_logger = M.new() @@ -126,7 +93,7 @@ function M.show() local hl = sev_to_hl[sev] local text = ctx and string.format('%s(%s): %s', sev, ctx, msg) or string.format('%s: %s', sev, msg) - api.nvim_echo({ { text, hl } }, false, {}) + echo({ { text, hl } }, false, {}) end end From 0bb981c87604200df6c8fb81e5a411101bdf93af Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 19 Apr 2024 18:12:54 +0100 Subject: [PATCH 039/434] fix: do not use vim.iter (#6469) --- lua/nvim-treesitter/config.lua | 53 +++++++++++++++++++++++---------- lua/nvim-treesitter/install.lua | 11 ++++--- lua/nvim-treesitter/parsers.lua | 22 +++++++++----- plugin/nvim-treesitter.lua | 20 +++++++++---- 4 files changed, 71 insertions(+), 35 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index cd4a3a178..a52c6a10e 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -106,12 +106,17 @@ function M.norm_languages(languages, skip) end -- keep local to avoid leaking parsers module + --- @param list string[] local function expand_tiers(list) for i, tier in ipairs(parsers.tiers) do if vim.list_contains(list, tier) then - list = vim.iter.filter(function(l) - return l ~= tier - end, list) --[[@as string[] ]] + list = vim.tbl_filter( + --- @param l string + function(l) + return l ~= tier + end, + list + ) vim.list_extend(list, parsers.get_available(i)) end end @@ -123,29 +128,45 @@ function M.norm_languages(languages, skip) if skip and skip.ignored then local ignored = expand_tiers(config.ignore_install) - languages = vim.iter.filter(function(v) - return not vim.list_contains(ignored, v) - end, languages) --[[@as string[] ]] + languages = vim.tbl_filter( + --- @param v string + function(v) + return not vim.list_contains(ignored, v) + end, + languages + ) end if skip and skip.installed then local installed = M.installed_parsers() - languages = vim.iter.filter(function(v) - return not vim.list_contains(installed, v) - end, languages) --[[@as string[] ]] + languages = vim.tbl_filter( + --- @param v string + function(v) + return not vim.list_contains(installed, v) + end, + languages + ) end if skip and skip.missing then local installed = M.installed_parsers() - languages = vim.iter.filter(function(v) - return vim.list_contains(installed, v) - end, languages) --[[@as string[] ]] + languages = vim.tbl_filter( + --- @param v string + function(v) + return vim.list_contains(installed, v) + end, + languages + ) end - languages = vim.iter.filter(function(v) - -- TODO(lewis6991): warn of any unknown parsers? - return parsers.configs[v] ~= nil - end, languages) --[[@as string[] ]] + languages = vim.tbl_filter( + --- @param v string + function(v) + -- TODO(lewis6991): warn of any unknown parsers? + return parsers.configs[v] ~= nil + end, + languages + ) if not (skip and skip.dependencies) then for _, lang in pairs(languages) do diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 5927619d3..1bb7d6fea 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -152,7 +152,7 @@ end local function cc_err() log.error( 'No C compiler found! "' - .. table.concat(vim.iter.filter(istring, M.compilers), '", "') + .. table.concat(vim.tbl_filter(istring, M.compilers), '", "') .. '" are not executable.' ) end @@ -230,7 +230,7 @@ local function do_download_tar(logger, repo, project_name, cache_dir, revision, cwd = cache_dir, }) if r.code > 0 then - return logger:error('Error during download, please verify your internet connection: %s', r.stderr) + return logger:error('Error during download: %s', r.stderr) end logger:debug('Creating temporary directory: ' .. temp_dir) @@ -328,7 +328,7 @@ end ---@param executables string[] ---@return string? function M.select_executable(executables) - return vim.iter.filter(executable, executables)[1] + return vim.tbl_filter(executable, executables)[1] end -- Returns the compiler arguments based on the compiler and OS @@ -520,8 +520,7 @@ local INSTALL_TIMEOUT = 60000 ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) if not force and vim.list_contains(config.installed_parsers(), lang) then - local yesno = - fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') + local yesno = fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') print('\n ') if yesno:sub(1, 1) ~= 'y' then install_status[lang] = 'installed' @@ -613,7 +612,7 @@ M.update = a.sync(function(languages, _options, _callback) languages = 'all' end languages = config.norm_languages(languages, { ignored = true, missing = true }) - languages = vim.iter.filter(needs_update, languages) --- @type string[] + languages = vim.tbl_filter(needs_update, languages) --- @type string[] if #languages > 0 then install(languages, { force = true }) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 25efd5d9d..538f2336c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -3010,15 +3010,23 @@ function M.get_available(tier) local parsers = vim.tbl_keys(M.configs) table.sort(parsers) if tier then - parsers = vim.iter.filter(function(p) - return M.configs[p].tier == tier - end, parsers) --[[@as string[] ]] + parsers = vim.tbl_filter( + --- @param p string + function(p) + return M.configs[p].tier == tier + end, + parsers + ) end if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then - parsers = vim.iter.filter(function(p) - return M.configs[p].install_info - and not M.configs[p].install_info.requires_generate_from_grammar - end, parsers) --[[@as string[] ]] + parsers = vim.tbl_filter( + --- @param p string + function(p) + return M.configs[p].install_info ~= nil + and not M.configs[p].install_info.requires_generate_from_grammar + end, + parsers + ) end return parsers end diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 0bcbe07c3..751e8aad1 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -6,15 +6,23 @@ vim.g.loaded_nvim_treesitter = true local api = vim.api local function complete_available_parsers(arglead) - return vim.iter.filter(function(v) - return v:find(arglead) - end, require('nvim-treesitter.parsers').get_available()) + return vim.tbl_filter( + --- @param v string + function(v) + return v:find(arglead) ~= nil + end, + require('nvim-treesitter.parsers').get_available() + ) end local function complete_installed_parsers(arglead) - return vim.iter.filter(function(v) - return v:find(arglead) - end, require('nvim-treesitter.config').installed_parsers()) + return vim.tbl_filter( + --- @param v string + function(v) + return v:find(arglead) ~= nil + end, + require('nvim-treesitter.config').installed_parsers() + ) end -- create user commands From c70daa36dcc2fdae113637fba76350daaf62dba5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 21 Apr 2024 00:14:12 +0200 Subject: [PATCH 040/434] feat(install)!: add explicit path field to parser info (#6476) Problem: Using `url` for both remote repo and local path complicates the code. Solution: Add `path` field that overrides `url` and bypasses git-specific manipulations, i.e., the contents of the `path` are used as-is (no git repo needed). This means `:TSUpdate` will skip such parsers; use `:TSInstall!` instead after making local changes. --------- Co-authored-by: Lewis Russell --- lua/nvim-treesitter/install.lua | 98 ++++++++++++-------------------- lua/nvim-treesitter/parsers.lua | 33 +++++------ runtime/queries/rust/indents.scm | 1 + 3 files changed, 55 insertions(+), 77 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 1bb7d6fea..57671d7d3 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -123,28 +123,6 @@ end --- PARSER MANAGEMENT FUNCTIONS --- ---- @param repo InstallInfo ---- @param project_name string ---- @param cache_dir string ---- @param from_local_path boolean ---- @return string -local function get_compile_location(repo, cache_dir, project_name, from_local_path) - ---@type string compile_location only needed for typescript installs. - if from_local_path then - local compile_location = repo.url - if repo.location then - compile_location = fs.joinpath(compile_location, repo.location) - end - return compile_location - end - - local repo_location = project_name - if repo.location then - repo_location = fs.joinpath(repo_location, repo.location) - end - return fs.joinpath(cache_dir, repo_location) -end - local function istring(c) return type(c) == 'string' end @@ -168,6 +146,10 @@ end --- @param compile_location string --- @return string? err local function do_generate_from_grammar(logger, repo, compile_location) + if not executable('tree-sitter') then + return logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') + end + if repo.generate_requires_npm then if not executable('npm') then return logger:error('NPM requires to be installed from grammar.js') @@ -400,23 +382,29 @@ local function can_download_tar(repo) 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 vim.SystemCompleted -local function do_compile(repo, cc, compile_location) +--- @return string? err +local function do_compile(logger, repo, cc, compile_location) local args = vim.tbl_flatten(select_compiler_args(repo, cc)) local cmd = vim.list_extend({ cc }, args) - return system(cmd, { cwd = compile_location }) + logger:info('Compiling parser') + + local r = system(cmd, { cwd = compile_location }) + if r.code > 0 then + return logger:error('Error during compilation: %s', r.stderr) + end end ---@param lang string ---@param cache_dir string ---@param install_dir string ----@param generate_from_grammar? boolean +---@param generate? boolean ---@return string? err -local function install_lang0(lang, cache_dir, install_dir, generate_from_grammar) +local function install_lang0(lang, cache_dir, install_dir, generate) local logger = log.new('install/' .. lang) local repo = get_parser_install_info(lang) @@ -429,50 +417,43 @@ local function install_lang0(lang, cache_dir, install_dir, generate_from_grammar local project_name = 'tree-sitter-' .. lang - generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar - - if generate_from_grammar and not executable('tree-sitter') then - return logger:error('tree-sitter CLI not found: `tree-sitter` is not executable') - end - - if generate_from_grammar and not executable('node') then - return logger:error('Node JS not found: `node` is not executable') - end - local revision = get_target_revision(lang) - local maybe_local_path = fs.normalize(repo.url) - local from_local_path = fn.isdirectory(maybe_local_path) == 1 - if from_local_path then - repo.url = maybe_local_path - end - - if not from_local_path then - util.delete(fs.joinpath(cache_dir, project_name)) + local compile_location ---@type string + if repo.path then + compile_location = fs.normalize(repo.path) + else local project_dir = fs.joinpath(cache_dir, project_name) + util.delete(project_dir) - revision = revision or repo.branch or 'master' + revision = revision or repo.branch or 'main' local do_download = can_download_tar(repo) and do_download_tar or do_download_git local err = do_download(logger, repo, project_name, cache_dir, revision, project_dir) if err then return err end + compile_location = fs.joinpath(cache_dir, project_name) end - local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path) + if repo.location then + compile_location = fs.joinpath(compile_location, repo.location) + end - if generate_from_grammar then - local err = do_generate_from_grammar(logger, repo, compile_location) - if err then - return err + do + if repo.generate or generate then + local err = do_generate_from_grammar(logger, repo, compile_location) + if err then + return err + end end end - logger:info('Compiling parser') - local r = do_compile(repo, cc, compile_location) - if r.code > 0 then - return logger:error('Error during compilation: %s', r.stderr) + do + local err = do_compile(logger, repo, cc, compile_location) + if err then + return err + end end local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so' @@ -486,7 +467,7 @@ local function install_lang0(lang, cache_dir, install_dir, generate_from_grammar local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') util.write_file(revfile, revision or '') - if not from_local_path then + if not repo.path then util.delete(fs.joinpath(cache_dir, project_name)) end end @@ -561,11 +542,6 @@ local function install(languages, options, _callback) local generate_from_grammar = options.generate_from_grammar local skip = options.skip - if not executable('git') then - log.error('Git is required on your system to run this command') - return - end - local cache_dir = vim.fs.normalize(fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 538f2336c..6f5915da1 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1,18 +1,19 @@ ---@class InstallInfo +---@field path? string ---@field url string ----@field branch string|nil ----@field revision string|nil Used to override lockfile revision +---@field branch? string +---@field revision? string ---@field files string[] ----@field generate_requires_npm boolean|nil ----@field requires_generate_from_grammar boolean|nil ----@field location string|nil +---@field generate_requires_npm? boolean +---@field generate? boolean +---@field location? string ---@class ParserInfo ----@field install_info InstallInfo? ----@field maintainers string[]? ----@field requires string[]? +---@field install_info? InstallInfo +---@field maintainers? string[] +---@field requires? string[] ---@field tier integer ----@field readme_note string|nil? +---@field readme_note? string local M = {} @@ -1413,7 +1414,7 @@ M.configs = { install_info = { url = 'https://github.com/latex-lsp/tree-sitter-latex', files = { 'src/parser.c', 'src/scanner.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@theHamsta', '@clason' }, tier = 2, @@ -1591,7 +1592,7 @@ M.configs = { install_info = { url = 'https://github.com/artagnon/tree-sitter-mlir', files = { 'src/parser.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@artagnon' }, tier = 4, @@ -1731,7 +1732,7 @@ M.configs = { install_info = { url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', files = { 'src/parser.c', 'src/scanner.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@undu' }, tier = 3, @@ -2246,7 +2247,7 @@ M.configs = { install_info = { url = 'https://github.com/rockorager/tree-sitter-scfg', files = { 'src/parser.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@WhyNotHugo' }, tier = 3, @@ -2489,7 +2490,7 @@ M.configs = { install_info = { url = 'https://github.com/alex-pinkus/tree-sitter-swift', files = { 'src/parser.c', 'src/scanner.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@alex-pinkus' }, tier = 3, @@ -2544,7 +2545,7 @@ M.configs = { install_info = { url = 'https://github.com/euclidianAce/tree-sitter-teal', files = { 'src/parser.c', 'src/scanner.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@euclidianAce' }, tier = 3, @@ -2753,7 +2754,7 @@ M.configs = { install_info = { url = 'https://github.com/kylegoetz/tree-sitter-unison', files = { 'src/parser.c', 'src/scanner.c' }, - requires_generate_from_grammar = true, + generate = true, }, maintainers = { '@tapegram' }, tier = 4, diff --git a/runtime/queries/rust/indents.scm b/runtime/queries/rust/indents.scm index 9fe337d5c..934d1c169 100644 --- a/runtime/queries/rust/indents.scm +++ b/runtime/queries/rust/indents.scm @@ -91,6 +91,7 @@ (tuple_struct_pattern ")" @indent.end) + ; Typing in "(" inside macro definitions breaks the tree entirely ; Making macro_definition becoming errors ; Offset this by adding back one indent for start of macro rules From 8f8cf7144d2cd6bfb66d27031cf49b28d1037559 Mon Sep 17 00:00:00 2001 From: "nvim-treesitter-bot[bot]" <157957100+nvim-treesitter-bot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:59:42 +0000 Subject: [PATCH 041/434] bot(readme): update --- SUPPORTED_LANGUAGES.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index dea60f0b4..3d559ab5e 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -141,7 +141,7 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [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 | `H  JL` | | | @traxys -[latex](https://github.com/latex-lsp/tree-sitter-latex) | core | `HF J ` | ✓ | | @theHamsta, @clason +[latex](https://github.com/latex-lsp/tree-sitter-latex) | core | `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/amaanq/tree-sitter-linkerscript) | core | `HFIJL` | | | @amaanq @@ -160,7 +160,7 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [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/Decodetalkers/tree-sitter-meson) | community | `HFIJ ` | | | @Decodetalkers -[mlir](https://github.com/artagnon/tree-sitter-mlir) | unsupported | `H   L` | ✓ | | @artagnon +[mlir](https://github.com/artagnon/tree-sitter-mlir) | unsupported | `H   L` | | | @artagnon [muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | | @Freed-Wu [nasm](https://github.com/naclsn/tree-sitter-nasm) | core | `H  J ` | | | @ObserverOfTime [nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unsupported | `H I  ` | | | @@ -173,7 +173,7 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | community | `H  J ` | | | @ColinKennedy [ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | community | `HFIJL` | | | @undu [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | community | `HFIJL` | | | @undu -[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | ✓ | | @undu +[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | | | @undu [odin](https://github.com/amaanq/tree-sitter-odin) | core | `HFIJL` | | | @amaanq [org](https://github.com/milisims/tree-sitter-org) | unsupported | `     ` | | | [pascal](https://github.com/Isopod/tree-sitter-pascal.git) | community | `HFIJL` | | | @Isopod @@ -221,7 +221,7 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [ruby](https://github.com/tree-sitter/tree-sitter-ruby) | community | `HFIJL` | | | @TravonteD [rust](https://github.com/tree-sitter/tree-sitter-rust) | core | `HFIJL` | | | @amaanq [scala](https://github.com/tree-sitter/tree-sitter-scala) | community | `HF JL` | | | @stevanmilic -[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H  J ` | ✓ | | @WhyNotHugo +[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/theHamsta/tree-sitter-slang)[^slang] | unsupported | `HFIJL` | | ✓ | @theHamsta @@ -243,13 +243,13 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [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 +[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.git) | community | `HFIJL` | | | @xasc [tablegen](https://github.com/amaanq/tree-sitter-tablegen) | core | `HFIJL` | | | @amaanq [tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | core | `HFI  ` | | | @lewis6991 -[teal](https://github.com/euclidianAce/tree-sitter-teal) | community | `HFIJL` | ✓ | | @euclidianAce +[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 @@ -268,7 +268,7 @@ jsx (queries only)[^jsx] | core | `HFIJ ` | | | @steelsojka [typst](https://github.com/uben0/tree-sitter-typst) | community | `HFIJ ` | | | @uben0, @RaafatTurki [udev](https://github.com/ObserverOfTime/tree-sitter-udev) | core | `H  JL` | | | @ObserverOfTime [ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) | community | `HFIJL` | | | @Philipp-M, @amaanq -[unison](https://github.com/kylegoetz/tree-sitter-unison) | unsupported | `H  J ` | ✓ | | @tapegram +[unison](https://github.com/kylegoetz/tree-sitter-unison) | unsupported | `H  J ` | | | @tapegram [usd](https://github.com/ColinKennedy/tree-sitter-usd) | community | `HFI L` | | | @ColinKennedy [uxntal](https://github.com/amaanq/tree-sitter-uxntal) | core | `HFIJL` | | | @amaanq [v](https://github.com/vlang/v-analyzer) | community | `HFIJL` | | | @kkharji, @amaanq From 5a38df5627fd0658223bdf32c9d6a87e32eb9504 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 18 Apr 2024 09:44:38 +0200 Subject: [PATCH 042/434] feat(install)!: generate from json instead of requiring node Problem: Many parsers require node/npm to evaluate the `grammar.js` before being able to generate a parser from it. Solution: Generate from `grammar.json` instead, which is fully resolved. Drops `node` and `npm` as (optional) requirements for nvim-treesitter. Note that this requires parsers to commit the generated json iff the grammar requires evaluation (which is currently the case for all tracked languages). --- .github/workflows/lint.yml | 3 +- CONTRIBUTING.md | 4 +- README.md | 4 +- SUPPORTED_LANGUAGES.md | 561 ++++++++++++++++---------------- lua/nvim-treesitter/health.lua | 10 +- lua/nvim-treesitter/install.lua | 44 ++- lua/nvim-treesitter/parsers.lua | 327 ++++++++++--------- plugin/nvim-treesitter.lua | 2 +- scripts/install-parsers.lua | 20 +- scripts/update-readme.lua | 11 +- 10 files changed, 502 insertions(+), 484 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e51833814..cd97cda06 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,12 +40,13 @@ jobs: NVIM_TAG: nightly steps: - uses: actions/checkout@v4 + - uses: tree-sitter/setup-action/cli@v1 - name: Prepare run: | bash ./scripts/ci-install.sh - name: Lint run: | - nvim --headless -c "TSInstallSync query" -c "q" + nvim -l scripts/install-parsers.lua query nvim -l scripts/format-queries.lua git diff --exit-code diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c989b585c..d043e6b08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,8 +24,8 @@ zimbu = { branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" revision = 'v2.1', -- tag or commit hash; bypasses automated updates - requires_generate_from_grammar = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_requires_npm = true, -- only needed if parser has npm dependencies + generate = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_from_json = true, -- only needed if grammar.js has npm-installed dependencies }, maintainers = { '@me' }, -- the _query_ maintainers tier = 3, -- community-contributed parser diff --git a/README.md b/README.md index 08794576c..6e3a52845 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,8 @@ parser_config.zimbu = { -- optional entries: branch = 'develop', -- only needed if different from default branch location= 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - requires_generate_from_grammar = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_requires_npm = true, -- only needed if parser has npm dependencies + generate = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_from_json = true, -- only needed if parser has npm dependencies }, } ``` diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 3d559ab5e..a63f603e7 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -5,291 +5,290 @@ 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 -- **NPM:** `:TSInstallFromGrammar` requires `node` installed - **Queries** available for **H**ighlights, **I**ndents, **F**olds, In**J**ections, **L**ocals -Language | Tier | Queries | CLI | NPM | Maintainer --------- |:----:|:-------:|:---:|:---:| ---------- -[ada](https://github.com/briot/tree-sitter-ada) | community | `HF  L` | | | @briot -[agda](https://github.com/tree-sitter/tree-sitter-agda) | community | `HF   ` | | | @Decodetalkers -[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unsupported | `HFIJL` | | ✓ | @dlvandenberg -[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF  L` | | | @aheber -[arduino](https://github.com/ObserverOfTime/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) | community | `HF JL` | | | @TravonteD -[bass](https://github.com/vito/tree-sitter-bass) | core | `HFIJL` | | | @amaanq -[beancount](https://github.com/polarmutex/tree-sitter-beancount) | community | `HF J ` | | | @polarmutex -[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | core | `HFI  ` | | | @theHamsta, @clason -[bicep](https://github.com/amaanq/tree-sitter-bicep) | core | `HFIJL` | | | @amaanq -[bitbake](https://github.com/amaanq/tree-sitter-bitbake) | core | `HFIJL` | | | @amaanq -[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) | 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) | community | `HF JL` | | | @Luxed -[cairo](https://github.com/amaanq/tree-sitter-cairo) | core | `HFIJL` | | | @amaanq -[capnp](https://github.com/amaanq/tree-sitter-capnp) | core | `HFIJL` | | | @amaanq -[chatito](https://github.com/ObserverOfTime/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) | unsupported | `HFI  ` | | | @uyha -[comment](https://github.com/stsewd/tree-sitter-comment) | core | `H    ` | | | @stsewd -[commonlisp](https://github.com/theHamsta/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/amaanq/tree-sitter-cpon) | core | `HFIJL` | | | @amaanq -[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | stable | `HFIJL` | | ✓ | @theHamsta -[css](https://github.com/tree-sitter/tree-sitter-css) | community | `HFIJ ` | | | @TravonteD -[csv](https://github.com/amaanq/tree-sitter-csv) | core | `H    ` | | | @amaanq -[cuda](https://github.com/theHamsta/tree-sitter-cuda) | core | `HFIJL` | | ✓ | @theHamsta -[cue](https://github.com/eonpatapon/tree-sitter-cue) | core | `HFIJL` | | | @amaanq -[d](https://github.com/gdamore/tree-sitter-d) | core | `HFIJL` | | | @amaanq -[dart](https://github.com/UserNobody14/tree-sitter-dart) | unsupported | `HFIJL` | | | @akinsho -[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | community | `HFIJL` | | | @jedrzejboczar -[dhall](https://github.com/jbellerb/tree-sitter-dhall) | core | `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/amaanq/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) | unsupported | `H    ` | | | @RubixDev -ecma (queries only)[^ecma] | core | `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) | unsupported | `H  J ` | | | @zweimach -[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | core | `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/amaanq/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) | core | `HFIJL` | | | @amaanq -[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | core | `HFI  ` | | | @amaanq -[fsh](https://github.com/mgramigna/tree-sitter-fsh) | community | `H    ` | | | @mgramigna -[func](https://github.com/amaanq/tree-sitter-func) | core | `H    ` | | | @amaanq -[fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) | 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) | core | `HF J ` | | | @amaanq -[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | community | `H  J ` | | | @gbprod -[gitattributes](https://github.com/ObserverOfTime/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) | core | `H    ` | | | @theHamsta -[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | core | `HFIJL` | | | @amaanq -[glimmer](https://github.com/alexlafroscia/tree-sitter-glimmer)[^glimmer] | community | `HFI L` | | | @NullVoxPopuli -[glsl](https://github.com/theHamsta/tree-sitter-glsl) | core | `HFIJL` | | ✓ | @theHamsta -[gn](https://github.com/amaanq/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) | stable | `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/amaanq/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/ObserverOfTime/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/theHamsta/tree-sitter-gstlaunch) | core | `H    ` | | | @theHamsta -[hack](https://github.com/slackhq/tree-sitter-hack) | unsupported | `H    ` | | | -[hare](https://github.com/amaanq/tree-sitter-hare) | core | `HFIJL` | | | @amaanq -[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | community | `HF J ` | | | @mrcjkb -[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | community | `HF   ` | | | @lykahb -[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | community | `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/theHamsta/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) | unsupported | `HF  L` | | | @urbit-pilled -[html](https://github.com/tree-sitter/tree-sitter-html) | community | `HFIJL` | | | @TravonteD -html_tags (queries only)[^html_tags] | community | `H IJ ` | | | @TravonteD -[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unsupported | `HFIJ ` | | | @ObserverOfTime -[http](https://github.com/rest-nvim/tree-sitter-http) | core | `H  J ` | | | @amaanq, @NTBBloodbath -[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj -[hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) | community | `HFIJ ` | | | @luckasRanarison -[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H  J ` | | | @cathaysa -[ini](https://github.com/justinmk/tree-sitter-ini) | unsupported | `HF   ` | | | @theHamsta -[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | | | @yorickpeterse -[ispc](https://github.com/fab4100/tree-sitter-ispc) | community | `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) | community | `HFIJL` | | | @p00f -[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | core | `HFIJL` | | | @steelsojka -[jq](https://github.com/flurie/tree-sitter-jq) | core | `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.git) | community | `HFIJL` | | ✓ | @WhyNotHugo -[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | community | `HF  L` | | | @nawordar -jsx (queries only)[^jsx] | core | `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/amaanq/tree-sitter-kconfig) | core | `HFIJL` | | | @amaanq -[kdl](https://github.com/amaanq/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 | `H  JL` | | | @traxys -[latex](https://github.com/latex-lsp/tree-sitter-latex) | core | `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/amaanq/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/MunifTanjim/tree-sitter-lua) | stable | `HFIJL` | | | @muniftanjim -[luadoc](https://github.com/amaanq/tree-sitter-luadoc) | core | `H    ` | | | @amaanq -[luap](https://github.com/amaanq/tree-sitter-luap)[^luap] | core | `H    ` | | | @amaanq -[luau](https://github.com/amaanq/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) | core | `HF J ` | | | @lewis6991 -[markdown](https://github.com/MDeiml/tree-sitter-markdown)[^markdown] | stable | `HFIJ ` | | | @MDeiml -[markdown_inline](https://github.com/MDeiml/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/Decodetalkers/tree-sitter-meson) | community | `HFIJ ` | | | @Decodetalkers -[mlir](https://github.com/artagnon/tree-sitter-mlir) | unsupported | `H   L` | | | @artagnon -[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | community | `H  J ` | | | @Freed-Wu -[nasm](https://github.com/naclsn/tree-sitter-nasm) | core | `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/amaanq/tree-sitter-nqc) | core | `HFIJL` | | | @amaanq -[objc](https://github.com/amaanq/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) | community | `HFIJL` | | | @undu -[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | community | `HFIJL` | | | @undu -[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | community | `H  J ` | | | @undu -[odin](https://github.com/amaanq/tree-sitter-odin) | core | `HFIJL` | | | @amaanq -[org](https://github.com/milisims/tree-sitter-org) | unsupported | `     ` | | | -[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | community | `HFIJL` | | | @Isopod -[passwd](https://github.com/ath3/tree-sitter-passwd) | community | `H    ` | | | @amaanq -[pem](https://github.com/ObserverOfTime/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] | community | `HFIJL` | | | @tk-shirasaka -[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | community | `HFIJL` | | | @tk-shirasaka -[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unsupported | `H    ` | | ✓ | @mikehaertl -[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | community | `H  J ` | | | @leo60228 -[po](https://github.com/erasin/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/ObserverOfTime/tree-sitter-poe-filter)[^poe_filter] | unsupported | `HFIJ ` | | | @ObserverOfTime -[pony](https://github.com/amaanq/tree-sitter-pony) | core | `HFIJL` | | | @amaanq, @mfelsche -[printf](https://github.com/ObserverOfTime/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) | unsupported | `H  J ` | | | @MichaHoffmann -[properties](https://github.com/ObserverOfTime/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) | core | `H  J ` | | | @matthias-Q -[psv](https://github.com/amaanq/tree-sitter-csv) | core | `H    ` | | | @amaanq -[pug](https://github.com/zealot128/tree-sitter-pug) | unsupported | `H  J ` | | | @zealot128 -[puppet](https://github.com/amaanq/tree-sitter-puppet) | core | `HFIJL` | | | @amaanq -[purescript](https://github.com/postsolar/tree-sitter-purescript) | community | `H  JL` | | | @postsolar -[pymanifest](https://github.com/ObserverOfTime/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) | community | `HFIJL` | | | @pwntester -[qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) | core | `H  J ` | | | @amaanq -[qmljs](https://github.com/yuja/tree-sitter-qmljs) | community | `HF J ` | | | @Decodetalkers -[query](https://github.com/nvim-treesitter/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/amaanq/tree-sitter-re2c) | core | `HFIJL` | | | @amaanq -[readline](https://github.com/ribru17/tree-sitter-readline) | community | `HFIJ ` | | | @ribru17 -[regex](https://github.com/tree-sitter/tree-sitter-regex) | stable | `H    ` | | | @theHamsta -[rego](https://github.com/FallenAngel97/tree-sitter-rego) | community | `H  J ` | | | @FallenAngel97 -[requirements](https://github.com/ObserverOfTime/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/amaanq/tree-sitter-ron) | core | `HFIJL` | | | @amaanq -[rst](https://github.com/stsewd/tree-sitter-rst) | core | `H  JL` | | | @stsewd -[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | community | `HFIJL` | | | @TravonteD -[rust](https://github.com/tree-sitter/tree-sitter-rust) | core | `HFIJL` | | | @amaanq -[scala](https://github.com/tree-sitter/tree-sitter-scala) | community | `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/theHamsta/tree-sitter-slang)[^slang] | unsupported | `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) | core | `H    ` | | | @amaanq, @keynmol -[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unsupported | `HFIJL` | | | -[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | core | `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/amaanq/tree-sitter-squirrel) | core | `HFIJL` | | | @amaanq -[ssh_config](https://github.com/ObserverOfTime/tree-sitter-ssh-config) | core | `HFIJL` | | | @ObserverOfTime -[starlark](https://github.com/amaanq/tree-sitter-starlark) | core | `HFIJL` | | | @amaanq -[strace](https://github.com/sigmaSd/tree-sitter-strace) | core | `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.git) | community | `HFIJL` | | | @xasc -[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | core | `HFIJL` | | | @amaanq -[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/duskmoon314/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.git) | unsupported | `H    ` | | | @arnarg -[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | community | `HFIJL` | | ✓ | @tk-shirasaka -[tsv](https://github.com/amaanq/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 -[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/ObserverOfTime/tree-sitter-udev) | core | `H  JL` | | | @ObserverOfTime -[ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) | community | `HFIJL` | | | @Philipp-M, @amaanq -[unison](https://github.com/kylegoetz/tree-sitter-unison) | unsupported | `H  J ` | | | @tapegram -[usd](https://github.com/ColinKennedy/tree-sitter-usd) | community | `HFI L` | | | @ColinKennedy -[uxntal](https://github.com/amaanq/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) | community | `HF JL` | | | @zegervdv -[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | community | `H    ` | | | @caarlos0 -[vim](https://github.com/neovim/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/theHamsta/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/ObserverOfTime/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/Philipp-M/tree-sitter-yuck) | community | `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 | 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.git) | 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` | | @Luxed +[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.git) | 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 J ` | | @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.git) | 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 | `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) | 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.git) | 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.git) | community | `HFIJL` | | @xasc +[tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | core | `HFIJL` | | @amaanq +[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.git) | 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 +[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 [^ecma]: queries required by javascript, typescript, tsx, qmljs [^gdscript]: Godot [^glimmer]: Glimmer and Ember diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 1d6400977..5d3a23300 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -37,16 +37,8 @@ local function install_health() ) end - if vim.fn.executable('node') == 0 then - health.warn('`node` executable not found (only needed for `:TSInstallFromGrammar`.') - else - local result = assert(vim.system({ 'node', '--version' }):wait().stdout) - local version = vim.split(result, '\n')[1] - health.ok('`node` found ' .. version .. ' (only needed for `:TSInstallFromGrammar`)') - end - if vim.fn.executable('git') == 0 then - health.error( + health.warn( '`git` executable not found.', 'Install it with your package manager and check that your `$PATH` is set correctly.' ) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 57671d7d3..c501b0fa0 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -31,7 +31,7 @@ local M = {} ---@type table local lockfile = {} -local max_jobs = 50 +local max_jobs = 10 local iswin = uv.os_uname().sysname == 'Windows_NT' local ismac = uv.os_uname().sysname == 'Darwin' @@ -145,24 +145,17 @@ end --- @param repo InstallInfo --- @param compile_location string --- @return string? err -local function do_generate_from_grammar(logger, repo, compile_location) +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 - if repo.generate_requires_npm then - if not executable('npm') then - return logger:error('NPM requires to be installed from grammar.js') - end - - logger:info('Installing NPM dependencies') - local r = system({ 'npm', 'install' }, { cwd = compile_location }) - if r.code > 0 then - return logger:error('Error during `npm install`: %s', r.stderr) - end - end - - logger:info('Generating source files from grammar.js...') + logger:info( + string.format( + 'Generating parser.c from %s...', + repo.generate_from_json and 'grammar.json' or 'grammar.js' + ) + ) local r = system({ fn.exepath('tree-sitter'), @@ -170,6 +163,7 @@ local function do_generate_from_grammar(logger, repo, compile_location) '--no-bindings', '--abi', tostring(vim.treesitter.language_version), + repo.generate_from_json and 'src/grammar.json', }, { cwd = compile_location }) if r.code > 0 then return logger:error('Error during "tree-sitter generate": %s', r.stderr) @@ -262,6 +256,10 @@ 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({ @@ -386,7 +384,7 @@ end ---@param repo InstallInfo ---@param cc string ---@param compile_location string ---- @return string? err +---@return string? err local function do_compile(logger, repo, cc, compile_location) local args = vim.tbl_flatten(select_compiler_args(repo, cc)) local cmd = vim.list_extend({ cc }, args) @@ -442,7 +440,7 @@ local function install_lang0(lang, cache_dir, install_dir, generate) do if repo.generate or generate then - local err = do_generate_from_grammar(logger, repo, compile_location) + local err = do_generate(logger, repo, compile_location) if err then return err end @@ -497,9 +495,9 @@ local INSTALL_TIMEOUT = 60000 ---@param cache_dir string ---@param install_dir string ---@param force? boolean ----@param generate_from_grammar? boolean +---@param generate? boolean ---@return InstallStatus status -local function install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) +local function install_lang(lang, cache_dir, install_dir, force, generate) if not force and vim.list_contains(config.installed_parsers(), lang) then local yesno = fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') print('\n ') @@ -518,7 +516,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g end else install_status[lang] = 'installing' - local err = install_lang0(lang, cache_dir, install_dir, generate_from_grammar) + local err = install_lang0(lang, cache_dir, install_dir, generate) install_status[lang] = err and 'failed' or 'installed' end @@ -529,7 +527,7 @@ end ---@class InstallOptions ---@field force? boolean ----@field generate_from_grammar? boolean +---@field generate? boolean ---@field skip? table --- Install a parser @@ -539,7 +537,7 @@ end local function install(languages, options, _callback) options = options or {} local force = options.force - local generate_from_grammar = options.generate_from_grammar + local generate = options.generate local skip = options.skip local cache_dir = vim.fs.normalize(fn.stdpath('cache')) @@ -560,7 +558,7 @@ local function install(languages, options, _callback) for _, lang in ipairs(languages) do tasks[#tasks + 1] = a.sync(function() a.main() - local status = install_lang(lang, cache_dir, install_dir, force, generate_from_grammar) + local status = install_lang(lang, cache_dir, install_dir, force, generate) if status ~= 'failed' then done = done + 1 end diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6f5915da1..4e3222563 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -4,8 +4,8 @@ ---@field branch? string ---@field revision? string ---@field files string[] ----@field generate_requires_npm? boolean ---@field generate? boolean +---@field generate_from_json? boolean ---@field location? string ---@class ParserInfo @@ -36,18 +36,18 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Decodetalkers' }, - tier = 3, + tier = 2, }, angular = { install_info = { url = 'https://github.com/dlvandenberg/tree-sitter-angular', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@dlvandenberg' }, requires = { 'html', 'html_tags' }, - tier = 4, + tier = 3, }, apex = { @@ -62,8 +62,9 @@ M.configs = { arduino = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-arduino', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@ObserverOfTime' }, requires = { 'cpp' }, @@ -83,6 +84,7 @@ M.configs = { install_info = { url = 'https://github.com/virchau13/tree-sitter-astro', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@virchau13' }, requires = { 'html', 'html_tags' }, @@ -112,7 +114,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, - tier = 3, + tier = 1, }, bass = { @@ -121,7 +123,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, beancount = { @@ -139,12 +141,12 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta', '@clason' }, - tier = 2, + tier = 3, }, bicep = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-bicep', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-bicep', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -153,7 +155,7 @@ M.configs = { bitbake = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-bitbake', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-bitbake', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -209,12 +211,12 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, cairo = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-cairo', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cairo', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -232,7 +234,7 @@ M.configs = { capnp = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-capnp', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-capnp', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -241,7 +243,7 @@ M.configs = { chatito = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-chatito', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -272,7 +274,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@uyha' }, - tier = 4, + tier = 3, }, comment = { @@ -281,14 +283,14 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stsewd' }, - tier = 2, + tier = 3, }, commonlisp = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-commonlisp', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-commonlisp', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, tier = 2, @@ -314,7 +316,7 @@ M.configs = { cpon = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-cpon', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cpon', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -325,11 +327,11 @@ M.configs = { install_info = { url = 'https://github.com/tree-sitter/tree-sitter-cpp', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, requires = { 'c' }, - tier = 1, + tier = 2, }, css = { @@ -338,12 +340,12 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, - tier = 3, + tier = 2, }, csv = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-csv', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'csv', }, @@ -354,9 +356,9 @@ M.configs = { cuda = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-cuda', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, @@ -369,7 +371,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, cylc = { @@ -386,7 +388,7 @@ M.configs = { url = 'https://github.com/gdamore/tree-sitter-d', files = { 'src/parser.c', 'src/scanner.c' }, }, - tier = 2, + tier = 3, maintainers = { '@amaanq' }, }, @@ -396,7 +398,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@akinsho' }, - tier = 4, + tier = 3, }, desktop = { @@ -423,7 +425,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, diff = { @@ -473,7 +475,7 @@ M.configs = { doxygen = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-doxygen', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-doxygen', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -498,6 +500,7 @@ M.configs = { maintainers = { '@glehmann' }, tier = 3, }, + ebnf = { install_info = { url = 'https://github.com/RubixDev/ebnf', @@ -505,13 +508,13 @@ M.configs = { location = 'crates/tree-sitter-ebnf', }, maintainers = { '@RubixDev' }, - tier = 4, + tier = 3, }, ecma = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, typescript, tsx, qmljs', - tier = 2, + tier = 3, }, editorconfig = { @@ -556,7 +559,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@zweimach' }, - tier = 4, + tier = 3, }, elsa = { @@ -565,7 +568,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@glapa-grossklag', '@amaanq' }, - tier = 2, + tier = 3, }, elvish = { @@ -625,7 +628,7 @@ M.configs = { install_info = { url = 'https://github.com/alexmozaidze/tree-sitter-fennel', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@alexmozaidze' }, tier = 3, @@ -642,7 +645,7 @@ M.configs = { firrtl = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-firrtl', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-firrtl', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -673,7 +676,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, fortran = { @@ -682,7 +685,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, fsh = { @@ -706,7 +709,7 @@ M.configs = { func = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-func', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-func', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -773,7 +776,7 @@ M.configs = { gitattributes = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-gitattributes', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -795,7 +798,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, gitignore = { @@ -804,7 +807,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, - tier = 2, + tier = 3, }, gleam = { @@ -813,7 +816,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, glimmer = { @@ -850,9 +853,9 @@ M.configs = { glsl = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-glsl', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, requires = { 'c' }, @@ -861,7 +864,7 @@ M.configs = { gn = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-gn', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gn', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -884,7 +887,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta', '@WinWisely268' }, - tier = 1, + tier = 2, }, goctl = { @@ -917,7 +920,7 @@ M.configs = { gosum = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-go-sum', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-go-sum', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -953,7 +956,7 @@ M.configs = { gpg = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-gpg-config', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -980,7 +983,7 @@ M.configs = { gstlaunch = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-gstlaunch', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch', files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, @@ -997,7 +1000,7 @@ M.configs = { hare = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-hare', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1010,7 +1013,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@mrcjkb' }, - tier = 3, + tier = 2, }, haskell_persistent = { @@ -1024,11 +1027,11 @@ M.configs = { hcl = { install_info = { - url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@MichaHoffmann' }, - tier = 3, + tier = 2, }, heex = { @@ -1054,7 +1057,7 @@ M.configs = { install_info = { url = 'https://github.com/winston0410/tree-sitter-hjson', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@winston0410' }, requires = { 'json' }, @@ -1063,9 +1066,9 @@ M.configs = { hlsl = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-hlsl', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, @@ -1085,7 +1088,7 @@ M.configs = { install_info = { url = 'https://github.com/antosha417/tree-sitter-hocon', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@antosha417' }, tier = 4, @@ -1097,7 +1100,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@urbit-pilled' }, - tier = 4, + tier = 3, }, html_tags = { @@ -1113,7 +1116,7 @@ M.configs = { }, maintainers = { '@TravonteD' }, requires = { 'html_tags' }, - tier = 3, + tier = 2, }, htmldjango = { @@ -1122,7 +1125,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, - tier = 4, + tier = 3, }, http = { @@ -1131,7 +1134,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@NTBBloodbath' }, - tier = 2, + tier = 3, }, hurl = { @@ -1145,11 +1148,11 @@ M.configs = { hyprlang = { install_info = { - url = 'https://github.com/luckasRanarison/tree-sitter-hyprlang', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', files = { 'src/parser.c' }, }, maintainers = { '@luckasRanarison' }, - tier = 3, + tier = 2, }, idl = { @@ -1176,7 +1179,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, - tier = 4, + tier = 3, }, inko = { @@ -1199,13 +1202,13 @@ M.configs = { ispc = { install_info = { - url = 'https://github.com/fab4100/tree-sitter-ispc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ispc', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@fab4100' }, requires = { 'c' }, - tier = 3, + tier = 2, }, janet_simple = { @@ -1223,7 +1226,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@p00f' }, - tier = 3, + tier = 2, }, javadoc = { @@ -1273,7 +1276,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, - tier = 2, + tier = 3, }, jsdoc = { @@ -1307,7 +1310,7 @@ M.configs = { install_info = { url = 'https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git', files = { 'src/parser.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@WhyNotHugo' }, requires = { 'json' }, @@ -1326,7 +1329,7 @@ M.configs = { jsx = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, tsx', - tier = 2, + tier = 3, }, julia = { @@ -1358,7 +1361,7 @@ M.configs = { kconfig = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-kconfig', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-kconfig', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -1367,7 +1370,7 @@ M.configs = { kdl = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-kdl', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-kdl', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -1417,7 +1420,7 @@ M.configs = { generate = true, }, maintainers = { '@theHamsta', '@clason' }, - tier = 2, + tier = 3, }, ledger = { @@ -1449,7 +1452,7 @@ M.configs = { linkerscript = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-linkerscript', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-linkerscript', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1476,7 +1479,7 @@ M.configs = { lua = { install_info = { - url = 'https://github.com/MunifTanjim/tree-sitter-lua', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@muniftanjim' }, @@ -1485,7 +1488,7 @@ M.configs = { luadoc = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-luadoc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luadoc', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1494,7 +1497,7 @@ M.configs = { luap = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-luap', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luap', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1504,8 +1507,9 @@ M.configs = { luau = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-luau', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@amaanq' }, requires = { 'lua' }, @@ -1527,12 +1531,12 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@lewis6991' }, - tier = 2, + tier = 3, }, markdown = { install_info = { - url = 'https://github.com/MDeiml/tree-sitter-markdown', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', location = 'tree-sitter-markdown', files = { 'src/parser.c', 'src/scanner.c' }, }, @@ -1544,7 +1548,7 @@ M.configs = { markdown_inline = { install_info = { - url = 'https://github.com/MDeiml/tree-sitter-markdown', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', location = 'tree-sitter-markdown-inline', files = { 'src/parser.c', 'src/scanner.c' }, }, @@ -1581,11 +1585,11 @@ M.configs = { meson = { install_info = { - url = 'https://github.com/Decodetalkers/tree-sitter-meson', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', files = { 'src/parser.c' }, }, maintainers = { '@Decodetalkers' }, - tier = 3, + tier = 2, }, mlir = { @@ -1595,7 +1599,7 @@ M.configs = { generate = true, }, maintainers = { '@artagnon' }, - tier = 4, + tier = 3, }, muttrc = { @@ -1613,7 +1617,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, - tier = 2, + tier = 3, }, nginx = { @@ -1672,8 +1676,9 @@ M.configs = { nqc = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-nqc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-nqc', files = { 'src/parser.c' }, + generate_from_json = true, }, maintainers = { '@amaanq' }, tier = 2, @@ -1690,8 +1695,9 @@ M.configs = { objc = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-objc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', files = { 'src/parser.c' }, + generate_from_json = true, }, maintainers = { '@amaanq' }, requires = { 'c' }, @@ -1714,7 +1720,7 @@ M.configs = { location = 'grammars/ocaml', }, maintainers = { '@undu' }, - tier = 3, + tier = 2, }, ocaml_interface = { @@ -1725,7 +1731,7 @@ M.configs = { }, maintainers = { '@undu' }, requires = { 'ocaml' }, - tier = 3, + tier = 2, }, ocamllex = { @@ -1740,7 +1746,7 @@ M.configs = { odin = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-odin', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -1767,7 +1773,7 @@ M.configs = { pem = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-pem', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -1779,6 +1785,7 @@ M.configs = { url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', branch = 'release', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, tier = 3, @@ -1793,7 +1800,7 @@ M.configs = { maintainers = { '@tk-shirasaka', '@calebdw' }, requires = { 'php_only' }, readme_note = 'PHP with embedded HTML', - tier = 3, + tier = 2, }, php_only = { @@ -1804,17 +1811,17 @@ M.configs = { }, maintainers = { '@tk-shirasaka', '@calebdw' }, readme_note = 'PHP without embedded HTML', - tier = 3, + tier = 2, }, phpdoc = { install_info = { url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@mikehaertl' }, - tier = 4, + tier = 3, }, pioasm = { @@ -1828,7 +1835,7 @@ M.configs = { po = { install_info = { - url = 'https://github.com/erasin/tree-sitter-po', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-po', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1840,6 +1847,7 @@ M.configs = { url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', files = { 'src/parser.c', 'src/scanner.c' }, branch = 'release', + generate_from_json = true, }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, tier = 3, @@ -1847,17 +1855,17 @@ M.configs = { poe_filter = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-poe-filter', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, readme_note = 'Path of Exile item filter', - tier = 4, + tier = 2, }, pony = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-pony', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pony', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq', '@mfelsche' }, @@ -1876,7 +1884,7 @@ M.configs = { printf = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-printf', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -1915,7 +1923,7 @@ M.configs = { properties = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-properties', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -1938,7 +1946,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@MichaHoffmann' }, - tier = 4, + tier = 3, }, prql = { @@ -1947,12 +1955,12 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@matthias-Q' }, - tier = 2, + tier = 3, }, psv = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-csv', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'psv', }, @@ -1967,12 +1975,12 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@zealot128' }, - tier = 4, + tier = 3, }, puppet = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-puppet', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-puppet', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -1990,7 +1998,7 @@ M.configs = { pymanifest = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-pymanifest', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pymanifest', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -2013,12 +2021,12 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@pwntester' }, - tier = 3, + tier = 2, }, qmldir = { install_info = { - url = 'https://github.com/Decodetalkers/tree-sitter-qmldir', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-qmldir', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -2029,6 +2037,7 @@ M.configs = { install_info = { url = 'https://github.com/yuja/tree-sitter-qmljs', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@Decodetalkers' }, requires = { 'ecma' }, @@ -2037,7 +2046,7 @@ M.configs = { query = { install_info = { - url = 'https://github.com/nvim-treesitter/tree-sitter-query', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', files = { 'src/parser.c' }, }, maintainers = { '@steelsojka' }, @@ -2082,6 +2091,8 @@ M.configs = { razor = { install_info = { + generate_from_json = true, + revision = 'a47cd8ca148685629739a4ab69f58864800fbdab', url = 'https://github.com/tris203/tree-sitter-razor', files = { 'src/parser.c', 'src/scanner.c' }, }, @@ -2100,7 +2111,7 @@ M.configs = { re2c = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-re2c', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-re2c', files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, @@ -2109,11 +2120,11 @@ M.configs = { readline = { install_info = { - url = 'https://github.com/ribru17/tree-sitter-readline', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-readline', files = { 'src/parser.c' }, }, maintainers = { '@ribru17' }, - tier = 3, + tier = 2, }, regex = { @@ -2122,7 +2133,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@theHamsta' }, - tier = 1, + tier = 2, }, rego = { @@ -2136,7 +2147,7 @@ M.configs = { requirements = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-requirements', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -2191,7 +2202,7 @@ M.configs = { ron = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-ron', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ron', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -2204,7 +2215,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stsewd' }, - tier = 2, + tier = 3, }, ruby = { @@ -2213,7 +2224,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@TravonteD' }, - tier = 3, + tier = 2, }, runescript = { @@ -2240,7 +2251,7 @@ M.configs = { files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@stevanmilic' }, - tier = 3, + tier = 2, }, scfg = { @@ -2283,13 +2294,13 @@ M.configs = { }, slang = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-slang', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, readme_note = 'Shader Slang', maintainers = { '@theHamsta' }, - tier = 4, + tier = 2, }, slim = { @@ -2323,9 +2334,10 @@ M.configs = { install_info = { url = 'https://github.com/osthomas/tree-sitter-snakemake', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, - maintainer = { '@osthomas' }, - tier = 4, + maintainers = { '@osthomas' }, + tier = 3, }, smithy = { @@ -2334,7 +2346,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@keynmol' }, - tier = 2, + tier = 3, }, solidity = { @@ -2343,7 +2355,7 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, soql = { @@ -2379,6 +2391,7 @@ M.configs = { install_info = { url = 'https://github.com/GordianDziwis/tree-sitter-sparql', files = { 'src/parser.c' }, + generate_from_json = true, }, maintainers = { '@GordianDziwis' }, tier = 3, @@ -2389,6 +2402,7 @@ M.configs = { url = 'https://github.com/derekstride/tree-sitter-sql', files = { 'src/parser.c', 'src/scanner.c' }, branch = 'gh-pages', + generate_from_json = true, }, maintainers = { '@derekstride' }, tier = 3, @@ -2396,7 +2410,7 @@ M.configs = { squirrel = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-squirrel', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-squirrel', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -2405,7 +2419,7 @@ M.configs = { ssh_config = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-ssh-config', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -2414,8 +2428,9 @@ M.configs = { starlark = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-starlark', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-starlark', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@amaanq' }, tier = 2, @@ -2427,13 +2442,14 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@amaanq' }, - tier = 2, + tier = 3, }, styled = { install_info = { url = 'https://github.com/mskelton/tree-sitter-styled', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@mskelton' }, tier = 3, @@ -2471,6 +2487,7 @@ M.configs = { install_info = { url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@amaanq' }, requires = { 'html_tags' }, @@ -2525,7 +2542,7 @@ M.configs = { tablegen = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-tablegen', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-tablegen', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -2555,6 +2572,7 @@ M.configs = { install_info = { url = 'https://github.com/vrischmann/tree-sitter-templ', files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, }, maintainers = { '@vrischmann' }, tier = 3, @@ -2600,7 +2618,7 @@ M.configs = { thrift = { install_info = { - url = 'https://github.com/duskmoon314/tree-sitter-thrift', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-thrift', files = { 'src/parser.c' }, }, maintainers = { '@amaanq', '@duskmoon314' }, @@ -2640,22 +2658,22 @@ M.configs = { files = { 'src/parser.c' }, }, maintainers = { '@arnarg' }, - tier = 4, + tier = 3, }, toml = { install_info = { url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@tk-shirasaka' }, - tier = 3, + tier = 2, }, tsv = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-csv', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'tsv', }, @@ -2668,7 +2686,7 @@ M.configs = { url = 'https://github.com/tree-sitter/tree-sitter-typescript', files = { 'src/parser.c', 'src/scanner.c' }, location = 'tsx', - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@steelsojka' }, requires = { 'ecma', 'jsx', 'typescript' }, @@ -2698,7 +2716,7 @@ M.configs = { url = 'https://github.com/tree-sitter/tree-sitter-typescript', files = { 'src/parser.c', 'src/scanner.c' }, location = 'typescript', - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@steelsojka' }, requires = { 'ecma' }, @@ -2734,7 +2752,7 @@ M.configs = { udev = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-udev', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -2743,11 +2761,11 @@ M.configs = { ungrammar = { install_info = { - url = 'https://github.com/Philipp-M/tree-sitter-ungrammar', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ungrammar', files = { 'src/parser.c' }, }, maintainers = { '@Philipp-M', '@amaanq' }, - tier = 3, + tier = 2, }, unison = { @@ -2757,7 +2775,7 @@ M.configs = { generate = true, }, maintainers = { '@tapegram' }, - tier = 4, + tier = 3, }, usd = { @@ -2771,7 +2789,7 @@ M.configs = { uxntal = { install_info = { - url = 'https://github.com/amaanq/tree-sitter-uxntal', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-uxntal', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@amaanq' }, @@ -2835,7 +2853,7 @@ M.configs = { vim = { install_info = { - url = 'https://github.com/neovim/tree-sitter-vim', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@clason' }, @@ -2865,6 +2883,7 @@ M.configs = { url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', files = { 'src/parser.c', 'src/scanner.c' }, branch = 'main', + generate_from_json = true, }, maintainers = { '@WhyNotHugo', '@lucario387' }, requires = { 'html_tags' }, @@ -2891,9 +2910,9 @@ M.configs = { wgsl_bevy = { install_info = { - url = 'https://github.com/theHamsta/tree-sitter-wgsl-bevy', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@theHamsta' }, tier = 2, @@ -2907,9 +2926,10 @@ M.configs = { maintainers = { '@liamwh' }, tier = 3, }, + xcompose = { install_info = { - url = 'https://github.com/ObserverOfTime/tree-sitter-xcompose', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', files = { 'src/parser.c' }, }, maintainers = { '@ObserverOfTime' }, @@ -2957,11 +2977,11 @@ M.configs = { yuck = { install_info = { - url = 'https://github.com/Philipp-M/tree-sitter-yuck', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-yuck', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@Philipp-M', '@amaanq' }, - tier = 3, + tier = 2, }, zathurarc = { @@ -3019,12 +3039,11 @@ function M.get_available(tier) parsers ) end - if vim.fn.executable('tree-sitter') == 0 or vim.fn.executable('node') == 0 then + if vim.fn.executable('tree-sitter') == 0 then parsers = vim.tbl_filter( --- @param p string function(p) - return M.configs[p].install_info ~= nil - and not M.configs[p].install_info.requires_generate_from_grammar + return M.configs[p].install_info ~= nil and not M.configs[p].install_info.generate end, parsers ) diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 751e8aad1..32f3db311 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -38,7 +38,7 @@ end, { api.nvim_create_user_command('TSInstallFromGrammar', function(args) require('nvim-treesitter.install').install(args.fargs, { - generate_from_grammar = true, + generate = true, force = args.bang, }) end, { diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index ab06e538f..c607e51f4 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -1,14 +1,28 @@ #!/usr/bin/env -S nvim -l +local generate = false +local parsers = {} +for i = 1, #_G.arg do + if _G.arg[i] == '--generate' then + generate = true + else + parsers[#parsers + 1] = _G.arg[i] + end +end + vim.opt.runtimepath:append('.') -- needed on CI vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') local done = false -require('nvim-treesitter.install').install('all', {}, function() - done = true -end) +require('nvim-treesitter.install').install( + #parsers > 0 and parsers or 'all', + { force = true, generate = generate }, + function() + done = true + end +) vim.wait(6000000, function() return done diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index fb9a9b32c..f8346bf4d 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -15,8 +15,8 @@ table.sort(sorted_parsers, function(a, b) end) local generated_text = [[ -Language | Tier | Queries | CLI | NPM | Maintainer --------- |:----:|:-------:|:---:|:---:| ---------- +Language | Tier | Queries | CLI | Maintainer +-------- |:----:|:-------:|:---:| ---------- ]] local footnotes = '' @@ -59,12 +59,7 @@ for _, v in ipairs(sorted_parsers) do -- CLI generated_text = generated_text - .. (p.install_info and p.install_info.requires_generate_from_grammar and '✓' or '') - .. ' | ' - - -- NPM - generated_text = generated_text - .. (p.install_info and p.install_info.generate_requires_npm and '✓' or '') + .. (p.install_info and p.install_info.generate and '✓' or '') .. ' | ' -- Maintainer From 054080bf5986b39128cc64fba6ab144e961d4e2d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 22 Apr 2024 19:27:12 +0200 Subject: [PATCH 043/434] fix: vim.tbl_flatten is deprecated --- lua/nvim-treesitter/install.lua | 2 +- tests/indent/common.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index c501b0fa0..6918a1820 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -386,7 +386,7 @@ end ---@param compile_location string ---@return string? err local function do_compile(logger, repo, cc, compile_location) - local args = vim.tbl_flatten(select_compiler_args(repo, cc)) + local args = vim.iter(select_compiler_args(repo, cc)):flatten():totable() local cmd = vim.list_extend({ cc }, args) logger:info('Compiling parser') diff --git a/tests/indent/common.lua b/tests/indent/common.lua index f33a5908b..6add58c7f 100644 --- a/tests/indent/common.lua +++ b/tests/indent/common.lua @@ -183,7 +183,7 @@ function Runner:whole_file(dirs, opts) assert.is.same(1, vim.fn.isdirectory(dir.filename)) return dir.filename end, dirs) - local files = require('nvim-treesitter.compat').flatten(vim.tbl_map(scan_dir, dirs)) + local files = vim.iter(vim.tbl_map(scan_dir, dirs)):flatten():totable() for _, file in ipairs(files) do local relpath = Path:new(file):make_relative(self.base_dir.filename) self.it(relpath, function() From c17de5689045f75c6244462182ae3b4b62df02d9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 14 Apr 2024 16:25:28 +0200 Subject: [PATCH 044/434] feat!: track parser revision in Lua Problem: Tracking parser revision in lockfile and allowing override through the parsers module complicates the code. In addition, only revision changes are handled robustly, not changes to other installation info. Solution: Track parser revision in the parsers module directly. Reload parser table on every install or update call. Support modifying parser table in a `User TSUpdate` autocommand. --- .github/workflows/tests.yml | 1 + .github/workflows/update-lockfile.yml | 55 - .github/workflows/update-parsers.yml | 55 + .github/workflows/update-readme.yml | 3 +- CONTRIBUTING.md | 18 +- README.md | 65 +- SUPPORTED_LANGUAGES.md | 20 +- TODO.md | 9 +- doc/nvim-treesitter.txt | 2 +- lua/nvim-treesitter/_meta/parsers.lua | 47 + lua/nvim-treesitter/config.lua | 82 +- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/install.lua | 77 +- lua/nvim-treesitter/parsers.lua | 1405 ++++++++--------- plugin/nvim-treesitter.lua | 2 +- scripts/check-queries.lua | 2 +- scripts/convert-lockfile.lua | 21 + scripts/update-lockfile.lua | 64 - scripts/update-parsers.lua | 65 + scripts/update-readme.lua | 5 +- .../injections/nix/test-nix-injections.nix | 2 +- 21 files changed, 1007 insertions(+), 995 deletions(-) delete mode 100644 .github/workflows/update-lockfile.yml create mode 100644 .github/workflows/update-parsers.yml create mode 100644 lua/nvim-treesitter/_meta/parsers.lua create mode 100755 scripts/convert-lockfile.lua delete mode 100755 scripts/update-lockfile.lua create mode 100755 scripts/update-parsers.lua diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86c7ad630..f78afe711 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - "main" + workflow_dispatch: # Cancel any in-progress CI runs for a PR if it is updated concurrency: diff --git a/.github/workflows/update-lockfile.yml b/.github/workflows/update-lockfile.yml deleted file mode 100644 index 70d2c0c0a..000000000 --- a/.github/workflows/update-lockfile.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Update lockfile - -on: - schedule: - - cron: "30 6 * * 6" - workflow_dispatch: - -jobs: - update-lockfile: - name: Update lockfile - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: main - - - uses: actions/create-github-app-token@v2 - id: app-token - with: - app-id: ${{ vars.TOKEN_ID }} - private-key: ${{ secrets.TOKEN_PRIVATE_KEY }} - - - name: Prepare - env: - NVIM_TAG: nightly - run: | - wget https://github.com/josephburnett/jd/releases/download/v1.7.1/jd-amd64-linux - mv jd-amd64-linux /tmp/jd - chmod +x /tmp/jd - bash scripts/ci-install.sh - - - name: Update parsers - env: - SKIP_LOCKFILE_UPDATE_FOR_LANGS: "bp,devicetree,dhall,elm,enforce,git_config,nickel,rescript,rust,slint,sql,t32,templ,typespec,verilog,wit" - run: | - cp lockfile.json /tmp/old_lockfile.json - nvim -l ./scripts/update-lockfile.lua - UPDATED_PARSERS=$(/tmp/jd -f merge /tmp/old_lockfile.json lockfile.json | jq -r 'keys | join(", ")') - echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ steps.app-token.outputs.token }} - sign-commits: true - commit-message: "bot(lockfile): update ${{ env.UPDATED_PARSERS }}" - title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}" - body: "[beep boop](https://github.com/peter-evans/create-pull-request)" - branch: update-lockfile-pr - base: ${{ github.head_ref }} - - - name: Enable Pull Request Automerge - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - run: gh pr merge --rebase --auto update-lockfile-pr diff --git a/.github/workflows/update-parsers.yml b/.github/workflows/update-parsers.yml new file mode 100644 index 000000000..683c732c6 --- /dev/null +++ b/.github/workflows/update-parsers.yml @@ -0,0 +1,55 @@ +name: Update parsers + +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + +env: + BIN_DIR: ${{ github.workspace }}/bin + +jobs: + update-parsers: + name: Update parsers + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + + - uses: actions/create-github-app-token@v2 + id: app-token + with: + app-id: ${{ vars.TOKEN_ID }} + private-key: ${{ secrets.TOKEN_PRIVATE_KEY }} + + - name: Add $BIN_DIR to PATH + run: echo "$BIN_DIR" >> $GITHUB_PATH + + - name: Prepare + env: + NVIM_TAG: nightly + run: | + bash scripts/ci-install.sh + wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip + (cd "$BIN_DIR"; unzip stylua*.zip) + + - name: Update parsers + run: ./scripts/update-parsers.lua + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + add-paths: lua/nvim-treesitter/parsers.lua + token: ${{ steps.app-token.outputs.token }} + sign-commits: true + commit-message: "bot(parsers): update ${{ env.UPDATED_PARSERS }}" + title: "Update parsers: ${{ env.UPDATED_PARSERS }}" + body: "[beep boop](https://github.com/peter-evans/create-pull-request)" + branch: update-parsers-pr + base: ${{ github.head_ref }} + + - name: Enable Pull Request Automerge + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + run: gh pr merge --rebase --auto update-parsers-pr diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml index 849bb9814..335756619 100644 --- a/.github/workflows/update-readme.yml +++ b/.github/workflows/update-readme.yml @@ -32,10 +32,11 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: + add-paths: SUPPORTED_LANGUAGES.md token: ${{ steps.app-token.outputs.token }} sign-commits: true commit-message: "bot(readme): update" - title: Update README + title: Update SUPPORTED_LANGUAGES.md body: "[beep boop](https://github.com/peter-evans/create-pull-request)" branch: update-readme-pr base: ${{ github.head_ref }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d043e6b08..0ea7dcdbf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,17 +13,17 @@ Depending on which part of the plugin you want to contribute to, please read the To add a new parser, edit the following files: -1. In `lua/parsers.lua`, add an entry to the `M.configs` table of the following form: +1. In `lua/parsers.lua`, add an entry to the returned table of the following form: ```lua zimbu = { install_info = { - url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- local path or git repo + url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- git repo; use `path` for local path files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c -- optional entries: branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - revision = 'v2.1', -- tag or commit hash; bypasses automated updates + revision = 'v2.1', -- tag or commit hash, will be updated automatically generate = true, -- only needed if repo does not contain pre-generated src/parser.c generate_from_json = true, -- only needed if grammar.js has npm-installed dependencies }, @@ -31,21 +31,13 @@ zimbu = { tier = 3, -- community-contributed parser -- optional entries: requires = { 'vim' }, -- if the queries inherit from another language - readme_note = "an example language", -- if the + readme_note = "an example language", } ``` **Note:** The "maintainers" here refers to the person maintaining the **queries** in `nvim-treesitter`, not the parser maintainers (who likely don't use Neovim). The maintainers' duty is to review issues and PRs related to the query and to keep them updated with respect to parser changes. -2. In `lockfile.json`, add an entry for the current commit your queries are compatible with: - -```json - "zimbu": { - "revision": "0d08703e4c3f426ec61695d7617415fff97029bd" - }, -``` - -3. If the parser name is not the same as the Vim filetype, add an entry to the `filetypes` table in `plugin/filetypes.lua`: +2. If the parser name is not the same as the Vim filetype, add an entry to the `filetypes` table in `plugin/filetypes.lua`: ```lua zimbu = { 'zu' }, diff --git a/README.md b/README.md index 6e3a52845..07a6c930e 100644 --- a/README.md +++ b/README.md @@ -126,28 +126,40 @@ These queries can be used to look up definitions and references to identifiers i If you have a parser that is not on the list of supported languages (either as a repository on Github or in a local directory), you can add it manually for use by `nvim-treesitter` as follows: -1. Clone the repository or [create a new project](https://tree-sitter.github.io/tree-sitter/creating-parsers#project-setup) in, say, `~/projects/tree-sitter-zimbu`. Make sure that the `tree-sitter-cli` executable is installed and in your path; see for installation instructions. -2. Run `tree-sitter generate` in this directory (followed by `tree-sitter test` for good measure). -3. Add the following snippet to your `init.lua`: +1. Add the following snippet in a `User TSUpdate` autocommand: ```lua -local parser_config = require('nvim-treesitter.parsers').configs -parser_config.zimbu = { - install_info = { - url = '~/projects/tree-sitter-zimbu', -- local path or git repo - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c - -- optional entries: - branch = 'develop', -- only needed if different from default branch - location= 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - generate = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_from_json = true, -- only needed if parser has npm dependencies - }, -} +vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate', +callback = function() + require('nvim-treesitter.parsers').zimbu = { + install_info = { + url = 'https://github.com/zimbulang/tree-sitter-zimbu', + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c + revision = , -- commit hash for revision to check out; HEAD if missing + -- optional entries: + branch = 'develop', -- only needed if different from default branch + location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" + generate = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_from_json = true, -- only needed if parser has npm dependencies + }, + } +end}) ``` -If you use a git repository for your parser and want to use a specific version, you can set the `revision` key -in the `install_info` table for you parser config. -4. If the parser name differs from the filetype(s) used by Neovim, you need to register the parser via +Alternatively, if you have a local checkout, you can instead use +```lua + install_info = { + path = '~/parsers/tree-sitter-zimbu', + files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c + -- optional entries + location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" + generate = true, -- only needed if repo does not contain pre-generated src/parser.c + generate_from_json = true, -- only needed if parser has npm dependencies + }, +``` +This will always use the state of the directory as-is (i.e., `branch` and `revision` will be ignored). + +2. If the parser name differs from the filetype(s) used by Neovim, you need to register the parser via ```lua vim.treesitter.language.register('zimbu', { 'zu' }) @@ -155,13 +167,20 @@ vim.treesitter.language.register('zimbu', { 'zu' }) If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`]() to add a custom detection rule. -5. Start `nvim` and `:TSInstall zimbu`. - -You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`. -Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`. +3. Start `nvim` and `:TSInstall zimbu`. **Note:** Parsers using external scanner need to be written in C. C++ scanners are no longer supported. +### Modifying parsers + +You can use the same approach for overriding parser information. E.g., if you always want to generate the `lua` parser from grammar, add +```lua +vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate', +callback = function() + require('nvim-treesitter.parsers').lua.install_info.generate = true +end}) +``` + ## Adding queries Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see `:h treesitter-query`. @@ -231,7 +250,7 @@ require("nvim-treesitter.install").prefer_git = true In your Lua config: ```lua -for _, config in pairs(require("nvim-treesitter.parsers").configs) do +for _, config in pairs(require("nvim-treesitter.parsers")) do config.install_info.url = config.install_info.url:gsub("https://github.com/", "something else") end diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a63f603e7..d2ba24468 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -26,9 +26,9 @@ Language | Tier | Queries | CLI | Maintainer [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.git) | unsupported | `H    ` | | @gabmus +[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` | | @Luxed +[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 @@ -77,7 +77,7 @@ ecma (queries only)[^ecma] | community | `HFIJL` | | @steelsojka [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.git) | community | `HFI L` | | @jirgn +[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 @@ -102,7 +102,7 @@ ecma (queries only)[^ecma] | community | `HFIJL` | | @steelsojka [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 J ` | | @mrcjkb +[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 @@ -129,7 +129,7 @@ html_tags (queries only)[^html_tags] | community | `H IJ ` | | @TravonteD [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.git) | community | `HFIJL` | | @WhyNotHugo +[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 @@ -139,7 +139,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | | @steelsojka [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 | `H  JL` | | @traxys +[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 @@ -175,7 +175,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | | @steelsojka [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.git) | community | `HFIJL` | | @Isopod +[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 @@ -245,8 +245,9 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | | @steelsojka [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.git) | community | `HFIJL` | | @xasc +[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 @@ -256,13 +257,14 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | | @steelsojka [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.git) | community | `H    ` | | @arnarg +[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 diff --git a/TODO.md b/TODO.md index ff2b05001..56d8c88cf 100644 --- a/TODO.md +++ b/TODO.md @@ -4,13 +4,16 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO -- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`? -- [ ] **`parsers.lua`:** include revision? () -- [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1) +- [ ] **`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 +- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`? - [ ] **textobjects:** include simple(!) function, queries? (check Helix) - [ ] **downstream:** adapt to breaking changes (`nvim-treesitter-refactor`) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 8b530550c..ef55eb2d8 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -37,7 +37,7 @@ To get a list of supported languages To install supported parsers and queries, put this in your `init.lua` file: >lua - require'nvim-treesitter.configs'.setup { + require'nvim-treesitter.config'.setup { -- A directory to install the parsers and queries to. -- Defaults to the `stdpath('data')/site` dir. install_dir = "/some/path/to/store/parsers", diff --git a/lua/nvim-treesitter/_meta/parsers.lua b/lua/nvim-treesitter/_meta/parsers.lua new file mode 100644 index 000000000..09e4d1846 --- /dev/null +++ b/lua/nvim-treesitter/_meta/parsers.lua @@ -0,0 +1,47 @@ +---@meta +error('Cannot require a meta file') + +---@class InstallInfo +--- +---URL of parser repo (Github/Gitlab) +---@field url string +--- +---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 +--- +---Location of `grammar.js` in repo (if not at root, e.g., in a monorepo) +---@field location? string +--- +---Repo does not contain a `parser.c`; must be generated from grammar first +---@field generate? boolean +--- +---Parser needs to be generated from `grammar.json` (generating from `grammar.js` requires npm) +---@field generate_from_json? boolean +--- +---Parser repo is a local directory; overrides `url`, `revision`, and `branch` +---@field path? string + +---@class ParserInfo +--- +---Information necessary to build and install the parser (empty for query-only language) +---@field install_info? InstallInfo +--- +---List of Github users maintaining the queries for Neovim +---@field maintainers? string[] +--- +---List of other languages to install (e.g., if queries inherit from them) +---@field requires? string[] +--- +---Language support tier, maps to "core", "stable", "community", "unmaintained" +---@field tier integer +--- +---Explanatory footnote text to add in SUPPORTED_LANGUAGES.md +---@field readme_note? string + +---@alias nvim-ts.parsers table diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index a52c6a10e..4c662bab6 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -1,5 +1,7 @@ local M = {} +M.tiers = { 'stable', 'core', 'community', 'unsupported' } + ---@class TSConfig ---@field auto_install boolean ---@field ensure_install string[] @@ -33,7 +35,7 @@ function M.setup(user_data) local ft = vim.bo[buf].filetype local lang = vim.treesitter.language.get_lang(ft) or ft if - require('nvim-treesitter.parsers').configs[lang] + require('nvim-treesitter.parsers')[lang] and not vim.list_contains(M.installed_parsers(), lang) and not vim.list_contains(config.ignore_install, lang) then @@ -51,7 +53,7 @@ function M.setup(user_data) local to_install = M.norm_languages(config.ensure_install, { ignored = true, installed = true }) if #to_install > 0 then - require('nvim-treesitter.install').install(to_install) + require('nvim-treesitter.install').install(to_install, { force = true }) end end end @@ -85,6 +87,52 @@ function M.installed_parsers() return installed end +-- Get a list of all available parsers +---@param tier integer? only get parsers of specified tier +---@return string[] +function M.get_available(tier) + local parsers = require('nvim-treesitter.parsers') + --- @type string[] + local languages = vim.tbl_keys(parsers) + table.sort(languages) + if tier then + languages = vim.tbl_filter( + --- @param p string + function(p) + return parsers[p].tier == tier + end, + 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 + +local function expand_tiers(list) + for i, tier in ipairs(M.tiers) do + if vim.list_contains(list, tier) then + list = vim.tbl_filter( + --- @param l string + function(l) + return l ~= tier + end, + list + ) + vim.list_extend(list, M.get_available(i)) + end + end + + return list +end + ---Normalize languages ---@param languages? string[]|string ---@param skip? { ignored: boolean, missing: boolean, installed: boolean, dependencies: boolean } @@ -96,32 +144,11 @@ function M.norm_languages(languages, skip) languages = { languages } end - local parsers = require('nvim-treesitter.parsers') - if vim.list_contains(languages, 'all') then if skip and skip.missing then return M.installed_parsers() end - languages = parsers.get_available() - end - - -- keep local to avoid leaking parsers module - --- @param list string[] - local function expand_tiers(list) - for i, tier in ipairs(parsers.tiers) do - if vim.list_contains(list, tier) then - list = vim.tbl_filter( - --- @param l string - function(l) - return l ~= tier - end, - list - ) - vim.list_extend(list, parsers.get_available(i)) - end - end - - return list + languages = M.get_available() end languages = expand_tiers(languages) @@ -159,19 +186,20 @@ function M.norm_languages(languages, skip) ) end + local parsers = require('nvim-treesitter.parsers') languages = vim.tbl_filter( --- @param v string function(v) -- TODO(lewis6991): warn of any unknown parsers? - return parsers.configs[v] ~= nil + return parsers[v] ~= nil end, languages ) if not (skip and skip.dependencies) then for _, lang in pairs(languages) do - if parsers.configs[lang].requires then - vim.list_extend(languages, parsers.configs[lang].requires) + if parsers[lang].requires then + vim.list_extend(languages, parsers[lang].requires) end end end diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 5d3a23300..58ede835a 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -134,7 +134,7 @@ function M.check() health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J') local languages = config.installed_parsers() for _, lang in pairs(languages) do - local parser = parsers.configs[lang] + local parser = parsers[lang] local out = lang .. string.rep(' ', 22 - #lang) if parser.install_info then for _, query_group in pairs(M.bundled_queries) do diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 6918a1820..8b3dc82fc 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -25,12 +25,6 @@ local uv_unlink = a.wrap(uv.fs_unlink, 2) local M = {} ----@class LockfileInfo ----@field revision string - ----@type table -local lockfile = {} - local max_jobs = 10 local iswin = uv.os_uname().sysname == 'Windows_NT' @@ -63,7 +57,7 @@ end ---@param lang string ---@return InstallInfo? local function get_parser_install_info(lang) - local parser_config = parsers.configs[lang] + local parser_config = parsers[lang] if not parser_config then log.error('Parser not available for language "' .. lang .. '"') @@ -78,24 +72,6 @@ function M.get_package_path(...) return fs.joinpath(fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) end ----@param lang string ----@return string? -local function get_target_revision(lang) - local info = get_parser_install_info(lang) - if info and info.revision then - return info.revision - end - - if #lockfile == 0 then - local filename = M.get_package_path('lockfile.json') - lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] - end - - if lockfile[lang] then - return lockfile[lang].revision - end -end - ---@param lang string ---@return string? local function get_installed_revision(lang) @@ -106,9 +82,9 @@ end ---@param lang string ---@return boolean local function needs_update(lang) - local revision = get_target_revision(lang) - if revision then - return revision ~= get_installed_revision(lang) + local info = get_parser_install_info(lang) + if info and info.revision then + return info.revision ~= get_installed_revision(lang) end -- No revision. Check the queries link to the same place @@ -415,7 +391,7 @@ local function install_lang0(lang, cache_dir, install_dir, generate) local project_name = 'tree-sitter-' .. lang - local revision = get_target_revision(lang) + local revision = repo.revision local compile_location ---@type string if repo.path then @@ -525,40 +501,33 @@ local function install_lang(lang, cache_dir, install_dir, force, generate) return status end +--- Reload the parser table and user modifications in case of update +local function reload_parsers() + package.loaded['nvim-treesitter.parsers'] = nil + parsers = require('nvim-treesitter.parsers') + vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' }) +end + ---@class InstallOptions ---@field force? boolean ---@field generate? boolean ----@field skip? table --- Install a parser ---- @param languages? string[]|string +--- @param languages string[] --- @param options? InstallOptions --- @param _callback? fun() local function install(languages, options, _callback) options = options or {} - local force = options.force - local generate = options.generate - local skip = options.skip local cache_dir = vim.fs.normalize(fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') - if not languages or type(languages) == 'string' then - languages = { languages } - end - - if languages[1] == 'all' then - force = true - end - - languages = config.norm_languages(languages, skip) - local tasks = {} --- @type fun()[] local done = 0 for _, lang in ipairs(languages) do tasks[#tasks + 1] = a.sync(function() a.main() - local status = install_lang(lang, cache_dir, install_dir, force, generate) + local status = install_lang(lang, cache_dir, install_dir, options.force, options.generate) if status ~= 'failed' then done = done + 1 end @@ -572,7 +541,20 @@ local function install(languages, options, _callback) end end -M.install = a.sync(install, 2) +M.install = a.sync(function(languages, options, _callback) + reload_parsers() + if not languages or #languages == 0 then + languages = 'all' + end + + languages = config.norm_languages(languages, options and options.skip) + + if languages[1] == 'all' then + options.force = true + end + + install(languages, options) +end, 2) ---@class UpdateOptions @@ -580,8 +562,7 @@ M.install = a.sync(install, 2) ---@param _options? UpdateOptions ---@param _callback function M.update = a.sync(function(languages, _options, _callback) - M.lockfile = {} - + reload_parsers() if not languages or #languages == 0 then languages = 'all' end diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4e3222563..83011c7cb 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1,167 +1,146 @@ ----@class InstallInfo ----@field path? string ----@field url string ----@field branch? string ----@field revision? string ----@field files string[] ----@field generate? boolean ----@field generate_from_json? boolean ----@field location? string - ----@class ParserInfo ----@field install_info? InstallInfo ----@field maintainers? string[] ----@field requires? string[] ----@field tier integer ----@field readme_note? string - -local M = {} - -M.tiers = { 'stable', 'core', 'community', 'unsupported' } - ----@type table -M.configs = { +---@type nvim-ts.parsers +return { ada = { install_info = { - url = 'https://github.com/briot/tree-sitter-ada', files = { 'src/parser.c' }, + revision = 'e8e2515465cc2d7c444498e68bdb9f1d86767f95', + url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, tier = 3, }, - agda = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-agda', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'd3dc807692e6bca671d4491b3bf5c67eeca8c016', + url = 'https://github.com/tree-sitter/tree-sitter-agda', }, maintainers = { '@Decodetalkers' }, tier = 2, }, - angular = { install_info = { - url = 'https://github.com/dlvandenberg/tree-sitter-angular', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '10f21f3f1b10584e62ecc113ab3cda1196d0ceb8', + url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, requires = { 'html', 'html_tags' }, tier = 3, }, - apex = { install_info = { - url = 'https://github.com/aheber/tree-sitter-sfapex', files = { 'src/parser.c' }, location = 'apex', + revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, tier = 3, }, - arduino = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = 'afb34b2c65f507932c5c6ddbf0d5a9ca6a772f2f', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, requires = { 'cpp' }, tier = 2, }, - asm = { install_info = { - url = 'https://github.com/RubixDev/tree-sitter-asm', files = { 'src/parser.c' }, + revision = 'b0306e9bb2ebe01c6562f1aef265cc42ccc53070', + url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, tier = 3, }, - astro = { install_info = { - url = 'https://github.com/virchau13/tree-sitter-astro', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '4be180759ec13651f72bacee65fa477c64222a1a', + url = 'https://github.com/virchau13/tree-sitter-astro', }, maintainers = { '@virchau13' }, requires = { 'html', 'html_tags' }, tier = 3, }, - authzed = { install_info = { - url = 'https://github.com/mleonidas/tree-sitter-authzed', files = { 'src/parser.c' }, + revision = '1dec7e1af96c56924e3322cd85fdce15d0a31d00', + url = 'https://github.com/mleonidas/tree-sitter-authzed', }, maintainers = { '@mattpolzin' }, tier = 3, }, - awk = { install_info = { - url = 'https://github.com/Beaglefoot/tree-sitter-awk', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'ba7472152d79a8c916550c80fdbfd5724d07a0c9', + url = 'https://github.com/Beaglefoot/tree-sitter-awk', }, tier = 4, }, - bash = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-bash', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '2fbd860f802802ca76a6661ce025b3a3bca2d3ed', + url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, tier = 1, }, - bass = { install_info = { - url = 'https://github.com/vito/tree-sitter-bass', files = { 'src/parser.c' }, + revision = '28dc7059722be090d04cd751aed915b2fee2f89a', + url = 'https://github.com/vito/tree-sitter-bass', }, maintainers = { '@amaanq' }, tier = 3, }, - beancount = { install_info = { - url = 'https://github.com/polarmutex/tree-sitter-beancount', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'c25f8034c977681653a8acd541c8b4877a58f474', + url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, tier = 3, }, - bibtex = { install_info = { - url = 'https://github.com/latex-lsp/tree-sitter-bibtex', files = { 'src/parser.c' }, + revision = 'ccfd77db0ed799b6c22c214fe9d2937f47bc8b34', + url = 'https://github.com/latex-lsp/tree-sitter-bibtex', }, maintainers = { '@theHamsta', '@clason' }, tier = 3, }, - bicep = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-bicep', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '0092c7d1bd6bb22ce0a6f78497d50ea2b87f19c0', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-bicep', }, maintainers = { '@amaanq' }, tier = 2, }, - bitbake = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-bitbake', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a5d04fdb5a69a02b8fa8eb5525a60dfb5309b73b', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-bitbake', }, maintainers = { '@amaanq' }, tier = 2, }, - blade = { install_info = { url = 'https://github.com/EmranMR/tree-sitter-blade', @@ -172,21 +151,22 @@ M.configs = { }, blueprint = { install_info = { - url = 'https://gitlab.com/gabmus/tree-sitter-blueprint.git', files = { 'src/parser.c' }, + revision = '60ba73739c6083c693d86a1a7cf039c07eb4ed59', + url = 'https://gitlab.com/gabmus/tree-sitter-blueprint', }, maintainers = { '@gabmus' }, tier = 4, }, - bp = { install_info = { - url = 'https://github.com/ambroisie/tree-sitter-bp', files = { 'src/parser.c' }, + revision = '2326d709fb9cf73cf124fdbc803c267f851721a4', + url = 'https://github.com/ambroisie/tree-sitter-bp', }, maintainers = { '@ambroisie' }, - tier = 3, readme_note = 'Android Blueprint', + tier = 3, }, brightscript = { install_info = { @@ -198,31 +178,31 @@ M.configs = { }, c = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-c', files = { 'src/parser.c' }, + revision = 'deca017a554045b4c203e7ddff39ae64ff05e071', + url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, tier = 1, }, - c_sharp = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '82fa8f05f41a33e9bc830f85d74a9548f0291738', + url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, tier = 2, }, - cairo = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-cairo', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '6238f609bea233040fe927858156dee5515a0745', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cairo', }, maintainers = { '@amaanq' }, tier = 2, }, - caddy = { install_info = { url = 'https://github.com/opa-oz/tree-sitter-caddy', @@ -231,25 +211,24 @@ M.configs = { maintainers = { '@opa-oz' }, tier = 3, }, - capnp = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-capnp', files = { 'src/parser.c' }, + revision = '7b0883c03e5edd34ef7bcf703194204299d7099f', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-capnp', }, maintainers = { '@amaanq' }, tier = 2, }, - chatito = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', files = { 'src/parser.c' }, + revision = 'a461f20dedb43905febb12c1635bc7d2e43e96f0', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - circom = { install_info = { url = 'https://github.com/Decurity/tree-sitter-circom', @@ -258,122 +237,121 @@ M.configs = { maintainers = { '@alexandr-martirosyan' }, tier = 3, }, - clojure = { install_info = { - url = 'https://github.com/sogaiu/tree-sitter-clojure', files = { 'src/parser.c' }, + revision = 'f4236d4da8aa92bc105d9c118746474c608e6af7', + url = 'https://github.com/sogaiu/tree-sitter-clojure', }, maintainers = { '@NoahTheDuke' }, tier = 3, }, - cmake = { install_info = { - url = 'https://github.com/uyha/tree-sitter-cmake', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '20ffd6d3b4da1acdbf2d08204b2130a5b2f7c4b3', + url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, tier = 3, }, - comment = { install_info = { - url = 'https://github.com/stsewd/tree-sitter-comment', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '5d8b29f6ef3bf64d59430dcfe76b31cc44b5abfd', + url = 'https://github.com/stsewd/tree-sitter-comment', }, maintainers = { '@stsewd' }, tier = 3, }, - commonlisp = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-commonlisp', files = { 'src/parser.c' }, generate_from_json = true, + revision = 'bf2a65b1c119898a1a17389e07f2a399c05cdc0c', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-commonlisp', }, maintainers = { '@theHamsta' }, tier = 2, }, - cooklang = { install_info = { - url = 'https://github.com/addcninblue/tree-sitter-cooklang', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '4ebe237c1cf64cf3826fc249e9ec0988fe07e58e', + url = 'https://github.com/addcninblue/tree-sitter-cooklang', }, maintainers = { '@addcninblue' }, tier = 3, }, - corn = { install_info = { - url = 'https://github.com/jakestanger/tree-sitter-corn', files = { 'src/parser.c' }, + revision = '604d73c38d4c28ca68e9e441ffd405d68cb63051', + url = 'https://github.com/jakestanger/tree-sitter-corn', }, maintainers = { '@jakestanger' }, tier = 3, }, - cpon = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-cpon', files = { 'src/parser.c' }, + revision = '594289eadfec719198e560f9d7fd243c4db678d5', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cpon', }, maintainers = { '@amaanq' }, tier = 2, }, - cpp = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-cpp', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = 'd29fbff09a8c9ff4f3074de2595dfca12cb33da9', + url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, requires = { 'c' }, tier = 2, }, - css = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-css', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'f6be52c3d1cdb1c5e4dd7d8bce0a57497f55d6af', + url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, tier = 2, }, - csv = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'csv', + revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', }, maintainers = { '@amaanq' }, requires = { 'tsv' }, tier = 2, }, - cuda = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '1f188eff83b562ffae36d13e1b804ec6f3b9f1d9', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, tier = 2, }, - cue = { install_info = { - url = 'https://github.com/eonpatapon/tree-sitter-cue', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '8a5f273bfa281c66354da562f2307c2d394b6c81', + url = 'https://github.com/eonpatapon/tree-sitter-cue', }, maintainers = { '@amaanq' }, tier = 3, }, - cylc = { install_info = { url = 'https://github.com/elliotfontaine/tree-sitter-cylc', @@ -382,141 +360,138 @@ M.configs = { maintainers = { '@elliotfontaine' }, tier = 3, }, - d = { install_info = { - url = 'https://github.com/gdamore/tree-sitter-d', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '750dde90ed9cdbd82493bc28478d8ab1976b0e9f', + url = 'https://github.com/gdamore/tree-sitter-d', }, - tier = 3, maintainers = { '@amaanq' }, + tier = 3, }, - dart = { install_info = { - url = 'https://github.com/UserNobody14/tree-sitter-dart', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'ac0bb849ccd1a923963af47573b5e396736ff582', + url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, tier = 3, }, - desktop = { install_info = { - url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', files = { 'src/parser.c' }, + url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, tier = 3, }, - devicetree = { install_info = { - url = 'https://github.com/joelspadin/tree-sitter-devicetree', files = { 'src/parser.c' }, + revision = 'fb07e6044ffd36932c57a5be01ba5d6b8a9337bb', + url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, tier = 3, }, - dhall = { install_info = { - url = 'https://github.com/jbellerb/tree-sitter-dhall', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'affb6ee38d629c9296749767ab832d69bb0d9ea8', + url = 'https://github.com/jbellerb/tree-sitter-dhall', }, maintainers = { '@amaanq' }, tier = 3, }, - diff = { install_info = { - url = 'https://github.com/the-mikedavis/tree-sitter-diff', files = { 'src/parser.c' }, + revision = '629676fc3919606964231b2c7b9677d6998a2cb4', + url = 'https://github.com/the-mikedavis/tree-sitter-diff', }, maintainers = { '@gbprod' }, tier = 3, }, - disassembly = { install_info = { - url = 'https://github.com/ColinKennedy/tree-sitter-disassembly', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '0229c0211dba909c5d45129ac784a3f4d49c243a', + url = 'https://github.com/ColinKennedy/tree-sitter-disassembly', }, maintainers = { '@ColinKennedy' }, tier = 3, }, - djot = { install_info = { - url = 'https://github.com/treeman/tree-sitter-djot', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '0e9a836ec47612ade15645fb1680adb549894a6c', + url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, tier = 3, }, - dockerfile = { install_info = { - url = 'https://github.com/camdencheek/tree-sitter-dockerfile', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '087daa20438a6cc01fa5e6fe6906d77c869d19fe', + url = 'https://github.com/camdencheek/tree-sitter-dockerfile', }, maintainers = { '@camdencheek' }, tier = 3, }, - dot = { install_info = { - url = 'https://github.com/rydesun/tree-sitter-dot', files = { 'src/parser.c' }, + revision = '9ab85550c896d8b294d9b9ca1e30698736f08cea', + url = 'https://github.com/rydesun/tree-sitter-dot', }, maintainers = { '@rydesun' }, tier = 3, }, - doxygen = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-doxygen', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '4a30eba5d047d6a8c5b005202b4848c0b33d76ca', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-doxygen', }, maintainers = { '@amaanq' }, tier = 2, }, - dtd = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', files = { 'src/parser.c', 'src/scanner.c' }, location = 'dtd', + revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - earthfile = { install_info = { - url = 'https://github.com/glehmann/tree-sitter-earthfile', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '6de809419cdfb23e3a8383b6575fa3634900f276', + url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, tier = 3, }, - ebnf = { install_info = { - url = 'https://github.com/RubixDev/ebnf', files = { 'src/parser.c' }, location = 'crates/tree-sitter-ebnf', + revision = '8e635b0b723c620774dfb8abf382a7f531894b40', + url = 'https://github.com/RubixDev/ebnf', }, maintainers = { '@RubixDev' }, tier = 3, }, - ecma = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, typescript, tsx, qmljs', tier = 3, }, - editorconfig = { install_info = { url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', @@ -525,69 +500,68 @@ M.configs = { maintainers = { '@ValdezFOmar' }, tier = 3, }, - eds = { install_info = { - url = 'https://github.com/uyha/tree-sitter-eds', files = { 'src/parser.c' }, + revision = '5517bdb90c90703df49579a4b04689a614780be2', + url = 'https://github.com/uyha/tree-sitter-eds', }, maintainers = { '@uyha' }, tier = 3, }, - eex = { install_info = { - url = 'https://github.com/connorlay/tree-sitter-eex', files = { 'src/parser.c' }, + revision = 'f742f2fe327463335e8671a87c0b9b396905d1d1', + url = 'https://github.com/connorlay/tree-sitter-eex', }, maintainers = { '@connorlay' }, tier = 3, }, - elixir = { install_info = { - url = 'https://github.com/elixir-lang/tree-sitter-elixir', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'de690fa8a028f122af46d9d2685679fe5f2d7d60', + url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, tier = 3, }, - elm = { install_info = { - url = 'https://github.com/elm-tooling/tree-sitter-elm', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '09dbf221d7491dc8d8839616b27c21b9c025c457', + url = 'https://github.com/elm-tooling/tree-sitter-elm', }, maintainers = { '@zweimach' }, tier = 3, }, - elsa = { install_info = { - url = 'https://github.com/glapa-grossklag/tree-sitter-elsa', files = { 'src/parser.c' }, + revision = '0a66b2b3f3c1915e67ad2ef9f7dbd2a84820d9d7', + url = 'https://github.com/glapa-grossklag/tree-sitter-elsa', }, maintainers = { '@glapa-grossklag', '@amaanq' }, tier = 3, }, - elvish = { install_info = { - url = 'https://github.com/elves/tree-sitter-elvish', files = { 'src/parser.c' }, + revision = '5e7210d945425b77f82cbaebc5af4dd3e1ad40f5', + url = 'https://github.com/elves/tree-sitter-elvish', }, maintainers = { '@elves' }, tier = 3, }, - embedded_template = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', files = { 'src/parser.c' }, + revision = '38d5004a797298dc42c85e7706c5ceac46a3f29f', + url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 4, }, - enforce = { install_info = { url = 'https://github.com/simonvic/tree-sitter-enforce', @@ -596,239 +570,235 @@ M.configs = { maintainers = { '@simonvic' }, tier = 3, }, - erlang = { install_info = { - url = 'https://github.com/WhatsApp/tree-sitter-erlang', files = { 'src/parser.c', 'src/parser.c' }, + revision = '98ea1f9c957b2ad520415eecb5a5b406e931101e', + url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, tier = 3, }, - facility = { install_info = { - url = 'https://github.com/FacilityApi/tree-sitter-facility', files = { 'src/parser.c' }, + revision = 'a52579670e2b14ec03d410c3c980fafaf6d659c4', + url = 'https://github.com/FacilityApi/tree-sitter-facility', }, maintainers = { '@bryankenote' }, tier = 3, }, - faust = { install_info = { - url = 'https://github.com/khiner/tree-sitter-faust', files = { 'src/parser.c' }, + revision = 'f3b9274514b5f9bf6b0dd4a01c30f9cc15c58bc4', + url = 'https://github.com/khiner/tree-sitter-faust', }, maintainers = { '@khiner' }, tier = 3, }, - fennel = { install_info = { - url = 'https://github.com/alexmozaidze/tree-sitter-fennel', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = 'cfbfa478dc2dbef267ee94ae4323d9c886f45e94', + url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, tier = 3, }, - fidl = { install_info = { - url = 'https://github.com/google/tree-sitter-fidl', files = { 'src/parser.c' }, + revision = '0a8910f293268e27ff554357c229ba172b0eaed2', + url = 'https://github.com/google/tree-sitter-fidl', }, maintainers = { '@chaopeng' }, tier = 3, }, - firrtl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-firrtl', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '8503d3a0fe0f9e427863cb0055699ff2d29ae5f5', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-firrtl', }, maintainers = { '@amaanq' }, tier = 2, }, - fish = { install_info = { - url = 'https://github.com/ram02z/tree-sitter-fish', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a78aef9abc395c600c38a037ac779afc7e3cc9e0', + url = 'https://github.com/ram02z/tree-sitter-fish', }, maintainers = { '@ram02z' }, tier = 3, }, - foam = { install_info = { - url = 'https://github.com/FoamScience/tree-sitter-foam', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '04664b40c0dadb7ef37028acf3422c63271d377b', + url = 'https://github.com/FoamScience/tree-sitter-foam', }, maintainers = { '@FoamScience' }, tier = 3, }, - forth = { install_info = { - url = 'https://github.com/AlexanderBrevig/tree-sitter-forth', files = { 'src/parser.c' }, + revision = '90189238385cf636b9ee99ce548b9e5b5e569d48', + url = 'https://github.com/AlexanderBrevig/tree-sitter-forth', }, maintainers = { '@amaanq' }, tier = 3, }, - fortran = { install_info = { - url = 'https://github.com/stadelmanma/tree-sitter-fortran', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'f73d473e3530862dee7cbb38520f28824e7804f6', + url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, tier = 3, }, - fsh = { install_info = { - url = 'https://github.com/mgramigna/tree-sitter-fsh', files = { 'src/parser.c' }, + revision = 'fad2e175099a45efbc98f000cc196d3674cc45e0', + url = 'https://github.com/mgramigna/tree-sitter-fsh', }, maintainers = { '@mgramigna' }, tier = 3, }, - fsharp = { install_info = { - url = 'https://github.com/ionide/tree-sitter-fsharp', files = { 'src/parser.c', 'src/scanner.c' }, location = 'fsharp', + url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, tier = 3, }, - func = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-func', files = { 'src/parser.c' }, + revision = 'f780ca55e65e7d7360d0229331763e16c452fc98', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-func', }, maintainers = { '@amaanq' }, tier = 2, }, - fusion = { install_info = { - url = 'https://gitlab.com/jirgn/tree-sitter-fusion.git', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6', + url = 'https://gitlab.com/jirgn/tree-sitter-fusion', }, maintainers = { '@jirgn' }, tier = 3, }, - gap = { install_info = { url = 'https://github.com/gap-system/tree-sitter-gap', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@reiniscirpons' }, - readme_name = 'GAP system', + readme_note = 'GAP system', tier = 3, }, - gaptst = { install_info = { url = 'https://github.com/gap-system/tree-sitter-gaptst', files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@reiniscirpons' }, - readme_name = 'GAP system test files', + readme_note = 'GAP system test files', requires = { 'gap' }, tier = 3, }, - gdscript = { install_info = { - url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '1f1e782fe2600f50ae57b53876505b8282388d77', + url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, readme_note = 'Godot', tier = 3, }, - gdshader = { install_info = { - url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', files = { 'src/parser.c' }, + revision = 'ffd9f958df13cae04593781d7d2562295a872455', + url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', }, maintainers = { '@godofavacyn' }, tier = 3, }, - + git_config = { + install_info = { + files = { 'src/parser.c' }, + revision = '9c2a1b7894e6d9eedfe99805b829b4ecd871375e', + url = 'https://github.com/the-mikedavis/tree-sitter-git-config', + }, + maintainers = { '@amaanq' }, + tier = 3, + }, git_rebase = { install_info = { - url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', files = { 'src/parser.c' }, + revision = 'd8a4207ebbc47bd78bacdf48f883db58283f9fd8', + url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', }, maintainers = { '@gbprod' }, tier = 3, }, - gitattributes = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', files = { 'src/parser.c' }, + revision = '41940e199ba5763abea1d21b4f717014b45f01ea', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - gitcommit = { install_info = { - url = 'https://github.com/gbprod/tree-sitter-gitcommit', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'edd817e0532f179b7f7f371dc180629070945f0c', + url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, tier = 3, }, - - git_config = { - install_info = { - url = 'https://github.com/the-mikedavis/tree-sitter-git-config', - files = { 'src/parser.c' }, - }, - maintainers = { '@amaanq' }, - tier = 3, - }, - gitignore = { install_info = { - url = 'https://github.com/shunsambongi/tree-sitter-gitignore', files = { 'src/parser.c' }, + revision = 'f4685bf11ac466dd278449bcfe5fd014e94aa504', + url = 'https://github.com/shunsambongi/tree-sitter-gitignore', }, maintainers = { '@theHamsta' }, tier = 3, }, - gleam = { install_info = { - url = 'https://github.com/gleam-lang/tree-sitter-gleam', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '02a17bf9d0553406268cdbf466d57808ae712bf3', + url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, tier = 3, }, - glimmer = { install_info = { - url = 'https://github.com/ember-tooling/tree-sitter-glimmer', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '6b25d265c990139353e1f7f97baf84987ebb7bf0', + url = 'https://github.com/ember-tooling/tree-sitter-glimmer', }, maintainers = { '@NullVoxPopuli' }, readme_note = 'Glimmer and Ember', tier = 3, }, - glimmer_javascript = { install_info = { url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', @@ -836,10 +806,9 @@ M.configs = { generate_requires_npm = true, }, maintainers = { '@NullVoxPopuli' }, - requires = { 'javascript' }, + requires = { 'ecma' }, tier = 3, }, - glimmer_typescript = { install_info = { url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', @@ -850,46 +819,45 @@ M.configs = { requires = { 'typescript' }, tier = 3, }, - glsl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', files = { 'src/parser.c' }, generate_from_json = true, + revision = '7f91bf34cadc06a96efc475df501ffca4dda9410', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', }, maintainers = { '@theHamsta' }, requires = { 'c' }, tier = 2, }, - gn = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-gn', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'bc06955bc1e3c9ff8e9b2b2a55b38b94da923c05', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gn', }, maintainers = { '@amaanq' }, readme_name = 'GN (Generate Ninja)', tier = 2, }, - gnuplot = { install_info = { - url = 'https://github.com/dpezto/tree-sitter-gnuplot', files = { 'src/parser.c' }, + revision = '3c895f5d9c0b3a3c7e02383766b462c21913c000', + url = 'https://github.com/dpezto/tree-sitter-gnuplot', }, maintainers = { '@dpezto' }, tier = 3, }, - go = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-go', files = { 'src/parser.c' }, + revision = '7ee8d928db5202f6831a78f8112fd693bf69f98b', + url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, tier = 2, }, - goctl = { install_info = { url = 'https://github.com/chaozwn/tree-sitter-goctl', @@ -898,71 +866,70 @@ M.configs = { maintainers = { '@chaozwn' }, tier = 3, }, - godot_resource = { install_info = { - url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '2ffb90de47417018651fc3b970e5f6b67214dc9d', + url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, readme_note = 'Godot Resources', tier = 3, }, - gomod = { install_info = { - url = 'https://github.com/camdencheek/tree-sitter-go-mod', files = { 'src/parser.c' }, + revision = 'bbe2fe3be4b87e06a613e685250f473d2267f430', + url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, maintainers = { '@camdencheek' }, tier = 3, }, - gosum = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-go-sum', files = { 'src/parser.c' }, + revision = 'e2ac513b2240c7ff1069ae33b2df29ce90777c11', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-go-sum', }, maintainers = { '@amaanq' }, tier = 2, }, - - gowork = { - install_info = { - url = 'https://github.com/omertuc/tree-sitter-go-work', - files = { 'src/parser.c' }, - }, - maintainers = { '@omertuc' }, - tier = 3, - }, - - graphql = { - install_info = { - url = 'https://github.com/bkegley/tree-sitter-graphql', - files = { 'src/parser.c' }, - }, - maintainers = { '@bkegley' }, - tier = 3, - }, - gotmpl = { install_info = { - url = 'https://github.com/ngalaiko/tree-sitter-go-template', files = { 'src/parser.c' }, + revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', + url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, tier = 3, }, - + gowork = { + install_info = { + files = { 'src/parser.c' }, + revision = '949a8a470559543857a62102c84700d291fc984c', + url = 'https://github.com/omertuc/tree-sitter-go-work', + }, + maintainers = { '@omertuc' }, + tier = 3, + }, gpg = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', files = { 'src/parser.c' }, + revision = 'f99323fb8f3f10b6c69db0c2f6d0a14bd7330675', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - + graphql = { + install_info = { + files = { 'src/parser.c' }, + revision = '5e66e961eee421786bdda8495ed1db045e06b5fe', + url = 'https://github.com/bkegley/tree-sitter-graphql', + }, + maintainers = { '@bkegley' }, + tier = 3, + }, gren = { install_info = { files = { 'src/parser.c', 'src/scanner.c' }, @@ -971,199 +938,197 @@ M.configs = { maintainers = { '@MaeBrooks' }, tier = 3, }, - groovy = { install_info = { - url = 'https://github.com/murtaza64/tree-sitter-groovy', files = { 'src/parser.c' }, + revision = '6c5c8813233fe326e24c5ef032858d13f8006a8d', + url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, tier = 3, }, - gstlaunch = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch', files = { 'src/parser.c' }, + revision = '549aef253fd38a53995cda1bf55c501174372bf7', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch', }, maintainers = { '@theHamsta' }, tier = 2, }, - hack = { install_info = { - url = 'https://github.com/slackhq/tree-sitter-hack', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'fca1e294f6dce8ec5659233a6a21f5bd0ed5b4f2', + url = 'https://github.com/slackhq/tree-sitter-hack', }, tier = 4, }, - hare = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', files = { 'src/parser.c' }, + revision = '070524937539eb8bb4f10debd9c83b66c434f3a2', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', }, maintainers = { '@amaanq' }, tier = 2, }, - haskell = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-haskell', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a50070d5bb5bd5c1281740a6102ecf1f4b0c4f19', + url = 'https://github.com/tree-sitter/tree-sitter-haskell', }, maintainers = { '@mrcjkb' }, tier = 2, }, - haskell_persistent = { install_info = { - url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '577259b4068b2c281c9ebf94c109bd50a74d5857', + url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', }, maintainers = { '@lykahb' }, tier = 3, }, - hcl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'e936d3fef8bac884661472dce71ad82284761eb1', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, tier = 2, }, - heex = { install_info = { - url = 'https://github.com/connorlay/tree-sitter-heex', files = { 'src/parser.c' }, + revision = 'b5ad6e34eea18a15bbd1466ca707a17f9bff7b93', + url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, tier = 3, }, - helm = { install_info = { - url = 'https://github.com/ngalaiko/tree-sitter-go-template', - location = 'dialects/helm', files = { 'src/parser.c' }, + location = 'dialects/helm', + revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', + url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, tier = 3, }, - hjson = { install_info = { - url = 'https://github.com/winston0410/tree-sitter-hjson', files = { 'src/parser.c' }, generate_from_json = true, + revision = '02fa3b79b3ff9a296066da6277adfc3f26cbc9e0', + url = 'https://github.com/winston0410/tree-sitter-hjson', }, maintainers = { '@winston0410' }, requires = { 'json' }, tier = 3, }, - hlsl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '5e1225a30712ca0a9040509806c7ba274a1bbcde', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', }, maintainers = { '@theHamsta' }, requires = { 'cpp' }, tier = 2, }, - hlsplaylist = { install_info = { - url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', files = { 'src/parser.c' }, + revision = '64f19029339e75d6762feae39e7878595860c980', + url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', }, maintainers = { '@Freed-Wu' }, tier = 3, }, - hocon = { install_info = { - url = 'https://github.com/antosha417/tree-sitter-hocon', files = { 'src/parser.c' }, generate_from_json = true, + revision = 'c390f10519ae69fdb03b3e5764f5592fb6924bcc', + url = 'https://github.com/antosha417/tree-sitter-hocon', }, maintainers = { '@antosha417' }, tier = 4, }, - hoon = { install_info = { - url = 'https://github.com/urbit-pilled/tree-sitter-hoon', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a24c5a39d1d7e993a8bee913c8e8b6a652ca5ae8', + url = 'https://github.com/urbit-pilled/tree-sitter-hoon', }, maintainers = { '@urbit-pilled' }, tier = 3, }, - - html_tags = { - maintainers = { '@TravonteD' }, - readme_note = 'queries required by html, astro, vue, svelte', - tier = 3, - }, - html = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-html', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'e4d834eb4918df01dcad5c27d1b15d56e3bd94cd', + url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, requires = { 'html_tags' }, tier = 2, }, - + html_tags = { + maintainers = { '@TravonteD' }, + readme_note = 'queries required by html, astro, vue, svelte', + tier = 3, + }, htmldjango = { install_info = { - url = 'https://github.com/interdependence/tree-sitter-htmldjango', files = { 'src/parser.c' }, + revision = 'ea71012d3fe14dd0b69f36be4f96bdfe9155ebae', + url = 'https://github.com/interdependence/tree-sitter-htmldjango', }, maintainers = { '@ObserverOfTime' }, tier = 3, }, - http = { install_info = { - url = 'https://github.com/rest-nvim/tree-sitter-http', files = { 'src/parser.c' }, + revision = '8d22f33faa5aa95c6526606fb656ada342e59e40', + url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, tier = 3, }, - hurl = { install_info = { - url = 'https://github.com/pfeiferj/tree-sitter-hurl', files = { 'src/parser.c' }, + revision = 'ad705af8c44c737bdb965fc081329c50716d2d03', + url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, tier = 3, }, - hyprlang = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', files = { 'src/parser.c' }, + revision = 'e5da7d0aa44403153e0394d87d9edea4e5bd6609', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, tier = 2, }, - idl = { install_info = { - url = 'https://github.com/cathaysia/tree-sitter-idl', files = { 'src/parser.c' }, + revision = '9f56001f8ed29b0ea9fa4f02813f3e83ab0a2aaa', + url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, tier = 3, }, - idris = { install_info = { url = 'https://github.com/kayhide/tree-sitter-idris', @@ -1172,25 +1137,24 @@ M.configs = { maintainers = { '@srghma' }, tier = 3, }, - ini = { install_info = { - url = 'https://github.com/justinmk/tree-sitter-ini', files = { 'src/parser.c' }, + revision = '87176e524f0a98f5be75fa44f4f0ff5c6eac069c', + url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, tier = 3, }, - inko = { install_info = { - url = 'https://github.com/inko-lang/tree-sitter-inko', files = { 'src/parser.c' }, + revision = '234c87be1dac20f766ddf6f486a7bde2a4bc5594', + url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, tier = 3, }, - ipkg = { install_info = { url = 'https://github.com/srghma/tree-sitter-ipkg', @@ -1199,36 +1163,35 @@ M.configs = { maintainers = { '@srghma' }, tier = 3, }, - ispc = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-ispc', files = { 'src/parser.c' }, generate_from_json = true, + revision = '9b2f9aec2106b94b4e099fe75e73ebd8ae707c04', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ispc', }, maintainers = { '@fab4100' }, requires = { 'c' }, tier = 2, }, - janet_simple = { install_info = { - url = 'https://github.com/sogaiu/tree-sitter-janet-simple', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '6bfbaadac2ba0da21087041eff85d26129c4c920', + url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, tier = 3, }, - java = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-java', files = { 'src/parser.c' }, + revision = '953abfc8bb3eb2f578e1f461edba4a9885f974b8', + url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, tier = 2, }, - javadoc = { install_info = { url = 'https://github.com/rmuir/tree-sitter-javadoc', @@ -1237,17 +1200,16 @@ M.configs = { maintainers = { '@rmuir' }, tier = 2, }, - javascript = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-javascript', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '391a8fcc48a11f63bf18ec9885f6f069e760949a', + url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, requires = { 'ecma', 'jsx' }, tier = 2, }, - jinja = { install_info = { url = 'https://github.com/cathaysia/tree-sitter-jinja', @@ -1256,9 +1218,9 @@ M.configs = { }, maintainers = { '@cathaysia' }, readme_note = 'basic highlighting', + requires = { 'jinja_inline' }, tier = 3, }, - jinja_inline = { install_info = { url = 'https://github.com/cathaysia/tree-sitter-jinja', @@ -1269,87 +1231,85 @@ M.configs = { readme_note = 'needed for full highlighting', tier = 3, }, - jq = { install_info = { - url = 'https://github.com/flurie/tree-sitter-jq', files = { 'src/parser.c' }, + revision = '13990f530e8e6709b7978503da9bc8701d366791', + url = 'https://github.com/flurie/tree-sitter-jq', }, maintainers = { '@ObserverOfTime' }, tier = 3, }, - jsdoc = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '49fde205b59a1d9792efc21ee0b6d50bbd35ff14', + url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', }, maintainers = { '@steelsojka' }, tier = 2, }, - json = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-json', files = { 'src/parser.c' }, + revision = '94f5c527b2965465956c2000ed6134dd24daf2a7', + url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, tier = 2, }, - json5 = { install_info = { - url = 'https://github.com/Joakker/tree-sitter-json5', files = { 'src/parser.c' }, + revision = 'ab0ba8229d639ec4f3fa5f674c9133477f4b77bd', + url = 'https://github.com/Joakker/tree-sitter-json5', }, maintainers = { '@Joakker' }, tier = 3, }, - jsonc = { install_info = { - url = 'https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git', files = { 'src/parser.c' }, generate_from_json = true, + revision = '02b01653c8a1c198ae7287d566efa86a135b30d5', + url = 'https://gitlab.com/WhyNotHugo/tree-sitter-jsonc', }, maintainers = { '@WhyNotHugo' }, requires = { 'json' }, tier = 3, }, - jsonnet = { install_info = { - url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'd34615fa12cc1d1cfc1f1f1a80acc9db80ee4596', + url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', }, maintainers = { '@nawordar' }, tier = 3, }, - jsx = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, tsx', tier = 3, }, - julia = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-julia', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'f1baa5f8e271109d01cc8ff7473c11df2d8a9aee', + url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, tier = 3, }, - just = { install_info = { - url = 'https://github.com/IndianBoy42/tree-sitter-just', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'fd814fc6c579f68c2a642f5e0268cf69daae92d7', + url = 'https://github.com/IndianBoy42/tree-sitter-just', }, maintainers = { '@Hubro' }, tier = 3, }, - kcl = { install_info = { url = 'https://github.com/kcl-lang/tree-sitter-kcl', @@ -1358,268 +1318,267 @@ M.configs = { maintainers = { '@bertbaron' }, tier = 2, }, - kconfig = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-kconfig', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '486fea71f61ad9f3fd4072a118402e97fe88d26c', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-kconfig', }, maintainers = { '@amaanq' }, tier = 2, }, - kdl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-kdl', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '49fb89a854d93b58a65a19724ac307195ca11941', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-kdl', }, maintainers = { '@amaanq' }, tier = 2, }, - kotlin = { install_info = { - url = 'https://github.com/fwcd/tree-sitter-kotlin', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'c9cb8504b81684375e7beb8907517dbd6947a1be', + url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, tier = 3, }, - koto = { install_info = { - url = 'https://github.com/koto-lang/tree-sitter-koto', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'eb8d866cff5751c0a7650623d244280618b0a378', + url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, tier = 3, }, - kusto = { install_info = { - url = 'https://github.com/Willem-J-an/tree-sitter-kusto', files = { 'src/parser.c' }, + revision = '8353a1296607d6ba33db7c7e312226e5fc83e8ce', + url = 'https://github.com/Willem-J-an/tree-sitter-kusto', }, maintainers = { '@Willem-J-an' }, tier = 3, }, - lalrpop = { install_info = { - url = 'https://github.com/traxys/tree-sitter-lalrpop', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '854a40e99f7c70258e522bdb8ab584ede6196e2e', + url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, tier = 3, }, - latex = { install_info = { - url = 'https://github.com/latex-lsp/tree-sitter-latex', files = { 'src/parser.c', 'src/scanner.c' }, generate = true, + revision = 'cd82eb40d31bdfe65f846f4e06292d6c804b5e0e', + url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, tier = 3, }, - ledger = { install_info = { - url = 'https://github.com/cbarrete/tree-sitter-ledger', files = { 'src/parser.c' }, + revision = '8a841fb20ce683bfbb3469e6ba67f2851cfdf94a', + url = 'https://github.com/cbarrete/tree-sitter-ledger', }, maintainers = { '@cbarrete' }, tier = 3, }, - leo = { install_info = { - url = 'https://github.com/r001/tree-sitter-leo', files = { 'src/parser.c' }, + revision = '304611b5eaf53aca07459a0a03803b83b6dfd3b3', + url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, tier = 3, }, - - llvm = { - install_info = { - url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', - files = { 'src/parser.c' }, - }, - maintainers = { '@benwilliamgraham' }, - tier = 3, - }, - linkerscript = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-linkerscript', files = { 'src/parser.c' }, + revision = 'f99011a3554213b654985a4b0a65b3b032ec4621', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-linkerscript', }, maintainers = { '@amaanq' }, tier = 2, }, - liquid = { install_info = { - url = 'https://github.com/hankthetank27/tree-sitter-liquid', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '293369818da219d97327908aab33707b04b63fd9', + url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, tier = 3, }, - liquidsoap = { install_info = { - url = 'https://github.com/savonet/tree-sitter-liquidsoap', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '14feafa91630afb1ab9988cf9b738b7ea29f3f89', + url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, tier = 3, }, - + llvm = { + install_info = { + files = { 'src/parser.c' }, + revision = '1b96e58faf558ce057d4dc664b904528aee743cb', + url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', + }, + maintainers = { '@benwilliamgraham' }, + tier = 3, + }, lua = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a24dab177e58c9c6832f96b9a73102a0cfbced4a', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, tier = 1, }, - luadoc = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-luadoc', files = { 'src/parser.c' }, + revision = '873612aadd3f684dd4e631bdf42ea8990c57634e', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luadoc', }, maintainers = { '@amaanq' }, tier = 2, }, - luap = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-luap', files = { 'src/parser.c' }, + revision = '31461ae9bd0866cb5117cfe5de71189854fd0f3e', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luap', }, maintainers = { '@amaanq' }, readme_note = 'Lua patterns', tier = 2, }, - luau = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '5aa9b88a8e3327276ec6e72de997f04ac80b1ae4', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', }, maintainers = { '@amaanq' }, requires = { 'lua' }, tier = 2, }, - m68k = { install_info = { - url = 'https://github.com/grahambates/tree-sitter-m68k', files = { 'src/parser.c' }, + revision = 'd097b123f19c6eaba2bf181c05420d88b9fc489d', + url = 'https://github.com/grahambates/tree-sitter-m68k', }, maintainers = { '@grahambates' }, tier = 3, }, - make = { install_info = { - url = 'https://github.com/alemuller/tree-sitter-make', files = { 'src/parser.c' }, + revision = 'a4b9187417d6be349ee5fd4b6e77b4172c6827dd', + url = 'https://github.com/alemuller/tree-sitter-make', }, maintainers = { '@lewis6991' }, tier = 3, }, - markdown = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', - location = 'tree-sitter-markdown', files = { 'src/parser.c', 'src/scanner.c' }, + location = 'tree-sitter-markdown', + revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, readme_note = 'basic highlighting', requires = { 'markdown_inline' }, tier = 1, }, - markdown_inline = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', - location = 'tree-sitter-markdown-inline', files = { 'src/parser.c', 'src/scanner.c' }, + location = 'tree-sitter-markdown-inline', + revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, readme_note = 'needed for full highlighting', tier = 1, }, - matlab = { install_info = { - url = 'https://github.com/acristoffers/tree-sitter-matlab', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '79d8b25f57b48f83ae1333aff6723b83c9532e37', + url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, tier = 3, }, - menhir = { install_info = { - url = 'https://github.com/Kerl13/tree-sitter-menhir', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'be8866a6bcc2b563ab0de895af69daeffa88fe70', + url = 'https://github.com/Kerl13/tree-sitter-menhir', }, maintainers = { '@Kerl13' }, tier = 3, }, - mermaid = { install_info = { - url = 'https://github.com/monaqa/tree-sitter-mermaid', files = { 'src/parser.c' }, + revision = '90ae195b31933ceb9d079abfa8a3ad0a36fee4cc', + url = 'https://github.com/monaqa/tree-sitter-mermaid', }, tier = 4, }, - meson = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', files = { 'src/parser.c' }, + revision = 'bd17c824196ce70800f64ad39cfddd1b17acc13f', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, tier = 2, }, - mlir = { install_info = { - url = 'https://github.com/artagnon/tree-sitter-mlir', files = { 'src/parser.c' }, generate = true, + revision = '00c32d8562dc957b187da110a3443307962b8da8', + url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, tier = 3, }, - muttrc = { install_info = { - url = 'https://github.com/neomutt/tree-sitter-muttrc', files = { 'src/parser.c' }, + revision = '90ef60852c410bd964cd3b954366e4c403c17314', + url = 'https://github.com/neomutt/tree-sitter-muttrc', }, maintainers = { '@Freed-Wu' }, tier = 3, }, - nasm = { install_info = { - url = 'https://github.com/naclsn/tree-sitter-nasm', files = { 'src/parser.c' }, + revision = '570f3d7be01fffc751237f4cfcf52d04e20532d1', + url = 'https://github.com/naclsn/tree-sitter-nasm', }, maintainers = { '@ObserverOfTime' }, tier = 3, }, - nginx = { install_info = { url = 'https://github.com/opa-oz/tree-sitter-nginx', @@ -1628,62 +1587,61 @@ M.configs = { maintainers = { '@opa-oz' }, tier = 3, }, - nickel = { install_info = { - url = 'https://github.com/nickel-lang/tree-sitter-nickel', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '0a796f3a312917724c1d9f486a201f7402a8acfd', + url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, }, - nim = { install_info = { - url = 'https://github.com/alaviss/tree-sitter-nim', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '961c2798cec9250c44f7d7225ddb33d47d25856a', + url = 'https://github.com/alaviss/tree-sitter-nim', }, maintainers = { '@aMOPel' }, requires = { 'nim_format_string' }, tier = 3, }, - nim_format_string = { install_info = { - url = 'https://github.com/aMOPel/tree-sitter-nim-format-string', files = { 'src/parser.c' }, + revision = 'd45f75022d147cda056e98bfba68222c9c8eca3a', + url = 'https://github.com/aMOPel/tree-sitter-nim-format-string', }, maintainers = { '@aMOPel' }, tier = 3, }, - ninja = { install_info = { - url = 'https://github.com/alemuller/tree-sitter-ninja', files = { 'src/parser.c' }, + revision = '0a95cfdc0745b6ae82f60d3a339b37f19b7b9267', + url = 'https://github.com/alemuller/tree-sitter-ninja', }, maintainers = { '@alemuller' }, tier = 3, }, - nix = { install_info = { - url = 'https://github.com/cstrahan/tree-sitter-nix', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'b3cda619248e7dd0f216088bd152f59ce0bbe488', + url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, tier = 3, }, - nqc = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-nqc', files = { 'src/parser.c' }, generate_from_json = true, + revision = '14e6da1627aaef21d2b2aa0c37d04269766dcc1d', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-nqc', }, maintainers = { '@amaanq' }, tier = 2, }, - nu = { install_info = { url = 'https://github.com/nushell/tree-sitter-nu', @@ -1692,186 +1650,185 @@ M.configs = { maintainers = { '@abhisheksingh0x558' }, tier = 3, }, - objc = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', files = { 'src/parser.c' }, generate_from_json = true, + revision = '62e61b6f5c0289c376d61a8c91faf6435cde9012', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', }, maintainers = { '@amaanq' }, requires = { 'c' }, tier = 2, }, - objdump = { install_info = { - url = 'https://github.com/ColinKennedy/tree-sitter-objdump', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '28d3b2e25a0b1881d1b47ed1924ca276c7003d45', + url = 'https://github.com/ColinKennedy/tree-sitter-objdump', }, maintainers = { '@ColinKennedy' }, tier = 3, }, - ocaml = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-ocaml', files = { 'src/parser.c', 'src/scanner.c' }, location = 'grammars/ocaml', + revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', + url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, tier = 2, }, - ocaml_interface = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-ocaml', files = { 'src/parser.c', 'src/scanner.c' }, location = 'grammars/interface', + revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', + url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, requires = { 'ocaml' }, tier = 2, }, - ocamllex = { install_info = { - url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', files = { 'src/parser.c', 'src/scanner.c' }, generate = true, + revision = '4b9898ccbf198602bb0dec9cd67cc1d2c0a4fad2', + url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', }, maintainers = { '@undu' }, tier = 3, }, - odin = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'd37b8f24f653378b268ec18404e9c14ad355b128', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', }, maintainers = { '@amaanq' }, tier = 2, }, - pascal = { install_info = { - url = 'https://github.com/Isopod/tree-sitter-pascal', files = { 'src/parser.c' }, + revision = 'a9ee969dec5b2e3b2ccccc5954fec04100c7619e', + url = 'https://github.com/Isopod/tree-sitter-pascal', }, maintainers = { '@Isopod' }, tier = 3, }, - passwd = { install_info = { - url = 'https://github.com/ath3/tree-sitter-passwd', files = { 'src/parser.c' }, + revision = '20239395eacdc2e0923a7e5683ad3605aee7b716', + url = 'https://github.com/ath3/tree-sitter-passwd', }, maintainers = { '@amaanq' }, tier = 3, }, - pem = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', files = { 'src/parser.c' }, + revision = '217ff2af3f2db15a79ab7e3d21ea1e0c17e71a1a', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - perl = { install_info = { - url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', branch = 'release', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '309cb8d33bcfd0a81050b21be08f9eb3f2fe2138', + url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, tier = 3, }, - php = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-php', - location = 'php', files = { 'src/parser.c', 'src/scanner.c' }, + location = 'php', + revision = 'b38c53537769df05871643c9688c264074fb6076', + url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, - requires = { 'php_only' }, readme_note = 'PHP with embedded HTML', + requires = { 'php_only' }, tier = 2, }, - php_only = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-php', - location = 'php_only', files = { 'src/parser.c', 'src/scanner.c' }, + location = 'php_only', + revision = 'b38c53537769df05871643c9688c264074fb6076', + url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, readme_note = 'PHP without embedded HTML', tier = 2, }, - phpdoc = { install_info = { - url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '1d0e255b37477d0ca46f1c9e9268c8fa76c0b3fc', + url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', }, maintainers = { '@mikehaertl' }, tier = 3, }, - pioasm = { install_info = { - url = 'https://github.com/leo60228/tree-sitter-pioasm', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '924aadaf5dea2a6074d72027b064f939acf32e20', + url = 'https://github.com/leo60228/tree-sitter-pioasm', }, maintainers = { '@leo60228' }, tier = 3, }, - po = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-po', files = { 'src/parser.c' }, + revision = 'bd860a0f57f697162bf28e576674be9c1500db5e', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-po', }, maintainers = { '@amaanq' }, tier = 2, }, - pod = { install_info = { - url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', - files = { 'src/parser.c', 'src/scanner.c' }, branch = 'release', + files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '39da859947b94abdee43e431368e1ae975c0a424', + url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, tier = 3, }, - poe_filter = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', files = { 'src/parser.c' }, + revision = '592476d81f95d2451f2ca107dc872224c76fecdf', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', }, maintainers = { '@ObserverOfTime' }, readme_note = 'Path of Exile item filter', tier = 2, }, - pony = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-pony', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '73ff874ae4c9e9b45462673cbc0a1e350e2522a7', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pony', }, maintainers = { '@amaanq', '@mfelsche' }, tier = 2, }, - powershell = { install_info = { url = 'https://github.com/airbus-cert/tree-sitter-powershell', @@ -1881,20 +1838,20 @@ M.configs = { maintainers = { '@L2jLiga' }, tier = 3, }, - printf = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', files = { 'src/parser.c' }, + revision = '0e0aceabbf607ea09e03562f5d8a56f048ddea3d', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - prisma = { install_info = { - url = 'https://github.com/victorhqc/tree-sitter-prisma', files = { 'src/parser.c' }, + revision = 'eca2596a355b1a9952b4f80f8f9caed300a272b5', + url = 'https://github.com/victorhqc/tree-sitter-prisma', }, maintainers = { '@elianiva' }, tier = 3, @@ -1920,175 +1877,174 @@ M.configs = { maintainers = { '@foxyseta' }, tier = 3, }, - - properties = { - install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', - files = { 'src/parser.c', 'src/scanner.c' }, - }, - maintainers = { '@ObserverOfTime' }, - tier = 2, - readme_note = 'Java properties files', - }, - - proto = { - install_info = { - url = 'https://github.com/treywood/tree-sitter-proto', - files = { 'src/parser.c' }, - }, - maintainers = { '@treywood' }, - tier = 3, - }, - promql = { install_info = { - url = 'https://github.com/MichaHoffmann/tree-sitter-promql', files = { 'src/parser.c' }, + revision = '77625d78eebc3ffc44d114a07b2f348dff3061b0', + url = 'https://github.com/MichaHoffmann/tree-sitter-promql', }, maintainers = { '@MichaHoffmann' }, tier = 3, }, - + properties = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + revision = '9d09f5f200c356c50c4103d36441309fd61b48d1', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', + }, + maintainers = { '@ObserverOfTime' }, + readme_note = 'Java properties files', + tier = 2, + }, + proto = { + install_info = { + files = { 'src/parser.c' }, + revision = 'e9f6b43f6844bd2189b50a422d4e2094313f6aa3', + url = 'https://github.com/treywood/tree-sitter-proto', + }, + maintainers = { '@treywood' }, + tier = 3, + }, prql = { install_info = { - url = 'https://github.com/PRQL/tree-sitter-prql', files = { 'src/parser.c' }, + revision = '09e158cd3650581c0af4c49c2e5b10c4834c8646', + url = 'https://github.com/PRQL/tree-sitter-prql', }, maintainers = { '@matthias-Q' }, tier = 3, }, - psv = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'psv', + revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', }, maintainers = { '@amaanq' }, requires = { 'tsv' }, tier = 2, }, - pug = { install_info = { - url = 'https://github.com/zealot128/tree-sitter-pug', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a7ff31a38908df9b9f34828d21d6ca5e12413e18', + url = 'https://github.com/zealot128/tree-sitter-pug', }, maintainers = { '@zealot128' }, tier = 3, }, - puppet = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-puppet', files = { 'src/parser.c' }, + revision = '584522f32495d648b18a53ccb52d988e60de127d', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-puppet', }, maintainers = { '@amaanq' }, tier = 2, }, - purescript = { install_info = { - url = 'https://github.com/postsolar/tree-sitter-purescript', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'daf9b3e2be18b0b2996a1281f7783e0d041d8b80', + url = 'https://github.com/postsolar/tree-sitter-purescript', }, maintainers = { '@postsolar' }, tier = 3, }, - pymanifest = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-pymanifest', files = { 'src/parser.c' }, + revision = 'e3b82b78721aee07f676dac8473ae69db51debcf', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-pymanifest', }, maintainers = { '@ObserverOfTime' }, readme_name = 'PyPA manifest', tier = 2, }, - python = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-python', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '71778c2a472ed00a64abf4219544edbf8e4b86d7', + url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, tier = 1, }, - ql = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-ql', files = { 'src/parser.c' }, + revision = '42becd6f8f7bae82c818fa3abb1b6ff34b552310', + url = 'https://github.com/tree-sitter/tree-sitter-ql', }, maintainers = { '@pwntester' }, tier = 2, }, - qmldir = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-qmldir', files = { 'src/parser.c' }, + revision = '6b2b5e41734bd6f07ea4c36ac20fb6f14061c841', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-qmldir', }, maintainers = { '@amaanq' }, tier = 2, }, - qmljs = { install_info = { - url = 'https://github.com/yuja/tree-sitter-qmljs', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '2c57cac27e207425f8df15327884434cb12365a3', + url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, requires = { 'ecma' }, tier = 3, }, - query = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', files = { 'src/parser.c' }, + revision = 'f767fb0ac5e711b6d44c5e0c8d1f349687a86ce0', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, readme_note = 'Tree-sitter query language', tier = 1, }, - r = { install_info = { - url = 'https://github.com/r-lib/tree-sitter-r', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '391400572538ff9854341a175ed8ab4b1e45f44b', + url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, tier = 3, }, - racket = { install_info = { - url = 'https://github.com/6cdh/tree-sitter-racket', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '171f52a8c0ed635b85cd42d1e36d82f1066a03b4', + url = 'https://github.com/6cdh/tree-sitter-racket', }, tier = 4, }, - ralph = { install_info = { - url = 'https://github.com/alephium/tree-sitter-ralph', files = { 'src/parser.c' }, + revision = '48b9d9d6e2b55ce8f9eb09ceb0d952e4b1cc87a0', + url = 'https://github.com/alephium/tree-sitter-ralph', }, maintainers = { '@tdroxler' }, tier = 3, }, - rasi = { install_info = { - url = 'https://github.com/Fymyte/tree-sitter-rasi', files = { 'src/parser.c' }, + revision = '6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa', + url = 'https://github.com/Fymyte/tree-sitter-rasi', }, maintainers = { '@Fymyte' }, tier = 3, }, - razor = { install_info = { generate_from_json = true, @@ -2099,62 +2055,61 @@ M.configs = { maintainers = { '@tris203' }, tier = 3, }, - rbs = { install_info = { - url = 'https://github.com/joker1007/tree-sitter-rbs', files = { 'src/parser.c' }, + revision = 'e5e807a50fcd104a2d740d354632fc671700a0bf', + url = 'https://github.com/joker1007/tree-sitter-rbs', }, maintainers = { '@joker1007' }, tier = 3, }, - re2c = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-re2c', files = { 'src/parser.c' }, + revision = '47aa19cf5f7aba2ed30e2b377f7172df76e819a6', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-re2c', }, maintainers = { '@amaanq' }, tier = 2, }, - readline = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-readline', files = { 'src/parser.c' }, + revision = '3d4768b04d7cfaf40533e12b28672603428b8f31', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-readline', }, maintainers = { '@ribru17' }, tier = 2, }, - regex = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-regex', files = { 'src/parser.c' }, + revision = '47007f195752d8e57bda80b0b6cdb2d173a9f7d7', + url = 'https://github.com/tree-sitter/tree-sitter-regex', }, maintainers = { '@theHamsta' }, tier = 2, }, - rego = { install_info = { - url = 'https://github.com/FallenAngel97/tree-sitter-rego', files = { 'src/parser.c' }, + revision = '23b1da8de9766d766c4f01531e8be14b5c00c493', + url = 'https://github.com/FallenAngel97/tree-sitter-rego', }, maintainers = { '@FallenAngel97' }, tier = 3, }, - requirements = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', files = { 'src/parser.c' }, + revision = '360c6a6b31076a482663806f7a8241de9cad6b4e', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', }, maintainers = { '@ObserverOfTime' }, readme_name = 'pip requirements', tier = 2, }, - rescript = { install_info = { url = 'https://github.com/rescript-lang/tree-sitter-rescript', @@ -2163,25 +2118,24 @@ M.configs = { maintainers = { '@ribru17' }, tier = 2, }, - rnoweb = { install_info = { - url = 'https://github.com/bamonroe/tree-sitter-rnoweb', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '1a74dc0ed731ad07db39f063e2c5a6fe528cae7f', + url = 'https://github.com/bamonroe/tree-sitter-rnoweb', }, maintainers = { '@bamonroe' }, tier = 3, }, - robot = { install_info = { - url = 'https://github.com/Hubro/tree-sitter-robot', files = { 'src/parser.c' }, + revision = '322e4cc65754d2b3fdef4f2f8a71e0762e3d13af', + url = 'https://github.com/Hubro/tree-sitter-robot', }, maintainers = { '@Hubro' }, tier = 3, }, - robots = { install_info = { url = 'https://github.com/opa-oz/tree-sitter-robots-txt', @@ -2190,98 +2144,96 @@ M.configs = { maintainers = { '@opa-oz' }, tier = 3, }, - roc = { install_info = { - url = 'https://github.com/faldor20/tree-sitter-roc', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '7df2c0892e62efb81a7504d9799d4e0d0443d241', + url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, tier = 3, }, - ron = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-ron', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '78938553b93075e638035f624973083451b29055', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ron', }, maintainers = { '@amaanq' }, tier = 2, }, - rst = { install_info = { - url = 'https://github.com/stsewd/tree-sitter-rst', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '5120f6e59284cb8b85b450bd2db0bd352635ba9f', + url = 'https://github.com/stsewd/tree-sitter-rst', }, maintainers = { '@stsewd' }, tier = 3, }, - ruby = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-ruby', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'dc2d7d6b50f9975bc3c35bbec0ba11b2617b736b', + url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, tier = 2, }, - runescript = { install_info = { - url = 'https://github.com/2004Scape/tree-sitter-runescript', files = { 'src/parser.c', 'src/scanner.c' }, + url = 'https://github.com/2004Scape/tree-sitter-runescript', }, maintainers = { '@2004Scape' }, tier = 3, }, - rust = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-rust', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '9c84af007b0f144954adb26b3f336495cbb320a7', + url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, tier = 2, }, - scala = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-scala', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'b76db435a7f876cf1ede837d66054c534783c72f', + url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, tier = 2, }, - scfg = { install_info = { - url = 'https://github.com/rockorager/tree-sitter-scfg', files = { 'src/parser.c' }, generate = true, + revision = '6deae0cbb458c849a4d1e2985093e9c9c32d7fd0', + url = 'https://github.com/rockorager/tree-sitter-scfg', }, maintainers = { '@WhyNotHugo' }, tier = 3, }, - scheme = { install_info = { - url = 'https://github.com/6cdh/tree-sitter-scheme', files = { 'src/parser.c' }, + revision = '8f9dff3d038f09934db5ea113cebc59c74447743', + url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 4, }, - scss = { install_info = { - url = 'https://github.com/serenadeai/tree-sitter-scss', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'c478c6868648eff49eb04a4df90d703dc45b312a', + url = 'https://github.com/serenadeai/tree-sitter-scss', }, maintainers = { '@elianiva' }, requires = { 'css' }, tier = 3, }, - sflog = { install_info = { url = 'https://github.com/aheber/tree-sitter-sfapex', @@ -2294,15 +2246,15 @@ M.configs = { }, slang = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '865d79e236c7f0e04276c969453d021d1da4b15f', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, - readme_note = 'Shader Slang', maintainers = { '@theHamsta' }, + readme_note = 'Shader Slang', tier = 2, }, - slim = { install_info = { url = 'https://github.com/theoo/tree-sitter-slim', @@ -2311,282 +2263,259 @@ M.configs = { maintainers = { '@theoo' }, tier = 3, }, - slint = { install_info = { - url = 'https://github.com/slint-ui/tree-sitter-slint', files = { 'src/parser.c' }, + revision = 'd82ab8c19ea1b60ff570256eaef7d137cc5ecb63', + url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, tier = 3, }, - smali = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-smali', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'fdfa6a1febc43c7467aa7e937b87b607956f2346', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-smali', }, maintainers = { '@amaanq' }, tier = 2, }, - - snakemake = { - install_info = { - url = 'https://github.com/osthomas/tree-sitter-snakemake', - files = { 'src/parser.c', 'src/scanner.c' }, - generate_from_json = true, - }, - maintainers = { '@osthomas' }, - tier = 3, - }, - smithy = { install_info = { - url = 'https://github.com/indoorvivants/tree-sitter-smithy', files = { 'src/parser.c' }, + revision = 'fa898ac0885d1da9a253695c3e0e91f5efc587cd', + url = 'https://github.com/indoorvivants/tree-sitter-smithy', }, maintainers = { '@amaanq', '@keynmol' }, tier = 3, }, - + snakemake = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, + revision = 'ba1b3868eaa960b945593404af9a7c2f296d3643', + url = 'https://github.com/osthomas/tree-sitter-snakemake', + }, + maintainers = { '@osthomas' }, + tier = 3, + }, solidity = { install_info = { - url = 'https://github.com/JoranHonig/tree-sitter-solidity', files = { 'src/parser.c' }, + revision = '1c94fe3d5351dfcff3551ec1f49614cbf758e444', + url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, tier = 3, }, - soql = { install_info = { - url = 'https://github.com/aheber/tree-sitter-sfapex', files = { 'src/parser.c' }, location = 'soql', + revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, tier = 3, }, - sosl = { install_info = { - url = 'https://github.com/aheber/tree-sitter-sfapex', files = { 'src/parser.c' }, location = 'sosl', + revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, tier = 3, }, - sourcepawn = { install_info = { - url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '64ad670dd59e88c5d32bc3d759ae8562b522cad9', + url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, tier = 3, }, - sparql = { install_info = { - url = 'https://github.com/GordianDziwis/tree-sitter-sparql', files = { 'src/parser.c' }, generate_from_json = true, + revision = '05f949d3c1c15e3261473a244d3ce87777374dec', + url = 'https://github.com/GordianDziwis/tree-sitter-sparql', }, maintainers = { '@GordianDziwis' }, tier = 3, }, - sql = { install_info = { - url = 'https://github.com/derekstride/tree-sitter-sql', - files = { 'src/parser.c', 'src/scanner.c' }, branch = 'gh-pages', + files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '6a99f4aff780f98bc119c7f034406e41d7e0b80d', + url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, tier = 3, }, - squirrel = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-squirrel', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '0a50d31098e83c668d34d1160a0f6c7d23b571cc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-squirrel', }, maintainers = { '@amaanq' }, tier = 2, }, - ssh_config = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', files = { 'src/parser.c' }, + revision = '77450e8bce8853921512348f83c73c168c71fdfb', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - starlark = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-starlark', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '018d0e09d9d0f0dd6740a37682b8ee4512e8b2ac', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-starlark', }, maintainers = { '@amaanq' }, tier = 2, }, - strace = { install_info = { - url = 'https://github.com/sigmaSd/tree-sitter-strace', files = { 'src/parser.c' }, + revision = 'd819cdd5dbe455bd3c859193633c8d91c0df7c36', + url = 'https://github.com/sigmaSd/tree-sitter-strace', }, maintainers = { '@amaanq' }, tier = 3, }, - styled = { install_info = { - url = 'https://github.com/mskelton/tree-sitter-styled', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '65835cca33a5f033bcde580ed66cde01c1fabbbe', + url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, tier = 3, }, - supercollider = { install_info = { - url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'affa4389186b6939d89673e1e9d2b28364f5ca6f', + url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, tier = 3, }, - superhtml = { install_info = { - url = 'https://github.com/kristoff-it/superhtml', files = { 'src/parser.c', 'src/scanner.c' }, location = 'tree-sitter-superhtml', + url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, tier = 3, }, - surface = { install_info = { - url = 'https://github.com/connorlay/tree-sitter-surface', files = { 'src/parser.c' }, + revision = 'f4586b35ac8548667a9aaa4eae44456c1f43d032', + url = 'https://github.com/connorlay/tree-sitter-surface', }, maintainers = { '@connorlay' }, tier = 3, }, - svelte = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '2c97326cd96b7c3016c3d249e8dc244c89b4abeb', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', }, maintainers = { '@amaanq' }, requires = { 'html_tags' }, tier = 2, }, - sway = { install_info = { - url = 'https://github.com/FuelLabs/tree-sitter-sway.git', files = { 'src/parser.c', 'src/scanner.c' }, + url = 'https://github.com/FuelLabs/tree-sitter-sway.git', }, maintainers = { '@ribru17' }, tier = 2, }, - swift = { install_info = { - url = 'https://github.com/alex-pinkus/tree-sitter-swift', files = { 'src/parser.c', 'src/scanner.c' }, generate = true, + revision = '26354ddec08c7efde4fa16bd29429f3310d2e2c5', + url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, tier = 3, }, - sxhkdrc = { install_info = { - url = 'https://github.com/RaafatTurki/tree-sitter-sxhkdrc', files = { 'src/parser.c' }, + revision = '440d5f913d9465c9c776a1bd92334d32febcf065', + url = 'https://github.com/RaafatTurki/tree-sitter-sxhkdrc', }, maintainers = { '@RaafatTurki' }, tier = 3, }, - systemtap = { install_info = { - url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', files = { 'src/parser.c' }, + revision = '1af543a96d060b1f808982037bfc54cc02218edd', + url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', }, maintainers = { '@ok-ryoko' }, tier = 3, }, - t32 = { install_info = { - url = 'https://gitlab.com/xasc/tree-sitter-t32.git', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '6182836f4128725f1e74ce986840d7317021a015', + url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, tier = 3, }, - tablegen = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-tablegen', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'b1170880c61355aaf38fc06f4af7d3c55abdabc4', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-tablegen', }, maintainers = { '@amaanq' }, tier = 2, }, - tact = { install_info = { - url = 'https://github.com/tact-lang/tree-sitter-tact', files = { 'src/parser.c' }, + revision = '034df2162ed7b654efd999942e266be713c7cde0', + url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, tier = 3, }, - - teal = { - install_info = { - url = 'https://github.com/euclidianAce/tree-sitter-teal', - files = { 'src/parser.c', 'src/scanner.c' }, - generate = true, - }, - maintainers = { '@euclidianAce' }, - tier = 3, - }, - - templ = { - install_info = { - url = 'https://github.com/vrischmann/tree-sitter-templ', - files = { 'src/parser.c', 'src/scanner.c' }, - generate_from_json = true, - }, - maintainers = { '@vrischmann' }, - tier = 3, - }, - tcl = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '8784024358c233efd0f3a6fd9e7a3c5852e628bc', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, tier = 2, }, - tera = { install_info = { url = 'https://github.com/uncenter/tree-sitter-tera', @@ -2595,244 +2524,263 @@ M.configs = { maintainers = { '@uncenter' }, tier = 2, }, - + teal = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + generate = true, + revision = '19b02da829d1721a521bf7b802eb80a50bd53aab', + url = 'https://github.com/euclidianAce/tree-sitter-teal', + }, + maintainers = { '@euclidianAce' }, + tier = 3, + }, + templ = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + generate_from_json = true, + revision = 'cf84ea53e2e2531f23009d676ac206090c1e2392', + url = 'https://github.com/vrischmann/tree-sitter-templ', + }, + maintainers = { '@vrischmann' }, + tier = 3, + }, terraform = { install_info = { - url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', files = { 'src/parser.c', 'src/scanner.c' }, location = 'dialects/terraform', + revision = 'e936d3fef8bac884661472dce71ad82284761eb1', + url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, requires = { 'hcl' }, tier = 3, }, - textproto = { install_info = { - url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', files = { 'src/parser.c' }, + revision = '8dacf02aa402892c91079f8577998ed5148c0496', + url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', }, maintainers = { '@Porter' }, tier = 3, }, - thrift = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-thrift', files = { 'src/parser.c' }, + revision = '68fd0d80943a828d9e6f49c58a74be1e9ca142cf', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-thrift', }, maintainers = { '@amaanq', '@duskmoon314' }, tier = 2, }, - tiger = { install_info = { - url = 'https://github.com/ambroisie/tree-sitter-tiger', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'a7f11d946b44244f71df41d2a78af0665d618dae', + url = 'https://github.com/ambroisie/tree-sitter-tiger', }, maintainers = { '@ambroisie' }, tier = 3, }, - tlaplus = { install_info = { - url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '200f9dab6b23f3b9bb8f67fc811221517f56c373', + url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, tier = 3, }, - tmux = { install_info = { - url = 'https://github.com/Freed-Wu/tree-sitter-tmux', files = { 'src/parser.c' }, + revision = '9138ea508410e0f34da2666609f600f65e944f22', + url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, maintainers = { '@Freed-Wu' }, tier = 3, }, - todotxt = { install_info = { - url = 'https://github.com/arnarg/tree-sitter-todotxt', files = { 'src/parser.c' }, + revision = '3937c5cd105ec4127448651a21aef45f52d19609', + url = 'https://github.com/arnarg/tree-sitter-todotxt', }, maintainers = { '@arnarg' }, tier = 3, }, - toml = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '16a30c83ce427385b8d14939c45c137fcfca6c42', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', }, maintainers = { '@tk-shirasaka' }, tier = 2, }, - tsv = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', files = { 'src/parser.c' }, location = 'tsv', + revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', }, maintainers = { '@amaanq' }, tier = 2, }, - tsx = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-typescript', files = { 'src/parser.c', 'src/scanner.c' }, - location = 'tsx', generate_from_json = true, + location = 'tsx', + revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', + url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, requires = { 'ecma', 'jsx', 'typescript' }, tier = 2, }, - turtle = { install_info = { - url = 'https://github.com/GordianDziwis/tree-sitter-turtle', files = { 'src/parser.c' }, + revision = '085437f5cb117703b7f520dd92161140a684f092', + url = 'https://github.com/GordianDziwis/tree-sitter-turtle', }, maintainers = { '@GordianDziwis' }, tier = 3, }, - twig = { install_info = { - url = 'https://github.com/gbprod/tree-sitter-twig', files = { 'src/parser.c' }, + revision = 'eaf80e6af969e25993576477a9dbdba3e48c1305', + url = 'https://github.com/gbprod/tree-sitter-twig', }, maintainers = { '@gbprod' }, tier = 3, }, - typescript = { install_info = { - url = 'https://github.com/tree-sitter/tree-sitter-typescript', files = { 'src/parser.c', 'src/scanner.c' }, - location = 'typescript', generate_from_json = true, + location = 'typescript', + revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', + url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, requires = { 'ecma' }, tier = 2, }, - typespec = { install_info = { - url = 'https://github.com/happenslol/tree-sitter-typespec', files = { 'src/parser.c' }, + revision = '28821d0d6da5f0a6b5eb02b9bad953fecafd7248', + url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, tier = 3, }, - typoscript = { install_info = { - url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', files = { 'src/parser.c' }, + revision = '43b221c0b76e77244efdaa9963e402a17c930fbc', + url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', }, maintainers = { '@Teddytrombone' }, tier = 3, }, - typst = { install_info = { - url = 'https://github.com/uben0/tree-sitter-typst', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '3924cb9ed9e0e62ce7df9c4fe0faa4c234795999', + url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, tier = 3, }, - udev = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', files = { 'src/parser.c' }, + revision = '8f58696e79092b4ad6bf197415bbd0970acf15cd', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - ungrammar = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-ungrammar', files = { 'src/parser.c' }, + revision = 'debd26fed283d80456ebafa33a06957b0c52e451', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-ungrammar', }, maintainers = { '@Philipp-M', '@amaanq' }, tier = 2, }, - unison = { install_info = { - url = 'https://github.com/kylegoetz/tree-sitter-unison', files = { 'src/parser.c', 'src/scanner.c' }, generate = true, + revision = '59d36a09282be7e4d3374854126590f3dcebee6e', + url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, tier = 3, }, - usd = { install_info = { - url = 'https://github.com/ColinKennedy/tree-sitter-usd', files = { 'src/parser.c' }, + revision = '4e0875f724d94d0c2ff36f9b8cb0b12f8b20d216', + url = 'https://github.com/ColinKennedy/tree-sitter-usd', }, maintainers = { '@ColinKennedy' }, tier = 3, }, - uxntal = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-uxntal', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'ad9b638b914095320de85d59c49ab271603af048', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-uxntal', }, maintainers = { '@amaanq' }, tier = 2, }, - v = { install_info = { - url = 'https://github.com/vlang/v-analyzer', files = { 'src/parser.c' }, location = 'tree_sitter_v', + revision = '7e11a6f8f369df935664fadd2f0c99d90fe3226f', + url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, tier = 3, }, - vala = { install_info = { - url = 'https://github.com/vala-lang/tree-sitter-vala', files = { 'src/parser.c' }, + revision = '8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b', + url = 'https://github.com/vala-lang/tree-sitter-vala', }, maintainers = { '@Prince781' }, tier = 3, }, - vento = { install_info = { - url = 'https://github.com/ventojs/tree-sitter-vento', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '3321077d7446c1b3b017c294fd56ce028ed817fe', + url = 'https://github.com/ventojs/tree-sitter-vento', }, maintainers = { '@wrapperup', '@oscarotero' }, tier = 3, }, - verilog = { install_info = { - url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', files = { 'src/parser.c' }, + revision = '075ebfc84543675f12e79a955f79d717772dcef3', + url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, tier = 3, }, - vhdl = { install_info = { url = 'https://github.com/jpt13653903/tree-sitter-vhdl', @@ -2841,34 +2789,33 @@ M.configs = { maintainers = { '@jpt13653903' }, tier = 3, }, - vhs = { install_info = { - url = 'https://github.com/charmbracelet/tree-sitter-vhs', files = { 'src/parser.c' }, + revision = '90028bbadb267ead5b87830380f6a825147f0c0f', + url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, tier = 3, }, - vim = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'b448ca63f972ade12c373c808acdd2bf972937db', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, tier = 1, }, - vimdoc = { install_info = { - url = 'https://github.com/neovim/tree-sitter-vimdoc', files = { 'src/parser.c' }, + revision = 'b711df784dd43d0a8ed8ddbfca0ddcc3239d94b4', + url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, tier = 1, }, - vrl = { install_info = { url = 'https://github.com/belltoy/tree-sitter-vrl', @@ -2877,126 +2824,124 @@ M.configs = { maintainers = { '@belltoy' }, tier = 3, }, - vue = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', - files = { 'src/parser.c', 'src/scanner.c' }, branch = 'main', + files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '22bdfa6c9fc0f5ffa44c6e938ec46869ac8a99ff', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', }, maintainers = { '@WhyNotHugo', '@lucario387' }, requires = { 'html_tags' }, tier = 2, }, - - wing = { - install_info = { - url = 'https://github.com/winglang/tree-sitter-wing', - files = { 'src/parser.c', 'src/scanner.c' }, - }, - maintainers = { '@gshpychka', '@MarkMcCulloh' }, - tier = 3, - }, - wgsl = { install_info = { - url = 'https://github.com/szebniok/tree-sitter-wgsl', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '40259f3c77ea856841a4e0c4c807705f3e4a2b65', + url = 'https://github.com/szebniok/tree-sitter-wgsl', }, maintainers = { '@szebniok' }, tier = 3, }, - wgsl_bevy = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '1e12c7925c41bb09818d86e30cd78644fde7d31a', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', }, maintainers = { '@theHamsta' }, tier = 2, }, - + wing = { + install_info = { + files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'bd1d35cf3e013dc7e189b46a593bdc2b281b0dd7', + url = 'https://github.com/winglang/tree-sitter-wing', + }, + maintainers = { '@gshpychka', '@MarkMcCulloh' }, + tier = 3, + }, wit = { install_info = { - url = 'https://github.com/liamwh/tree-sitter-wit', files = { 'src/parser.c' }, + revision = 'cab94791450524a542324d8cbe8017d69c516d8e', + url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, tier = 3, }, - xcompose = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', files = { 'src/parser.c' }, + revision = '2383cc69a2c42cfade41c7cb971fb3862bec6df1', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', }, maintainers = { '@ObserverOfTime' }, tier = 2, }, - xml = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', files = { 'src/parser.c', 'src/scanner.c' }, location = 'xml', + revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, requires = { 'dtd' }, tier = 2, }, - xresources = { install_info = { url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', files = { 'src/parser.c' }, }, - filetype = 'xdefaults', maintainers = { '@ValdezFOmar' }, tier = 3, }, - yaml = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', files = { 'src/parser.c', 'src/scanner.c' }, + revision = '7b03feefd36b5f155465ca736c6304aca983b267', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, tier = 2, }, - yang = { install_info = { - url = 'https://github.com/Hubro/tree-sitter-yang', files = { 'src/parser.c' }, + revision = '2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502', + url = 'https://github.com/Hubro/tree-sitter-yang', }, maintainers = { '@Hubro' }, tier = 3, }, - yuck = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-yuck', files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'e877f6ade4b77d5ef8787075141053631ba12318', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-yuck', }, maintainers = { '@Philipp-M', '@amaanq' }, tier = 2, }, - zathurarc = { install_info = { - url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', files = { 'src/parser.c' }, + revision = '6e7c8edfcd6f5f7c12b2fa9ffc6d042f1b6d7068', + url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', }, maintainers = { '@Freed-Wu' }, tier = 3, }, - zig = { install_info = { - url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', files = { 'src/parser.c' }, + revision = '0d08703e4c3f426ec61695d7617415fff97029bd', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, tier = 1, @@ -3022,33 +2967,3 @@ M.configs = { tier = 3, }, } - --- Get a list of all available parsers ----@param tier integer? only get parsers of specified tier ----@return string[] -function M.get_available(tier) - --- @type string[] - local parsers = vim.tbl_keys(M.configs) - table.sort(parsers) - if tier then - parsers = vim.tbl_filter( - --- @param p string - function(p) - return M.configs[p].tier == tier - end, - parsers - ) - end - if vim.fn.executable('tree-sitter') == 0 then - parsers = vim.tbl_filter( - --- @param p string - function(p) - return M.configs[p].install_info ~= nil and not M.configs[p].install_info.generate - end, - parsers - ) - end - return parsers -end - -return M diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 32f3db311..b007ca29b 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -11,7 +11,7 @@ local function complete_available_parsers(arglead) function(v) return v:find(arglead) ~= nil end, - require('nvim-treesitter.parsers').get_available() + require('nvim-treesitter.config').get_available() ) end diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index bfde0f8a3..dddaf80d7 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -2,7 +2,7 @@ vim.opt.runtimepath:append('.') local query_types = require('nvim-treesitter.health').bundled_queries -local configs = require('nvim-treesitter.parsers').configs +local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } or require('nvim-treesitter.config').installed_parsers() diff --git a/scripts/convert-lockfile.lua b/scripts/convert-lockfile.lua new file mode 100755 index 000000000..e0a694897 --- /dev/null +++ b/scripts/convert-lockfile.lua @@ -0,0 +1,21 @@ +#!/usr/bin/env -S nvim -l +vim.opt.runtimepath:append('.') +local util = require('nvim-treesitter.util') +local parsers = require('nvim-treesitter.parsers') + +local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') +local lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] + +for k, p in pairs(parsers) do + if p.install_info then + p.install_info.revision = lockfile[k].revision + end +end + +-- write new parser file +local header = '---@type nvim-ts.parsers\nreturn ' +local parser_file = header .. vim.inspect(parsers) +if vim.fn.executable('stylua') == 1 then + parser_file = vim.system({ 'stylua', '-' }, { stdin = parser_file }):wait().stdout --[[@as string]] +end +util.write_file('lua/nvim-treesitter/parsers.lua', parser_file) diff --git a/scripts/update-lockfile.lua b/scripts/update-lockfile.lua deleted file mode 100755 index d77baed61..000000000 --- a/scripts/update-lockfile.lua +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env -S nvim -l -vim.opt.runtimepath:append('.') -local util = require('nvim-treesitter.util') -local parsers = require('nvim-treesitter.parsers').configs - --- Load previous lockfile -local filename = require('nvim-treesitter.install').get_package_path('lockfile.json') -local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table]] - -local jobs = {} ---@type table -local new_lockfile = {} ---@type table -local updates = {} ---@type string[] - --- check for new revisions -for k, p in pairs(parsers) do - if p.tier == 4 then - new_lockfile[k] = old_lockfile[k] - print('Skipping ' .. k) - elseif p.install_info then - print('Updating ' .. k) - jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) - end - - if #vim.tbl_keys(jobs) % 100 == 0 or next(parsers, k) == nil then - for name, job in pairs(jobs) do - local stdout = vim.split(job:wait().stdout, '\n') - jobs[name] = nil - - local branch = parsers[name].install_info.branch - - local line = 1 - if branch then - for j, l in ipairs(stdout) do - if l:find(vim.pesc(branch)) then - line = j - break - end - end - end - - local sha = vim.split(stdout[line], '\t')[1] - new_lockfile[name] = { revision = sha } - if new_lockfile[name].revision ~= old_lockfile[name].revision then - updates[#updates + 1] = name - end - end - end -end - -assert(#vim.tbl_keys(jobs) == 0) - -if #updates > 0 then - -- write new lockfile - local lockfile_json = vim.json.encode(new_lockfile) --[[@as string]] - if vim.fn.executable('jq') == 1 then - lockfile_json = - assert(vim.system({ 'jq', '--sort-keys' }, { stdin = lockfile_json }):wait().stdout) - end - util.write_file(filename, lockfile_json) - - print(string.format('\nUpdated parsers: %s', table.concat(updates, ', '))) -else - print('\nAll parsers up to date!') -end diff --git a/scripts/update-parsers.lua b/scripts/update-parsers.lua new file mode 100755 index 000000000..ec1308d77 --- /dev/null +++ b/scripts/update-parsers.lua @@ -0,0 +1,65 @@ +#!/usr/bin/env -S nvim -l +vim.opt.runtimepath:append('.') +local util = require('nvim-treesitter.util') +local parsers = require('nvim-treesitter.parsers') + +local jobs = {} ---@type table +local updates = {} ---@type string[] + +-- check for new revisions +for k, p in pairs(parsers) do + if p.tier < 5 and p.install_info then + print('Updating ' .. k) + jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) + end + + if #vim.tbl_keys(jobs) % 100 == 0 or next(parsers, k) == nil then + for name, job in pairs(jobs) do + local stdout = vim.split(job:wait().stdout, '\n') + jobs[name] = nil + + local info = parsers[name].install_info + assert(info) + + local branch = info.branch + local line = 1 + if branch then + for j, l in ipairs(stdout) do + if l:find(vim.pesc(branch)) then + line = j + break + end + end + end + + local sha = vim.split(stdout[line], '\t')[1] + if info.revision ~= sha then + info.revision = sha + updates[#updates + 1] = name + end + end + end +end + +assert(#vim.tbl_keys(jobs) == 0) + +if #updates > 0 then + -- write new parser file + local header = '---@type nvim-ts.parsers\nreturn ' + local parser_file = header .. vim.inspect(parsers) + if vim.fn.executable('stylua') == 1 then + parser_file = vim.system({ 'stylua', '-' }, { stdin = parser_file }):wait().stdout --[[@as string]] + end + util.write_file('lua/nvim-treesitter/parsers.lua', parser_file) + + local update_list = table.concat(updates, ', ') + print(string.format('\nUpdated parsers: %s', update_list)) + -- pass list to workflow + if os.getenv('GITHUB_ENV') then + local env = io.open(os.getenv('GITHUB_ENV'), 'a') + env:write(string.format('UPDATED_PARSERS=%s\n', update_list)) + env:close() + end +else + print('\nAll parsers up to date!') +end diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua index f8346bf4d..9f6f9a3de 100755 --- a/scripts/update-readme.lua +++ b/scripts/update-readme.lua @@ -2,12 +2,13 @@ vim.opt.runtimepath:append('.') local util = require('nvim-treesitter.util') local parsers = require('nvim-treesitter.parsers') +local tiers = require('nvim-treesitter.config').tiers ---@class Parser ---@field name string ---@field parser ParserInfo local sorted_parsers = {} -for k, v in pairs(parsers.configs) do +for k, v in pairs(parsers) do table.insert(sorted_parsers, { name = k, parser = v }) end table.sort(sorted_parsers, function(a, b) @@ -45,7 +46,7 @@ for _, v in ipairs(sorted_parsers) do end -- tier - generated_text = generated_text .. (p.tier and parsers.tiers[p.tier] or '') .. ' | ' + generated_text = generated_text .. (p.tier and tiers[p.tier] or '') .. ' | ' -- queries generated_text = generated_text diff --git a/tests/query/injections/nix/test-nix-injections.nix b/tests/query/injections/nix/test-nix-injections.nix index 86e9f975d..477ca4abb 100644 --- a/tests/query/injections/nix/test-nix-injections.nix +++ b/tests/query/injections/nix/test-nix-injections.nix @@ -64,7 +64,7 @@ mod1 = { type = "lua"; config = '' - require('nvim-treesitter.configs').setup() + require('nvim-treesitter.config').setup() ''; }; } From 214cfcf851d95a4c4f2dc7526b95ce9d31c88a76 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 22 Apr 2024 19:56:30 +0200 Subject: [PATCH 045/434] feat!: use tree-sitter build --- .github/workflows/test-queries.yml | 27 +- .github/workflows/tests.yml | 14 +- README.md | 40 +- SUPPORTED_LANGUAGES.md | 569 +++++++++++++------------- TODO.md | 5 - lua/nvim-treesitter/_meta/parsers.lua | 3 - lua/nvim-treesitter/config.lua | 9 - lua/nvim-treesitter/health.lua | 131 +++--- lua/nvim-treesitter/install.lua | 185 +++------ lua/nvim-treesitter/parsers.lua | 346 ++-------------- plugin/filetypes.lua | 2 +- scripts/convert-lockfile.lua | 1 + scripts/update-readme.lua | 9 +- 13 files changed, 443 insertions(+), 898 deletions(-) diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index 3b1717791..819924c43 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f78afe711..7a946377c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/README.md b/README.md index 07a6c930e..5e487233f 100644 --- a/README.md +++ b/README.md @@ -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 ) ## 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", "" }, -} -``` - -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: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index d2ba24468..1c72c9ba9 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -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!) -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 diff --git a/TODO.md b/TODO.md index 56d8c88cf..fb0032c96 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/lua/nvim-treesitter/_meta/parsers.lua b/lua/nvim-treesitter/_meta/parsers.lua index 09e4d1846..e265bf611 100644 --- a/lua/nvim-treesitter/_meta/parsers.lua +++ b/lua/nvim-treesitter/_meta/parsers.lua @@ -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 --- diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 4c662bab6..704c8e87e 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -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 diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 58ede835a..dc7078bdf 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -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 diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 8b3dc82fc..ac37c7af0 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -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> -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 diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 83011c7cb..b31224d26 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,6 @@ return { ada = { install_info = { - files = { 'src/parser.c' }, revision = 'e8e2515465cc2d7c444498e68bdb9f1d86767f95', url = 'https://github.com/briot/tree-sitter-ada', }, @@ -11,7 +10,6 @@ return { }, agda = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'd3dc807692e6bca671d4491b3bf5c67eeca8c016', url = 'https://github.com/tree-sitter/tree-sitter-agda', }, @@ -20,7 +18,6 @@ return { }, angular = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '10f21f3f1b10584e62ecc113ab3cda1196d0ceb8', url = 'https://github.com/dlvandenberg/tree-sitter-angular', @@ -31,7 +28,6 @@ return { }, apex = { install_info = { - files = { 'src/parser.c' }, location = 'apex', revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', url = 'https://github.com/aheber/tree-sitter-sfapex', @@ -41,7 +37,6 @@ return { }, arduino = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = 'afb34b2c65f507932c5c6ddbf0d5a9ca6a772f2f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', @@ -52,7 +47,6 @@ return { }, asm = { install_info = { - files = { 'src/parser.c' }, revision = 'b0306e9bb2ebe01c6562f1aef265cc42ccc53070', url = 'https://github.com/RubixDev/tree-sitter-asm', }, @@ -61,7 +55,6 @@ return { }, astro = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '4be180759ec13651f72bacee65fa477c64222a1a', url = 'https://github.com/virchau13/tree-sitter-astro', @@ -72,7 +65,6 @@ return { }, authzed = { install_info = { - files = { 'src/parser.c' }, revision = '1dec7e1af96c56924e3322cd85fdce15d0a31d00', url = 'https://github.com/mleonidas/tree-sitter-authzed', }, @@ -81,7 +73,6 @@ return { }, awk = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'ba7472152d79a8c916550c80fdbfd5724d07a0c9', url = 'https://github.com/Beaglefoot/tree-sitter-awk', }, @@ -89,7 +80,6 @@ return { }, bash = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '2fbd860f802802ca76a6661ce025b3a3bca2d3ed', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, @@ -98,7 +88,6 @@ return { }, bass = { install_info = { - files = { 'src/parser.c' }, revision = '28dc7059722be090d04cd751aed915b2fee2f89a', url = 'https://github.com/vito/tree-sitter-bass', }, @@ -107,7 +96,6 @@ return { }, beancount = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'c25f8034c977681653a8acd541c8b4877a58f474', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, @@ -116,7 +104,6 @@ return { }, bibtex = { install_info = { - files = { 'src/parser.c' }, revision = 'ccfd77db0ed799b6c22c214fe9d2937f47bc8b34', url = 'https://github.com/latex-lsp/tree-sitter-bibtex', }, @@ -125,7 +112,6 @@ return { }, bicep = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '0092c7d1bd6bb22ce0a6f78497d50ea2b87f19c0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-bicep', }, @@ -134,7 +120,6 @@ return { }, bitbake = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a5d04fdb5a69a02b8fa8eb5525a60dfb5309b73b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-bitbake', }, @@ -151,7 +136,6 @@ return { }, blueprint = { install_info = { - files = { 'src/parser.c' }, revision = '60ba73739c6083c693d86a1a7cf039c07eb4ed59', url = 'https://gitlab.com/gabmus/tree-sitter-blueprint', }, @@ -160,7 +144,6 @@ return { }, bp = { install_info = { - files = { 'src/parser.c' }, revision = '2326d709fb9cf73cf124fdbc803c267f851721a4', url = 'https://github.com/ambroisie/tree-sitter-bp', }, @@ -178,7 +161,6 @@ return { }, c = { install_info = { - files = { 'src/parser.c' }, revision = 'deca017a554045b4c203e7ddff39ae64ff05e071', url = 'https://github.com/tree-sitter/tree-sitter-c', }, @@ -187,7 +169,6 @@ return { }, c_sharp = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '82fa8f05f41a33e9bc830f85d74a9548f0291738', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, @@ -196,7 +177,6 @@ return { }, cairo = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '6238f609bea233040fe927858156dee5515a0745', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cairo', }, @@ -213,7 +193,6 @@ return { }, capnp = { install_info = { - files = { 'src/parser.c' }, revision = '7b0883c03e5edd34ef7bcf703194204299d7099f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-capnp', }, @@ -222,7 +201,6 @@ return { }, chatito = { install_info = { - files = { 'src/parser.c' }, revision = 'a461f20dedb43905febb12c1635bc7d2e43e96f0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', }, @@ -239,7 +217,6 @@ return { }, clojure = { install_info = { - files = { 'src/parser.c' }, revision = 'f4236d4da8aa92bc105d9c118746474c608e6af7', url = 'https://github.com/sogaiu/tree-sitter-clojure', }, @@ -248,8 +225,7 @@ return { }, cmake = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '20ffd6d3b4da1acdbf2d08204b2130a5b2f7c4b3', + revision = '4864abb95a1f6e54d6b362677beef9fb674b41e9', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -257,7 +233,6 @@ return { }, comment = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '5d8b29f6ef3bf64d59430dcfe76b31cc44b5abfd', url = 'https://github.com/stsewd/tree-sitter-comment', }, @@ -266,7 +241,6 @@ return { }, commonlisp = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = 'bf2a65b1c119898a1a17389e07f2a399c05cdc0c', url = 'https://github.com/tree-sitter-grammars/tree-sitter-commonlisp', @@ -276,7 +250,6 @@ return { }, cooklang = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '4ebe237c1cf64cf3826fc249e9ec0988fe07e58e', url = 'https://github.com/addcninblue/tree-sitter-cooklang', }, @@ -285,8 +258,7 @@ return { }, corn = { install_info = { - files = { 'src/parser.c' }, - revision = '604d73c38d4c28ca68e9e441ffd405d68cb63051', + revision = '464654742cbfd3a3de560aba120998f1d5dfa844', url = 'https://github.com/jakestanger/tree-sitter-corn', }, maintainers = { '@jakestanger' }, @@ -294,7 +266,6 @@ return { }, cpon = { install_info = { - files = { 'src/parser.c' }, revision = '594289eadfec719198e560f9d7fd243c4db678d5', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cpon', }, @@ -303,9 +274,8 @@ return { }, cpp = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, - revision = 'd29fbff09a8c9ff4f3074de2595dfca12cb33da9', + revision = '9d412ba7e597fe158f209da33e60f31b1f0df967', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -314,7 +284,6 @@ return { }, css = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'f6be52c3d1cdb1c5e4dd7d8bce0a57497f55d6af', url = 'https://github.com/tree-sitter/tree-sitter-css', }, @@ -323,7 +292,6 @@ return { }, csv = { install_info = { - files = { 'src/parser.c' }, location = 'csv', revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', @@ -334,7 +302,6 @@ return { }, cuda = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '1f188eff83b562ffae36d13e1b804ec6f3b9f1d9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', @@ -345,7 +312,6 @@ return { }, cue = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '8a5f273bfa281c66354da562f2307c2d394b6c81', url = 'https://github.com/eonpatapon/tree-sitter-cue', }, @@ -362,7 +328,6 @@ return { }, d = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '750dde90ed9cdbd82493bc28478d8ab1976b0e9f', url = 'https://github.com/gdamore/tree-sitter-d', }, @@ -371,7 +336,6 @@ return { }, dart = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'ac0bb849ccd1a923963af47573b5e396736ff582', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, @@ -388,7 +352,6 @@ return { }, devicetree = { install_info = { - files = { 'src/parser.c' }, revision = 'fb07e6044ffd36932c57a5be01ba5d6b8a9337bb', url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, @@ -397,7 +360,6 @@ return { }, dhall = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'affb6ee38d629c9296749767ab832d69bb0d9ea8', url = 'https://github.com/jbellerb/tree-sitter-dhall', }, @@ -406,7 +368,6 @@ return { }, diff = { install_info = { - files = { 'src/parser.c' }, revision = '629676fc3919606964231b2c7b9677d6998a2cb4', url = 'https://github.com/the-mikedavis/tree-sitter-diff', }, @@ -415,7 +376,6 @@ return { }, disassembly = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '0229c0211dba909c5d45129ac784a3f4d49c243a', url = 'https://github.com/ColinKennedy/tree-sitter-disassembly', }, @@ -424,8 +384,7 @@ return { }, djot = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '0e9a836ec47612ade15645fb1680adb549894a6c', + revision = 'ea851b9cf1a71e475f4e2ac4dc03609a1b9ca56d', url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, @@ -433,7 +392,6 @@ return { }, dockerfile = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '087daa20438a6cc01fa5e6fe6906d77c869d19fe', url = 'https://github.com/camdencheek/tree-sitter-dockerfile', }, @@ -442,7 +400,6 @@ return { }, dot = { install_info = { - files = { 'src/parser.c' }, revision = '9ab85550c896d8b294d9b9ca1e30698736f08cea', url = 'https://github.com/rydesun/tree-sitter-dot', }, @@ -451,8 +408,7 @@ return { }, doxygen = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '4a30eba5d047d6a8c5b005202b4848c0b33d76ca', + revision = 'ccd998f378c3f9345ea4eeb223f56d7b84d16687', url = 'https://github.com/tree-sitter-grammars/tree-sitter-doxygen', }, maintainers = { '@amaanq' }, @@ -460,7 +416,6 @@ return { }, dtd = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'dtd', revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', @@ -470,8 +425,7 @@ return { }, earthfile = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '6de809419cdfb23e3a8383b6575fa3634900f276', + revision = 'b5bdcb5813ce0e582fbd8e03eb42c80d3cc8984e', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -479,7 +433,6 @@ return { }, ebnf = { install_info = { - files = { 'src/parser.c' }, location = 'crates/tree-sitter-ebnf', revision = '8e635b0b723c620774dfb8abf382a7f531894b40', url = 'https://github.com/RubixDev/ebnf', @@ -502,8 +455,7 @@ return { }, eds = { install_info = { - files = { 'src/parser.c' }, - revision = '5517bdb90c90703df49579a4b04689a614780be2', + revision = '0ad62cb635c2f4353359a88dec9e3a57bbf9f66d', url = 'https://github.com/uyha/tree-sitter-eds', }, maintainers = { '@uyha' }, @@ -511,7 +463,6 @@ return { }, eex = { install_info = { - files = { 'src/parser.c' }, revision = 'f742f2fe327463335e8671a87c0b9b396905d1d1', url = 'https://github.com/connorlay/tree-sitter-eex', }, @@ -520,8 +471,7 @@ return { }, elixir = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = 'de690fa8a028f122af46d9d2685679fe5f2d7d60', + revision = 'c7ae8b77e2749826dcf23df6514f08fdd68c66a3', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -529,7 +479,6 @@ return { }, elm = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '09dbf221d7491dc8d8839616b27c21b9c025c457', url = 'https://github.com/elm-tooling/tree-sitter-elm', }, @@ -538,7 +487,6 @@ return { }, elsa = { install_info = { - files = { 'src/parser.c' }, revision = '0a66b2b3f3c1915e67ad2ef9f7dbd2a84820d9d7', url = 'https://github.com/glapa-grossklag/tree-sitter-elsa', }, @@ -547,7 +495,6 @@ return { }, elvish = { install_info = { - files = { 'src/parser.c' }, revision = '5e7210d945425b77f82cbaebc5af4dd3e1ad40f5', url = 'https://github.com/elves/tree-sitter-elvish', }, @@ -556,7 +503,6 @@ return { }, embedded_template = { install_info = { - files = { 'src/parser.c' }, revision = '38d5004a797298dc42c85e7706c5ceac46a3f29f', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, @@ -572,7 +518,6 @@ return { }, erlang = { install_info = { - files = { 'src/parser.c', 'src/parser.c' }, revision = '98ea1f9c957b2ad520415eecb5a5b406e931101e', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, @@ -581,7 +526,6 @@ return { }, facility = { install_info = { - files = { 'src/parser.c' }, revision = 'a52579670e2b14ec03d410c3c980fafaf6d659c4', url = 'https://github.com/FacilityApi/tree-sitter-facility', }, @@ -590,7 +534,6 @@ return { }, faust = { install_info = { - files = { 'src/parser.c' }, revision = 'f3b9274514b5f9bf6b0dd4a01c30f9cc15c58bc4', url = 'https://github.com/khiner/tree-sitter-faust', }, @@ -599,7 +542,6 @@ return { }, fennel = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = 'cfbfa478dc2dbef267ee94ae4323d9c886f45e94', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', @@ -609,7 +551,6 @@ return { }, fidl = { install_info = { - files = { 'src/parser.c' }, revision = '0a8910f293268e27ff554357c229ba172b0eaed2', url = 'https://github.com/google/tree-sitter-fidl', }, @@ -618,7 +559,6 @@ return { }, firrtl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '8503d3a0fe0f9e427863cb0055699ff2d29ae5f5', url = 'https://github.com/tree-sitter-grammars/tree-sitter-firrtl', }, @@ -627,7 +567,6 @@ return { }, fish = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a78aef9abc395c600c38a037ac779afc7e3cc9e0', url = 'https://github.com/ram02z/tree-sitter-fish', }, @@ -636,7 +575,6 @@ return { }, foam = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '04664b40c0dadb7ef37028acf3422c63271d377b', url = 'https://github.com/FoamScience/tree-sitter-foam', }, @@ -645,7 +583,6 @@ return { }, forth = { install_info = { - files = { 'src/parser.c' }, revision = '90189238385cf636b9ee99ce548b9e5b5e569d48', url = 'https://github.com/AlexanderBrevig/tree-sitter-forth', }, @@ -654,7 +591,6 @@ return { }, fortran = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'f73d473e3530862dee7cbb38520f28824e7804f6', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, @@ -663,7 +599,6 @@ return { }, fsh = { install_info = { - files = { 'src/parser.c' }, revision = 'fad2e175099a45efbc98f000cc196d3674cc45e0', url = 'https://github.com/mgramigna/tree-sitter-fsh', }, @@ -681,7 +616,6 @@ return { }, func = { install_info = { - files = { 'src/parser.c' }, revision = 'f780ca55e65e7d7360d0229331763e16c452fc98', url = 'https://github.com/tree-sitter-grammars/tree-sitter-func', }, @@ -690,7 +624,6 @@ return { }, fusion = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6', url = 'https://gitlab.com/jirgn/tree-sitter-fusion', }, @@ -718,7 +651,6 @@ return { }, gdscript = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '1f1e782fe2600f50ae57b53876505b8282388d77', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, @@ -728,7 +660,6 @@ return { }, gdshader = { install_info = { - files = { 'src/parser.c' }, revision = 'ffd9f958df13cae04593781d7d2562295a872455', url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', }, @@ -737,7 +668,6 @@ return { }, git_config = { install_info = { - files = { 'src/parser.c' }, revision = '9c2a1b7894e6d9eedfe99805b829b4ecd871375e', url = 'https://github.com/the-mikedavis/tree-sitter-git-config', }, @@ -746,7 +676,6 @@ return { }, git_rebase = { install_info = { - files = { 'src/parser.c' }, revision = 'd8a4207ebbc47bd78bacdf48f883db58283f9fd8', url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', }, @@ -755,7 +684,6 @@ return { }, gitattributes = { install_info = { - files = { 'src/parser.c' }, revision = '41940e199ba5763abea1d21b4f717014b45f01ea', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', }, @@ -764,7 +692,6 @@ return { }, gitcommit = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'edd817e0532f179b7f7f371dc180629070945f0c', url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, @@ -773,7 +700,6 @@ return { }, gitignore = { install_info = { - files = { 'src/parser.c' }, revision = 'f4685bf11ac466dd278449bcfe5fd014e94aa504', url = 'https://github.com/shunsambongi/tree-sitter-gitignore', }, @@ -782,7 +708,6 @@ return { }, gleam = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '02a17bf9d0553406268cdbf466d57808ae712bf3', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, @@ -791,7 +716,6 @@ return { }, glimmer = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '6b25d265c990139353e1f7f97baf84987ebb7bf0', url = 'https://github.com/ember-tooling/tree-sitter-glimmer', }, @@ -821,7 +745,6 @@ return { }, glsl = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '7f91bf34cadc06a96efc475df501ffca4dda9410', url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', @@ -832,7 +755,6 @@ return { }, gn = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'bc06955bc1e3c9ff8e9b2b2a55b38b94da923c05', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gn', }, @@ -842,7 +764,6 @@ return { }, gnuplot = { install_info = { - files = { 'src/parser.c' }, revision = '3c895f5d9c0b3a3c7e02383766b462c21913c000', url = 'https://github.com/dpezto/tree-sitter-gnuplot', }, @@ -851,7 +772,6 @@ return { }, go = { install_info = { - files = { 'src/parser.c' }, revision = '7ee8d928db5202f6831a78f8112fd693bf69f98b', url = 'https://github.com/tree-sitter/tree-sitter-go', }, @@ -868,7 +788,6 @@ return { }, godot_resource = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '2ffb90de47417018651fc3b970e5f6b67214dc9d', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, @@ -878,7 +797,6 @@ return { }, gomod = { install_info = { - files = { 'src/parser.c' }, revision = 'bbe2fe3be4b87e06a613e685250f473d2267f430', url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, @@ -887,7 +805,6 @@ return { }, gosum = { install_info = { - files = { 'src/parser.c' }, revision = 'e2ac513b2240c7ff1069ae33b2df29ce90777c11', url = 'https://github.com/tree-sitter-grammars/tree-sitter-go-sum', }, @@ -896,7 +813,6 @@ return { }, gotmpl = { install_info = { - files = { 'src/parser.c' }, revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, @@ -905,7 +821,6 @@ return { }, gowork = { install_info = { - files = { 'src/parser.c' }, revision = '949a8a470559543857a62102c84700d291fc984c', url = 'https://github.com/omertuc/tree-sitter-go-work', }, @@ -914,7 +829,6 @@ return { }, gpg = { install_info = { - files = { 'src/parser.c' }, revision = 'f99323fb8f3f10b6c69db0c2f6d0a14bd7330675', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', }, @@ -923,7 +837,6 @@ return { }, graphql = { install_info = { - files = { 'src/parser.c' }, revision = '5e66e961eee421786bdda8495ed1db045e06b5fe', url = 'https://github.com/bkegley/tree-sitter-graphql', }, @@ -940,7 +853,6 @@ return { }, groovy = { install_info = { - files = { 'src/parser.c' }, revision = '6c5c8813233fe326e24c5ef032858d13f8006a8d', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, @@ -949,7 +861,6 @@ return { }, gstlaunch = { install_info = { - files = { 'src/parser.c' }, revision = '549aef253fd38a53995cda1bf55c501174372bf7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch', }, @@ -958,7 +869,6 @@ return { }, hack = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'fca1e294f6dce8ec5659233a6a21f5bd0ed5b4f2', url = 'https://github.com/slackhq/tree-sitter-hack', }, @@ -966,7 +876,6 @@ return { }, hare = { install_info = { - files = { 'src/parser.c' }, revision = '070524937539eb8bb4f10debd9c83b66c434f3a2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', }, @@ -975,7 +884,6 @@ return { }, haskell = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a50070d5bb5bd5c1281740a6102ecf1f4b0c4f19', url = 'https://github.com/tree-sitter/tree-sitter-haskell', }, @@ -984,7 +892,6 @@ return { }, haskell_persistent = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '577259b4068b2c281c9ebf94c109bd50a74d5857', url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', }, @@ -993,8 +900,7 @@ return { }, hcl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = 'e936d3fef8bac884661472dce71ad82284761eb1', + revision = 'e2d416afeba80e8cf711ed6792e089ed5c8e184e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -1002,7 +908,6 @@ return { }, heex = { install_info = { - files = { 'src/parser.c' }, revision = 'b5ad6e34eea18a15bbd1466ca707a17f9bff7b93', url = 'https://github.com/connorlay/tree-sitter-heex', }, @@ -1011,7 +916,6 @@ return { }, helm = { install_info = { - files = { 'src/parser.c' }, location = 'dialects/helm', revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', url = 'https://github.com/ngalaiko/tree-sitter-go-template', @@ -1021,7 +925,6 @@ return { }, hjson = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '02fa3b79b3ff9a296066da6277adfc3f26cbc9e0', url = 'https://github.com/winston0410/tree-sitter-hjson', @@ -1032,7 +935,6 @@ return { }, hlsl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '5e1225a30712ca0a9040509806c7ba274a1bbcde', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', @@ -1043,7 +945,6 @@ return { }, hlsplaylist = { install_info = { - files = { 'src/parser.c' }, revision = '64f19029339e75d6762feae39e7878595860c980', url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', }, @@ -1052,7 +953,6 @@ return { }, hocon = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = 'c390f10519ae69fdb03b3e5764f5592fb6924bcc', url = 'https://github.com/antosha417/tree-sitter-hocon', @@ -1062,7 +962,6 @@ return { }, hoon = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a24c5a39d1d7e993a8bee913c8e8b6a652ca5ae8', url = 'https://github.com/urbit-pilled/tree-sitter-hoon', }, @@ -1071,7 +970,6 @@ return { }, html = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'e4d834eb4918df01dcad5c27d1b15d56e3bd94cd', url = 'https://github.com/tree-sitter/tree-sitter-html', }, @@ -1086,7 +984,6 @@ return { }, htmldjango = { install_info = { - files = { 'src/parser.c' }, revision = 'ea71012d3fe14dd0b69f36be4f96bdfe9155ebae', url = 'https://github.com/interdependence/tree-sitter-htmldjango', }, @@ -1095,7 +992,6 @@ return { }, http = { install_info = { - files = { 'src/parser.c' }, revision = '8d22f33faa5aa95c6526606fb656ada342e59e40', url = 'https://github.com/rest-nvim/tree-sitter-http', }, @@ -1104,7 +1000,6 @@ return { }, hurl = { install_info = { - files = { 'src/parser.c' }, revision = 'ad705af8c44c737bdb965fc081329c50716d2d03', url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, @@ -1113,8 +1008,7 @@ return { }, hyprlang = { install_info = { - files = { 'src/parser.c' }, - revision = 'e5da7d0aa44403153e0394d87d9edea4e5bd6609', + revision = 'c9012d6dcaaa939f17c21e1fdb17b013d139e6b9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, @@ -1122,7 +1016,6 @@ return { }, idl = { install_info = { - files = { 'src/parser.c' }, revision = '9f56001f8ed29b0ea9fa4f02813f3e83ab0a2aaa', url = 'https://github.com/cathaysia/tree-sitter-idl', }, @@ -1139,7 +1032,6 @@ return { }, ini = { install_info = { - files = { 'src/parser.c' }, revision = '87176e524f0a98f5be75fa44f4f0ff5c6eac069c', url = 'https://github.com/justinmk/tree-sitter-ini', }, @@ -1148,7 +1040,6 @@ return { }, inko = { install_info = { - files = { 'src/parser.c' }, revision = '234c87be1dac20f766ddf6f486a7bde2a4bc5594', url = 'https://github.com/inko-lang/tree-sitter-inko', }, @@ -1165,7 +1056,6 @@ return { }, ispc = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '9b2f9aec2106b94b4e099fe75e73ebd8ae707c04', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ispc', @@ -1176,8 +1066,7 @@ return { }, janet_simple = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '6bfbaadac2ba0da21087041eff85d26129c4c920', + revision = '2a05cab838dfec52daa76f10920917d2e69a85bc', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1185,7 +1074,6 @@ return { }, java = { install_info = { - files = { 'src/parser.c' }, revision = '953abfc8bb3eb2f578e1f461edba4a9885f974b8', url = 'https://github.com/tree-sitter/tree-sitter-java', }, @@ -1202,7 +1090,6 @@ return { }, javascript = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '391a8fcc48a11f63bf18ec9885f6f069e760949a', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, @@ -1233,7 +1120,6 @@ return { }, jq = { install_info = { - files = { 'src/parser.c' }, revision = '13990f530e8e6709b7978503da9bc8701d366791', url = 'https://github.com/flurie/tree-sitter-jq', }, @@ -1242,7 +1128,6 @@ return { }, jsdoc = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '49fde205b59a1d9792efc21ee0b6d50bbd35ff14', url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', }, @@ -1251,7 +1136,6 @@ return { }, json = { install_info = { - files = { 'src/parser.c' }, revision = '94f5c527b2965465956c2000ed6134dd24daf2a7', url = 'https://github.com/tree-sitter/tree-sitter-json', }, @@ -1260,7 +1144,6 @@ return { }, json5 = { install_info = { - files = { 'src/parser.c' }, revision = 'ab0ba8229d639ec4f3fa5f674c9133477f4b77bd', url = 'https://github.com/Joakker/tree-sitter-json5', }, @@ -1269,7 +1152,6 @@ return { }, jsonc = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '02b01653c8a1c198ae7287d566efa86a135b30d5', url = 'https://gitlab.com/WhyNotHugo/tree-sitter-jsonc', @@ -1280,7 +1162,6 @@ return { }, jsonnet = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'd34615fa12cc1d1cfc1f1f1a80acc9db80ee4596', url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', }, @@ -1294,7 +1175,6 @@ return { }, julia = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'f1baa5f8e271109d01cc8ff7473c11df2d8a9aee', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, @@ -1303,7 +1183,6 @@ return { }, just = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'fd814fc6c579f68c2a642f5e0268cf69daae92d7', url = 'https://github.com/IndianBoy42/tree-sitter-just', }, @@ -1320,7 +1199,6 @@ return { }, kconfig = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '486fea71f61ad9f3fd4072a118402e97fe88d26c', url = 'https://github.com/tree-sitter-grammars/tree-sitter-kconfig', }, @@ -1329,8 +1207,7 @@ return { }, kdl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '49fb89a854d93b58a65a19724ac307195ca11941', + revision = 'b37e3d58e5c5cf8d739b315d6114e02d42e66664', url = 'https://github.com/tree-sitter-grammars/tree-sitter-kdl', }, maintainers = { '@amaanq' }, @@ -1338,7 +1215,6 @@ return { }, kotlin = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'c9cb8504b81684375e7beb8907517dbd6947a1be', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, @@ -1347,8 +1223,7 @@ return { }, koto = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = 'eb8d866cff5751c0a7650623d244280618b0a378', + revision = 'd4109879ba1387d19095269a7473bd7d274ab848', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1356,7 +1231,6 @@ return { }, kusto = { install_info = { - files = { 'src/parser.c' }, revision = '8353a1296607d6ba33db7c7e312226e5fc83e8ce', url = 'https://github.com/Willem-J-an/tree-sitter-kusto', }, @@ -1365,7 +1239,6 @@ return { }, lalrpop = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '854a40e99f7c70258e522bdb8ab584ede6196e2e', url = 'https://github.com/traxys/tree-sitter-lalrpop', }, @@ -1374,7 +1247,6 @@ return { }, latex = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate = true, revision = 'cd82eb40d31bdfe65f846f4e06292d6c804b5e0e', url = 'https://github.com/latex-lsp/tree-sitter-latex', @@ -1384,7 +1256,6 @@ return { }, ledger = { install_info = { - files = { 'src/parser.c' }, revision = '8a841fb20ce683bfbb3469e6ba67f2851cfdf94a', url = 'https://github.com/cbarrete/tree-sitter-ledger', }, @@ -1393,7 +1264,6 @@ return { }, leo = { install_info = { - files = { 'src/parser.c' }, revision = '304611b5eaf53aca07459a0a03803b83b6dfd3b3', url = 'https://github.com/r001/tree-sitter-leo', }, @@ -1402,7 +1272,6 @@ return { }, linkerscript = { install_info = { - files = { 'src/parser.c' }, revision = 'f99011a3554213b654985a4b0a65b3b032ec4621', url = 'https://github.com/tree-sitter-grammars/tree-sitter-linkerscript', }, @@ -1411,8 +1280,7 @@ return { }, liquid = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '293369818da219d97327908aab33707b04b63fd9', + revision = '0419ac4868585320eee8615c90b864a1b04ef433', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1420,7 +1288,6 @@ return { }, liquidsoap = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '14feafa91630afb1ab9988cf9b738b7ea29f3f89', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, @@ -1429,7 +1296,6 @@ return { }, llvm = { install_info = { - files = { 'src/parser.c' }, revision = '1b96e58faf558ce057d4dc664b904528aee743cb', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, @@ -1438,7 +1304,6 @@ return { }, lua = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a24dab177e58c9c6832f96b9a73102a0cfbced4a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, @@ -1447,7 +1312,6 @@ return { }, luadoc = { install_info = { - files = { 'src/parser.c' }, revision = '873612aadd3f684dd4e631bdf42ea8990c57634e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-luadoc', }, @@ -1456,8 +1320,7 @@ return { }, luap = { install_info = { - files = { 'src/parser.c' }, - revision = '31461ae9bd0866cb5117cfe5de71189854fd0f3e', + revision = 'c134aaec6acf4fa95fe4aa0dc9aba3eacdbbe55a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-luap', }, maintainers = { '@amaanq' }, @@ -1466,7 +1329,6 @@ return { }, luau = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '5aa9b88a8e3327276ec6e72de997f04ac80b1ae4', url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', @@ -1477,7 +1339,6 @@ return { }, m68k = { install_info = { - files = { 'src/parser.c' }, revision = 'd097b123f19c6eaba2bf181c05420d88b9fc489d', url = 'https://github.com/grahambates/tree-sitter-m68k', }, @@ -1486,7 +1347,6 @@ return { }, make = { install_info = { - files = { 'src/parser.c' }, revision = 'a4b9187417d6be349ee5fd4b6e77b4172c6827dd', url = 'https://github.com/alemuller/tree-sitter-make', }, @@ -1495,7 +1355,6 @@ return { }, markdown = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'tree-sitter-markdown', revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', @@ -1507,7 +1366,6 @@ return { }, markdown_inline = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'tree-sitter-markdown-inline', revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', @@ -1518,7 +1376,6 @@ return { }, matlab = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '79d8b25f57b48f83ae1333aff6723b83c9532e37', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, @@ -1527,7 +1384,6 @@ return { }, menhir = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'be8866a6bcc2b563ab0de895af69daeffa88fe70', url = 'https://github.com/Kerl13/tree-sitter-menhir', }, @@ -1536,7 +1392,6 @@ return { }, mermaid = { install_info = { - files = { 'src/parser.c' }, revision = '90ae195b31933ceb9d079abfa8a3ad0a36fee4cc', url = 'https://github.com/monaqa/tree-sitter-mermaid', }, @@ -1544,7 +1399,6 @@ return { }, meson = { install_info = { - files = { 'src/parser.c' }, revision = 'bd17c824196ce70800f64ad39cfddd1b17acc13f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, @@ -1553,7 +1407,6 @@ return { }, mlir = { install_info = { - files = { 'src/parser.c' }, generate = true, revision = '00c32d8562dc957b187da110a3443307962b8da8', url = 'https://github.com/artagnon/tree-sitter-mlir', @@ -1563,7 +1416,6 @@ return { }, muttrc = { install_info = { - files = { 'src/parser.c' }, revision = '90ef60852c410bd964cd3b954366e4c403c17314', url = 'https://github.com/neomutt/tree-sitter-muttrc', }, @@ -1572,7 +1424,6 @@ return { }, nasm = { install_info = { - files = { 'src/parser.c' }, revision = '570f3d7be01fffc751237f4cfcf52d04e20532d1', url = 'https://github.com/naclsn/tree-sitter-nasm', }, @@ -1589,15 +1440,13 @@ return { }, nickel = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '0a796f3a312917724c1d9f486a201f7402a8acfd', + revision = '43433d8477b24cd13acaac20a66deda49b7e2547', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, }, nim = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '961c2798cec9250c44f7d7225ddb33d47d25856a', url = 'https://github.com/alaviss/tree-sitter-nim', }, @@ -1607,7 +1456,6 @@ return { }, nim_format_string = { install_info = { - files = { 'src/parser.c' }, revision = 'd45f75022d147cda056e98bfba68222c9c8eca3a', url = 'https://github.com/aMOPel/tree-sitter-nim-format-string', }, @@ -1616,7 +1464,6 @@ return { }, ninja = { install_info = { - files = { 'src/parser.c' }, revision = '0a95cfdc0745b6ae82f60d3a339b37f19b7b9267', url = 'https://github.com/alemuller/tree-sitter-ninja', }, @@ -1625,7 +1472,6 @@ return { }, nix = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'b3cda619248e7dd0f216088bd152f59ce0bbe488', url = 'https://github.com/cstrahan/tree-sitter-nix', }, @@ -1634,7 +1480,6 @@ return { }, nqc = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '14e6da1627aaef21d2b2aa0c37d04269766dcc1d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-nqc', @@ -1652,7 +1497,6 @@ return { }, objc = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '62e61b6f5c0289c376d61a8c91faf6435cde9012', url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', @@ -1663,7 +1507,6 @@ return { }, objdump = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '28d3b2e25a0b1881d1b47ed1924ca276c7003d45', url = 'https://github.com/ColinKennedy/tree-sitter-objdump', }, @@ -1672,7 +1515,6 @@ return { }, ocaml = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'grammars/ocaml', revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', @@ -1682,7 +1524,6 @@ return { }, ocaml_interface = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'grammars/interface', revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', @@ -1693,7 +1534,6 @@ return { }, ocamllex = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate = true, revision = '4b9898ccbf198602bb0dec9cd67cc1d2c0a4fad2', url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', @@ -1703,7 +1543,6 @@ return { }, odin = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'd37b8f24f653378b268ec18404e9c14ad355b128', url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', }, @@ -1712,7 +1551,6 @@ return { }, pascal = { install_info = { - files = { 'src/parser.c' }, revision = 'a9ee969dec5b2e3b2ccccc5954fec04100c7619e', url = 'https://github.com/Isopod/tree-sitter-pascal', }, @@ -1721,7 +1559,6 @@ return { }, passwd = { install_info = { - files = { 'src/parser.c' }, revision = '20239395eacdc2e0923a7e5683ad3605aee7b716', url = 'https://github.com/ath3/tree-sitter-passwd', }, @@ -1730,7 +1567,6 @@ return { }, pem = { install_info = { - files = { 'src/parser.c' }, revision = '217ff2af3f2db15a79ab7e3d21ea1e0c17e71a1a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', }, @@ -1740,7 +1576,6 @@ return { perl = { install_info = { branch = 'release', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '309cb8d33bcfd0a81050b21be08f9eb3f2fe2138', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', @@ -1750,9 +1585,8 @@ return { }, php = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'php', - revision = 'b38c53537769df05871643c9688c264074fb6076', + revision = '4f124bc6075e1c3333e80190c1c170933ed72c95', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1762,9 +1596,8 @@ return { }, php_only = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'php_only', - revision = 'b38c53537769df05871643c9688c264074fb6076', + revision = '4f124bc6075e1c3333e80190c1c170933ed72c95', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1773,7 +1606,6 @@ return { }, phpdoc = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '1d0e255b37477d0ca46f1c9e9268c8fa76c0b3fc', url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', @@ -1783,7 +1615,6 @@ return { }, pioasm = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '924aadaf5dea2a6074d72027b064f939acf32e20', url = 'https://github.com/leo60228/tree-sitter-pioasm', }, @@ -1792,7 +1623,6 @@ return { }, po = { install_info = { - files = { 'src/parser.c' }, revision = 'bd860a0f57f697162bf28e576674be9c1500db5e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-po', }, @@ -1802,7 +1632,6 @@ return { pod = { install_info = { branch = 'release', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '39da859947b94abdee43e431368e1ae975c0a424', url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', @@ -1812,7 +1641,6 @@ return { }, poe_filter = { install_info = { - files = { 'src/parser.c' }, revision = '592476d81f95d2451f2ca107dc872224c76fecdf', url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', }, @@ -1822,7 +1650,6 @@ return { }, pony = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '73ff874ae4c9e9b45462673cbc0a1e350e2522a7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pony', }, @@ -1840,7 +1667,6 @@ return { }, printf = { install_info = { - files = { 'src/parser.c' }, revision = '0e0aceabbf607ea09e03562f5d8a56f048ddea3d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', }, @@ -1849,7 +1675,6 @@ return { }, prisma = { install_info = { - files = { 'src/parser.c' }, revision = 'eca2596a355b1a9952b4f80f8f9caed300a272b5', url = 'https://github.com/victorhqc/tree-sitter-prisma', }, @@ -1879,7 +1704,6 @@ return { }, promql = { install_info = { - files = { 'src/parser.c' }, revision = '77625d78eebc3ffc44d114a07b2f348dff3061b0', url = 'https://github.com/MichaHoffmann/tree-sitter-promql', }, @@ -1888,7 +1712,6 @@ return { }, properties = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '9d09f5f200c356c50c4103d36441309fd61b48d1', url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', }, @@ -1898,7 +1721,6 @@ return { }, proto = { install_info = { - files = { 'src/parser.c' }, revision = 'e9f6b43f6844bd2189b50a422d4e2094313f6aa3', url = 'https://github.com/treywood/tree-sitter-proto', }, @@ -1907,7 +1729,6 @@ return { }, prql = { install_info = { - files = { 'src/parser.c' }, revision = '09e158cd3650581c0af4c49c2e5b10c4834c8646', url = 'https://github.com/PRQL/tree-sitter-prql', }, @@ -1916,7 +1737,6 @@ return { }, psv = { install_info = { - files = { 'src/parser.c' }, location = 'psv', revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', @@ -1927,7 +1747,6 @@ return { }, pug = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a7ff31a38908df9b9f34828d21d6ca5e12413e18', url = 'https://github.com/zealot128/tree-sitter-pug', }, @@ -1936,7 +1755,6 @@ return { }, puppet = { install_info = { - files = { 'src/parser.c' }, revision = '584522f32495d648b18a53ccb52d988e60de127d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-puppet', }, @@ -1945,7 +1763,6 @@ return { }, purescript = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'daf9b3e2be18b0b2996a1281f7783e0d041d8b80', url = 'https://github.com/postsolar/tree-sitter-purescript', }, @@ -1954,8 +1771,7 @@ return { }, pymanifest = { install_info = { - files = { 'src/parser.c' }, - revision = 'e3b82b78721aee07f676dac8473ae69db51debcf', + revision = 'be062582956165019d3253794b4d712f66dfeaaa', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pymanifest', }, maintainers = { '@ObserverOfTime' }, @@ -1964,7 +1780,6 @@ return { }, python = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '71778c2a472ed00a64abf4219544edbf8e4b86d7', url = 'https://github.com/tree-sitter/tree-sitter-python', }, @@ -1973,7 +1788,6 @@ return { }, ql = { install_info = { - files = { 'src/parser.c' }, revision = '42becd6f8f7bae82c818fa3abb1b6ff34b552310', url = 'https://github.com/tree-sitter/tree-sitter-ql', }, @@ -1982,7 +1796,6 @@ return { }, qmldir = { install_info = { - files = { 'src/parser.c' }, revision = '6b2b5e41734bd6f07ea4c36ac20fb6f14061c841', url = 'https://github.com/tree-sitter-grammars/tree-sitter-qmldir', }, @@ -1991,9 +1804,8 @@ return { }, qmljs = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, - revision = '2c57cac27e207425f8df15327884434cb12365a3', + revision = 'febf48a5b6928600cd8fb2a01254743af550780d', url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, @@ -2002,7 +1814,6 @@ return { }, query = { install_info = { - files = { 'src/parser.c' }, revision = 'f767fb0ac5e711b6d44c5e0c8d1f349687a86ce0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, @@ -2012,7 +1823,6 @@ return { }, r = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '391400572538ff9854341a175ed8ab4b1e45f44b', url = 'https://github.com/r-lib/tree-sitter-r', }, @@ -2021,7 +1831,6 @@ return { }, racket = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '171f52a8c0ed635b85cd42d1e36d82f1066a03b4', url = 'https://github.com/6cdh/tree-sitter-racket', }, @@ -2029,7 +1838,6 @@ return { }, ralph = { install_info = { - files = { 'src/parser.c' }, revision = '48b9d9d6e2b55ce8f9eb09ceb0d952e4b1cc87a0', url = 'https://github.com/alephium/tree-sitter-ralph', }, @@ -2038,7 +1846,6 @@ return { }, rasi = { install_info = { - files = { 'src/parser.c' }, revision = '6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa', url = 'https://github.com/Fymyte/tree-sitter-rasi', }, @@ -2057,8 +1864,7 @@ return { }, rbs = { install_info = { - files = { 'src/parser.c' }, - revision = 'e5e807a50fcd104a2d740d354632fc671700a0bf', + revision = '88d8ed487b5449ddda2fc0c4fe23b71cba29ca24', url = 'https://github.com/joker1007/tree-sitter-rbs', }, maintainers = { '@joker1007' }, @@ -2066,7 +1872,6 @@ return { }, re2c = { install_info = { - files = { 'src/parser.c' }, revision = '47aa19cf5f7aba2ed30e2b377f7172df76e819a6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-re2c', }, @@ -2075,7 +1880,6 @@ return { }, readline = { install_info = { - files = { 'src/parser.c' }, revision = '3d4768b04d7cfaf40533e12b28672603428b8f31', url = 'https://github.com/tree-sitter-grammars/tree-sitter-readline', }, @@ -2084,7 +1888,6 @@ return { }, regex = { install_info = { - files = { 'src/parser.c' }, revision = '47007f195752d8e57bda80b0b6cdb2d173a9f7d7', url = 'https://github.com/tree-sitter/tree-sitter-regex', }, @@ -2093,8 +1896,7 @@ return { }, rego = { install_info = { - files = { 'src/parser.c' }, - revision = '23b1da8de9766d766c4f01531e8be14b5c00c493', + revision = '20b5a5958c837bc9f74b231022a68a594a313f6d', url = 'https://github.com/FallenAngel97/tree-sitter-rego', }, maintainers = { '@FallenAngel97' }, @@ -2102,8 +1904,7 @@ return { }, requirements = { install_info = { - files = { 'src/parser.c' }, - revision = '360c6a6b31076a482663806f7a8241de9cad6b4e', + revision = '5ad9b7581b3334f6ad492847d007f2fac6e6e5f2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', }, maintainers = { '@ObserverOfTime' }, @@ -2120,7 +1921,6 @@ return { }, rnoweb = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '1a74dc0ed731ad07db39f063e2c5a6fe528cae7f', url = 'https://github.com/bamonroe/tree-sitter-rnoweb', }, @@ -2129,7 +1929,6 @@ return { }, robot = { install_info = { - files = { 'src/parser.c' }, revision = '322e4cc65754d2b3fdef4f2f8a71e0762e3d13af', url = 'https://github.com/Hubro/tree-sitter-robot', }, @@ -2146,8 +1945,7 @@ return { }, roc = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '7df2c0892e62efb81a7504d9799d4e0d0443d241', + revision = 'df46a85abda9f948d38f5d4e3684cec49c42fef2', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -2155,7 +1953,6 @@ return { }, ron = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '78938553b93075e638035f624973083451b29055', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ron', }, @@ -2164,7 +1961,6 @@ return { }, rst = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '5120f6e59284cb8b85b450bd2db0bd352635ba9f', url = 'https://github.com/stsewd/tree-sitter-rst', }, @@ -2173,7 +1969,6 @@ return { }, ruby = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'dc2d7d6b50f9975bc3c35bbec0ba11b2617b736b', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, @@ -2190,7 +1985,6 @@ return { }, rust = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '9c84af007b0f144954adb26b3f336495cbb320a7', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, @@ -2199,7 +1993,6 @@ return { }, scala = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'b76db435a7f876cf1ede837d66054c534783c72f', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, @@ -2208,17 +2001,15 @@ return { }, scfg = { install_info = { - files = { 'src/parser.c' }, generate = true, revision = '6deae0cbb458c849a4d1e2985093e9c9c32d7fd0', url = 'https://github.com/rockorager/tree-sitter-scfg', }, maintainers = { '@WhyNotHugo' }, - tier = 3, + tier = 4, }, scheme = { install_info = { - files = { 'src/parser.c' }, revision = '8f9dff3d038f09934db5ea113cebc59c74447743', url = 'https://github.com/6cdh/tree-sitter-scheme', }, @@ -2226,7 +2017,6 @@ return { }, scss = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'c478c6868648eff49eb04a4df90d703dc45b312a', url = 'https://github.com/serenadeai/tree-sitter-scss', }, @@ -2246,7 +2036,6 @@ return { }, slang = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '865d79e236c7f0e04276c969453d021d1da4b15f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', @@ -2265,7 +2054,6 @@ return { }, slint = { install_info = { - files = { 'src/parser.c' }, revision = 'd82ab8c19ea1b60ff570256eaef7d137cc5ecb63', url = 'https://github.com/slint-ui/tree-sitter-slint', }, @@ -2274,7 +2062,6 @@ return { }, smali = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'fdfa6a1febc43c7467aa7e937b87b607956f2346', url = 'https://github.com/tree-sitter-grammars/tree-sitter-smali', }, @@ -2283,7 +2070,6 @@ return { }, smithy = { install_info = { - files = { 'src/parser.c' }, revision = 'fa898ac0885d1da9a253695c3e0e91f5efc587cd', url = 'https://github.com/indoorvivants/tree-sitter-smithy', }, @@ -2292,9 +2078,8 @@ return { }, snakemake = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, - revision = 'ba1b3868eaa960b945593404af9a7c2f296d3643', + revision = '5a7b14074bca95b25935e865ca8f1efad32317e4', url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, @@ -2302,8 +2087,7 @@ return { }, solidity = { install_info = { - files = { 'src/parser.c' }, - revision = '1c94fe3d5351dfcff3551ec1f49614cbf758e444', + revision = 'ee5a2d2ba30b487c4bbf613d2ef310a454c09c7c', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2311,7 +2095,6 @@ return { }, soql = { install_info = { - files = { 'src/parser.c' }, location = 'soql', revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', url = 'https://github.com/aheber/tree-sitter-sfapex', @@ -2321,7 +2104,6 @@ return { }, sosl = { install_info = { - files = { 'src/parser.c' }, location = 'sosl', revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', url = 'https://github.com/aheber/tree-sitter-sfapex', @@ -2331,8 +2113,7 @@ return { }, sourcepawn = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, - revision = '64ad670dd59e88c5d32bc3d759ae8562b522cad9', + revision = '645d093763bcaaf7535edbdf6575a5c978b16491', url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, @@ -2340,7 +2121,6 @@ return { }, sparql = { install_info = { - files = { 'src/parser.c' }, generate_from_json = true, revision = '05f949d3c1c15e3261473a244d3ce87777374dec', url = 'https://github.com/GordianDziwis/tree-sitter-sparql', @@ -2351,9 +2131,8 @@ return { sql = { install_info = { branch = 'gh-pages', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, - revision = '6a99f4aff780f98bc119c7f034406e41d7e0b80d', + revision = '89fd00d0aff3bc9985ac37caf362ec4fd9b2ba1d', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2361,7 +2140,6 @@ return { }, squirrel = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '0a50d31098e83c668d34d1160a0f6c7d23b571cc', url = 'https://github.com/tree-sitter-grammars/tree-sitter-squirrel', }, @@ -2370,7 +2148,6 @@ return { }, ssh_config = { install_info = { - files = { 'src/parser.c' }, revision = '77450e8bce8853921512348f83c73c168c71fdfb', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', }, @@ -2379,7 +2156,6 @@ return { }, starlark = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '018d0e09d9d0f0dd6740a37682b8ee4512e8b2ac', url = 'https://github.com/tree-sitter-grammars/tree-sitter-starlark', @@ -2389,7 +2165,6 @@ return { }, strace = { install_info = { - files = { 'src/parser.c' }, revision = 'd819cdd5dbe455bd3c859193633c8d91c0df7c36', url = 'https://github.com/sigmaSd/tree-sitter-strace', }, @@ -2398,7 +2173,6 @@ return { }, styled = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '65835cca33a5f033bcde580ed66cde01c1fabbbe', url = 'https://github.com/mskelton/tree-sitter-styled', @@ -2408,7 +2182,6 @@ return { }, supercollider = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'affa4389186b6939d89673e1e9d2b28364f5ca6f', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, @@ -2426,7 +2199,6 @@ return { }, surface = { install_info = { - files = { 'src/parser.c' }, revision = 'f4586b35ac8548667a9aaa4eae44456c1f43d032', url = 'https://github.com/connorlay/tree-sitter-surface', }, @@ -2435,9 +2207,8 @@ return { }, svelte = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, - revision = '2c97326cd96b7c3016c3d249e8dc244c89b4abeb', + revision = '7218cf622b057ae9c530e1f0a7a3ce49806ca55e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', }, maintainers = { '@amaanq' }, @@ -2454,9 +2225,8 @@ return { }, swift = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate = true, - revision = '26354ddec08c7efde4fa16bd29429f3310d2e2c5', + revision = '13ffaec4068facfff608e3afbdb7a581c185f6a6', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2464,7 +2234,6 @@ return { }, sxhkdrc = { install_info = { - files = { 'src/parser.c' }, revision = '440d5f913d9465c9c776a1bd92334d32febcf065', url = 'https://github.com/RaafatTurki/tree-sitter-sxhkdrc', }, @@ -2473,7 +2242,6 @@ return { }, systemtap = { install_info = { - files = { 'src/parser.c' }, revision = '1af543a96d060b1f808982037bfc54cc02218edd', url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', }, @@ -2482,7 +2250,6 @@ return { }, t32 = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '6182836f4128725f1e74ce986840d7317021a015', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, @@ -2491,7 +2258,6 @@ return { }, tablegen = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'b1170880c61355aaf38fc06f4af7d3c55abdabc4', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tablegen', }, @@ -2500,7 +2266,6 @@ return { }, tact = { install_info = { - files = { 'src/parser.c' }, revision = '034df2162ed7b654efd999942e266be713c7cde0', url = 'https://github.com/tact-lang/tree-sitter-tact', }, @@ -2509,7 +2274,6 @@ return { }, tcl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '8784024358c233efd0f3a6fd9e7a3c5852e628bc', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, @@ -2526,7 +2290,6 @@ return { }, teal = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate = true, revision = '19b02da829d1721a521bf7b802eb80a50bd53aab', url = 'https://github.com/euclidianAce/tree-sitter-teal', @@ -2536,7 +2299,6 @@ return { }, templ = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = 'cf84ea53e2e2531f23009d676ac206090c1e2392', url = 'https://github.com/vrischmann/tree-sitter-templ', @@ -2546,7 +2308,6 @@ return { }, terraform = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'dialects/terraform', revision = 'e936d3fef8bac884661472dce71ad82284761eb1', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', @@ -2557,7 +2318,6 @@ return { }, textproto = { install_info = { - files = { 'src/parser.c' }, revision = '8dacf02aa402892c91079f8577998ed5148c0496', url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', }, @@ -2566,7 +2326,6 @@ return { }, thrift = { install_info = { - files = { 'src/parser.c' }, revision = '68fd0d80943a828d9e6f49c58a74be1e9ca142cf', url = 'https://github.com/tree-sitter-grammars/tree-sitter-thrift', }, @@ -2575,7 +2334,6 @@ return { }, tiger = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'a7f11d946b44244f71df41d2a78af0665d618dae', url = 'https://github.com/ambroisie/tree-sitter-tiger', }, @@ -2584,7 +2342,6 @@ return { }, tlaplus = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '200f9dab6b23f3b9bb8f67fc811221517f56c373', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, @@ -2593,7 +2350,6 @@ return { }, tmux = { install_info = { - files = { 'src/parser.c' }, revision = '9138ea508410e0f34da2666609f600f65e944f22', url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, @@ -2602,7 +2358,6 @@ return { }, todotxt = { install_info = { - files = { 'src/parser.c' }, revision = '3937c5cd105ec4127448651a21aef45f52d19609', url = 'https://github.com/arnarg/tree-sitter-todotxt', }, @@ -2611,7 +2366,6 @@ return { }, toml = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '16a30c83ce427385b8d14939c45c137fcfca6c42', url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', @@ -2621,7 +2375,6 @@ return { }, tsv = { install_info = { - files = { 'src/parser.c' }, location = 'tsv', revision = '7eb7297823605392d2bbcc4c09b1cd18d6fa9529', url = 'https://github.com/tree-sitter-grammars/tree-sitter-csv', @@ -2631,7 +2384,6 @@ return { }, tsx = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, location = 'tsx', revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', @@ -2643,7 +2395,6 @@ return { }, turtle = { install_info = { - files = { 'src/parser.c' }, revision = '085437f5cb117703b7f520dd92161140a684f092', url = 'https://github.com/GordianDziwis/tree-sitter-turtle', }, @@ -2652,8 +2403,7 @@ return { }, twig = { install_info = { - files = { 'src/parser.c' }, - revision = 'eaf80e6af969e25993576477a9dbdba3e48c1305', + revision = '085648e01d1422163a1702a44e72303b4e2a0bd1', url = 'https://github.com/gbprod/tree-sitter-twig', }, maintainers = { '@gbprod' }, @@ -2661,7 +2411,6 @@ return { }, typescript = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, location = 'typescript', revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', @@ -2673,7 +2422,6 @@ return { }, typespec = { install_info = { - files = { 'src/parser.c' }, revision = '28821d0d6da5f0a6b5eb02b9bad953fecafd7248', url = 'https://github.com/happenslol/tree-sitter-typespec', }, @@ -2682,7 +2430,6 @@ return { }, typoscript = { install_info = { - files = { 'src/parser.c' }, revision = '43b221c0b76e77244efdaa9963e402a17c930fbc', url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', }, @@ -2691,7 +2438,6 @@ return { }, typst = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '3924cb9ed9e0e62ce7df9c4fe0faa4c234795999', url = 'https://github.com/uben0/tree-sitter-typst', }, @@ -2700,7 +2446,6 @@ return { }, udev = { install_info = { - files = { 'src/parser.c' }, revision = '8f58696e79092b4ad6bf197415bbd0970acf15cd', url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', }, @@ -2709,7 +2454,6 @@ return { }, ungrammar = { install_info = { - files = { 'src/parser.c' }, revision = 'debd26fed283d80456ebafa33a06957b0c52e451', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ungrammar', }, @@ -2718,7 +2462,6 @@ return { }, unison = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate = true, revision = '59d36a09282be7e4d3374854126590f3dcebee6e', url = 'https://github.com/kylegoetz/tree-sitter-unison', @@ -2728,7 +2471,6 @@ return { }, usd = { install_info = { - files = { 'src/parser.c' }, revision = '4e0875f724d94d0c2ff36f9b8cb0b12f8b20d216', url = 'https://github.com/ColinKennedy/tree-sitter-usd', }, @@ -2737,7 +2479,6 @@ return { }, uxntal = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'ad9b638b914095320de85d59c49ab271603af048', url = 'https://github.com/tree-sitter-grammars/tree-sitter-uxntal', }, @@ -2746,9 +2487,8 @@ return { }, v = { install_info = { - files = { 'src/parser.c' }, location = 'tree_sitter_v', - revision = '7e11a6f8f369df935664fadd2f0c99d90fe3226f', + revision = 'e91f8a42de7842f24f4ce600754f2b6651985fd4', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2756,7 +2496,6 @@ return { }, vala = { install_info = { - files = { 'src/parser.c' }, revision = '8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b', url = 'https://github.com/vala-lang/tree-sitter-vala', }, @@ -2765,7 +2504,6 @@ return { }, vento = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '3321077d7446c1b3b017c294fd56ce028ed817fe', url = 'https://github.com/ventojs/tree-sitter-vento', }, @@ -2774,7 +2512,6 @@ return { }, verilog = { install_info = { - files = { 'src/parser.c' }, revision = '075ebfc84543675f12e79a955f79d717772dcef3', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, @@ -2791,7 +2528,6 @@ return { }, vhs = { install_info = { - files = { 'src/parser.c' }, revision = '90028bbadb267ead5b87830380f6a825147f0c0f', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, @@ -2800,7 +2536,6 @@ return { }, vim = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'b448ca63f972ade12c373c808acdd2bf972937db', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, @@ -2809,8 +2544,7 @@ return { }, vimdoc = { install_info = { - files = { 'src/parser.c' }, - revision = 'b711df784dd43d0a8ed8ddbfca0ddcc3239d94b4', + revision = '2249c44ecd3f5cf22da3dcccfb74f816ddb29245', url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, @@ -2827,7 +2561,6 @@ return { vue = { install_info = { branch = 'main', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '22bdfa6c9fc0f5ffa44c6e938ec46869ac8a99ff', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', @@ -2838,7 +2571,6 @@ return { }, wgsl = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '40259f3c77ea856841a4e0c4c807705f3e4a2b65', url = 'https://github.com/szebniok/tree-sitter-wgsl', }, @@ -2847,7 +2579,6 @@ return { }, wgsl_bevy = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, revision = '1e12c7925c41bb09818d86e30cd78644fde7d31a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', @@ -2857,7 +2588,6 @@ return { }, wing = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'bd1d35cf3e013dc7e189b46a593bdc2b281b0dd7', url = 'https://github.com/winglang/tree-sitter-wing', }, @@ -2866,7 +2596,6 @@ return { }, wit = { install_info = { - files = { 'src/parser.c' }, revision = 'cab94791450524a542324d8cbe8017d69c516d8e', url = 'https://github.com/liamwh/tree-sitter-wit', }, @@ -2875,7 +2604,6 @@ return { }, xcompose = { install_info = { - files = { 'src/parser.c' }, revision = '2383cc69a2c42cfade41c7cb971fb3862bec6df1', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', }, @@ -2884,7 +2612,6 @@ return { }, xml = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'xml', revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', @@ -2903,7 +2630,6 @@ return { }, yaml = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = '7b03feefd36b5f155465ca736c6304aca983b267', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, @@ -2912,7 +2638,6 @@ return { }, yang = { install_info = { - files = { 'src/parser.c' }, revision = '2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502', url = 'https://github.com/Hubro/tree-sitter-yang', }, @@ -2921,7 +2646,6 @@ return { }, yuck = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, revision = 'e877f6ade4b77d5ef8787075141053631ba12318', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yuck', }, @@ -2930,7 +2654,6 @@ return { }, zathurarc = { install_info = { - files = { 'src/parser.c' }, revision = '6e7c8edfcd6f5f7c12b2fa9ffc6d042f1b6d7068', url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', }, @@ -2939,7 +2662,6 @@ return { }, zig = { install_info = { - files = { 'src/parser.c' }, revision = '0d08703e4c3f426ec61695d7617415fff97029bd', url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index a4c236ec3..82b2900ac 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -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' }, diff --git a/scripts/convert-lockfile.lua b/scripts/convert-lockfile.lua index e0a694897..5759c0426 100755 --- a/scripts/convert-lockfile.lua +++ b/scripts/convert-lockfile.lua @@ -9,6 +9,7 @@ local lockfile = vim.json.decode(util.read_file(filename)) --[[@as table Date: Thu, 13 Jun 2024 12:30:57 +0200 Subject: [PATCH 046/434] feat(install)!: drop support for git Problem: Using git for installing parsers can lead to data loss if in a git commit buffer. Solution: Only support downloading via curl+tar, which are installed on all supported platforms (since Windows 10). Curl will also be required for WASM parsers (and for `vim.net.download()`). --- SUPPORTED_LANGUAGES.md | 45 +++-- TODO.md | 8 +- lua/nvim-treesitter/health.lua | 28 +-- lua/nvim-treesitter/install.lua | 295 +++++++++++++++----------------- lua/nvim-treesitter/parsers.lua | 220 ++++++++++++------------ 5 files changed, 301 insertions(+), 295 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 1c72c9ba9..028caeaff 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -14,7 +14,7 @@ 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 +[apex](https://github.com/aheber/tree-sitter-sfapex) | community | `HF JL` | @aheber, @xixiafinland [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 @@ -49,7 +49,7 @@ Language | Tier | Queries | Maintainer [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 +[diff](https://github.com/the-mikedavis/tree-sitter-diff) | community | `H  J ` | @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 @@ -59,10 +59,11 @@ Language | Tier | Queries | Maintainer [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 +[editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) | community | `HF J ` | @ValdezFOmar [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 +[elm](https://github.com/elm-tooling/tree-sitter-elm) | community | `HF 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 ` | @@ -92,10 +93,11 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[goctl](https://github.com/chaozwn/tree-sitter-goctl) | community | `HFIJ ` | @chaozwn [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 +[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | community | `HF JL` | @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 @@ -107,7 +109,7 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[helm](https://github.com/ngalaiko/tree-sitter-go-template) | community | `HF JL` | @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 @@ -119,8 +121,8 @@ html_tags (queries only)[^html_tags] | community | `H IJ ` | @TravonteD [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 +[idl](https://github.com/cathaysia/tree-sitter-idl) | community | `H IJ ` | @cathaysia +[ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF J ` | @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 @@ -163,11 +165,12 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[nginx](https://github.com/opa-oz/tree-sitter-nginx) | community | `HF J ` | @opa-oz [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 +[nix](https://github.com/cstrahan/tree-sitter-nix) | community | `HFIJL` | @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 @@ -188,8 +191,11 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[powershell](https://github.com/airbus-cert/tree-sitter-powershell) | community | `HFIJL` | @L2jLiga [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 +[problog](https://github.com/foxyseta/tree-sitter-prolog) | community | `HFIJ ` | @foxyseta +[prolog](https://github.com/foxyseta/tree-sitter-prolog) | community | `HFIJ ` | @foxyseta [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 @@ -204,7 +210,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[r](https://github.com/r-lib/tree-sitter-r) | community | `H IJL` | @ribru17 [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 @@ -214,27 +220,30 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[rescript](https://github.com/rescript-lang/tree-sitter-rescript) | core | `HFIJL` | @ribru17 [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | community | `HF J ` | @bamonroe [robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFIJ ` | @Hubro +[robots](https://github.com/opa-oz/tree-sitter-robots-txt) | community | `H  J ` | @opa-oz [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 +[scfg](https://github.com/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 +[sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | community | `H    ` | @aheber, @xixiaofinland [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 +[soql](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | @aheber, @xixiafinland +[sosl](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | @aheber, @xixiafinland [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  JL` | @Sarrus1 -[sparql](https://github.com/BonaBeavis/tree-sitter-sparql) | community | `HFIJL` | @BonaBeavis +[sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | community | `HFIJL` | @GordianDziwis [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 @@ -247,12 +256,13 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[systemverilog](https://github.com/zhangwwpeng/tree-sitter-systemverilog) | community | `HF J ` | @zhangwwpeng [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 +[templ](https://github.com/vrischmann/tree-sitter-templ) | community | `HF 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 @@ -263,7 +273,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[turtle](https://github.com/GordianDziwis/tree-sitter-turtle) | community | `HFIJL` | @GordianDziwis [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 @@ -278,14 +288,16 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | community | `HF J ` | @jpt13653903 [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 +[vrl](https://github.com/belltoy/tree-sitter-vrl) | community | `HFIJL` | @belltoy [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 +[wit](https://github.com/liamwh/tree-sitter-wit) | community | `HF 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 @@ -308,5 +320,6 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [^poe_filter]: Path of Exile item filter [^properties]: Java properties files [^query]: Tree-sitter query language +[^sflog]: Salesforce debug log [^slang]: Shader Slang diff --git a/TODO.md b/TODO.md index fb0032c96..5aef3991c 100644 --- a/TODO.md +++ b/TODO.md @@ -5,11 +5,13 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO - [ ] **`parsers.lua`:** allow specifying version in addition to commit hash (for Tier 1) -- [ ] **tests:** fix, update, extend (cover all Tier 1 languages) +- [ ] **`parsers.lua`:** add WASM support (tier 1) +- [ ] **`parsers.lua`:** update tiers (stable, dev, unmaintained, broken) +- [ ] **tests:** fix, update (remove custom crate, plenary dependency) - [ ] **documentation:** consolidate, autogenerate? - [ ] **documentation:** migration guide -- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`? -- [ ] **textobjects:** include simple(!) function, queries? (check Helix) +- [ ] **indents:** rewrite (Helix compatible) +- [ ] **textobjects:** include simple(!) `node`, `scope` (using `locals`) objects - [ ] **downstream:** adapt to breaking changes (`nvim-treesitter-refactor`) ## DONE diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index dc7078bdf..30c3345d3 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -67,20 +67,28 @@ local function install_health() end end - do -- curl+tar or git check - local curl = check_exe('curl') - local tar = check_exe('tar') + do -- node check + local node = check_exe('node') + if node then + health.ok(string.format('node %s (%s)', node.version, node.path)) + else + health.error('node not found') + end + end - if curl and tar and vim.uv.os_uname().sysname ~= 'Windows_NT' then + do -- curl+tar check + local tar = check_exe('tar') + if tar then health.ok(string.format('tar %s (%s)', tar.version, tar.path)) + else + health.error('tar not found') + end + + local curl = check_exe('curl') + if curl then 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 + health.error('curl not found') end end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index ac37c7af0..f9a52461c 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -8,25 +8,31 @@ local log = require('nvim-treesitter.log') local parsers = require('nvim-treesitter.parsers') local util = require('nvim-treesitter.util') ---- @type fun(path: string, new_path: string, flags?: table): string? +---@type fun(path: string, new_path: string, flags?: table): string? local uv_copyfile = a.wrap(uv.fs_copyfile, 4) ---- @type fun(path: string, mode: integer): string? +---@type fun(path: string, mode: integer): string? local uv_mkdir = a.wrap(uv.fs_mkdir, 3) ---- @type fun(path: string, new_path: string): string? +---@type fun(path: string, new_path: string): string? local uv_rename = a.wrap(uv.fs_rename, 3) ---- @type fun(path: string, new_path: string, flags?: table): string? +---@type fun(path: string, new_path: string, flags?: table): string? local uv_symlink = a.wrap(uv.fs_symlink, 4) ---- @type fun(path: string): string? +---@type fun(path: string): string? local uv_unlink = a.wrap(uv.fs_unlink, 2) -local max_jobs = 10 +local MAX_JOBS = 10 +local INSTALL_TIMEOUT = 60000 +---@async +---@param cmd string[] +---@param opts? vim.SystemOpts +---@return vim.SystemCompleted local function system(cmd, opts) - log.trace('running job: (cwd=%s) %s', opts.cwd, table.concat(cmd, ' ')) + local cwd = opts and opts.cwd or uv.cwd() + log.trace('running job: (cwd=%s) %s', cwd, table.concat(cmd, ' ')) local r = a.wrap(vim.system, 3)(cmd, opts) --[[@as vim.SystemCompleted]] a.main() if r.stdout and r.stdout ~= '' then @@ -39,7 +45,38 @@ local function system(cmd, opts) return r end -local iswin = uv.os_uname().sysname == 'Windows_NT' +---@async +---@param url string +---@param output string +---@return string? err +local function download_file(url, output) + local r = system({ + 'curl', + '--silent', + '--fail', + '--show-error', + '-L', -- follow redirects + url, + '--output', + output, + }) + if r.code > 0 then + return r.stderr + end +end + +---@async +---@param path string +---@param mode? string +---@return string? err +local function mkpath(path, mode) + local parent = fs.dirname(path) + if not parent:match('^[./]$') and not uv.fs_stat(parent) then + mkpath(parent, mode) + end + + return uv_mkdir(path, tonumber(mode or '755', 8)) +end local M = {} @@ -59,8 +96,8 @@ local function get_parser_install_info(lang) return parser_config.install_info end ---- @param ... string ---- @return string +---@param ... string +---@return string function M.get_package_path(...) return fs.joinpath(fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h:h:h'), ...) end @@ -92,16 +129,11 @@ end --- PARSER MANAGEMENT FUNCTIONS --- ---- @param x string ---- @return boolean -local function executable(x) - return fn.executable(x) == 1 -end - ---- @param logger Logger ---- @param repo InstallInfo ---- @param compile_location string ---- @return string? err +---@async +---@param logger Logger +---@param repo InstallInfo +---@param compile_location string +---@return string? err local function do_generate(logger, repo, compile_location) logger:info( string.format( @@ -123,131 +155,82 @@ local function do_generate(logger, repo, compile_location) end end +---@async ---@param logger Logger ----@param repo InstallInfo +---@param url string ---@param project_name string ---@param cache_dir string ---@param revision string ----@param project_dir string +---@param output_dir string ---@return string? err -local function do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir) - local is_github = repo.url:find('github.com', 1, true) - local url = repo.url:gsub('.git$', '') +local function do_download(logger, url, project_name, cache_dir, revision, output_dir) + local is_gitlab = url:find('gitlab.com', 1, true) - local dir_rev = revision - if is_github and revision:find('^v%d') then - dir_rev = revision:sub(2) + local tmp = output_dir .. '-tmp' + + util.delete(tmp) + + url = url:gsub('.git$', '') + local target = is_gitlab + and string.format('%s/-/archive/%s/%s-%s.tar.gz', url, revision, project_name, revision) + or string.format('%s/archive/%s.tar.gz', url, revision) + + local tarball_path = fs.joinpath(cache_dir, project_name .. '.tar.gz') + + do -- Download tarball + logger:info('Downloading %s...', project_name) + local err = download_file(target, tarball_path) + if err then + return logger:error('Error during download: %s', err) + end end - local temp_dir = project_dir .. '-tmp' - - util.delete(temp_dir) - - logger:info('Downloading ' .. project_name .. '...') - local target = is_github and url .. '/archive/' .. revision .. '.tar.gz' - or url .. '/-/archive/' .. revision .. '/' .. project_name .. '-' .. revision .. '.tar.gz' - - local r = system({ - 'curl', - '--silent', - '--show-error', - '-L', -- follow redirects - target, - '--output', - project_name .. '.tar.gz', - }, { - cwd = cache_dir, - }) - if r.code > 0 then - return logger:error('Error during download: %s', r.stderr) + do -- Create tmp dir + logger:debug('Creating temporary directory: %s', tmp) + local err = mkpath(tmp) + a.main() + if err then + return logger:error('Could not create %s-tmp: %s', project_name, err) + end end - logger:debug('Creating temporary directory: ' .. temp_dir) - --TODO(clason): use fn.mkdir(temp_dir, 'p') in case stdpath('cache') is not created - local err = uv_mkdir(temp_dir, 493) - a.main() - if err then - return logger:error('Could not create %s-tmp: %s', project_name, err) + do -- Extract tarball + logger:debug('Extracting %s into %s...', tarball_path, project_name) + -- Windows tar can't handle drive letters + local r = system( + { 'tar', '-xzf', project_name .. '.tar.gz', '-C', project_name .. '-tmp' }, + { cwd = cache_dir } + ) + if r.code > 0 then + return logger:error('Error during tarball extraction: %s', r.stderr) + end end - logger:info('Extracting ' .. project_name .. '...') - r = system({ - 'tar', - '-xzf', - project_name .. '.tar.gz', - '-C', - project_name .. '-tmp', - }, { - cwd = cache_dir, - }) - - if r.code > 0 then - return logger:error('Error during tarball extraction: %s', r.stderr) + do -- Remove tarball + logger:debug('Removing %s...', tarball_path) + local err = uv_unlink(tarball_path) + a.main() + if err then + return logger:error('Could not remove tarball: %s', err) + end end - err = uv_unlink(project_dir .. '.tar.gz') - if err then - return logger:error('Could not remove tarball: %s', err) - end - a.main() - - err = uv_rename(fs.joinpath(temp_dir, url:match('[^/]-$') .. '-' .. dir_rev), project_dir) - a.main() - - if err then - return logger:error('Could not rename temp: %s', err) + do -- Move tmp dir to output dir + local dir_rev = revision:find('^v%d') and revision:sub(2) or revision + local repo_project_name = url:match('[^/]-$') + local extracted = fs.joinpath(tmp, repo_project_name .. '-' .. dir_rev) + logger:debug('Moving %s to %s/...', extracted, output_dir) + local err = uv_rename(extracted, output_dir) + a.main() + if err then + return logger:error('Could not rename temp: %s', err) + end end - util.delete(temp_dir) -end - ----@param logger Logger ----@param repo InstallInfo ----@param project_name string ----@param cache_dir string ----@param revision string ----@param project_dir string ----@return string? err -local function do_download_git(logger, repo, project_name, cache_dir, revision, project_dir) - logger:info('Downloading ' .. project_name .. '...') - - local r = system({ - 'git', - 'clone', - '--filter=blob:none', - repo.url, - project_name, - }, { - cwd = cache_dir, - }) - - if r.code > 0 then - return logger:error('Error during download, please verify your internet connection: ', r.stderr) - end - - logger:info('Checking out locked revision') - r = system({ - 'git', - 'checkout', - revision, - }, { - cwd = project_dir, - }) - - if r.code > 0 then - return logger:error('Error while checking out revision: %s', r.stderr) - end -end - ----@param repo InstallInfo ----@return boolean -local function can_download_tar(repo) - local can_use_tar = executable('tar') and executable('curl') - local is_github = repo.url:find('github.com', 1, true) ~= nil - local is_gitlab = repo.url:find('gitlab.com', 1, true) ~= nil - return can_use_tar and (is_github or is_gitlab) and not iswin + util.delete(tmp) end +---@async ---@param logger Logger ---@param compile_location string ---@return string? err @@ -265,6 +248,7 @@ local function do_compile(logger, compile_location) end end +---@async ---@param logger Logger ---@param compile_location string ---@param target_location string @@ -272,7 +256,7 @@ end 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?! + if uv.os_uname().sysname == 'Windows_NT' 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 @@ -285,12 +269,13 @@ local function do_install(logger, compile_location, target_location) end end +---@async ---@param lang string ---@param cache_dir string ---@param install_dir string ---@param generate? boolean ---@return string? err -local function install_lang0(lang, cache_dir, install_dir, generate) +local function try_install_lang(lang, cache_dir, install_dir, generate) local logger = log.new('install/' .. lang) local repo = get_parser_install_info(lang) @@ -308,8 +293,7 @@ local function install_lang0(lang, cache_dir, install_dir, generate) revision = revision or repo.branch or 'main' - local do_download = can_download_tar(repo) and do_download_tar or do_download_git - local err = do_download(logger, repo, project_name, cache_dir, revision, project_dir) + local err = do_download(logger, repo.url, project_name, cache_dir, revision, project_dir) if err then return err end @@ -364,16 +348,15 @@ local function install_lang0(lang, cache_dir, install_dir, generate) logger:info('Language installed') end ---- @alias InstallStatus +---@alias InstallStatus --- | 'installing' --- | 'installed' --- | 'failed' --- | 'timeout' -local install_status = {} --- @type table - -local INSTALL_TIMEOUT = 60000 +local install_status = {} ---@type table +---@async ---@param lang string ---@param cache_dir string ---@param install_dir string @@ -399,7 +382,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate) end else install_status[lang] = 'installing' - local err = install_lang0(lang, cache_dir, install_dir, generate) + local err = try_install_lang(lang, cache_dir, install_dir, generate) install_status[lang] = err and 'failed' or 'installed' end @@ -410,6 +393,7 @@ end --- Reload the parser table and user modifications in case of update local function reload_parsers() + ---@diagnostic disable-next-line:no-unknown package.loaded['nvim-treesitter.parsers'] = nil parsers = require('nvim-treesitter.parsers') vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' }) @@ -420,16 +404,16 @@ end ---@field generate? boolean --- Install a parser ---- @param languages string[] ---- @param options? InstallOptions ---- @param _callback? fun() +---@param languages string[] +---@param options? InstallOptions +---@param _callback? fun() local function install(languages, options, _callback) options = options or {} - local cache_dir = vim.fs.normalize(fn.stdpath('cache')) + local cache_dir = fs.normalize(fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') - local tasks = {} --- @type fun()[] + local tasks = {} ---@type fun()[] local done = 0 for _, lang in ipairs(languages) do tasks[#tasks + 1] = a.sync(function() @@ -441,7 +425,7 @@ local function install(languages, options, _callback) end) end - a.join(max_jobs, nil, tasks) + a.join(MAX_JOBS, nil, tasks) if #tasks > 1 then a.main() log.info('Installed %d/%d languages', done, #tasks) @@ -474,7 +458,7 @@ M.update = a.sync(function(languages, _options, _callback) languages = 'all' end languages = config.norm_languages(languages, { ignored = true, missing = true }) - languages = vim.tbl_filter(needs_update, languages) --- @type string[] + languages = vim.tbl_filter(needs_update, languages) ---@type string[] if #languages > 0 then install(languages, { force = true }) @@ -483,16 +467,17 @@ M.update = a.sync(function(languages, _options, _callback) end end, 2) ---- @param logger Logger ---- @param lang string ---- @param parser string ---- @param queries string ---- @return string? err +---@async +---@param logger Logger +---@param lang string +---@param parser string +---@param queries string +---@return string? err local function uninstall_lang(logger, lang, parser, queries) logger:debug('Uninstalling ' .. lang) install_status[lang] = nil - if vim.fn.filereadable(parser) == 1 then + if fn.filereadable(parser) == 1 then logger:debug('Unlinking ' .. parser) local perr = uv_unlink(parser) a.main() @@ -502,7 +487,7 @@ local function uninstall_lang(logger, lang, parser, queries) end end - if vim.fn.isdirectory(queries) == 1 then + if fn.isdirectory(queries) == 1 then logger:debug('Unlinking ' .. queries) local qerr = uv_unlink(queries) a.main() @@ -515,9 +500,9 @@ local function uninstall_lang(logger, lang, parser, queries) logger:info('Language uninstalled') end ---- @param languages string[]|string ---- @param _options? UpdateOptions ---- @param _callback fun() +---@param languages string[]|string +---@param _options? UpdateOptions +---@param _callback fun() M.uninstall = a.sync(function(languages, _options, _callback) languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) @@ -525,7 +510,7 @@ M.uninstall = a.sync(function(languages, _options, _callback) local query_dir = config.get_install_dir('queries') local installed = config.installed_parsers() - local tasks = {} --- @type fun()[] + local tasks = {} ---@type fun()[] local done = 0 for _, lang in ipairs(languages) do local logger = log.new('uninstall/' .. lang) @@ -543,7 +528,7 @@ M.uninstall = a.sync(function(languages, _options, _callback) end end - a.join(max_jobs, nil, tasks) + a.join(MAX_JOBS, nil, tasks) if #tasks > 1 then a.main() log.info('Uninstalled %d/%d languages', done, #tasks) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b31224d26..5d01f968b 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = '10f21f3f1b10584e62ecc113ab3cda1196d0ceb8', + revision = '31182d43b062a350d4bd2449f2fc0d5654972be9', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -29,7 +29,7 @@ return { apex = { install_info = { location = 'apex', - revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -47,7 +47,7 @@ return { }, asm = { install_info = { - revision = 'b0306e9bb2ebe01c6562f1aef265cc42ccc53070', + revision = '2a35fccebcc08aa8b6c7bb3cff1f07cf0f8cff83', url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, @@ -96,7 +96,7 @@ return { }, beancount = { install_info = { - revision = 'c25f8034c977681653a8acd541c8b4877a58f474', + revision = '01c0da29e0fc7130420a09d939ecc524e09b6ba6', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -144,7 +144,7 @@ return { }, bp = { install_info = { - revision = '2326d709fb9cf73cf124fdbc803c267f851721a4', + revision = '4e60cf3c2e613625c06f6f85540b3631e2d06cd3', url = 'https://github.com/ambroisie/tree-sitter-bp', }, maintainers = { '@ambroisie' }, @@ -161,7 +161,7 @@ return { }, c = { install_info = { - revision = 'deca017a554045b4c203e7ddff39ae64ff05e071', + revision = 'be23d2c9d8e5b550e713ef0f86126a248462ca6e', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -169,7 +169,7 @@ return { }, c_sharp = { install_info = { - revision = '82fa8f05f41a33e9bc830f85d74a9548f0291738', + revision = '31a64b28292aac6adf44071e449fa03fb80eaf4e', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = '4864abb95a1f6e54d6b362677beef9fb674b41e9', + revision = '69d7a8b0f7493b0dbb07d54e8fea96c5421e8a71', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -275,7 +275,7 @@ return { cpp = { install_info = { generate_from_json = true, - revision = '9d412ba7e597fe158f209da33e60f31b1f0df967', + revision = '0b4aa47f07d958a49260aadc87e8474b03897c23', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -303,7 +303,7 @@ return { cuda = { install_info = { generate_from_json = true, - revision = '1f188eff83b562ffae36d13e1b804ec6f3b9f1d9', + revision = '7c97acb8398734d790c86210c53c320df61ff66b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -328,7 +328,7 @@ return { }, d = { install_info = { - revision = '750dde90ed9cdbd82493bc28478d8ab1976b0e9f', + revision = 'ac584585a15c4cacd6cda8e6bfe7cb1ca7b3898e', url = 'https://github.com/gdamore/tree-sitter-d', }, maintainers = { '@amaanq' }, @@ -352,7 +352,7 @@ return { }, devicetree = { install_info = { - revision = 'fb07e6044ffd36932c57a5be01ba5d6b8a9337bb', + revision = '296b3c294a8bcfca6673296d99f9cd37049b8026', url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, @@ -368,7 +368,7 @@ return { }, diff = { install_info = { - revision = '629676fc3919606964231b2c7b9677d6998a2cb4', + revision = '19dd5aa52fe339a1d974768a09ee2537303e8ca5', url = 'https://github.com/the-mikedavis/tree-sitter-diff', }, maintainers = { '@gbprod' }, @@ -384,7 +384,7 @@ return { }, djot = { install_info = { - revision = 'ea851b9cf1a71e475f4e2ac4dc03609a1b9ca56d', + revision = '886601b67d1f4690173a4925c214343c30704d32', url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, @@ -417,7 +417,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', + revision = '809266ed1694d64dedc168a18893cc254e3edf7e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -425,7 +425,7 @@ return { }, earthfile = { install_info = { - revision = 'b5bdcb5813ce0e582fbd8e03eb42c80d3cc8984e', + revision = 'b0a9bc5737340a9b80b489fe9ae93d7b2fe78cd7', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -447,8 +447,8 @@ return { }, editorconfig = { install_info = { + revision = 'fd0d64d2fc91eab903bed4c11ce280b62e46f16e', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ValdezFOmar' }, tier = 3, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '98ea1f9c957b2ad520415eecb5a5b406e931101e', + revision = '8f41b588fe38b981156651ef56b192ed3d158efd', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -526,7 +526,7 @@ return { }, facility = { install_info = { - revision = 'a52579670e2b14ec03d410c3c980fafaf6d659c4', + revision = '2d037f2f2bf668737f72e6be6eda4b7918b68d86', url = 'https://github.com/FacilityApi/tree-sitter-facility', }, maintainers = { '@bryankenote' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = 'f73d473e3530862dee7cbb38520f28824e7804f6', + revision = '6b633433fb3f132f21250cf8e8be76d5a6389b7e', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -676,7 +676,7 @@ return { }, git_rebase = { install_info = { - revision = 'd8a4207ebbc47bd78bacdf48f883db58283f9fd8', + revision = 'bff4b66b44b020d918d67e2828eada1974a966aa', url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', }, maintainers = { '@gbprod' }, @@ -692,7 +692,7 @@ return { }, gitcommit = { install_info = { - revision = 'edd817e0532f179b7f7f371dc180629070945f0c', + revision = 'aa5c279287f0895a7ebc76a06e55ac3e4b2df7c7', url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = '02a17bf9d0553406268cdbf466d57808ae712bf3', + revision = '426e67087fd62be5f4533581b5916b2cf010fb5b', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -746,7 +746,7 @@ return { glsl = { install_info = { generate_from_json = true, - revision = '7f91bf34cadc06a96efc475df501ffca4dda9410', + revision = 'ddc3137a2d775aca93084ff997fa13cc1691058a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', }, maintainers = { '@theHamsta' }, @@ -780,8 +780,8 @@ return { }, goctl = { install_info = { + revision = 'f107937259c7ec4bb05f7e3d2c24b89ac36d4cc3', url = 'https://github.com/chaozwn/tree-sitter-goctl', - files = { 'src/parser.c' }, }, maintainers = { '@chaozwn' }, tier = 3, @@ -797,7 +797,7 @@ return { }, gomod = { install_info = { - revision = 'bbe2fe3be4b87e06a613e685250f473d2267f430', + revision = '1f55029bacd0a6a11f6eb894c4312d429dcf735c', url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, maintainers = { '@camdencheek' }, @@ -853,7 +853,7 @@ return { }, groovy = { install_info = { - revision = '6c5c8813233fe326e24c5ef032858d13f8006a8d', + revision = '105ee343682b7eee86b38ec6858a269e16474a72', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, @@ -876,7 +876,7 @@ return { }, hare = { install_info = { - revision = '070524937539eb8bb4f10debd9c83b66c434f3a2', + revision = '4af5d82cf9ec39f67cb1db5b7a9269d337406592', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', }, maintainers = { '@amaanq' }, @@ -900,7 +900,7 @@ return { }, hcl = { install_info = { - revision = 'e2d416afeba80e8cf711ed6792e089ed5c8e184e', + revision = '9e3ec9848f28d26845ba300fd73c740459b83e9b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -908,7 +908,7 @@ return { }, heex = { install_info = { - revision = 'b5ad6e34eea18a15bbd1466ca707a17f9bff7b93', + revision = '6dd0303acf7138dd2b9b432a229e16539581c701', url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, @@ -936,7 +936,7 @@ return { hlsl = { install_info = { generate_from_json = true, - revision = '5e1225a30712ca0a9040509806c7ba274a1bbcde', + revision = '5d788a46727c8199a7c63a3c849092e0364375b6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', }, maintainers = { '@theHamsta' }, @@ -945,7 +945,7 @@ return { }, hlsplaylist = { install_info = { - revision = '64f19029339e75d6762feae39e7878595860c980', + revision = '3bfda9271e3adb08d35f47a2102fe957009e1c55', url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', }, maintainers = { '@Freed-Wu' }, @@ -992,7 +992,7 @@ return { }, http = { install_info = { - revision = '8d22f33faa5aa95c6526606fb656ada342e59e40', + revision = '5ae6c7cfa62a7d7325c26171a1de4f6b866702b5', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, @@ -1000,7 +1000,7 @@ return { }, hurl = { install_info = { - revision = 'ad705af8c44c737bdb965fc081329c50716d2d03', + revision = 'fba6ed8db3a009b9e7d656511931b181a3ee5b08', url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, @@ -1008,7 +1008,7 @@ return { }, hyprlang = { install_info = { - revision = 'c9012d6dcaaa939f17c21e1fdb17b013d139e6b9', + revision = '6858695eba0e63b9e0fceef081d291eb352abce8', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, @@ -1016,7 +1016,7 @@ return { }, idl = { install_info = { - revision = '9f56001f8ed29b0ea9fa4f02813f3e83ab0a2aaa', + revision = '7412851348d9d8ba93dc6abd5e60aba9b50a4811', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1066,7 +1066,7 @@ return { }, janet_simple = { install_info = { - revision = '2a05cab838dfec52daa76f10920917d2e69a85bc', + revision = 'ea842cb57a90865c8f50bcb4499de1a94860f3a4', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1090,7 +1090,7 @@ return { }, javascript = { install_info = { - revision = '391a8fcc48a11f63bf18ec9885f6f069e760949a', + revision = '12e45374422f6051648717be62f0ffc40a279ee2', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1175,7 +1175,7 @@ return { }, julia = { install_info = { - revision = 'f1baa5f8e271109d01cc8ff7473c11df2d8a9aee', + revision = 'a528de39923448e6b809a6b9f686f3472728f202', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, @@ -1183,7 +1183,7 @@ return { }, just = { install_info = { - revision = 'fd814fc6c579f68c2a642f5e0268cf69daae92d7', + revision = '6648ac1c0cdadaec8ee8bcf9a4ca6ace5102cf21', url = 'https://github.com/IndianBoy42/tree-sitter-just', }, maintainers = { '@Hubro' }, @@ -1215,7 +1215,7 @@ return { }, kotlin = { install_info = { - revision = 'c9cb8504b81684375e7beb8907517dbd6947a1be', + revision = '8d9d372b09fa4c3735657c5fc2ad03e53a5f05f5', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, @@ -1248,7 +1248,7 @@ return { latex = { install_info = { generate = true, - revision = 'cd82eb40d31bdfe65f846f4e06292d6c804b5e0e', + revision = 'efe5afdbb59b70214e6d70db5197dc945d5b213e', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1280,7 +1280,7 @@ return { }, liquid = { install_info = { - revision = '0419ac4868585320eee8615c90b864a1b04ef433', + revision = '7862a3424832c3a9d45eb21143b375837bd6573b', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1330,7 +1330,7 @@ return { luau = { install_info = { generate_from_json = true, - revision = '5aa9b88a8e3327276ec6e72de997f04ac80b1ae4', + revision = 'fbadc96272f718dba267628ba7b0e694c368cef3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', }, maintainers = { '@amaanq' }, @@ -1339,7 +1339,7 @@ return { }, m68k = { install_info = { - revision = 'd097b123f19c6eaba2bf181c05420d88b9fc489d', + revision = 'e128454c2210c0e0c10b68fe45ddb8fee80182a3', url = 'https://github.com/grahambates/tree-sitter-m68k', }, maintainers = { '@grahambates' }, @@ -1376,7 +1376,7 @@ return { }, matlab = { install_info = { - revision = '79d8b25f57b48f83ae1333aff6723b83c9532e37', + revision = '0d5a05e543af2de60cdb5e71f0f5888c95ab936f', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = '00c32d8562dc957b187da110a3443307962b8da8', + revision = 'affbd6f3b08155826a22cfa8373147acbf60f1f1', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1416,7 +1416,7 @@ return { }, muttrc = { install_info = { - revision = '90ef60852c410bd964cd3b954366e4c403c17314', + revision = '173b0ab53a9c07962c9777189c4c70e90f1c1837', url = 'https://github.com/neomutt/tree-sitter-muttrc', }, maintainers = { '@Freed-Wu' }, @@ -1432,22 +1432,22 @@ return { }, nginx = { install_info = { + revision = '281d184b8240b2b22670b8907b57b6d6842db6f3', url = 'https://github.com/opa-oz/tree-sitter-nginx', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@opa-oz' }, tier = 3, }, nickel = { install_info = { - revision = '43433d8477b24cd13acaac20a66deda49b7e2547', + revision = '3039ad9e9af3c1ffe049a04ee83a2b489915b0b9', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, }, nim = { install_info = { - revision = '961c2798cec9250c44f7d7225ddb33d47d25856a', + revision = '897e5d346f0b59ed62b517cfb0f1a845ad8f0ab7', url = 'https://github.com/alaviss/tree-sitter-nim', }, maintainers = { '@aMOPel' }, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = 'b3cda619248e7dd0f216088bd152f59ce0bbe488', + revision = '486bb0337ee94575f53367b53bffeaea99063f2c', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', + revision = '036226e5edb410aec004cc7ac0f4b2014dd04a0e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '0b12614ded3ec7ed7ab7933a9ba4f695ba4c342e', + revision = '036226e5edb410aec004cc7ac0f4b2014dd04a0e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1551,7 +1551,7 @@ return { }, pascal = { install_info = { - revision = 'a9ee969dec5b2e3b2ccccc5954fec04100c7619e', + revision = 'd0ebabefaea9ac3f6fc3004cf08cd121b66da9e4', url = 'https://github.com/Isopod/tree-sitter-pascal', }, maintainers = { '@Isopod' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '309cb8d33bcfd0a81050b21be08f9eb3f2fe2138', + revision = '3a21d9cb2a20a062c17f8f53d5983fd473c4673c', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = '4f124bc6075e1c3333e80190c1c170933ed72c95', + revision = 'c07d69739ba71b5a449bdbb7735991f8aabf8546', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '4f124bc6075e1c3333e80190c1c170933ed72c95', + revision = 'c07d69739ba71b5a449bdbb7735991f8aabf8546', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1657,11 +1657,11 @@ return { tier = 2, }, powershell = { - install_info = { - url = 'https://github.com/airbus-cert/tree-sitter-powershell', - files = { 'src/parser.c', 'src/scanner.c' }, - }, filetype = 'ps1', + install_info = { + revision = 'fc15514b2f1dbba9c58528d15a3708f89eda6a01', + url = 'https://github.com/airbus-cert/tree-sitter-powershell', + }, maintainers = { '@L2jLiga' }, tier = 3, }, @@ -1681,23 +1681,21 @@ return { maintainers = { '@elianiva' }, tier = 3, }, - problog = { install_info = { - url = 'https://github.com/foxyseta/tree-sitter-prolog', - files = { 'src/parser.c' }, location = 'grammars/problog', + revision = '93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8', + url = 'https://github.com/foxyseta/tree-sitter-prolog', }, maintainers = { '@foxyseta' }, requires = { 'prolog' }, tier = 3, }, - prolog = { install_info = { - url = 'https://github.com/foxyseta/tree-sitter-prolog', - files = { 'src/parser.c' }, location = 'grammars/prolog', + revision = '93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8', + url = 'https://github.com/foxyseta/tree-sitter-prolog', }, maintainers = { '@foxyseta' }, tier = 3, @@ -1780,7 +1778,7 @@ return { }, python = { install_info = { - revision = '71778c2a472ed00a64abf4219544edbf8e4b86d7', + revision = '0dee05ef958ba2eae88d1e65f24b33cad70d4367', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1823,7 +1821,7 @@ return { }, r = { install_info = { - revision = '391400572538ff9854341a175ed8ab4b1e45f44b', + revision = 'b1e211f52ad8f8e1e182bbbcc16dcd5e3688eb7d', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1838,7 +1836,7 @@ return { }, ralph = { install_info = { - revision = '48b9d9d6e2b55ce8f9eb09ceb0d952e4b1cc87a0', + revision = 'f6d81bf7a4599c77388035439cf5801cd461ff77', url = 'https://github.com/alephium/tree-sitter-ralph', }, maintainers = { '@tdroxler' }, @@ -1864,7 +1862,7 @@ return { }, rbs = { install_info = { - revision = '88d8ed487b5449ddda2fc0c4fe23b71cba29ca24', + revision = '8d8e65ac3f77fbc9e15b1cdb9f980a3e0ac3ab99', url = 'https://github.com/joker1007/tree-sitter-rbs', }, maintainers = { '@joker1007' }, @@ -1913,8 +1911,8 @@ return { }, rescript = { install_info = { + revision = '4606cd81c4c31d1d02390fee530858323410a74c', url = 'https://github.com/rescript-lang/tree-sitter-rescript', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@ribru17' }, tier = 2, @@ -1937,15 +1935,15 @@ return { }, robots = { install_info = { + revision = '8e3a4205b76236bb6dbebdbee5afc262ce38bb62', url = 'https://github.com/opa-oz/tree-sitter-robots-txt', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@opa-oz' }, tier = 3, }, roc = { install_info = { - revision = 'df46a85abda9f948d38f5d4e3684cec49c42fef2', + revision = 'ef46edd0c03ea30a22f7e92bc68628fb7231dc8a', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -1969,7 +1967,7 @@ return { }, ruby = { install_info = { - revision = 'dc2d7d6b50f9975bc3c35bbec0ba11b2617b736b', + revision = '0ffe457fb6aabf064f173fd30ea356845cef2513', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1993,7 +1991,7 @@ return { }, scala = { install_info = { - revision = 'b76db435a7f876cf1ede837d66054c534783c72f', + revision = 'be7184df70dd3b5790becfb2c93ba796b2797781', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2002,7 +2000,7 @@ return { scfg = { install_info = { generate = true, - revision = '6deae0cbb458c849a4d1e2985093e9c9c32d7fd0', + revision = 'a5512800ea0220da4abbae61b8aea8423d1549aa', url = 'https://github.com/rockorager/tree-sitter-scfg', }, maintainers = { '@WhyNotHugo' }, @@ -2026,9 +2024,9 @@ return { }, sflog = { install_info = { - url = 'https://github.com/aheber/tree-sitter-sfapex', - files = { 'src/parser.c' }, location = 'sflog', + revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', + url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, readme_note = 'Salesforce debug log', @@ -2037,7 +2035,7 @@ return { slang = { install_info = { generate_from_json = true, - revision = '865d79e236c7f0e04276c969453d021d1da4b15f', + revision = 'd84b43d75d65bbc4ba57166ce17555f32c0b8983', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2054,7 +2052,7 @@ return { }, slint = { install_info = { - revision = 'd82ab8c19ea1b60ff570256eaef7d137cc5ecb63', + revision = '4a0558cc0fcd7a6110815b9bbd7cc12d7ab31e74', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2079,7 +2077,7 @@ return { snakemake = { install_info = { generate_from_json = true, - revision = '5a7b14074bca95b25935e865ca8f1efad32317e4', + revision = 'e909815acdbe37e69440261ebb1091ed52e1dec6', url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, @@ -2096,7 +2094,7 @@ return { soql = { install_info = { location = 'soql', - revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2105,7 +2103,7 @@ return { sosl = { install_info = { location = 'sosl', - revision = 'c99ad4b16d112fea91745e3f1b769754239fdaba', + revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2113,7 +2111,7 @@ return { }, sourcepawn = { install_info = { - revision = '645d093763bcaaf7535edbdf6575a5c978b16491', + revision = '6b9bf9cbab91443380d2ca8a2f6c491cc7fac5bf', url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, @@ -2122,7 +2120,7 @@ return { sparql = { install_info = { generate_from_json = true, - revision = '05f949d3c1c15e3261473a244d3ce87777374dec', + revision = 'd853661ca680d8ff7f8d800182d5782b61d0dd58', url = 'https://github.com/GordianDziwis/tree-sitter-sparql', }, maintainers = { '@GordianDziwis' }, @@ -2132,7 +2130,7 @@ return { install_info = { branch = 'gh-pages', generate_from_json = true, - revision = '89fd00d0aff3bc9985ac37caf362ec4fd9b2ba1d', + revision = 'c67ecbd37d8d12f22e4cc7138afd14bc20253e10', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2140,7 +2138,7 @@ return { }, squirrel = { install_info = { - revision = '0a50d31098e83c668d34d1160a0f6c7d23b571cc', + revision = '072c969749e66f000dba35a33c387650e203e96e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-squirrel', }, maintainers = { '@amaanq' }, @@ -2208,7 +2206,7 @@ return { svelte = { install_info = { generate_from_json = true, - revision = '7218cf622b057ae9c530e1f0a7a3ce49806ca55e', + revision = '7ab8221e3f378a3b04b4b488f07c1f408c5bd0d8', url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', }, maintainers = { '@amaanq' }, @@ -2226,7 +2224,7 @@ return { swift = { install_info = { generate = true, - revision = '13ffaec4068facfff608e3afbdb7a581c185f6a6', + revision = '769bb834feb2947f2c706d82830b0a05958727de', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2242,7 +2240,7 @@ return { }, systemtap = { install_info = { - revision = '1af543a96d060b1f808982037bfc54cc02218edd', + revision = 'f2b378a9af0b7e1192cff67a5fb45508c927205d', url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', }, maintainers = { '@ok-ryoko' }, @@ -2266,7 +2264,7 @@ return { }, tact = { install_info = { - revision = '034df2162ed7b654efd999942e266be713c7cde0', + revision = '91cc49a83f4f0b3a756bf7d0e65403a9cf757003', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2300,7 +2298,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = 'cf84ea53e2e2531f23009d676ac206090c1e2392', + revision = 'de0d0ee129cf643872e8e0d5c4a6589b5a3aae23', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2309,7 +2307,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = 'e936d3fef8bac884661472dce71ad82284761eb1', + revision = '9e3ec9848f28d26845ba300fd73c740459b83e9b', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2342,7 +2340,7 @@ return { }, tlaplus = { install_info = { - revision = '200f9dab6b23f3b9bb8f67fc811221517f56c373', + revision = 'bba02e79f85e335f310fc95e21c677e49f2c4439', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2350,7 +2348,7 @@ return { }, tmux = { install_info = { - revision = '9138ea508410e0f34da2666609f600f65e944f22', + revision = '0252ecd080016e45e6305ef1a943388f5ae2f4b4', url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, maintainers = { '@Freed-Wu' }, @@ -2386,7 +2384,7 @@ return { install_info = { generate_from_json = true, location = 'tsx', - revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', + revision = '198d03553f43a45b92ac5d0ee167db3fec6a6fd6', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2395,7 +2393,7 @@ return { }, turtle = { install_info = { - revision = '085437f5cb117703b7f520dd92161140a684f092', + revision = '7f789ea7ef765080f71a298fc96b7c957fa24422', url = 'https://github.com/GordianDziwis/tree-sitter-turtle', }, maintainers = { '@GordianDziwis' }, @@ -2413,7 +2411,7 @@ return { install_info = { generate_from_json = true, location = 'typescript', - revision = '4ad3010c91d700026d036b5230e2d99ba94ae8a4', + revision = '198d03553f43a45b92ac5d0ee167db3fec6a6fd6', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2422,7 +2420,7 @@ return { }, typespec = { install_info = { - revision = '28821d0d6da5f0a6b5eb02b9bad953fecafd7248', + revision = '0ee05546d73d8eb64635ed8125de6f35c77759fe', url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, @@ -2438,7 +2436,7 @@ return { }, typst = { install_info = { - revision = '3924cb9ed9e0e62ce7df9c4fe0faa4c234795999', + revision = 'abe60cbed7986ee475d93f816c1be287f220c5d8', url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, @@ -2488,7 +2486,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = 'e91f8a42de7842f24f4ce600754f2b6651985fd4', + revision = '7f80a0441ff2ca6aa8ced8e1ee87cead9dd26515', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2520,8 +2518,8 @@ return { }, vhdl = { install_info = { + revision = '4ab3e251eae8890a020d083d00acd1b8c2653c07', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@jpt13653903' }, tier = 3, @@ -2536,7 +2534,7 @@ return { }, vim = { install_info = { - revision = 'b448ca63f972ade12c373c808acdd2bf972937db', + revision = 'f3cd62d8bd043ef20507e84bb6b4b53731ccf3a7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, @@ -2552,8 +2550,8 @@ return { }, vrl = { install_info = { + revision = '274b3ce63f72aa8ffea18e7fc280d3062d28f0ba', url = 'https://github.com/belltoy/tree-sitter-vrl', - files = { 'src/parser.c' }, }, maintainers = { '@belltoy' }, tier = 3, @@ -2580,7 +2578,7 @@ return { wgsl_bevy = { install_info = { generate_from_json = true, - revision = '1e12c7925c41bb09818d86e30cd78644fde7d31a', + revision = '0f06f24e259ac725045956436b9025dab008ff9f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', }, maintainers = { '@theHamsta' }, @@ -2596,7 +2594,7 @@ return { }, wit = { install_info = { - revision = 'cab94791450524a542324d8cbe8017d69c516d8e', + revision = 'c52f0b07786603df17ad0197f6cef680f312eb2c', url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, @@ -2604,7 +2602,7 @@ return { }, xcompose = { install_info = { - revision = '2383cc69a2c42cfade41c7cb971fb3862bec6df1', + revision = 'fff3e72242aa110ebba6441946ea4d12d200fa68', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', }, maintainers = { '@ObserverOfTime' }, @@ -2613,7 +2611,7 @@ return { xml = { install_info = { location = 'xml', - revision = '648183d86f6f8ffb240ea11b4c6873f6f45d8b67', + revision = '809266ed1694d64dedc168a18893cc254e3edf7e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2654,7 +2652,7 @@ return { }, zathurarc = { install_info = { - revision = '6e7c8edfcd6f5f7c12b2fa9ffc6d042f1b6d7068', + revision = '0554b4a5d313244b7fc000cbb41c04afae4f4e31', url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', }, maintainers = { '@Freed-Wu' }, From ab230eadd4a96baec86fb17bd625893649f2612f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 10 Aug 2024 12:58:04 +0200 Subject: [PATCH 047/434] feat(config)!: remove auto_install use https://github.com/lewis6991/ts-install.nvim instead --- README.md | 3 - SUPPORTED_LANGUAGES.md | 6 +- doc/nvim-treesitter.txt | 3 - lua/nvim-treesitter/config.lua | 23 ------- lua/nvim-treesitter/parsers.lua | 110 ++++++++++++++++---------------- 5 files changed, 58 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index 5e487233f..ac2794af5 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,6 @@ require'nvim-treesitter'.setup { -- List of parsers to ignore installing ignore_install = { 'unsupported' }, - -- Automatically install missing parsers when entering buffer - auto_install = false, - -- Directory to install parsers and queries to install_dir = vim.fn.stdpath('data') .. '/site' } diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 028caeaff..fe389b55a 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -183,8 +183,8 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | core | `HFIJL` | @tk-shirasaka, @calebdw +[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | core | `HFIJL` | @tk-shirasaka, @calebdw [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 @@ -198,7 +198,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [prolog](https://github.com/foxyseta/tree-sitter-prolog) | community | `HFIJ ` | @foxyseta [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 +[proto](https://github.com/treywood/tree-sitter-proto) | community | `HFIJ ` | @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 diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index ef55eb2d8..9ba76be2a 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -45,9 +45,6 @@ To install supported parsers and queries, put this in your `init.lua` file: -- A list of parser names, or "core", "stable", "community", "unstable" ensure_install = { "core", "rust" }, - -- Automatically install missing parsers when entering buffer - auto_install = false, - -- List of parsers to ignore installing (for "core" etc.) ignore_install = { "javascript" }, } diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 704c8e87e..4781d5a21 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -3,14 +3,12 @@ local M = {} M.tiers = { 'stable', 'core', 'community', 'unsupported' } ---@class TSConfig ----@field auto_install boolean ---@field ensure_install string[] ---@field ignore_install string[] ---@field install_dir string ---@type TSConfig local config = { - auto_install = false, ensure_install = {}, ignore_install = { 'unsupported' }, install_dir = vim.fs.joinpath(vim.fn.stdpath('data'), 'site'), @@ -28,27 +26,6 @@ function M.setup(user_data) config = vim.tbl_deep_extend('force', config, user_data) end - if config.auto_install then - vim.api.nvim_create_autocmd('FileType', { - callback = function(args) - local buf = args.buf --- @type integer - local ft = vim.bo[buf].filetype - local lang = vim.treesitter.language.get_lang(ft) or ft - if - require('nvim-treesitter.parsers')[lang] - and not vim.list_contains(M.installed_parsers(), lang) - and not vim.list_contains(config.ignore_install, lang) - then - require('nvim-treesitter.install').install(lang, nil, function() - -- Need to pcall since 'FileType' can be triggered multiple times - -- per buffer - pcall(vim.treesitter.start, buf, lang) - end) - end - end, - }) - end - if #config.ensure_install > 0 then local to_install = M.norm_languages(config.ensure_install, { ignored = true, installed = true }) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 5d01f968b..685e2dffe 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = '31182d43b062a350d4bd2449f2fc0d5654972be9', + revision = 'c2d1f6d4c5f1993afce7f984ca2675af8d67457c', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -29,7 +29,7 @@ return { apex = { install_info = { location = 'apex', - revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', + revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -47,7 +47,7 @@ return { }, asm = { install_info = { - revision = '2a35fccebcc08aa8b6c7bb3cff1f07cf0f8cff83', + revision = '55b2b913f1e71136027d6fce8212e760c64f3532', url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, @@ -161,7 +161,7 @@ return { }, c = { install_info = { - revision = 'be23d2c9d8e5b550e713ef0f86126a248462ca6e', + revision = '927da1f210ebb24b7f109230a61a55b428875985', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -233,7 +233,7 @@ return { }, comment = { install_info = { - revision = '5d8b29f6ef3bf64d59430dcfe76b31cc44b5abfd', + revision = '3555706cef8b98d3e4c7379d7260548ff03ad363', url = 'https://github.com/stsewd/tree-sitter-comment', }, maintainers = { '@stsewd' }, @@ -275,7 +275,7 @@ return { cpp = { install_info = { generate_from_json = true, - revision = '0b4aa47f07d958a49260aadc87e8474b03897c23', + revision = 'b1a4e2b25148f3cfcb5f241cbc4c49f001a6fb35', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -284,7 +284,7 @@ return { }, css = { install_info = { - revision = 'f6be52c3d1cdb1c5e4dd7d8bce0a57497f55d6af', + revision = '9af0bdd9d225edee12f489cfa8284e248321959b', url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, @@ -303,7 +303,7 @@ return { cuda = { install_info = { generate_from_json = true, - revision = '7c97acb8398734d790c86210c53c320df61ff66b', + revision = '8812343a1f8496fc219f3d07a270f9c1d6ba3391', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -336,7 +336,7 @@ return { }, dart = { install_info = { - revision = 'ac0bb849ccd1a923963af47573b5e396736ff582', + revision = 'cf72df5d4a623ca705e81bf9e9d264e1fe9d5da0', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -503,7 +503,7 @@ return { }, embedded_template = { install_info = { - revision = '38d5004a797298dc42c85e7706c5ceac46a3f29f', + revision = 'ffbf64942c334933ee7982e144557b6efb76d0b9', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 4, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '8f41b588fe38b981156651ef56b192ed3d158efd', + revision = '0b5a0dcfcedd9b397252cb5568cc55ab1905b1a9', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -716,7 +716,7 @@ return { }, glimmer = { install_info = { - revision = '6b25d265c990139353e1f7f97baf84987ebb7bf0', + revision = 'da605af8c5999b43e6839b575eae5e6cafabb06f', url = 'https://github.com/ember-tooling/tree-sitter-glimmer', }, maintainers = { '@NullVoxPopuli' }, @@ -727,7 +727,7 @@ return { install_info = { url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@NullVoxPopuli' }, requires = { 'ecma' }, @@ -737,7 +737,7 @@ return { install_info = { url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', files = { 'src/parser.c', 'src/scanner.c' }, - generate_requires_npm = true, + generate_from_json = true, }, maintainers = { '@NullVoxPopuli' }, requires = { 'typescript' }, @@ -772,7 +772,7 @@ return { }, go = { install_info = { - revision = '7ee8d928db5202f6831a78f8112fd693bf69f98b', + revision = '6204b7308a32e991a8daed2e9895a90be55a510a', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -780,7 +780,7 @@ return { }, goctl = { install_info = { - revision = 'f107937259c7ec4bb05f7e3d2c24b89ac36d4cc3', + revision = '49c43532689fe1f53e8b9e009d0521cab02c432b', url = 'https://github.com/chaozwn/tree-sitter-goctl', }, maintainers = { '@chaozwn' }, @@ -813,7 +813,7 @@ return { }, gotmpl = { install_info = { - revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', + revision = 'fd9e1c6647e5e9b23918d00d1e48710d0f703e19', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -853,7 +853,7 @@ return { }, groovy = { install_info = { - revision = '105ee343682b7eee86b38ec6858a269e16474a72', + revision = '171b3b7412bc93284fc0dad0a7a7bbbbd1b51289', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, @@ -917,7 +917,7 @@ return { helm = { install_info = { location = 'dialects/helm', - revision = '9d3f6e526dd074b9edae9070b7bb778f00e87a5b', + revision = 'fd9e1c6647e5e9b23918d00d1e48710d0f703e19', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -970,7 +970,7 @@ return { }, html = { install_info = { - revision = 'e4d834eb4918df01dcad5c27d1b15d56e3bd94cd', + revision = 'd11201a263d02169d303db903ba0bb13dc59e068', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -992,7 +992,7 @@ return { }, http = { install_info = { - revision = '5ae6c7cfa62a7d7325c26171a1de4f6b866702b5', + revision = 'bbcd67642e5749b90277c353b72e762f3be16993', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, @@ -1016,7 +1016,7 @@ return { }, idl = { install_info = { - revision = '7412851348d9d8ba93dc6abd5e60aba9b50a4811', + revision = '5573b295410201ed22771776b34d636900eba368', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1066,7 +1066,7 @@ return { }, janet_simple = { install_info = { - revision = 'ea842cb57a90865c8f50bcb4499de1a94860f3a4', + revision = '12bfab7db8a5f5b1d774ef84b5831acd34936071', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1074,7 +1074,7 @@ return { }, java = { install_info = { - revision = '953abfc8bb3eb2f578e1f461edba4a9885f974b8', + revision = '576d8097e495b411f31daaee28cb34c1752ac702', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1090,7 +1090,7 @@ return { }, javascript = { install_info = { - revision = '12e45374422f6051648717be62f0ffc40a279ee2', + revision = '15887341e5b57ffdb423aff840aef142b8f53d6d', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1136,7 +1136,7 @@ return { }, json = { install_info = { - revision = '94f5c527b2965465956c2000ed6134dd24daf2a7', + revision = 'bdd69eb8c8a58a9f54df03de0488d9990179be46', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1162,7 +1162,7 @@ return { }, jsonnet = { install_info = { - revision = 'd34615fa12cc1d1cfc1f1f1a80acc9db80ee4596', + revision = 'ddd075f1939aed8147b7aa67f042eda3fce22790', url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', }, maintainers = { '@nawordar' }, @@ -1215,7 +1215,7 @@ return { }, kotlin = { install_info = { - revision = '8d9d372b09fa4c3735657c5fc2ad03e53a5f05f5', + revision = 'dc5e8a14cb1f45582a8c221a270a199a5f8bdb63', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, @@ -1248,7 +1248,7 @@ return { latex = { install_info = { generate = true, - revision = 'efe5afdbb59b70214e6d70db5197dc945d5b213e', + revision = '90fd9894bebddce79f5b8041e7f82523364a619b', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1264,7 +1264,7 @@ return { }, leo = { install_info = { - revision = '304611b5eaf53aca07459a0a03803b83b6dfd3b3', + revision = 'f5ecaaa869a845e689399092cb9a61feca66cf12', url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, @@ -1280,7 +1280,7 @@ return { }, liquid = { install_info = { - revision = '7862a3424832c3a9d45eb21143b375837bd6573b', + revision = '4c19cc5b2b408de590f83497a90cc941ed59ea06', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1376,7 +1376,7 @@ return { }, matlab = { install_info = { - revision = '0d5a05e543af2de60cdb5e71f0f5888c95ab936f', + revision = '306c43ab28b7b8a4976e40ff0a7c26b019ad52df', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = 'affbd6f3b08155826a22cfa8373147acbf60f1f1', + revision = 'fd8cbd544bdff4acdfe1da63b403b5c591059aeb', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1440,7 +1440,7 @@ return { }, nickel = { install_info = { - revision = '3039ad9e9af3c1ffe049a04ee83a2b489915b0b9', + revision = '88d836a24b3b11c8720874a1a9286b8ae838d30a', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '486bb0337ee94575f53367b53bffeaea99063f2c', + revision = '537095ddc80cf610fa75a2a0149fe9799b011014', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '3a21d9cb2a20a062c17f8f53d5983fd473c4673c', + revision = '55fb764e6a94512ceeaa1b9e4d53f6103e0610b2', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = 'c07d69739ba71b5a449bdbb7735991f8aabf8546', + revision = 'a552625b56c19006932cff1f207ebc07b55ed12d', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'c07d69739ba71b5a449bdbb7735991f8aabf8546', + revision = 'a552625b56c19006932cff1f207ebc07b55ed12d', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1633,7 +1633,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '39da859947b94abdee43e431368e1ae975c0a424', + revision = '0bf8387987c21bf2f8ed41d2575a8f22b139687f', url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1778,7 +1778,7 @@ return { }, python = { install_info = { - revision = '0dee05ef958ba2eae88d1e65f24b33cad70d4367', + revision = '346fa42dc2990d2a2736cc60891369d0d3d8e65c', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1803,7 +1803,7 @@ return { qmljs = { install_info = { generate_from_json = true, - revision = 'febf48a5b6928600cd8fb2a01254743af550780d', + revision = 'cc4186f15e2829385be33440561fdd17b1c40cf7', url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, @@ -1967,7 +1967,7 @@ return { }, ruby = { install_info = { - revision = '0ffe457fb6aabf064f173fd30ea356845cef2513', + revision = '7dbc1e2d0e2d752577655881f73b4573f3fe85d4', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1983,7 +1983,7 @@ return { }, rust = { install_info = { - revision = '9c84af007b0f144954adb26b3f336495cbb320a7', + revision = '2b43eafe64470846cdaa0eaae1e287c120ee5f03', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -1991,7 +1991,7 @@ return { }, scala = { install_info = { - revision = 'be7184df70dd3b5790becfb2c93ba796b2797781', + revision = 'dd7fe4d7838ca751f5259718658dd309d999855b', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2025,7 +2025,7 @@ return { sflog = { install_info = { location = 'sflog', - revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', + revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, @@ -2052,7 +2052,7 @@ return { }, slint = { install_info = { - revision = '4a0558cc0fcd7a6110815b9bbd7cc12d7ab31e74', + revision = '34ccfd58d3baee7636f62d9326f32092264e8407', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2094,7 +2094,7 @@ return { soql = { install_info = { location = 'soql', - revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', + revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2103,7 +2103,7 @@ return { sosl = { install_info = { location = 'sosl', - revision = 'c47a639e1a0e5407ee39a8761ec1accebe6dacfc', + revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2130,7 +2130,7 @@ return { install_info = { branch = 'gh-pages', generate_from_json = true, - revision = 'c67ecbd37d8d12f22e4cc7138afd14bc20253e10', + revision = 'a8b10c76759a372d0f92bb070b4f5c993e0ce5f9', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2172,7 +2172,7 @@ return { styled = { install_info = { generate_from_json = true, - revision = '65835cca33a5f033bcde580ed66cde01c1fabbbe', + revision = 'e8bf912db4996b32515639d42fe2b258517f135e', url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, @@ -2224,7 +2224,7 @@ return { swift = { install_info = { generate = true, - revision = '769bb834feb2947f2c706d82830b0a05958727de', + revision = 'd627a54d7266f0a8ee61b447b34d0ad07dadf1d6', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2264,7 +2264,7 @@ return { }, tact = { install_info = { - revision = '91cc49a83f4f0b3a756bf7d0e65403a9cf757003', + revision = 'b3710fe2723bd9b285de7f3d0c0717bebf3f17bd', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2298,7 +2298,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = 'de0d0ee129cf643872e8e0d5c4a6589b5a3aae23', + revision = '58aed18580c476d7bc211f187e7b07a6cd12bb1f', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2486,7 +2486,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '7f80a0441ff2ca6aa8ced8e1ee87cead9dd26515', + revision = 'a18d695ec105f0cda1903d1974f493207e122b35', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2526,7 +2526,7 @@ return { }, vhs = { install_info = { - revision = '90028bbadb267ead5b87830380f6a825147f0c0f', + revision = '09f8fbfe40a3a699b200daca7d92e65fbbe9f9e6', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, From 83dae49a10d6eaedb77f0a26df921825341242d9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 27 Aug 2024 11:02:34 +0200 Subject: [PATCH 048/434] feat(install): allow specifying max jobs --- lua/nvim-treesitter/install.lua | 5 +++-- scripts/install-parsers.lua | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index f9a52461c..07be39d6d 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -23,7 +23,7 @@ local uv_symlink = a.wrap(uv.fs_symlink, 4) ---@type fun(path: string): string? local uv_unlink = a.wrap(uv.fs_unlink, 2) -local MAX_JOBS = 10 +local MAX_JOBS = 100 local INSTALL_TIMEOUT = 60000 ---@async @@ -402,6 +402,7 @@ end ---@class InstallOptions ---@field force? boolean ---@field generate? boolean +---@field max_jobs? integer --- Install a parser ---@param languages string[] @@ -425,7 +426,7 @@ local function install(languages, options, _callback) end) end - a.join(MAX_JOBS, nil, tasks) + a.join(options and options.max_jobs or MAX_JOBS, nil, tasks) if #tasks > 1 then a.main() log.info('Installed %d/%d languages', done, #tasks) diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index c607e51f4..756d34561 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -1,10 +1,13 @@ #!/usr/bin/env -S nvim -l local generate = false +local max_jobs = nil ---@as integer local parsers = {} for i = 1, #_G.arg do if _G.arg[i] == '--generate' then generate = true + elseif _G.arg[i]:find('^%-%-max%-jobs') then + max_jobs = _G.arg[i]:match('=(%d+)') else parsers[#parsers + 1] = _G.arg[i] end @@ -18,7 +21,7 @@ vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') local done = false require('nvim-treesitter.install').install( #parsers > 0 and parsers or 'all', - { force = true, generate = generate }, + { force = true, generate = generate, max_jobs = max_jobs }, function() done = true end From c5a8c9d01a12efbdee501d67dba7423b790fe500 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 18 Aug 2024 13:01:29 +0200 Subject: [PATCH 049/434] ci(tests): add optional workflow for generating grammars run on PR by adding label `ci:generate` or manually --- .github/workflows/lint.yml | 4 +- .github/workflows/test-core.yml | 55 ++++++++ .github/workflows/test-generate.yml | 20 +++ .github/workflows/test-queries.yml | 55 +------- SUPPORTED_LANGUAGES.md | 20 ++- lua/nvim-treesitter/parsers.lua | 206 ++++++++++++++-------------- 6 files changed, 201 insertions(+), 159 deletions(-) create mode 100644 .github/workflows/test-core.yml create mode 100644 .github/workflows/test-generate.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd97cda06..5c29559d0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Linting and style checking +name: Lint on: pull_request: @@ -34,7 +34,7 @@ jobs: args: --check . format-queries: - name: Lint queries + name: Format queries runs-on: ubuntu-latest env: NVIM_TAG: nightly diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml new file mode 100644 index 000000000..313084dab --- /dev/null +++ b/.github/workflows/test-core.yml @@ -0,0 +1,55 @@ +on: + workflow_call: + inputs: + type: + type: string + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + check_compilation: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + nvim_tag: [nightly] + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }} + steps: + - uses: actions/checkout@v4 + - uses: tree-sitter/setup-action/cli@v1 + - uses: ilammy/msvc-dev-cmd@v1 + + - name: Install and prepare Neovim + env: + NVIM_TAG: ${{ matrix.nvim_tag }} + run: | + bash ./scripts/ci-install.sh + + - if: inputs.type == 'generate' + name: Generate and compile parsers + run: $NVIM -l ./scripts/install-parsers.lua --generate --max-jobs=2 + + - if: inputs.type == 'queries' + name: Setup Parsers Cache + id: parsers-cache + uses: actions/cache@v4 + with: + path: | + ~/.local/share/nvim/site/parser/ + ~/AppData/Local/nvim-data/site/parser/ + key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles( + './lua/nvim-treesitter/install.lua', + './lua/nvim-treesitter/parsers.lua') }} + + - if: inputs.type == 'queries' + name: Compile parsers + run: $NVIM -l ./scripts/install-parsers.lua + + - name: Check query files + run: $NVIM -l ./scripts/check-queries.lua diff --git a/.github/workflows/test-generate.yml b/.github/workflows/test-generate.yml new file mode 100644 index 000000000..ae2f7bd1f --- /dev/null +++ b/.github/workflows/test-generate.yml @@ -0,0 +1,20 @@ +name: Generate from grammar + +on: + pull_request: + types: [unlabeled, labeled, opened, synchronize, reopened] + branches: + - "main" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + check_compilation: + name: Build + if: contains(github.event.pull_request.labels.*.name, 'ci:generate') || github.event_name == 'workflow_dispatch' + uses: ./.github/workflows/test-core.yml + with: + type: "generate" diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index 819924c43..a7d4ae79c 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -1,58 +1,17 @@ -name: Test queries +name: Check queries on: - # push: - # branches: - # - "main" pull_request: branches: - "main" -# Cancel any in-progress CI runs for a PR if it is updated concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -defaults: - run: - shell: bash + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: check_compilation: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-14] - nvim_tag: [nightly] - - name: Parser compilation - runs-on: ${{ matrix.os }} - env: - NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }} - steps: - - uses: actions/checkout@v4 - - uses: tree-sitter/setup-action/cli@v1 - - uses: ilammy/msvc-dev-cmd@v1 - - - name: Install and prepare Neovim - env: - NVIM_TAG: ${{ matrix.nvim_tag }} - run: | - bash ./scripts/ci-install.sh - - - name: Setup Parsers Cache - id: parsers-cache - uses: actions/cache@v4 - with: - path: | - ~/.local/share/nvim/site/parser/ - ~/AppData/Local/nvim-data/site/parser/ - key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles( - './lua/nvim-treesitter/install.lua', - './lua/nvim-treesitter/parsers.lua') }} - - - name: Compile parsers - run: $NVIM -l ./scripts/install-parsers.lua - - - name: Check query files - run: $NVIM -l ./scripts/check-queries.lua + name: Build + uses: ./.github/workflows/test-core.yml + with: + type: "queries" diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index fe389b55a..5f3832ddc 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -49,7 +49,7 @@ Language | Tier | Queries | Maintainer [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  J ` | @gbprod +[diff](https://github.com/the-mikedavis/tree-sitter-diff) | community | `HF J ` | @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 @@ -78,8 +78,11 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[fsharp](https://github.com/ionide/tree-sitter-fsharp) | community | `H  J ` | @nsidorenco [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 +[gap](https://github.com/gap-system/tree-sitter-gap)[^gap] | community | `HF JL` | @reiniscirpons +[gaptst](https://github.com/gap-system/tree-sitter-gaptst)[^gaptst] | community | `HF J ` | @reiniscirpons [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 @@ -88,7 +91,9 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[glimmer](https://github.com/ember-tooling/tree-sitter-glimmer)[^glimmer] | community | `HFIJL` | @NullVoxPopuli +[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | community | `H IJL` | @NullVoxPopuli +[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | community | `H IJ ` | @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 @@ -160,7 +165,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 ` | +[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unsupported | `HFIJ ` | [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 @@ -251,9 +256,10 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[superhtml](https://github.com/kristoff-it/superhtml) | community | `H  J ` | @rockorager [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 +[swift](https://github.com/alex-pinkus/tree-sitter-swift) | community | `HFIJL` | @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 [systemverilog](https://github.com/zhangwwpeng/tree-sitter-systemverilog) | community | `HF J ` | @zhangwwpeng @@ -304,9 +310,13 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) | stable | `HFIJL` | @amaanq +[ziggy](https://github.com/kristoff-it/ziggy) | community | `H I  ` | @rockorager +[ziggy_schema](https://github.com/kristoff-it/ziggy) | community | `H I  ` | @rockorager [^bp]: Android Blueprint [^ecma]: queries required by javascript, typescript, tsx, qmljs +[^gap]: GAP system +[^gaptst]: GAP system test files [^gdscript]: Godot [^glimmer]: Glimmer and Ember [^godot_resource]: Godot Resources diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 685e2dffe..48f86b11a 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = 'c2d1f6d4c5f1993afce7f984ca2675af8d67457c', + revision = '745d3c65c2294aca1110b6b6ad6805124be605c9', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -29,7 +29,7 @@ return { apex = { install_info = { location = 'apex', - revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', + revision = '779684231107cef4d86ac16f74320e9324680da3', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -38,7 +38,7 @@ return { arduino = { install_info = { generate_from_json = true, - revision = 'afb34b2c65f507932c5c6ddbf0d5a9ca6a772f2f', + revision = '415ebc8f75eb02a748faa03f5af199f08ced120f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -73,14 +73,14 @@ return { }, awk = { install_info = { - revision = 'ba7472152d79a8c916550c80fdbfd5724d07a0c9', + revision = '553fdc4afb3b603332c3f4baf50c711506f4e797', url = 'https://github.com/Beaglefoot/tree-sitter-awk', }, tier = 4, }, bash = { install_info = { - revision = '2fbd860f802802ca76a6661ce025b3a3bca2d3ed', + revision = 'c8713e50f0bd77d080832fc61ad128bc8f2934e9', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -161,7 +161,7 @@ return { }, c = { install_info = { - revision = '927da1f210ebb24b7f109230a61a55b428875985', + revision = 'f4c21152f1952a99f4744e8c41d3ffb8038ae78c', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -169,7 +169,7 @@ return { }, c_sharp = { install_info = { - revision = '31a64b28292aac6adf44071e449fa03fb80eaf4e', + revision = 'fd7f7402db6e66afd70b402fb2e367b2d71c10d6', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -275,7 +275,7 @@ return { cpp = { install_info = { generate_from_json = true, - revision = 'b1a4e2b25148f3cfcb5f241cbc4c49f001a6fb35', + revision = '30d2fa385735378388a55917e2910965fce19748', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -284,7 +284,7 @@ return { }, css = { install_info = { - revision = '9af0bdd9d225edee12f489cfa8284e248321959b', + revision = 'a68fcd1e6b03118d1e92ffa45e7ab7a39d52d3f7', url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, @@ -303,7 +303,7 @@ return { cuda = { install_info = { generate_from_json = true, - revision = '8812343a1f8496fc219f3d07a270f9c1d6ba3391', + revision = '635e8aa3747823a0c4e9660c07cef76fe8d3ef93', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -328,7 +328,7 @@ return { }, d = { install_info = { - revision = 'ac584585a15c4cacd6cda8e6bfe7cb1ca7b3898e', + revision = '45e5f1e9d6de2c68591bc8e5ec662cf18e950b4a', url = 'https://github.com/gdamore/tree-sitter-d', }, maintainers = { '@amaanq' }, @@ -336,7 +336,7 @@ return { }, dart = { install_info = { - revision = 'cf72df5d4a623ca705e81bf9e9d264e1fe9d5da0', + revision = '9ac03bb2154316624fb4c41fe0f372a5f1597b43', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -352,7 +352,7 @@ return { }, devicetree = { install_info = { - revision = '296b3c294a8bcfca6673296d99f9cd37049b8026', + revision = '07a647c8fb70e6b06379a60526721e3141aa2fd2', url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, @@ -425,7 +425,7 @@ return { }, earthfile = { install_info = { - revision = 'b0a9bc5737340a9b80b489fe9ae93d7b2fe78cd7', + revision = '1d637f2002bb8b22d4c08d26ad2bfbc22916f3ce', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -447,7 +447,7 @@ return { }, editorconfig = { install_info = { - revision = 'fd0d64d2fc91eab903bed4c11ce280b62e46f16e', + revision = 'a761198025448c77ea11bcf22505b395a77fc0d0', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -471,7 +471,7 @@ return { }, elixir = { install_info = { - revision = 'c7ae8b77e2749826dcf23df6514f08fdd68c66a3', + revision = 'ef124b83a3f3572b0af23db4efae3f8de06a15e1', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -479,7 +479,7 @@ return { }, elm = { install_info = { - revision = '09dbf221d7491dc8d8839616b27c21b9c025c457', + revision = '27f502ed0a1cbd3c5912d284cc7934ee0d4cdddc', url = 'https://github.com/elm-tooling/tree-sitter-elm', }, maintainers = { '@zweimach' }, @@ -503,7 +503,7 @@ return { }, embedded_template = { install_info = { - revision = 'ffbf64942c334933ee7982e144557b6efb76d0b9', + revision = '62b0a6e45900a7dff7c37da95fec20a09968ba52', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 4, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '0b5a0dcfcedd9b397252cb5568cc55ab1905b1a9', + revision = 'f1919a34af3a9c79402c4a3d6c52986e9c2ea949', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = '6b633433fb3f132f21250cf8e8be76d5a6389b7e', + revision = '4a593dda9cbc050a6686187249f8350ceea292ce', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -607,8 +607,8 @@ return { }, fsharp = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'fsharp', + revision = '5202637c203fcf8876affbd18b04ff43256d4c4a', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -632,8 +632,8 @@ return { }, gap = { install_info = { + revision = '141b063335e85299bde3f61b4888d02d674a1abc', url = 'https://github.com/gap-system/tree-sitter-gap', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@reiniscirpons' }, readme_note = 'GAP system', @@ -641,8 +641,8 @@ return { }, gaptst = { install_info = { + revision = 'e0723dc6136309b3d5904dad2c73ef71267428c1', url = 'https://github.com/gap-system/tree-sitter-gaptst', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@reiniscirpons' }, readme_note = 'GAP system test files', @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = '426e67087fd62be5f4533581b5916b2cf010fb5b', + revision = '57c9951b290c8084d7c60b0aee7a2b30986ea031', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -725,9 +725,9 @@ return { }, glimmer_javascript = { install_info = { - url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = 'a260911201684f80cf815418b3771e6c39309f81', + url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', }, maintainers = { '@NullVoxPopuli' }, requires = { 'ecma' }, @@ -735,9 +735,9 @@ return { }, glimmer_typescript = { install_info = { - url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', - files = { 'src/parser.c', 'src/scanner.c' }, generate_from_json = true, + revision = '9d018a0f93417e6951264a26093b89ee63df7315', + url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', }, maintainers = { '@NullVoxPopuli' }, requires = { 'typescript' }, @@ -746,7 +746,7 @@ return { glsl = { install_info = { generate_from_json = true, - revision = 'ddc3137a2d775aca93084ff997fa13cc1691058a', + revision = '66aec57f7119c7e8e40665b723cd7af5594f15ee', url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', }, maintainers = { '@theHamsta' }, @@ -772,7 +772,7 @@ return { }, go = { install_info = { - revision = '6204b7308a32e991a8daed2e9895a90be55a510a', + revision = 'ecc20866d1bd4d80f3aef06456ed3014d4d598e6', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -797,7 +797,7 @@ return { }, gomod = { install_info = { - revision = '1f55029bacd0a6a11f6eb894c4312d429dcf735c', + revision = '3b01edce2b9ea6766ca19328d1850e456fde3103', url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, maintainers = { '@camdencheek' }, @@ -853,7 +853,7 @@ return { }, groovy = { install_info = { - revision = '171b3b7412bc93284fc0dad0a7a7bbbbd1b51289', + revision = '0d8884514fe10c4fa47527d9a0284d207f38ddea', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, @@ -884,7 +884,7 @@ return { }, haskell = { install_info = { - revision = 'a50070d5bb5bd5c1281740a6102ecf1f4b0c4f19', + revision = '558b997049fddcb07fc513528189c57d6129a260', url = 'https://github.com/tree-sitter/tree-sitter-haskell', }, maintainers = { '@mrcjkb' }, @@ -936,7 +936,7 @@ return { hlsl = { install_info = { generate_from_json = true, - revision = '5d788a46727c8199a7c63a3c849092e0364375b6', + revision = '543930235970a04c2f0d549c9e88815847c7a74a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', }, maintainers = { '@theHamsta' }, @@ -970,7 +970,7 @@ return { }, html = { install_info = { - revision = 'd11201a263d02169d303db903ba0bb13dc59e068', + revision = '14bdaf0da9e26e2de9b30178c2242539d2b0b285', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -992,7 +992,7 @@ return { }, http = { install_info = { - revision = 'bbcd67642e5749b90277c353b72e762f3be16993', + revision = '231f1b1bafd12e46c8ed8c21dbbdd940d9f15e94', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, @@ -1000,7 +1000,7 @@ return { }, hurl = { install_info = { - revision = 'fba6ed8db3a009b9e7d656511931b181a3ee5b08', + revision = 'ff07a42d9ec95443b5c1b57ed793414bf7b79be5', url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, @@ -1032,7 +1032,7 @@ return { }, ini = { install_info = { - revision = '87176e524f0a98f5be75fa44f4f0ff5c6eac069c', + revision = '962568c9efa71d25720ab42c5d36e222626ef3a6', url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, @@ -1040,7 +1040,7 @@ return { }, inko = { install_info = { - revision = '234c87be1dac20f766ddf6f486a7bde2a4bc5594', + revision = '6f9c072d023c3886aabcd8012274461b35d2d0a9', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, @@ -1074,7 +1074,7 @@ return { }, java = { install_info = { - revision = '576d8097e495b411f31daaee28cb34c1752ac702', + revision = '490d878cf33b0ad5ae7a7253ff30597a5bdc348e', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1090,7 +1090,7 @@ return { }, javascript = { install_info = { - revision = '15887341e5b57ffdb423aff840aef142b8f53d6d', + revision = 'b6f0624c1447bc209830b195999b78a56b10a579', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1128,7 +1128,7 @@ return { }, jsdoc = { install_info = { - revision = '49fde205b59a1d9792efc21ee0b6d50bbd35ff14', + revision = 'bc09606fc786ead131a301e4b7524888f2d5c517', url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', }, maintainers = { '@steelsojka' }, @@ -1136,7 +1136,7 @@ return { }, json = { install_info = { - revision = 'bdd69eb8c8a58a9f54df03de0488d9990179be46', + revision = '8bfdb43f47ad805bb1ce093203cfcbaa8ed2c571', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1175,7 +1175,7 @@ return { }, julia = { install_info = { - revision = 'a528de39923448e6b809a6b9f686f3472728f202', + revision = '3520b57e418f734f582215181ecd926a6178c90f', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, @@ -1215,7 +1215,7 @@ return { }, kotlin = { install_info = { - revision = 'dc5e8a14cb1f45582a8c221a270a199a5f8bdb63', + revision = 'ec985672ff21f7fd7f835869d8021e8f87304bb4', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, @@ -1223,7 +1223,7 @@ return { }, koto = { install_info = { - revision = 'd4109879ba1387d19095269a7473bd7d274ab848', + revision = 'cbf637e5163065934c827d254b293f4d2f08f523', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1239,7 +1239,7 @@ return { }, lalrpop = { install_info = { - revision = '854a40e99f7c70258e522bdb8ab584ede6196e2e', + revision = '194c25539f435de415ee0551a5f07058833da915', url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, @@ -1248,7 +1248,7 @@ return { latex = { install_info = { generate = true, - revision = '90fd9894bebddce79f5b8041e7f82523364a619b', + revision = '87e4059f01bed363230dc349f794ce4cc580e862', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1264,7 +1264,7 @@ return { }, leo = { install_info = { - revision = 'f5ecaaa869a845e689399092cb9a61feca66cf12', + revision = '6ca11a96fc2cab51217e0cf4a2f9ed3ea63e28fb', url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, @@ -1280,7 +1280,7 @@ return { }, liquid = { install_info = { - revision = '4c19cc5b2b408de590f83497a90cc941ed59ea06', + revision = '23ac814111e2b4b4b083e2c92219af2d5b74d13d', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1304,7 +1304,7 @@ return { }, lua = { install_info = { - revision = 'a24dab177e58c9c6832f96b9a73102a0cfbced4a', + revision = '99fc677e6971c425e8d407f59c77ab897e585c92', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1356,7 +1356,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', + revision = 'b7eba93e6a3e588e259e831416ac11abdaa8616a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1367,7 +1367,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '7fe453beacecf02c86f7736439f238f5bb8b5c9b', + revision = 'b7eba93e6a3e588e259e831416ac11abdaa8616a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = 'fd8cbd544bdff4acdfe1da63b403b5c591059aeb', + revision = '5da32586f41659cc566d6f8145f9aaff3b842c96', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1440,7 +1440,7 @@ return { }, nickel = { install_info = { - revision = '88d836a24b3b11c8720874a1a9286b8ae838d30a', + revision = 'ddaa2bc22355effd97c0d6b09ff5962705c6368d', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '537095ddc80cf610fa75a2a0149fe9799b011014', + revision = '8be0e516904650a868639aa8d3923ebe84f62627', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '036226e5edb410aec004cc7ac0f4b2014dd04a0e', + revision = '5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '036226e5edb410aec004cc7ac0f4b2014dd04a0e', + revision = '5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1543,7 +1543,7 @@ return { }, odin = { install_info = { - revision = 'd37b8f24f653378b268ec18404e9c14ad355b128', + revision = '3fee7964bbfb2554deef12c224344f3870d15375', url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', }, maintainers = { '@amaanq' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '55fb764e6a94512ceeaa1b9e4d53f6103e0610b2', + revision = '81c57e274c541c30d6c204c8dbceb90ec647ed8d', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = 'a552625b56c19006932cff1f207ebc07b55ed12d', + revision = '07a04599ed9ac97f82c6383a24ae139a807930f3', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'a552625b56c19006932cff1f207ebc07b55ed12d', + revision = '07a04599ed9ac97f82c6383a24ae139a807930f3', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1607,7 +1607,7 @@ return { phpdoc = { install_info = { generate_from_json = true, - revision = '1d0e255b37477d0ca46f1c9e9268c8fa76c0b3fc', + revision = 'df5e7da4b83da072f99135079ac3436550b8d67d', url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', }, maintainers = { '@mikehaertl' }, @@ -1659,7 +1659,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = 'fc15514b2f1dbba9c58528d15a3708f89eda6a01', + revision = 'ebe2ab2f642eda2072c68c8de02e83973c26f33c', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1778,7 +1778,7 @@ return { }, python = { install_info = { - revision = '346fa42dc2990d2a2736cc60891369d0d3d8e65c', + revision = '8c65e256f971812276ff2a69a2f515c218ed7f82', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1786,7 +1786,7 @@ return { }, ql = { install_info = { - revision = '42becd6f8f7bae82c818fa3abb1b6ff34b552310', + revision = 'c73c31c89cb0019ef56fe8bc1723e7c36e0be607', url = 'https://github.com/tree-sitter/tree-sitter-ql', }, maintainers = { '@pwntester' }, @@ -1821,7 +1821,7 @@ return { }, r = { install_info = { - revision = 'b1e211f52ad8f8e1e182bbbcc16dcd5e3688eb7d', + revision = '2097fa502efa21349d26af0ffee55d773015e481', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1829,7 +1829,7 @@ return { }, racket = { install_info = { - revision = '171f52a8c0ed635b85cd42d1e36d82f1066a03b4', + revision = '5b211bf93021d1c45f39aa96898be9f794f087e4', url = 'https://github.com/6cdh/tree-sitter-racket', }, tier = 4, @@ -1870,7 +1870,7 @@ return { }, re2c = { install_info = { - revision = '47aa19cf5f7aba2ed30e2b377f7172df76e819a6', + revision = 'c18a3c2f4b6665e35b7e50d6048ea3cff770c572', url = 'https://github.com/tree-sitter-grammars/tree-sitter-re2c', }, maintainers = { '@amaanq' }, @@ -1878,7 +1878,7 @@ return { }, readline = { install_info = { - revision = '3d4768b04d7cfaf40533e12b28672603428b8f31', + revision = '74addc90fc539d31d413c0c7cf7581997a7fa46e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-readline', }, maintainers = { '@ribru17' }, @@ -1886,7 +1886,7 @@ return { }, regex = { install_info = { - revision = '47007f195752d8e57bda80b0b6cdb2d173a9f7d7', + revision = 'f70251e1f1d72bd6dc1f897f956f9112f8668441', url = 'https://github.com/tree-sitter/tree-sitter-regex', }, maintainers = { '@theHamsta' }, @@ -1967,7 +1967,7 @@ return { }, ruby = { install_info = { - revision = '7dbc1e2d0e2d752577655881f73b4573f3fe85d4', + revision = '0b4729672f9aec4810c01a0f971541dcb433fef5', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1983,7 +1983,7 @@ return { }, rust = { install_info = { - revision = '2b43eafe64470846cdaa0eaae1e287c120ee5f03', + revision = '6b7d1fc73ded57f73b1619bcf4371618212208b1', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -1991,7 +1991,7 @@ return { }, scala = { install_info = { - revision = 'dd7fe4d7838ca751f5259718658dd309d999855b', + revision = '2cfbb6e3fcdfd51e0d477a43cc37ae8c6f87dc2e', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2008,7 +2008,7 @@ return { }, scheme = { install_info = { - revision = '8f9dff3d038f09934db5ea113cebc59c74447743', + revision = '63e25a4a84142ae7ee0ee01fe3a32c985ca16745', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 4, @@ -2025,7 +2025,7 @@ return { sflog = { install_info = { location = 'sflog', - revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', + revision = '779684231107cef4d86ac16f74320e9324680da3', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, @@ -2035,7 +2035,7 @@ return { slang = { install_info = { generate_from_json = true, - revision = 'd84b43d75d65bbc4ba57166ce17555f32c0b8983', + revision = 'dd991eb3b6957a33d9044e0f5914588f7f449a78', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2052,7 +2052,7 @@ return { }, slint = { install_info = { - revision = '34ccfd58d3baee7636f62d9326f32092264e8407', + revision = '4e2765d4cac1f03ada6f635eeb6008d1d0aff5a3', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2094,7 +2094,7 @@ return { soql = { install_info = { location = 'soql', - revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', + revision = '779684231107cef4d86ac16f74320e9324680da3', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2103,7 +2103,7 @@ return { sosl = { install_info = { location = 'sosl', - revision = '602cc4b050ef1e14a69acc2ea094968bf928fa59', + revision = '779684231107cef4d86ac16f74320e9324680da3', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2172,7 +2172,7 @@ return { styled = { install_info = { generate_from_json = true, - revision = 'e8bf912db4996b32515639d42fe2b258517f135e', + revision = '764af55fc6b8e5ae177eb272f5c5de6238db23e6', url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, @@ -2180,7 +2180,7 @@ return { }, supercollider = { install_info = { - revision = 'affa4389186b6939d89673e1e9d2b28364f5ca6f', + revision = '1a8ee0da9a4f2df5a8a22f4d637ac863623a78a7', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, @@ -2188,8 +2188,8 @@ return { }, superhtml = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, location = 'tree-sitter-superhtml', + revision = '3edb67236291d45ba97a79cdac3b91692487a352', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2206,7 +2206,7 @@ return { svelte = { install_info = { generate_from_json = true, - revision = '7ab8221e3f378a3b04b4b488f07c1f408c5bd0d8', + revision = '774a65aea563accc35f5d45fafa4d96ec5761f57', url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', }, maintainers = { '@amaanq' }, @@ -2224,7 +2224,7 @@ return { swift = { install_info = { generate = true, - revision = 'd627a54d7266f0a8ee61b447b34d0ad07dadf1d6', + revision = '4bff50b78b4d3c0517e4d0f0a344aca165f00146', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2264,7 +2264,7 @@ return { }, tact = { install_info = { - revision = 'b3710fe2723bd9b285de7f3d0c0717bebf3f17bd', + revision = '09c57b6b9759560b4d067e0546c9953ee0e065da', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2272,7 +2272,7 @@ return { }, tcl = { install_info = { - revision = '8784024358c233efd0f3a6fd9e7a3c5852e628bc', + revision = 'cdba4ab96a9896492d0d5219b70300c8783ca4e7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, @@ -2298,7 +2298,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = '58aed18580c476d7bc211f187e7b07a6cd12bb1f', + revision = '80d1a04e6bf3ced1c924bcb05527aa2eaf3f6239', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2316,7 +2316,7 @@ return { }, textproto = { install_info = { - revision = '8dacf02aa402892c91079f8577998ed5148c0496', + revision = 'd900077aef9f5dcb0d47c86be33585013ed5db9a', url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', }, maintainers = { '@Porter' }, @@ -2340,7 +2340,7 @@ return { }, tlaplus = { install_info = { - revision = 'bba02e79f85e335f310fc95e21c677e49f2c4439', + revision = 'da9cf9793686e236327aadfbad449414c895bf84', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2384,7 +2384,7 @@ return { install_info = { generate_from_json = true, location = 'tsx', - revision = '198d03553f43a45b92ac5d0ee167db3fec6a6fd6', + revision = '9951831c5f05be434514dce38b30eef213667601', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2411,7 +2411,7 @@ return { install_info = { generate_from_json = true, location = 'typescript', - revision = '198d03553f43a45b92ac5d0ee167db3fec6a6fd6', + revision = '9951831c5f05be434514dce38b30eef213667601', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2461,7 +2461,7 @@ return { unison = { install_info = { generate = true, - revision = '59d36a09282be7e4d3374854126590f3dcebee6e', + revision = 'bc06e1eb100e1c0fab9bd89a9ca55d646ac80fc4', url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, @@ -2486,7 +2486,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = 'a18d695ec105f0cda1903d1974f493207e122b35', + revision = 'bc5b3caa85f7a8d4597f51aeaf92b83162ed6b33', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2518,7 +2518,7 @@ return { }, vhdl = { install_info = { - revision = '4ab3e251eae8890a020d083d00acd1b8c2653c07', + revision = '3f13cd14952b39ccf6817f58880834b84565ca54', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2586,7 +2586,7 @@ return { }, wing = { install_info = { - revision = 'bd1d35cf3e013dc7e189b46a593bdc2b281b0dd7', + revision = '76e0c25844a66ebc6e866d690fcc5f4e90698947', url = 'https://github.com/winglang/tree-sitter-wing', }, maintainers = { '@gshpychka', '@MarkMcCulloh' }, @@ -2594,7 +2594,7 @@ return { }, wit = { install_info = { - revision = 'c52f0b07786603df17ad0197f6cef680f312eb2c', + revision = '81490b4e74c792369e005f72b0d46fe082d3fed2', url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, @@ -2660,28 +2660,26 @@ return { }, zig = { install_info = { - revision = '0d08703e4c3f426ec61695d7617415fff97029bd', + revision = 'eb7d58c2dc4fbeea4745019dee8df013034ae66b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, tier = 1, }, - ziggy = { install_info = { - url = 'https://github.com/kristoff-it/ziggy', - files = { 'src/parser.c' }, location = 'tree-sitter-ziggy', + revision = '42b6f5d7320340bc5903c4c29d34065e8517a549', + url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, tier = 3, }, - ziggy_schema = { install_info = { - url = 'https://github.com/kristoff-it/ziggy', - files = { 'src/parser.c' }, location = 'tree-sitter-ziggy-schema', + revision = '42b6f5d7320340bc5903c4c29d34065e8517a549', + url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, tier = 3, From a2841d29d73db53e4d9767e012ddd5da39898a42 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 6 Oct 2024 12:02:32 +0200 Subject: [PATCH 050/434] feat(install)!: bump minimum tree-sitter version to 0.24 --- README.md | 4 +-- lua/nvim-treesitter/health.lua | 4 +-- lua/nvim-treesitter/install.lua | 1 - lua/nvim-treesitter/parsers.lua | 44 ++++++++++++++++----------------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ac2794af5..8523a75e1 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ The `nvim-treesitter` plugin provides ## Requirements -- Neovim 0.10.0 or later (nightly) +- Neovim 0.11.0 or later (nightly) - `tar` and `curl` in your path (or alternatively `git`) -- [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) CLI (0.22.6 or later) +- [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) CLI (0.24.0 or later) - a C compiler in your path (see ) ## Installation diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 30c3345d3..1776cffe7 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -7,7 +7,7 @@ local health = vim.health local M = {} local NVIM_TREESITTER_MINIMUM_ABI = 13 -local TREE_SITTER_MIN_VER = { 0, 22, 6 } +local TREE_SITTER_MIN_VER = { 0, 25, 1 } ---@param name string ---@return table? @@ -24,7 +24,7 @@ local function install_health() health.start('Requirements') do -- nvim check - if vim.fn.has('nvim-0.10') ~= 1 then + if vim.fn.has('nvim-0.11') ~= 1 then health.error('Nvim-treesitter requires the latest Neovim nightly') end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 07be39d6d..4e0c4485f 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -145,7 +145,6 @@ local function do_generate(logger, repo, compile_location) local r = system({ 'tree-sitter', 'generate', - '--no-bindings', '--abi', tostring(vim.treesitter.language_version), repo.generate_from_json and 'src/grammar.json', diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 48f86b11a..002469356 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -29,7 +29,7 @@ return { apex = { install_info = { location = 'apex', - revision = '779684231107cef4d86ac16f74320e9324680da3', + revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = '69d7a8b0f7493b0dbb07d54e8fea96c5421e8a71', + revision = 'f2569dd1fce0f252097a25bcbcb9ed8898840310', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -447,7 +447,7 @@ return { }, editorconfig = { install_info = { - revision = 'a761198025448c77ea11bcf22505b395a77fc0d0', + revision = 'efbe0b2f2eaa248e8c657a80a8c2305056bda477', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -1215,7 +1215,7 @@ return { }, kotlin = { install_info = { - revision = 'ec985672ff21f7fd7f835869d8021e8f87304bb4', + revision = '76f53c48d29e8588934fb55b0240d7bdfe00bfe5', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, @@ -1296,7 +1296,7 @@ return { }, llvm = { install_info = { - revision = '1b96e58faf558ce057d4dc664b904528aee743cb', + revision = 'c14cb839003348692158b845db9edda201374548', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = 'bd17c824196ce70800f64ad39cfddd1b17acc13f', + revision = 'c5fffb8edd39f22644084ab3f73a924a75721ee3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = '5da32586f41659cc566d6f8145f9aaff3b842c96', + revision = '0238b7fb6a630f77b3fc8b8a48285ef6ed45cbcc', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '8be0e516904650a868639aa8d3923ebe84f62627', + revision = '456b14a2fa6315abc7e02fcffaf4a1f35d4955d3', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '81c57e274c541c30d6c204c8dbceb90ec647ed8d', + revision = '76ab9a52b9dd2a1758aae3da8286519d995037e9', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1607,7 +1607,7 @@ return { phpdoc = { install_info = { generate_from_json = true, - revision = 'df5e7da4b83da072f99135079ac3436550b8d67d', + revision = 'fe3202e468bc17332bec8969f2b50ff1f1da3a46', url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', }, maintainers = { '@mikehaertl' }, @@ -1615,7 +1615,7 @@ return { }, pioasm = { install_info = { - revision = '924aadaf5dea2a6074d72027b064f939acf32e20', + revision = 'afece58efdb30440bddd151ef1347fa8d6f744a9', url = 'https://github.com/leo60228/tree-sitter-pioasm', }, maintainers = { '@leo60228' }, @@ -2025,7 +2025,7 @@ return { sflog = { install_info = { location = 'sflog', - revision = '779684231107cef4d86ac16f74320e9324680da3', + revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, @@ -2094,7 +2094,7 @@ return { soql = { install_info = { location = 'soql', - revision = '779684231107cef4d86ac16f74320e9324680da3', + revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2103,7 +2103,7 @@ return { sosl = { install_info = { location = 'sosl', - revision = '779684231107cef4d86ac16f74320e9324680da3', + revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2189,7 +2189,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '3edb67236291d45ba97a79cdac3b91692487a352', + revision = '36f37aa5aa440805f27d4a9f5203e616a303c6a1', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2224,7 +2224,7 @@ return { swift = { install_info = { generate = true, - revision = '4bff50b78b4d3c0517e4d0f0a344aca165f00146', + revision = 'a6ec57ad4d12c68d952ba1f869bd373a7ac95832', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2264,7 +2264,7 @@ return { }, tact = { install_info = { - revision = '09c57b6b9759560b4d067e0546c9953ee0e065da', + revision = '83e264928fa194b7283428527259e88e54205264', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2289,7 +2289,7 @@ return { teal = { install_info = { generate = true, - revision = '19b02da829d1721a521bf7b802eb80a50bd53aab', + revision = '485fbdc00d811b01b2090dff4d0469fd1d0350f5', url = 'https://github.com/euclidianAce/tree-sitter-teal', }, maintainers = { '@euclidianAce' }, @@ -2298,7 +2298,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = '80d1a04e6bf3ced1c924bcb05527aa2eaf3f6239', + revision = 'e3e894ef9e490c3d36d94a51458ec55480991730', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2436,7 +2436,7 @@ return { }, typst = { install_info = { - revision = 'abe60cbed7986ee475d93f816c1be287f220c5d8', + revision = '8b8b16ef1b40cbecbe3f754b1c1c966b5a0904fe', url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, @@ -2486,7 +2486,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = 'bc5b3caa85f7a8d4597f51aeaf92b83162ed6b33', + revision = 'ea538758a1273b59774dc9179cde460d9c73fd89', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2518,7 +2518,7 @@ return { }, vhdl = { install_info = { - revision = '3f13cd14952b39ccf6817f58880834b84565ca54', + revision = 'd6e8301999336b47d663052d43f983c3edeb01dd', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, From aaf5b7fdf7664581601063f7804cff02e849525e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 12 Oct 2024 20:14:21 +0200 Subject: [PATCH 051/434] fix(install): return error code in callback --- SUPPORTED_LANGUAGES.md | 20 +- lua/nvim-treesitter/install.lua | 13 +- lua/nvim-treesitter/parsers.lua | 332 +++++++++++------------ lua/nvim-treesitter/util.lua | 2 - runtime/queries/ada/injections.scm | 3 - runtime/queries/beancount/injections.scm | 3 - runtime/queries/unison/injections.scm | 3 + runtime/queries/verilog/injections.scm | 3 + scripts/install-parsers.lua | 11 +- 9 files changed, 202 insertions(+), 188 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 5f3832ddc..61cebafa2 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -33,6 +33,7 @@ Language | Tier | Queries | Maintainer [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 +[circom](https://github.com/Decurity/tree-sitter-circom) | community | `HF JL` | @alexandr-martirosyan [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 @@ -45,8 +46,10 @@ Language | Tier | Queries | Maintainer [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 +[cylc](https://github.com/elliotfontaine/tree-sitter-cylc) | community | `HFIJ ` | @elliotfontaine [d](https://github.com/gdamore/tree-sitter-d) | community | `HFIJL` | @amaanq [dart](https://github.com/UserNobody14/tree-sitter-dart) | community | `HFIJL` | @akinsho +[desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) | community | `HF J ` | @ValdezFOmar [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 | `HF J ` | @gbprod @@ -106,6 +109,7 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[gren](https://github.com/MaeBrooks/tree-sitter-gren) | community | `H  J ` | @MaeBrooks [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 ` | @@ -123,12 +127,14 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 +[http](https://github.com/rest-nvim/tree-sitter-http) | community | `HF 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 IJ ` | @cathaysia +[idris](https://github.com/kayhide/tree-sitter-idris) | community | `     ` | @srghma [ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF J ` | @theHamsta [inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | @yorickpeterse +[ipkg](https://github.com/srghma/tree-sitter-ipkg) | community | `HFIJL` | @srghma [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 @@ -140,7 +146,7 @@ html_tags (queries only)[^html_tags] | community | `H IJ ` | @TravonteD [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 +[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | @fredrikekre [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 @@ -177,6 +183,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [ninja](https://github.com/alemuller/tree-sitter-ninja) | community | `HFIJ ` | @alemuller [nix](https://github.com/cstrahan/tree-sitter-nix) | community | `HFIJL` | @leo60228 [nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | core | `HFIJL` | @amaanq +[nu](https://github.com/nushell/tree-sitter-nu) | community | `H IJ ` | @abhisheksingh0x558 [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 @@ -233,6 +240,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[runescript](https://github.com/2004Scape/tree-sitter-runescript) | community | `H  J ` | @2004Scape [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://github.com/rockorager/tree-sitter-scfg) | unsupported | `H  J ` | @WhyNotHugo @@ -240,6 +248,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFIJ ` | @elianiva [sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | community | `H    ` | @aheber, @xixiaofinland [slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | core | `HFIJL` | @theHamsta +[slim](https://github.com/theoo/tree-sitter-slim) | community | `     ` | @theoo [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 @@ -259,10 +268,10 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [superhtml](https://github.com/kristoff-it/superhtml) | community | `H  J ` | @rockorager [surface](https://github.com/connorlay/tree-sitter-surface) | community | `HFIJ ` | @connorlay [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | core | `HFIJL` | @amaanq +[sway](https://github.com/FuelLabs/tree-sitter-sway.git) | core | `HFIJL` | @ribru17 [swift](https://github.com/alex-pinkus/tree-sitter-swift) | community | `HFIJL` | @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 -[systemverilog](https://github.com/zhangwwpeng/tree-sitter-systemverilog) | community | `HF J ` | @zhangwwpeng [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 @@ -287,13 +296,13 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[unison](https://github.com/kylegoetz/tree-sitter-unison) | community | `HF 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 +[verilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | community | `HF J ` | @zhangwwpeng [vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | community | `HF J ` | @jpt13653903 [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 @@ -306,6 +315,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [wit](https://github.com/liamwh/tree-sitter-wit) | community | `HF 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 +[xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | community | `HF JL` | @ValdezFOmar [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 diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 4e0c4485f..930a8f8f6 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -406,8 +406,8 @@ end --- Install a parser ---@param languages string[] ---@param options? InstallOptions ----@param _callback? fun() -local function install(languages, options, _callback) +---@param callback? fun(boolean) +local function install(languages, options, callback) options = options or {} local cache_dir = fs.normalize(fn.stdpath('cache')) @@ -430,9 +430,12 @@ local function install(languages, options, _callback) a.main() log.info('Installed %d/%d languages', done, #tasks) end + if callback then + callback(done == #tasks) + end end -M.install = a.sync(function(languages, options, _callback) +M.install = a.sync(function(languages, options, callback) reload_parsers() if not languages or #languages == 0 then languages = 'all' @@ -444,8 +447,8 @@ M.install = a.sync(function(languages, options, _callback) options.force = true end - install(languages, options) -end, 2) + install(languages, options, callback) +end, 3) ---@class UpdateOptions diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 002469356..d06f184ae 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -10,7 +10,7 @@ return { }, agda = { install_info = { - revision = 'd3dc807692e6bca671d4491b3bf5c67eeca8c016', + revision = 'b9b32fa042c2952a7bfca86847ea325e44ccc897', url = 'https://github.com/tree-sitter/tree-sitter-agda', }, maintainers = { '@Decodetalkers' }, @@ -29,7 +29,7 @@ return { apex = { install_info = { location = 'apex', - revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', + revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -38,7 +38,7 @@ return { arduino = { install_info = { generate_from_json = true, - revision = '415ebc8f75eb02a748faa03f5af199f08ced120f', + revision = '017696bdf47ca2b10948c5a511f9ab387722d0f3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -56,7 +56,7 @@ return { astro = { install_info = { generate_from_json = true, - revision = '4be180759ec13651f72bacee65fa477c64222a1a', + revision = '0ad33e32ae9726e151d16ca20ba3e507ff65e01f', url = 'https://github.com/virchau13/tree-sitter-astro', }, maintainers = { '@virchau13' }, @@ -73,14 +73,14 @@ return { }, awk = { install_info = { - revision = '553fdc4afb3b603332c3f4baf50c711506f4e797', + revision = '34bbdc7cce8e803096f47b625979e34c1be38127', url = 'https://github.com/Beaglefoot/tree-sitter-awk', }, tier = 4, }, bash = { install_info = { - revision = 'c8713e50f0bd77d080832fc61ad128bc8f2934e9', + revision = 'a985bd2d14d249b8f583343ad21aeb13c50c85e8', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -96,7 +96,7 @@ return { }, beancount = { install_info = { - revision = '01c0da29e0fc7130420a09d939ecc524e09b6ba6', + revision = '9bc460a05b5f096d69568b5fb36105032ff4ff97', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -112,7 +112,7 @@ return { }, bicep = { install_info = { - revision = '0092c7d1bd6bb22ce0a6f78497d50ea2b87f19c0', + revision = 'bff59884307c0ab009bd5e81afd9324b46a6c0f9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-bicep', }, maintainers = { '@amaanq' }, @@ -144,7 +144,7 @@ return { }, bp = { install_info = { - revision = '4e60cf3c2e613625c06f6f85540b3631e2d06cd3', + revision = '16c43068ec30828c5aed11e87262c56f36782595', url = 'https://github.com/ambroisie/tree-sitter-bp', }, maintainers = { '@ambroisie' }, @@ -161,7 +161,7 @@ return { }, c = { install_info = { - revision = 'f4c21152f1952a99f4744e8c41d3ffb8038ae78c', + revision = '492f7aaa37560204856a2b3f775398b66ba09f31', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -169,7 +169,7 @@ return { }, c_sharp = { install_info = { - revision = 'fd7f7402db6e66afd70b402fb2e367b2d71c10d6', + revision = '2c31cc87640ab6ad74fb408c0cf1262ce54da5bb', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -201,7 +201,7 @@ return { }, chatito = { install_info = { - revision = 'a461f20dedb43905febb12c1635bc7d2e43e96f0', + revision = 'b4cbe9ab7672d5106e9550d8413835395a1be362', url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', }, maintainers = { '@ObserverOfTime' }, @@ -209,8 +209,8 @@ return { }, circom = { install_info = { + revision = '02150524228b1e6afef96949f2d6b7cc0aaf999e', url = 'https://github.com/Decurity/tree-sitter-circom', - files = { 'src/parser.c' }, }, maintainers = { '@alexandr-martirosyan' }, tier = 3, @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = 'f2569dd1fce0f252097a25bcbcb9ed8898840310', + revision = 'e409ae33f00e04cde30f2bcffb979caf1a33562a', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -275,7 +275,7 @@ return { cpp = { install_info = { generate_from_json = true, - revision = '30d2fa385735378388a55917e2910965fce19748', + revision = 'a352ed85f733f9c6cc458fe5a82bcd4c00f70eab', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -284,7 +284,7 @@ return { }, css = { install_info = { - revision = 'a68fcd1e6b03118d1e92ffa45e7ab7a39d52d3f7', + revision = '6731f030693d3698ad94865ed0228fe45df07e30', url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, @@ -303,7 +303,7 @@ return { cuda = { install_info = { generate_from_json = true, - revision = '635e8aa3747823a0c4e9660c07cef76fe8d3ef93', + revision = '757e0a61f9d38b3d9eaa299e8d866e8283ffc284', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -320,8 +320,8 @@ return { }, cylc = { install_info = { + revision = '8b895c278f98d05e67997f5e3a43fb5531933023', url = 'https://github.com/elliotfontaine/tree-sitter-cylc', - files = { 'src/parser.c' }, }, maintainers = { '@elliotfontaine' }, tier = 3, @@ -336,7 +336,7 @@ return { }, dart = { install_info = { - revision = '9ac03bb2154316624fb4c41fe0f372a5f1597b43', + revision = 'e81af6ab94a728ed99c30083be72d88e6d56cf9e', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -344,7 +344,7 @@ return { }, desktop = { install_info = { - files = { 'src/parser.c' }, + revision = '54133af61b2a9a75fd42c49ce0c771115f81f50b', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -352,7 +352,7 @@ return { }, devicetree = { install_info = { - revision = '07a647c8fb70e6b06379a60526721e3141aa2fd2', + revision = '16f640f3c59117c9e749d581634afdb00e004f4c', url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, @@ -360,7 +360,7 @@ return { }, dhall = { install_info = { - revision = 'affb6ee38d629c9296749767ab832d69bb0d9ea8', + revision = '4a6c08abfb54827db4e722d6cdca81b093898988', url = 'https://github.com/jbellerb/tree-sitter-dhall', }, maintainers = { '@amaanq' }, @@ -368,7 +368,7 @@ return { }, diff = { install_info = { - revision = '19dd5aa52fe339a1d974768a09ee2537303e8ca5', + revision = 'e42b8def4f75633568f1aecfe01817bf15164928', url = 'https://github.com/the-mikedavis/tree-sitter-diff', }, maintainers = { '@gbprod' }, @@ -392,7 +392,7 @@ return { }, dockerfile = { install_info = { - revision = '087daa20438a6cc01fa5e6fe6906d77c869d19fe', + revision = '971acdd908568b4531b0ba28a445bf0bb720aba5', url = 'https://github.com/camdencheek/tree-sitter-dockerfile', }, maintainers = { '@camdencheek' }, @@ -417,7 +417,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '809266ed1694d64dedc168a18893cc254e3edf7e', + revision = 'ce150c5be7f617e18ffa2064213e5d9c4cb5d69e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -425,7 +425,7 @@ return { }, earthfile = { install_info = { - revision = '1d637f2002bb8b22d4c08d26ad2bfbc22916f3ce', + revision = 'a44f6f6d22ea4fe16fa37ababd90240ab87a9e0d', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -447,7 +447,7 @@ return { }, editorconfig = { install_info = { - revision = 'efbe0b2f2eaa248e8c657a80a8c2305056bda477', + revision = '02f562e71dc28d573187809eecdffaee7c82321c', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -455,7 +455,7 @@ return { }, eds = { install_info = { - revision = '0ad62cb635c2f4353359a88dec9e3a57bbf9f66d', + revision = '26d529e6cfecde391a03c21d1474eb51e0285805', url = 'https://github.com/uyha/tree-sitter-eds', }, maintainers = { '@uyha' }, @@ -471,7 +471,7 @@ return { }, elixir = { install_info = { - revision = 'ef124b83a3f3572b0af23db4efae3f8de06a15e1', + revision = '0e8eb7fc1dfb3d855398870827a9866a1529a5e4', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -479,7 +479,7 @@ return { }, elm = { install_info = { - revision = '27f502ed0a1cbd3c5912d284cc7934ee0d4cdddc', + revision = 'e34bdc5c512918628b05b48e633f711123204e45', url = 'https://github.com/elm-tooling/tree-sitter-elm', }, maintainers = { '@zweimach' }, @@ -503,7 +503,7 @@ return { }, embedded_template = { install_info = { - revision = '62b0a6e45900a7dff7c37da95fec20a09968ba52', + revision = '8495d106154741e6d35d37064f864758ece75de6', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 4, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = 'f1919a34af3a9c79402c4a3d6c52986e9c2ea949', + revision = '981fda038d2eb182a88a9374ccb1c14b840cba0b', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -526,7 +526,7 @@ return { }, facility = { install_info = { - revision = '2d037f2f2bf668737f72e6be6eda4b7918b68d86', + revision = 'e4bfd3e960de9f4b4648acb1c92e9b95b47d8cfb', url = 'https://github.com/FacilityApi/tree-sitter-facility', }, maintainers = { '@bryankenote' }, @@ -567,7 +567,7 @@ return { }, fish = { install_info = { - revision = 'a78aef9abc395c600c38a037ac779afc7e3cc9e0', + revision = '70640c0696abde32622afc43291a385681afbd32', url = 'https://github.com/ram02z/tree-sitter-fish', }, maintainers = { '@ram02z' }, @@ -575,7 +575,7 @@ return { }, foam = { install_info = { - revision = '04664b40c0dadb7ef37028acf3422c63271d377b', + revision = 'f08bb76892b93e5b23c45ac3bd6b1eea5df323cc', url = 'https://github.com/FoamScience/tree-sitter-foam', }, maintainers = { '@FoamScience' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = '4a593dda9cbc050a6686187249f8350ceea292ce', + revision = '022b032d31299c5d8336cdfd0ece97de20a609c0', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -608,7 +608,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = '5202637c203fcf8876affbd18b04ff43256d4c4a', + revision = '207f1c988f4649e12fe207e4a7e4f83b9da037d1', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -632,7 +632,7 @@ return { }, gap = { install_info = { - revision = '141b063335e85299bde3f61b4888d02d674a1abc', + revision = '7db79590d2f8b0e0246008ecfd569b4bfca587a9', url = 'https://github.com/gap-system/tree-sitter-gap', }, maintainers = { '@reiniscirpons' }, @@ -641,7 +641,7 @@ return { }, gaptst = { install_info = { - revision = 'e0723dc6136309b3d5904dad2c73ef71267428c1', + revision = '69086d7627c03e1f4baf766bcef14c60d9e92331', url = 'https://github.com/gap-system/tree-sitter-gaptst', }, maintainers = { '@reiniscirpons' }, @@ -651,7 +651,7 @@ return { }, gdscript = { install_info = { - revision = '1f1e782fe2600f50ae57b53876505b8282388d77', + revision = '48b49330888a4669b48619b211cc8da573827725', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -684,7 +684,7 @@ return { }, gitattributes = { install_info = { - revision = '41940e199ba5763abea1d21b4f717014b45f01ea', + revision = '5425944fd61bf2b3bad2c17c2dc9f53172b0f01d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', }, maintainers = { '@ObserverOfTime' }, @@ -692,7 +692,7 @@ return { }, gitcommit = { install_info = { - revision = 'aa5c279287f0895a7ebc76a06e55ac3e4b2df7c7', + revision = 'db0e0c4fb9095fdc42a7af34019c0616c071e9eb', url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = '57c9951b290c8084d7c60b0aee7a2b30986ea031', + revision = '066704e4826699e754d351e3bbe12bf2e51de9d8', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -726,7 +726,7 @@ return { glimmer_javascript = { install_info = { generate_from_json = true, - revision = 'a260911201684f80cf815418b3771e6c39309f81', + revision = '7e8ea8cf39fc360cb97bd253442cd48e4f7a9ce3', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', }, maintainers = { '@NullVoxPopuli' }, @@ -736,7 +736,7 @@ return { glimmer_typescript = { install_info = { generate_from_json = true, - revision = '9d018a0f93417e6951264a26093b89ee63df7315', + revision = '4006128790efb58ca82a4492d8ef0983b260fc6a', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', }, maintainers = { '@NullVoxPopuli' }, @@ -764,7 +764,7 @@ return { }, gnuplot = { install_info = { - revision = '3c895f5d9c0b3a3c7e02383766b462c21913c000', + revision = '8923c1e38b9634a688a6c0dce7c18c8ffb823e79', url = 'https://github.com/dpezto/tree-sitter-gnuplot', }, maintainers = { '@dpezto' }, @@ -772,7 +772,7 @@ return { }, go = { install_info = { - revision = 'ecc20866d1bd4d80f3aef06456ed3014d4d598e6', + revision = '7cb21a65af6cc8e5c6742b9dba42881ea1158475', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -788,7 +788,7 @@ return { }, godot_resource = { install_info = { - revision = '2ffb90de47417018651fc3b970e5f6b67214dc9d', + revision = '941955d027f1d8530501e77ce5e1d6035f5f99c1', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, @@ -797,7 +797,7 @@ return { }, gomod = { install_info = { - revision = '3b01edce2b9ea6766ca19328d1850e456fde3103', + revision = '6efb59652d30e0e9cd5f3b3a669afd6f1a926d3c', url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, maintainers = { '@camdencheek' }, @@ -813,7 +813,7 @@ return { }, gotmpl = { install_info = { - revision = 'fd9e1c6647e5e9b23918d00d1e48710d0f703e19', + revision = 'ab4a8c4a51f271f320f2bad6a5d499415bf541b1', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -829,7 +829,7 @@ return { }, gpg = { install_info = { - revision = 'f99323fb8f3f10b6c69db0c2f6d0a14bd7330675', + revision = '63e80cfe1302da9f9c7ee8d9df295f47d7d181bf', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', }, maintainers = { '@ObserverOfTime' }, @@ -845,7 +845,7 @@ return { }, gren = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, + revision = '76554f4f2339f5a24eed19c58f2079b51c694152', url = 'https://github.com/MaeBrooks/tree-sitter-gren', }, maintainers = { '@MaeBrooks' }, @@ -853,7 +853,7 @@ return { }, groovy = { install_info = { - revision = '0d8884514fe10c4fa47527d9a0284d207f38ddea', + revision = '86911590a8e46d71301c66468e5620d9faa5b6af', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, @@ -869,7 +869,7 @@ return { }, hack = { install_info = { - revision = 'fca1e294f6dce8ec5659233a6a21f5bd0ed5b4f2', + revision = 'bc5b3a10d6d27e8220a113a9a7fe9bec0a1574b0', url = 'https://github.com/slackhq/tree-sitter-hack', }, tier = 4, @@ -884,7 +884,7 @@ return { }, haskell = { install_info = { - revision = '558b997049fddcb07fc513528189c57d6129a260', + revision = '2c2fcb22e3b939ed59ae8d6f10500c3213c68670', url = 'https://github.com/tree-sitter/tree-sitter-haskell', }, maintainers = { '@mrcjkb' }, @@ -908,7 +908,7 @@ return { }, heex = { install_info = { - revision = '6dd0303acf7138dd2b9b432a229e16539581c701', + revision = 'a63c69c20fd88d1e5614a02b4a6b48cfb7e54a45', url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, @@ -917,7 +917,7 @@ return { helm = { install_info = { location = 'dialects/helm', - revision = 'fd9e1c6647e5e9b23918d00d1e48710d0f703e19', + revision = 'ab4a8c4a51f271f320f2bad6a5d499415bf541b1', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -936,7 +936,7 @@ return { hlsl = { install_info = { generate_from_json = true, - revision = '543930235970a04c2f0d549c9e88815847c7a74a', + revision = 'b309425a7ab4456605cfe78774b80f7e275ca87d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', }, maintainers = { '@theHamsta' }, @@ -962,7 +962,7 @@ return { }, hoon = { install_info = { - revision = 'a24c5a39d1d7e993a8bee913c8e8b6a652ca5ae8', + revision = '1545137aadcc63660c47db9ad98d02fa602655d0', url = 'https://github.com/urbit-pilled/tree-sitter-hoon', }, maintainers = { '@urbit-pilled' }, @@ -970,7 +970,7 @@ return { }, html = { install_info = { - revision = '14bdaf0da9e26e2de9b30178c2242539d2b0b285', + revision = 'd18f83f8bed0be99796c4eacafe9b295ab2ee144', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -992,7 +992,7 @@ return { }, http = { install_info = { - revision = '231f1b1bafd12e46c8ed8c21dbbdd940d9f15e94', + revision = 'd2e4e4c7d03f70e0465d436f2b5f67497cd544ca', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, @@ -1008,7 +1008,7 @@ return { }, hyprlang = { install_info = { - revision = '6858695eba0e63b9e0fceef081d291eb352abce8', + revision = 'd719158abe537b1916daaea6fa03287089f0b601', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, @@ -1016,7 +1016,7 @@ return { }, idl = { install_info = { - revision = '5573b295410201ed22771776b34d636900eba368', + revision = '86ff7f19747a761dc8ba72f4045fd64aed94ba4c', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1024,8 +1024,8 @@ return { }, idris = { install_info = { + revision = 'c56a25cf57c68ff929356db25505c1cc4c7820f6', url = 'https://github.com/kayhide/tree-sitter-idris', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@srghma' }, tier = 3, @@ -1040,7 +1040,7 @@ return { }, inko = { install_info = { - revision = '6f9c072d023c3886aabcd8012274461b35d2d0a9', + revision = '0b08a8f976456a9271f70d4682143328d7224115', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, @@ -1048,8 +1048,8 @@ return { }, ipkg = { install_info = { + revision = '8d3e9782f2d091d0cd39c13bfb3068db0c675960', url = 'https://github.com/srghma/tree-sitter-ipkg', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@srghma' }, tier = 3, @@ -1066,7 +1066,7 @@ return { }, janet_simple = { install_info = { - revision = '12bfab7db8a5f5b1d774ef84b5831acd34936071', + revision = 'ca4785b47a4ff15653f0408a49c764dec533e0d3', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1074,7 +1074,7 @@ return { }, java = { install_info = { - revision = '490d878cf33b0ad5ae7a7253ff30597a5bdc348e', + revision = '677da92875756e31b3a42505d822cc8be7c5ab5e', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1090,7 +1090,7 @@ return { }, javascript = { install_info = { - revision = 'b6f0624c1447bc209830b195999b78a56b10a579', + revision = '3f1c835d05165050834da0e3cbc23a75e94aaa64', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1128,7 +1128,7 @@ return { }, jsdoc = { install_info = { - revision = 'bc09606fc786ead131a301e4b7524888f2d5c517', + revision = 'a417db5dbdd869fccb6a8b75ec04459e1d4ccd2c', url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', }, maintainers = { '@steelsojka' }, @@ -1136,7 +1136,7 @@ return { }, json = { install_info = { - revision = '8bfdb43f47ad805bb1ce093203cfcbaa8ed2c571', + revision = '54ccd9485e0122a5e9faf5d8aaed7294c308e894', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1175,7 +1175,7 @@ return { }, julia = { install_info = { - revision = '3520b57e418f734f582215181ecd926a6178c90f', + revision = 'ffdd9fe4dccdc26d62ce1654fceac52c394f0cf3', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, @@ -1183,7 +1183,7 @@ return { }, just = { install_info = { - revision = '6648ac1c0cdadaec8ee8bcf9a4ca6ace5102cf21', + revision = 'bb0c898a80644de438e6efe5d88d30bf092935cd', url = 'https://github.com/IndianBoy42/tree-sitter-just', }, maintainers = { '@Hubro' }, @@ -1199,7 +1199,7 @@ return { }, kconfig = { install_info = { - revision = '486fea71f61ad9f3fd4072a118402e97fe88d26c', + revision = '9ac99fe4c0c27a35dc6f757cef534c646e944881', url = 'https://github.com/tree-sitter-grammars/tree-sitter-kconfig', }, maintainers = { '@amaanq' }, @@ -1215,7 +1215,7 @@ return { }, kotlin = { install_info = { - revision = '76f53c48d29e8588934fb55b0240d7bdfe00bfe5', + revision = 'c4ddea359a7ff4d92360b2efcd6cfce5dc25afe6', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, @@ -1223,7 +1223,7 @@ return { }, koto = { install_info = { - revision = 'cbf637e5163065934c827d254b293f4d2f08f523', + revision = '329b0e84ef6cc6950665de4accd0bdda1601a2f1', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1239,7 +1239,7 @@ return { }, lalrpop = { install_info = { - revision = '194c25539f435de415ee0551a5f07058833da915', + revision = 'a7f5ea297bd621d072ed4cb2cc8ba5ae64ae3c4b', url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, @@ -1248,7 +1248,7 @@ return { latex = { install_info = { generate = true, - revision = '87e4059f01bed363230dc349f794ce4cc580e862', + revision = '7b06f6ed394308e7407a1703d2724128c45fc9d7', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1256,7 +1256,7 @@ return { }, ledger = { install_info = { - revision = '8a841fb20ce683bfbb3469e6ba67f2851cfdf94a', + revision = 'd313153eef68c557ba4538b20de2d0e92f3ef6f8', url = 'https://github.com/cbarrete/tree-sitter-ledger', }, maintainers = { '@cbarrete' }, @@ -1264,7 +1264,7 @@ return { }, leo = { install_info = { - revision = '6ca11a96fc2cab51217e0cf4a2f9ed3ea63e28fb', + revision = '44a061bac4d9443d75f2700c62a71cd4dcf16f05', url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, @@ -1288,7 +1288,7 @@ return { }, liquidsoap = { install_info = { - revision = '14feafa91630afb1ab9988cf9b738b7ea29f3f89', + revision = '8e51fa63ddb93ac179d4e34a311d3d3f03780b42', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, @@ -1304,7 +1304,7 @@ return { }, lua = { install_info = { - revision = '99fc677e6971c425e8d407f59c77ab897e585c92', + revision = '34e60e7f45fc313463c68090d88d742a55d1bd7a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1330,7 +1330,7 @@ return { luau = { install_info = { generate_from_json = true, - revision = 'fbadc96272f718dba267628ba7b0e694c368cef3', + revision = 'a8914d6c1fc5131f8e1c13f769fa704c9f5eb02f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-luau', }, maintainers = { '@amaanq' }, @@ -1356,7 +1356,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = 'b7eba93e6a3e588e259e831416ac11abdaa8616a', + revision = '192407ab5a24bfc24f13332979b5e7967518754a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1367,7 +1367,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = 'b7eba93e6a3e588e259e831416ac11abdaa8616a', + revision = '192407ab5a24bfc24f13332979b5e7967518754a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1376,7 +1376,7 @@ return { }, matlab = { install_info = { - revision = '306c43ab28b7b8a4976e40ff0a7c26b019ad52df', + revision = 'b0a0198b182574cd3ca0447264c83331901b9338', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = '0238b7fb6a630f77b3fc8b8a48285ef6ed45cbcc', + revision = 'b5d5f238b371b7c9b764f6a053b045dda92bc836', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1424,7 +1424,7 @@ return { }, nasm = { install_info = { - revision = '570f3d7be01fffc751237f4cfcf52d04e20532d1', + revision = 'd1b3638d017f2a8585e26dcfc66fe1df94185e30', url = 'https://github.com/naclsn/tree-sitter-nasm', }, maintainers = { '@ObserverOfTime' }, @@ -1432,7 +1432,7 @@ return { }, nginx = { install_info = { - revision = '281d184b8240b2b22670b8907b57b6d6842db6f3', + revision = '989da760be05a3334af3ec88705cbf57e6a9c41d', url = 'https://github.com/opa-oz/tree-sitter-nginx', }, maintainers = { '@opa-oz' }, @@ -1440,7 +1440,7 @@ return { }, nickel = { install_info = { - revision = 'ddaa2bc22355effd97c0d6b09ff5962705c6368d', + revision = '25464b33522c3f609fa512aa9651707c0b66d48b', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 4, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '456b14a2fa6315abc7e02fcffaf4a1f35d4955d3', + revision = '4b952d99ce6fc795ff3cfa48b05637f2b1751d3b', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1489,8 +1489,8 @@ return { }, nu = { install_info = { + revision = '9822fc63a62ff87939c88ead9f381f951f092dee', url = 'https://github.com/nushell/tree-sitter-nu', - files = { 'src/parser.c' }, }, maintainers = { '@abhisheksingh0x558' }, tier = 3, @@ -1498,7 +1498,7 @@ return { objc = { install_info = { generate_from_json = true, - revision = '62e61b6f5c0289c376d61a8c91faf6435cde9012', + revision = '18802acf31d0b5c1c1d50bdbc9eb0e1636cab9ed', url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', }, maintainers = { '@amaanq' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e', + revision = '37ad9efe601316248b22173d2ff19a6b4c992016', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '5f7a97e9757d8afe6c0b0b5dd8734cf59f35456e', + revision = '37ad9efe601316248b22173d2ff19a6b4c992016', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1543,7 +1543,7 @@ return { }, odin = { install_info = { - revision = '3fee7964bbfb2554deef12c224344f3870d15375', + revision = 'd2ca8efb4487e156a60d5bd6db2598b872629403', url = 'https://github.com/tree-sitter-grammars/tree-sitter-odin', }, maintainers = { '@amaanq' }, @@ -1567,7 +1567,7 @@ return { }, pem = { install_info = { - revision = '217ff2af3f2db15a79ab7e3d21ea1e0c17e71a1a', + revision = '1d16b8e063fdf4385e389096c4bc4999eaaef05f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', }, maintainers = { '@ObserverOfTime' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '76ab9a52b9dd2a1758aae3da8286519d995037e9', + revision = '6f280c52662dc254eb7a5abc0889f7a9e1154ffd', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = '07a04599ed9ac97f82c6383a24ae139a807930f3', + revision = '5021edde6d0ea75aedc313e75cca2ac5aa064d41', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '07a04599ed9ac97f82c6383a24ae139a807930f3', + revision = '5021edde6d0ea75aedc313e75cca2ac5aa064d41', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1641,7 +1641,7 @@ return { }, poe_filter = { install_info = { - revision = '592476d81f95d2451f2ca107dc872224c76fecdf', + revision = '2902dc45439125b9386812c1089a8e9b5f71c4ab', url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', }, maintainers = { '@ObserverOfTime' }, @@ -1659,7 +1659,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = 'ebe2ab2f642eda2072c68c8de02e83973c26f33c', + revision = '32fe49cc5d4a2d5a976dacafc0da16d98787866b', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1667,7 +1667,7 @@ return { }, printf = { install_info = { - revision = '0e0aceabbf607ea09e03562f5d8a56f048ddea3d', + revision = '60d50a2247b0c1fb72b967562c64711d65c6a060', url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', }, maintainers = { '@ObserverOfTime' }, @@ -1675,7 +1675,7 @@ return { }, prisma = { install_info = { - revision = 'eca2596a355b1a9952b4f80f8f9caed300a272b5', + revision = '73f39a6d5401cfdcd143951e499336cf5ab2ffaa', url = 'https://github.com/victorhqc/tree-sitter-prisma', }, maintainers = { '@elianiva' }, @@ -1710,7 +1710,7 @@ return { }, properties = { install_info = { - revision = '9d09f5f200c356c50c4103d36441309fd61b48d1', + revision = '579b62f5ad8d96c2bb331f07d1408c92767531d9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', }, maintainers = { '@ObserverOfTime' }, @@ -1745,7 +1745,7 @@ return { }, pug = { install_info = { - revision = 'a7ff31a38908df9b9f34828d21d6ca5e12413e18', + revision = '13e9195370172c86a8b88184cc358b23b677cc46', url = 'https://github.com/zealot128/tree-sitter-pug', }, maintainers = { '@zealot128' }, @@ -1753,7 +1753,7 @@ return { }, puppet = { install_info = { - revision = '584522f32495d648b18a53ccb52d988e60de127d', + revision = '15f192929b7d317f5914de2b4accd37b349182a6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-puppet', }, maintainers = { '@amaanq' }, @@ -1778,7 +1778,7 @@ return { }, python = { install_info = { - revision = '8c65e256f971812276ff2a69a2f515c218ed7f82', + revision = '44c2f7aebce0efac5867cdc5f2ea03c1d43a0305', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1786,7 +1786,7 @@ return { }, ql = { install_info = { - revision = 'c73c31c89cb0019ef56fe8bc1723e7c36e0be607', + revision = '1fd627a4e8bff8c24c11987474bd33112bead857', url = 'https://github.com/tree-sitter/tree-sitter-ql', }, maintainers = { '@pwntester' }, @@ -1803,7 +1803,7 @@ return { qmljs = { install_info = { generate_from_json = true, - revision = 'cc4186f15e2829385be33440561fdd17b1c40cf7', + revision = '8fef30e231d74b65c713bcbac21956156d8963da', url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, @@ -1812,7 +1812,7 @@ return { }, query = { install_info = { - revision = 'f767fb0ac5e711b6d44c5e0c8d1f349687a86ce0', + revision = '5c2d02747250bc326bc33687b3319b7db8554e24', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1821,7 +1821,7 @@ return { }, r = { install_info = { - revision = '2097fa502efa21349d26af0ffee55d773015e481', + revision = 'a0d3e3307489c3ca54da8c7b5b4e0c5f5fd6953a', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1862,7 +1862,7 @@ return { }, rbs = { install_info = { - revision = '8d8e65ac3f77fbc9e15b1cdb9f980a3e0ac3ab99', + revision = 'de893b166476205b09e79cd3689f95831269579a', url = 'https://github.com/joker1007/tree-sitter-rbs', }, maintainers = { '@joker1007' }, @@ -1886,7 +1886,7 @@ return { }, regex = { install_info = { - revision = 'f70251e1f1d72bd6dc1f897f956f9112f8668441', + revision = 'b638d29335ef41215b86732dd51be34c701ef683', url = 'https://github.com/tree-sitter/tree-sitter-regex', }, maintainers = { '@theHamsta' }, @@ -1927,7 +1927,7 @@ return { }, robot = { install_info = { - revision = '322e4cc65754d2b3fdef4f2f8a71e0762e3d13af', + revision = '17c2300e91fc9da4ba14c16558bf4292941dc074', url = 'https://github.com/Hubro/tree-sitter-robot', }, maintainers = { '@Hubro' }, @@ -1943,7 +1943,7 @@ return { }, roc = { install_info = { - revision = 'ef46edd0c03ea30a22f7e92bc68628fb7231dc8a', + revision = 'de0839d6c7db2405e827435cf3ac62d22f4bd5e9', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -1959,7 +1959,7 @@ return { }, rst = { install_info = { - revision = '5120f6e59284cb8b85b450bd2db0bd352635ba9f', + revision = 'dd5971ef7759583aadd5aa5e3a3a0905eb5734d5', url = 'https://github.com/stsewd/tree-sitter-rst', }, maintainers = { '@stsewd' }, @@ -1967,7 +1967,7 @@ return { }, ruby = { install_info = { - revision = '0b4729672f9aec4810c01a0f971541dcb433fef5', + revision = '71bd32fb7607035768799732addba884a37a6210', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1975,7 +1975,7 @@ return { }, runescript = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, + revision = 'cf85bbd5da0c5ad243301d889c7f84d790a4cae4', url = 'https://github.com/2004Scape/tree-sitter-runescript', }, maintainers = { '@2004Scape' }, @@ -1983,7 +1983,7 @@ return { }, rust = { install_info = { - revision = '6b7d1fc73ded57f73b1619bcf4371618212208b1', + revision = '2eaf126458a4d6a69401089b6ba78c5e5d6c1ced', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -1991,7 +1991,7 @@ return { }, scala = { install_info = { - revision = '2cfbb6e3fcdfd51e0d477a43cc37ae8c6f87dc2e', + revision = 'd3b9553b47d7ab413a146c4b6498e527265b966e', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2000,7 +2000,7 @@ return { scfg = { install_info = { generate = true, - revision = 'a5512800ea0220da4abbae61b8aea8423d1549aa', + revision = '2f3709e7656fa2c443f92041c91a9f843f8cd625', url = 'https://github.com/rockorager/tree-sitter-scfg', }, maintainers = { '@WhyNotHugo' }, @@ -2025,7 +2025,7 @@ return { sflog = { install_info = { location = 'sflog', - revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', + revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, @@ -2035,7 +2035,7 @@ return { slang = { install_info = { generate_from_json = true, - revision = 'dd991eb3b6957a33d9044e0f5914588f7f449a78', + revision = '3ed23c04a412a0559162d9cadf96dfff7cb36079', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2044,15 +2044,15 @@ return { }, slim = { install_info = { + revision = 'a0f08e85b787248219ea645423c5916c8d620ef6', url = 'https://github.com/theoo/tree-sitter-slim', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@theoo' }, tier = 3, }, slint = { install_info = { - revision = '4e2765d4cac1f03ada6f635eeb6008d1d0aff5a3', + revision = 'f11da7e62051ba8b9d4faa299c26de8aeedfc1cd', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2077,7 +2077,7 @@ return { snakemake = { install_info = { generate_from_json = true, - revision = 'e909815acdbe37e69440261ebb1091ed52e1dec6', + revision = 'f36c1587624d6d84376c82a357c20fc319cbf02c', url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, @@ -2085,7 +2085,7 @@ return { }, solidity = { install_info = { - revision = 'ee5a2d2ba30b487c4bbf613d2ef310a454c09c7c', + revision = '727087514eff57d92e273a24303142308bce3381', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2094,7 +2094,7 @@ return { soql = { install_info = { location = 'soql', - revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', + revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2103,7 +2103,7 @@ return { sosl = { install_info = { location = 'sosl', - revision = '46d4a12e4e90b10a575b7b16ea3b6ead50322074', + revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, @@ -2111,7 +2111,7 @@ return { }, sourcepawn = { install_info = { - revision = '6b9bf9cbab91443380d2ca8a2f6c491cc7fac5bf', + revision = 'f2af8d0dc14c6790130cceb2a20027eb41a8297c', url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, @@ -2130,7 +2130,7 @@ return { install_info = { branch = 'gh-pages', generate_from_json = true, - revision = 'a8b10c76759a372d0f92bb070b4f5c993e0ce5f9', + revision = 'b9d109588d5b5ed986c857464830c2f0bef53f18', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2146,7 +2146,7 @@ return { }, ssh_config = { install_info = { - revision = '77450e8bce8853921512348f83c73c168c71fdfb', + revision = '0dd3c7e9f301758f6c69a6efde43d3048deb4d8a', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', }, maintainers = { '@ObserverOfTime' }, @@ -2155,7 +2155,7 @@ return { starlark = { install_info = { generate_from_json = true, - revision = '018d0e09d9d0f0dd6740a37682b8ee4512e8b2ac', + revision = 'a453dbf3ba433db0e5ec621a38a7e59d72e4dc69', url = 'https://github.com/tree-sitter-grammars/tree-sitter-starlark', }, maintainers = { '@amaanq' }, @@ -2172,7 +2172,7 @@ return { styled = { install_info = { generate_from_json = true, - revision = '764af55fc6b8e5ae177eb272f5c5de6238db23e6', + revision = '75d3ad20818c30c49b445ca2cb35999c278b3453', url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, @@ -2189,7 +2189,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '36f37aa5aa440805f27d4a9f5203e616a303c6a1', + revision = 'e6eba40bf54dd94d842154be0389c53a37be8dc8', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2206,7 +2206,7 @@ return { svelte = { install_info = { generate_from_json = true, - revision = '774a65aea563accc35f5d45fafa4d96ec5761f57', + revision = 'ae5199db47757f785e43a14b332118a5474de1a2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-svelte', }, maintainers = { '@amaanq' }, @@ -2215,7 +2215,7 @@ return { }, sway = { install_info = { - files = { 'src/parser.c', 'src/scanner.c' }, + revision = '395006713db3bbb90d267ebdfcbf1881b399b05c', url = 'https://github.com/FuelLabs/tree-sitter-sway.git', }, maintainers = { '@ribru17' }, @@ -2224,7 +2224,7 @@ return { swift = { install_info = { generate = true, - revision = 'a6ec57ad4d12c68d952ba1f869bd373a7ac95832', + revision = 'f4be8072f18fb9704fd35d4b8154ae2b19e314c0', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2248,7 +2248,7 @@ return { }, t32 = { install_info = { - revision = '6182836f4128725f1e74ce986840d7317021a015', + revision = 'e5a12f798f056049642aa03fbb83786e3a5b95d4', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2272,7 +2272,7 @@ return { }, tcl = { install_info = { - revision = 'cdba4ab96a9896492d0d5219b70300c8783ca4e7', + revision = '98015ebe182d94e5a4439e32ffd91beaac32fcb9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, @@ -2289,7 +2289,7 @@ return { teal = { install_info = { generate = true, - revision = '485fbdc00d811b01b2090dff4d0469fd1d0350f5', + revision = '3db655924b2ff1c54fdf6371b5425ea6b5dccefe', url = 'https://github.com/euclidianAce/tree-sitter-teal', }, maintainers = { '@euclidianAce' }, @@ -2298,7 +2298,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = 'e3e894ef9e490c3d36d94a51458ec55480991730', + revision = 'a9178bfc9cc8040c08f39b47bae5400a2bf06e50', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2316,7 +2316,7 @@ return { }, textproto = { install_info = { - revision = 'd900077aef9f5dcb0d47c86be33585013ed5db9a', + revision = '568471b80fd8793d37ed01865d8c2208a9fefd1b', url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', }, maintainers = { '@Porter' }, @@ -2340,7 +2340,7 @@ return { }, tlaplus = { install_info = { - revision = 'da9cf9793686e236327aadfbad449414c895bf84', + revision = 'd711f24c93221cdfc9a9b4dbb0998f528fc982ac', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2365,7 +2365,7 @@ return { toml = { install_info = { generate_from_json = true, - revision = '16a30c83ce427385b8d14939c45c137fcfca6c42', + revision = '64b56832c2cffe41758f28e05c756a3a98d16f41', url = 'https://github.com/tree-sitter-grammars/tree-sitter-toml', }, maintainers = { '@tk-shirasaka' }, @@ -2384,7 +2384,7 @@ return { install_info = { generate_from_json = true, location = 'tsx', - revision = '9951831c5f05be434514dce38b30eef213667601', + revision = '410947e9d2ca8e032cd2419bf1241406c7e6f9bb', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2411,7 +2411,7 @@ return { install_info = { generate_from_json = true, location = 'typescript', - revision = '9951831c5f05be434514dce38b30eef213667601', + revision = '410947e9d2ca8e032cd2419bf1241406c7e6f9bb', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2420,7 +2420,7 @@ return { }, typespec = { install_info = { - revision = '0ee05546d73d8eb64635ed8125de6f35c77759fe', + revision = '42fb163442ef2691b9b720fb4e4e846809415d18', url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, @@ -2436,7 +2436,7 @@ return { }, typst = { install_info = { - revision = '8b8b16ef1b40cbecbe3f754b1c1c966b5a0904fe', + revision = '26dfb4b94a99cc9d6044342b7ad0ba761da77d60', url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, @@ -2444,7 +2444,7 @@ return { }, udev = { install_info = { - revision = '8f58696e79092b4ad6bf197415bbd0970acf15cd', + revision = '18a1d183c4c0cc40438bae2ebf8191aaf2dee8dc', url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', }, maintainers = { '@ObserverOfTime' }, @@ -2461,7 +2461,7 @@ return { unison = { install_info = { generate = true, - revision = 'bc06e1eb100e1c0fab9bd89a9ca55d646ac80fc4', + revision = '3c97db76d3cdbd002dfba493620c2d5df2fd6fa9', url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, @@ -2486,7 +2486,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = 'ea538758a1273b59774dc9179cde460d9c73fd89', + revision = '0461bf8addccb4df566827f1601f415d07b1ffbc', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2494,7 +2494,7 @@ return { }, vala = { install_info = { - revision = '8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b', + revision = '97e6db3c8c73b15a9541a458d8e797a07f588ef4', url = 'https://github.com/vala-lang/tree-sitter-vala', }, maintainers = { '@Prince781' }, @@ -2502,7 +2502,7 @@ return { }, vento = { install_info = { - revision = '3321077d7446c1b3b017c294fd56ce028ed817fe', + revision = '3b32474bc29584ea214e4e84b47102408263fe0e', url = 'https://github.com/ventojs/tree-sitter-vento', }, maintainers = { '@wrapperup', '@oscarotero' }, @@ -2510,7 +2510,7 @@ return { }, verilog = { install_info = { - revision = '075ebfc84543675f12e79a955f79d717772dcef3', + revision = '15fbf73dafaffc89050d247857beb27500ea30e8', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2518,7 +2518,7 @@ return { }, vhdl = { install_info = { - revision = 'd6e8301999336b47d663052d43f983c3edeb01dd', + revision = 'da8ea8afa7899a99e43a7d61afef9f77b7a675eb', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2526,7 +2526,7 @@ return { }, vhs = { install_info = { - revision = '09f8fbfe40a3a699b200daca7d92e65fbbe9f9e6', + revision = '037e675d547b18bbf3fdeb222e242ae5dccc39d7', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, @@ -2542,7 +2542,7 @@ return { }, vimdoc = { install_info = { - revision = '2249c44ecd3f5cf22da3dcccfb74f816ddb29245', + revision = 'd2e4b5c172a109966c2ce0378f73df6cede39400', url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, @@ -2578,7 +2578,7 @@ return { wgsl_bevy = { install_info = { generate_from_json = true, - revision = '0f06f24e259ac725045956436b9025dab008ff9f', + revision = '47c1818d245a6156a488c4c4d06e9336714bae9b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', }, maintainers = { '@theHamsta' }, @@ -2611,7 +2611,7 @@ return { xml = { install_info = { location = 'xml', - revision = '809266ed1694d64dedc168a18893cc254e3edf7e', + revision = 'ce150c5be7f617e18ffa2064213e5d9c4cb5d69e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2620,15 +2620,15 @@ return { }, xresources = { install_info = { + revision = 'd0f9dc7cec4dc15fc6f9d556bb4e9dd5050328a6', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', - files = { 'src/parser.c' }, }, maintainers = { '@ValdezFOmar' }, tier = 3, }, yaml = { install_info = { - revision = '7b03feefd36b5f155465ca736c6304aca983b267', + revision = '1805917414a9a8ba2473717fd69447277a175fae', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, @@ -2660,7 +2660,7 @@ return { }, zig = { install_info = { - revision = 'eb7d58c2dc4fbeea4745019dee8df013034ae66b', + revision = 'b670c8df85a1568f498aa5c8cae42f51a90473c0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, @@ -2669,7 +2669,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = '42b6f5d7320340bc5903c4c29d34065e8517a549', + revision = '3518133e9ebea7c372eff4def368eda8488fad18', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2678,7 +2678,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = '42b6f5d7320340bc5903c4c29d34065e8517a549', + revision = '3518133e9ebea7c372eff4def368eda8488fad18', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, diff --git a/lua/nvim-treesitter/util.lua b/lua/nvim-treesitter/util.lua index 3087e9422..8a9779617 100644 --- a/lua/nvim-treesitter/util.lua +++ b/lua/nvim-treesitter/util.lua @@ -1,5 +1,3 @@ -local uv = vim.uv - local M = {} --- @param filename string diff --git a/runtime/queries/ada/injections.scm b/runtime/queries/ada/injections.scm index f9754504e..2f0e58eb6 100644 --- a/runtime/queries/ada/injections.scm +++ b/runtime/queries/ada/injections.scm @@ -1,5 +1,2 @@ ((comment) @injection.content (#set! injection.language "comment")) - -((doc_block) @injection.content - (#set! injection.language "markdown")) diff --git a/runtime/queries/beancount/injections.scm b/runtime/queries/beancount/injections.scm index 05aa24d8f..2f0e58eb6 100644 --- a/runtime/queries/beancount/injections.scm +++ b/runtime/queries/beancount/injections.scm @@ -1,5 +1,2 @@ ((comment) @injection.content (#set! injection.language "comment")) - -((macro_text) @injection.content - (#set! injection.language "verilog")) diff --git a/runtime/queries/unison/injections.scm b/runtime/queries/unison/injections.scm index 2f0e58eb6..f9754504e 100644 --- a/runtime/queries/unison/injections.scm +++ b/runtime/queries/unison/injections.scm @@ -1,2 +1,5 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((doc_block) @injection.content + (#set! injection.language "markdown")) diff --git a/runtime/queries/verilog/injections.scm b/runtime/queries/verilog/injections.scm index 2f0e58eb6..05aa24d8f 100644 --- a/runtime/queries/verilog/injections.scm +++ b/runtime/queries/verilog/injections.scm @@ -1,2 +1,5 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((macro_text) @injection.content + (#set! injection.language "verilog")) diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index 756d34561..36be0b9c4 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -18,15 +18,18 @@ vim.opt.runtimepath:append('.') -- needed on CI vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') -local done = false +local ok = nil require('nvim-treesitter.install').install( #parsers > 0 and parsers or 'all', { force = true, generate = generate, max_jobs = max_jobs }, - function() - done = true + function(success) + ok = success end ) vim.wait(6000000, function() - return done + return ok ~= nil end) +if not ok then + vim.cmd.cq() +end From 188bbf7a098915511b899cdb7324450b35ab3ce7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 27 Jan 2025 16:53:58 +0100 Subject: [PATCH 052/434] fix(ci): update to changed neovim release name --- SUPPORTED_LANGUAGES.md | 10 ++- lua/nvim-treesitter/parsers.lua | 127 ++++++++++++++++---------------- scripts/ci-install.sh | 4 +- 3 files changed, 73 insertions(+), 68 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 61cebafa2..1d15c5328 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -70,6 +70,7 @@ ecma (queries only)[^ecma] | community | `HFIJL` | @steelsojka [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 ` | +[enforce](https://github.com/simonvic/tree-sitter-enforce) | community | `HFIJL` | @simonvic [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 @@ -131,7 +132,7 @@ html_tags (queries only)[^html_tags] | community | `H IJ ` | @TravonteD [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 IJ ` | @cathaysia -[idris](https://github.com/kayhide/tree-sitter-idris) | community | `     ` | @srghma +[idris](https://github.com/kayhide/tree-sitter-idris) | community | `HF JL` | @srghma [ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF J ` | @theHamsta [inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | @yorickpeterse [ipkg](https://github.com/srghma/tree-sitter-ipkg) | community | `HFIJL` | @srghma @@ -139,6 +140,8 @@ html_tags (queries only)[^html_tags] | community | `H IJ ` | @TravonteD [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 +[jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | community | `H  J ` | @cathaysia +[jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | community | `H  J ` | @cathaysia [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 @@ -226,6 +229,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [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 +[razor](https://github.com/tris203/tree-sitter-razor) | community | `HF J ` | @tris203 [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 @@ -248,7 +252,7 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFIJ ` | @elianiva [sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | community | `H    ` | @aheber, @xixiaofinland [slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | core | `HFIJL` | @theHamsta -[slim](https://github.com/theoo/tree-sitter-slim) | community | `     ` | @theoo +[slim](https://github.com/theoo/tree-sitter-slim) | community | `HFIJL` | @theoo [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 @@ -331,6 +335,8 @@ jsx (queries only)[^jsx] | community | `HFIJ ` | @steelsojka [^glimmer]: Glimmer and Ember [^godot_resource]: Godot Resources [^html_tags]: queries required by html, astro, vue, svelte +[^jinja]: basic highlighting +[^jinja_inline]: needed for full highlighting [^jsx]: queries required by javascript, tsx [^luap]: Lua patterns [^markdown]: basic highlighting diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index d06f184ae..75f202e60 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -47,7 +47,7 @@ return { }, asm = { install_info = { - revision = '55b2b913f1e71136027d6fce8212e760c64f3532', + revision = '5bb5b03e3c1ce5853b5282b9fba060f7c7bbf11e', url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, @@ -80,7 +80,7 @@ return { }, bash = { install_info = { - revision = 'a985bd2d14d249b8f583343ad21aeb13c50c85e8', + revision = '0c46d792d54c536be5ff7eb18eb95c70fccdb232', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -161,7 +161,7 @@ return { }, c = { install_info = { - revision = '492f7aaa37560204856a2b3f775398b66ba09f31', + revision = '2a265d69a4caf57108a73ad2ed1e6922dd2f998c', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -169,7 +169,7 @@ return { }, c_sharp = { install_info = { - revision = '2c31cc87640ab6ad74fb408c0cf1262ce54da5bb', + revision = 'b27b091bfdc5f16d0ef76421ea5609c82a57dff0', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -275,7 +275,7 @@ return { cpp = { install_info = { generate_from_json = true, - revision = 'a352ed85f733f9c6cc458fe5a82bcd4c00f70eab', + revision = 'e5cea0ec884c5c3d2d1e41a741a66ce13da4d945', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -284,7 +284,7 @@ return { }, css = { install_info = { - revision = '6731f030693d3698ad94865ed0228fe45df07e30', + revision = '6e327db434fec0ee90f006697782e43ec855adf5', url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, @@ -312,7 +312,7 @@ return { }, cue = { install_info = { - revision = '8a5f273bfa281c66354da562f2307c2d394b6c81', + revision = '770737bcff2c4aa3f624d439e32b07dbb07102d3', url = 'https://github.com/eonpatapon/tree-sitter-cue', }, maintainers = { '@amaanq' }, @@ -344,7 +344,7 @@ return { }, desktop = { install_info = { - revision = '54133af61b2a9a75fd42c49ce0c771115f81f50b', + revision = '6d66eea37afa1d6bc1e25ef457113743df42416d', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -384,7 +384,7 @@ return { }, djot = { install_info = { - revision = '886601b67d1f4690173a4925c214343c30704d32', + revision = '67e6e23ba7be81a4373e0f49e21207bdc32d12a5', url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, @@ -417,7 +417,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = 'ce150c5be7f617e18ffa2064213e5d9c4cb5d69e', + revision = '26e95de449d772bc2dd4f0382580f84e2a0754d6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -425,7 +425,7 @@ return { }, earthfile = { install_info = { - revision = 'a44f6f6d22ea4fe16fa37ababd90240ab87a9e0d', + revision = '6695a2dfea5f8d9076b11f9bebcac8184e405e67', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -471,7 +471,7 @@ return { }, elixir = { install_info = { - revision = '0e8eb7fc1dfb3d855398870827a9866a1529a5e4', + revision = '86ec2ed45d6d9433b4e0b88cd3d96796bd45625f', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -510,15 +510,15 @@ return { }, enforce = { install_info = { + revision = '9db7a49f3d73222c05b75dcfa8892f5e93542d1e', url = 'https://github.com/simonvic/tree-sitter-enforce', - files = { 'src/parser.c' }, }, maintainers = { '@simonvic' }, tier = 3, }, erlang = { install_info = { - revision = '981fda038d2eb182a88a9374ccb1c14b840cba0b', + revision = '9cea919877741b2ed87cf215c0a06feb9a1930bf', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -608,7 +608,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = '207f1c988f4649e12fe207e4a7e4f83b9da037d1', + revision = 'ad824dea984734406b50699c5f388a7412e85946', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = '066704e4826699e754d351e3bbe12bf2e51de9d8', + revision = 'af6043419f5aa0f8b6c2a26db0187aefa46c7f5f', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -772,7 +772,7 @@ return { }, go = { install_info = { - revision = '7cb21a65af6cc8e5c6742b9dba42881ea1158475', + revision = '5e73f476efafe5c768eda19bbe877f188ded6144', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -788,7 +788,7 @@ return { }, godot_resource = { install_info = { - revision = '941955d027f1d8530501e77ce5e1d6035f5f99c1', + revision = '91c55fdf325a832659e59cdf4a02bfe8a423f14c', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, @@ -813,7 +813,7 @@ return { }, gotmpl = { install_info = { - revision = 'ab4a8c4a51f271f320f2bad6a5d499415bf541b1', + revision = '5f19a36bb1eebb30454e277b222b278ceafed0dd', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -845,7 +845,7 @@ return { }, gren = { install_info = { - revision = '76554f4f2339f5a24eed19c58f2079b51c694152', + revision = '06389ece5bc7344ed3931dc516bb609d8864dd2a', url = 'https://github.com/MaeBrooks/tree-sitter-gren', }, maintainers = { '@MaeBrooks' }, @@ -884,7 +884,7 @@ return { }, haskell = { install_info = { - revision = '2c2fcb22e3b939ed59ae8d6f10500c3213c68670', + revision = '0975ef72fc3c47b530309ca93937d7d143523628', url = 'https://github.com/tree-sitter/tree-sitter-haskell', }, maintainers = { '@mrcjkb' }, @@ -908,7 +908,7 @@ return { }, heex = { install_info = { - revision = 'a63c69c20fd88d1e5614a02b4a6b48cfb7e54a45', + revision = '008626a3fad379d17c81d5ed576edd9bd7a4fbf7', url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, @@ -917,7 +917,7 @@ return { helm = { install_info = { location = 'dialects/helm', - revision = 'ab4a8c4a51f271f320f2bad6a5d499415bf541b1', + revision = '5f19a36bb1eebb30454e277b222b278ceafed0dd', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -970,7 +970,7 @@ return { }, html = { install_info = { - revision = 'd18f83f8bed0be99796c4eacafe9b295ab2ee144', + revision = 'cbb91a0ff3621245e890d1c50cc811bffb77a26b', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -1066,7 +1066,7 @@ return { }, janet_simple = { install_info = { - revision = 'ca4785b47a4ff15653f0408a49c764dec533e0d3', + revision = 'b08b402207fba0037d5152ce7c521351147f4388', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1074,7 +1074,7 @@ return { }, java = { install_info = { - revision = '677da92875756e31b3a42505d822cc8be7c5ab5e', + revision = 'a7db5227ec40fcfe94489559d8c9bc7c8181e25a', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1090,7 +1090,7 @@ return { }, javascript = { install_info = { - revision = '3f1c835d05165050834da0e3cbc23a75e94aaa64', + revision = '6fbef40512dcd9f0a61ce03a4c9ae7597b36ab5c', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1099,9 +1099,9 @@ return { }, jinja = { install_info = { - url = 'https://github.com/cathaysia/tree-sitter-jinja', location = 'tree-sitter-jinja', - files = { 'src/parser.c', 'src/scanner.c' }, + revision = '41b17a33f335130ce9861fd21bffeb88fd768ef4', + url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, readme_note = 'basic highlighting', @@ -1110,9 +1110,9 @@ return { }, jinja_inline = { install_info = { - url = 'https://github.com/cathaysia/tree-sitter-jinja', location = 'tree-sitter-jinja_inline', - files = { 'src/parser.c', 'src/scanner.c' }, + revision = '41b17a33f335130ce9861fd21bffeb88fd768ef4', + url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, readme_note = 'needed for full highlighting', @@ -1136,7 +1136,7 @@ return { }, json = { install_info = { - revision = '54ccd9485e0122a5e9faf5d8aaed7294c308e894', + revision = '46aa487b3ade14b7b05ef92507fdaa3915a662a3', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1175,7 +1175,7 @@ return { }, julia = { install_info = { - revision = 'ffdd9fe4dccdc26d62ce1654fceac52c394f0cf3', + revision = '3f9870ca1f419e480f39fc181fcfb6dad480969a', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, @@ -1264,7 +1264,7 @@ return { }, leo = { install_info = { - revision = '44a061bac4d9443d75f2700c62a71cd4dcf16f05', + revision = '6bc5564917edacd070afc4d33cf5e2e677831ea9', url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, @@ -1304,7 +1304,7 @@ return { }, lua = { install_info = { - revision = '34e60e7f45fc313463c68090d88d742a55d1bd7a', + revision = '68d29aa745b68ae22cbbdb5dcb68c20232521ff6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1376,7 +1376,7 @@ return { }, matlab = { install_info = { - revision = 'b0a0198b182574cd3ca0447264c83331901b9338', + revision = 'bbf1b3f0bd7417c1efb8958fe95be3d0d540207a', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = 'b5d5f238b371b7c9b764f6a053b045dda92bc836', + revision = '65bca19232744b920859ce682cd830b5006b8ccd', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '4b952d99ce6fc795ff3cfa48b05637f2b1751d3b', + revision = 'b3a88cf3e597d48c33657deca4fda7a75c0069c1', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1489,7 +1489,7 @@ return { }, nu = { install_info = { - revision = '9822fc63a62ff87939c88ead9f381f951f092dee', + revision = 'd0b26e45525016ef8e6f2ced05852437c06a00ca', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1498,7 +1498,7 @@ return { objc = { install_info = { generate_from_json = true, - revision = '18802acf31d0b5c1c1d50bdbc9eb0e1636cab9ed', + revision = '181a81b8f23a2d593e7ab4259981f50122909fda', url = 'https://github.com/tree-sitter-grammars/tree-sitter-objc', }, maintainers = { '@amaanq' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '37ad9efe601316248b22173d2ff19a6b4c992016', + revision = '91e4d9106f5da8199ab5158ba65e02da3e664597', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '37ad9efe601316248b22173d2ff19a6b4c992016', + revision = '91e4d9106f5da8199ab5158ba65e02da3e664597', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1535,7 +1535,7 @@ return { ocamllex = { install_info = { generate = true, - revision = '4b9898ccbf198602bb0dec9cd67cc1d2c0a4fad2', + revision = '5da5bb7508ac9fd3317561670ef18c126a0fe2aa', url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', }, maintainers = { '@undu' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = '6f280c52662dc254eb7a5abc0889f7a9e1154ffd', + revision = 'db79ba96ba13e2e89ce9da07c1cc1dfbe6e2e0f6', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = '5021edde6d0ea75aedc313e75cca2ac5aa064d41', + revision = 'f3a19ab3217a6e838870fc7142fa492d1fd7a7c9', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '5021edde6d0ea75aedc313e75cca2ac5aa064d41', + revision = 'f3a19ab3217a6e838870fc7142fa492d1fd7a7c9', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1667,7 +1667,7 @@ return { }, printf = { install_info = { - revision = '60d50a2247b0c1fb72b967562c64711d65c6a060', + revision = 'df6b69967db7d74ab338a86a9ab45c0966c5ee3c', url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', }, maintainers = { '@ObserverOfTime' }, @@ -1778,7 +1778,7 @@ return { }, python = { install_info = { - revision = '44c2f7aebce0efac5867cdc5f2ea03c1d43a0305', + revision = '710796b8b877a970297106e5bbc8e2afa47f86ec', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1812,7 +1812,7 @@ return { }, query = { install_info = { - revision = '5c2d02747250bc326bc33687b3319b7db8554e24', + revision = '0555ac0da902abff06076e40501102cee3ba68bd', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1855,7 +1855,6 @@ return { generate_from_json = true, revision = 'a47cd8ca148685629739a4ab69f58864800fbdab', url = 'https://github.com/tris203/tree-sitter-razor', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@tris203' }, tier = 3, @@ -1959,7 +1958,7 @@ return { }, rst = { install_info = { - revision = 'dd5971ef7759583aadd5aa5e3a3a0905eb5734d5', + revision = '899e073a10012b8028b643d676c30bbf9c64a45d', url = 'https://github.com/stsewd/tree-sitter-rst', }, maintainers = { '@stsewd' }, @@ -1967,7 +1966,7 @@ return { }, ruby = { install_info = { - revision = '71bd32fb7607035768799732addba884a37a6210', + revision = '89bd7a8e5450cb6a942418a619d30469f259e5d6', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1991,7 +1990,7 @@ return { }, scala = { install_info = { - revision = 'd3b9553b47d7ab413a146c4b6498e527265b966e', + revision = 'd67fe3ba3879bd7ba74bd7f56c9a38fed241ba25', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2085,7 +2084,7 @@ return { }, solidity = { install_info = { - revision = '727087514eff57d92e273a24303142308bce3381', + revision = 'd38dcd0b58b223c43e3f9265914fb3167dc624c6', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2224,7 +2223,7 @@ return { swift = { install_info = { generate = true, - revision = 'f4be8072f18fb9704fd35d4b8154ae2b19e314c0', + revision = '1ebc09c38f41d6aab7dd65ca0f8ea032ced0364f', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2298,7 +2297,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = 'a9178bfc9cc8040c08f39b47bae5400a2bf06e50', + revision = 'def9849184de71a797c4e2b2837df85abeccf92c', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2384,7 +2383,7 @@ return { install_info = { generate_from_json = true, location = 'tsx', - revision = '410947e9d2ca8e032cd2419bf1241406c7e6f9bb', + revision = '75b3874edb2dc714fb1fd77a32013d0f8699989f', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2411,7 +2410,7 @@ return { install_info = { generate_from_json = true, location = 'typescript', - revision = '410947e9d2ca8e032cd2419bf1241406c7e6f9bb', + revision = '75b3874edb2dc714fb1fd77a32013d0f8699989f', url = 'https://github.com/tree-sitter/tree-sitter-typescript', }, maintainers = { '@steelsojka' }, @@ -2436,7 +2435,7 @@ return { }, typst = { install_info = { - revision = '26dfb4b94a99cc9d6044342b7ad0ba761da77d60', + revision = 'cb0ffe14259f7f63ee6f05b57ceb24a35bedef75', url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, @@ -2518,7 +2517,7 @@ return { }, vhdl = { install_info = { - revision = 'da8ea8afa7899a99e43a7d61afef9f77b7a675eb', + revision = 'cfc522af3e49c1a00ae74e01aa14e19818dab8f2', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2526,7 +2525,7 @@ return { }, vhs = { install_info = { - revision = '037e675d547b18bbf3fdeb222e242ae5dccc39d7', + revision = '966067fe81d78071805d8e55ec836b3926c4ece4', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, @@ -2611,7 +2610,7 @@ return { xml = { install_info = { location = 'xml', - revision = 'ce150c5be7f617e18ffa2064213e5d9c4cb5d69e', + revision = '26e95de449d772bc2dd4f0382580f84e2a0754d6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2669,7 +2668,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = '3518133e9ebea7c372eff4def368eda8488fad18', + revision = 'acf2b6b5aa8b9ce93f4a1ef1adf4e95c06db7831', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2678,7 +2677,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = '3518133e9ebea7c372eff4def368eda8488fad18', + revision = 'acf2b6b5aa8b9ce93f4a1ef1adf4e95c06db7831', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, diff --git a/scripts/ci-install.sh b/scripts/ci-install.sh index 100cfde27..43f3c4ade 100755 --- a/scripts/ci-install.sh +++ b/scripts/ci-install.sh @@ -6,10 +6,10 @@ NVIM_TAG=${NVIM_TAG-nightly} os=$(uname -s) if [[ $os == Linux ]]; then - wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux-x86_64.tar.gz + wget "https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim-linux-x86_64.tar.gz" tar -zxf nvim-linux-x86_64.tar.gz sudo ln -s "$PWD"/nvim-linux-x86_64/bin/nvim /usr/local/bin - rm -rf "$PWD"/nvim-linux-x86_64/lib/nvim/parser + rm -rf "$PWD"/nvim-linu-x86_x64/lib/nvim/parser mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start ln -s "$PWD" ~/.local/share/nvim/site/pack/nvim-treesitter/start elif [[ $os == Darwin ]]; then From a9f34d5a768b2afcece98ba31345602a71f42fcb Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 9 Feb 2025 13:19:34 +0100 Subject: [PATCH 053/434] feat(parsers): rework tiers * stable: updates follow semver releases (todo) * unstable: updates follow HEAD (default) * unmaintained: no automatic updates * unsupported: no updates, cannot be installed --- CONTRIBUTING.md | 5 +- README.md | 8 +- SUPPORTED_LANGUAGES.md | 633 +++++++++++++------------- TODO.md | 2 +- doc/nvim-treesitter.txt | 6 +- lua/nvim-treesitter/_meta/parsers.lua | 2 +- lua/nvim-treesitter/config.lua | 4 +- lua/nvim-treesitter/parsers.lua | 478 +++++++++---------- scripts/update-parsers.lua | 2 +- 9 files changed, 569 insertions(+), 571 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ea7dcdbf..d82c9cd7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,16 +19,15 @@ To add a new parser, edit the following files: zimbu = { install_info = { url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- git repo; use `path` for local path - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c + revision = 'v2.1', -- tag or commit hash, will be updated automatically -- optional entries: branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - revision = 'v2.1', -- tag or commit hash, will be updated automatically generate = true, -- only needed if repo does not contain pre-generated src/parser.c generate_from_json = true, -- only needed if grammar.js has npm-installed dependencies }, maintainers = { '@me' }, -- the _query_ maintainers - tier = 3, -- community-contributed parser + tier = 1, -- stable: track versioned releases -- optional entries: requires = { 'vim' }, -- if the queries inherit from another language readme_note = "an example language", diff --git a/README.md b/README.md index 8523a75e1..7ea64b76d 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ require('lazy').setup( ```lua require'nvim-treesitter'.setup { - -- A list of parser names or tiers ('stable', 'core', 'community', 'unsupported') - ensure_install = { }, + -- A list of parser names or tiers ('stable', 'unstable') + ensure_install = { 'stable' }, - -- List of parsers to ignore installing - ignore_install = { 'unsupported' }, + -- List of parsers to ignore when installing tiers + ignore_install = { 'rust' }, -- Directory to install parsers and queries to install_dir = vim.fn.stdpath('data') .. '/site' diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 1d15c5328..648c0d445 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -3,7 +3,7 @@ The following is a list of languages for which a parser can be installed through `:TSInstall`. Legend: -- **Tier:** _stable_, _core_, _community_, or _unsupported_ +- **Tier:** _stable_ (updates follow semver releases), _unstable_ (updates follow HEAD), _unmaintained_ (no automatic updates), or _unsupported_ (known to be broken, cannot be 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!) @@ -11,322 +11,321 @@ Legend: 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, @xixiafinland -[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 -[circom](https://github.com/Decurity/tree-sitter-circom) | community | `HF JL` | @alexandr-martirosyan -[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 -[cylc](https://github.com/elliotfontaine/tree-sitter-cylc) | community | `HFIJ ` | @elliotfontaine -[d](https://github.com/gdamore/tree-sitter-d) | community | `HFIJL` | @amaanq -[dart](https://github.com/UserNobody14/tree-sitter-dart) | community | `HFIJL` | @akinsho -[desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) | community | `HF J ` | @ValdezFOmar -[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 | `HF J ` | @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 -[editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) | community | `HF J ` | @ValdezFOmar -[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 | `HF 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 ` | -[enforce](https://github.com/simonvic/tree-sitter-enforce) | community | `HFIJL` | @simonvic -[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 -[fsharp](https://github.com/ionide/tree-sitter-fsharp) | community | `H  J ` | @nsidorenco -[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 -[gap](https://github.com/gap-system/tree-sitter-gap)[^gap] | community | `HF JL` | @reiniscirpons -[gaptst](https://github.com/gap-system/tree-sitter-gaptst)[^gaptst] | community | `HF J ` | @reiniscirpons -[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/ember-tooling/tree-sitter-glimmer)[^glimmer] | community | `HFIJL` | @NullVoxPopuli -[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | community | `H IJL` | @NullVoxPopuli -[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | community | `H IJ ` | @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 -[goctl](https://github.com/chaozwn/tree-sitter-goctl) | community | `HFIJ ` | @chaozwn -[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 | `HF JL` | @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 -[gren](https://github.com/MaeBrooks/tree-sitter-gren) | community | `H  J ` | @MaeBrooks -[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 | `HF JL` | @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 | `HF 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 IJ ` | @cathaysia -[idris](https://github.com/kayhide/tree-sitter-idris) | community | `HF JL` | @srghma -[ini](https://github.com/justinmk/tree-sitter-ini) | community | `HF J ` | @theHamsta -[inko](https://github.com/inko-lang/tree-sitter-inko) | community | `HFIJL` | @yorickpeterse -[ipkg](https://github.com/srghma/tree-sitter-ipkg) | community | `HFIJL` | @srghma -[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 -[jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | community | `H  J ` | @cathaysia -[jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | community | `H  J ` | @cathaysia -[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) | community | `HFIJL` | @fredrikekre -[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 | `HFIJ ` | -[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 -[nginx](https://github.com/opa-oz/tree-sitter-nginx) | community | `HF J ` | @opa-oz -[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 | `HFIJL` | @leo60228 -[nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | core | `HFIJL` | @amaanq -[nu](https://github.com/nushell/tree-sitter-nu) | community | `H IJ ` | @abhisheksingh0x558 -[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, @calebdw -[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | core | `HFIJL` | @tk-shirasaka, @calebdw -[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 -[powershell](https://github.com/airbus-cert/tree-sitter-powershell) | community | `HFIJL` | @L2jLiga -[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 -[problog](https://github.com/foxyseta/tree-sitter-prolog) | community | `HFIJ ` | @foxyseta -[prolog](https://github.com/foxyseta/tree-sitter-prolog) | community | `HFIJ ` | @foxyseta -[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 | `HFIJ ` | @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` | @ribru17 -[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 -[razor](https://github.com/tris203/tree-sitter-razor) | community | `HF J ` | @tris203 -[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 -[rescript](https://github.com/rescript-lang/tree-sitter-rescript) | core | `HFIJL` | @ribru17 -[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | community | `HF J ` | @bamonroe -[robot](https://github.com/Hubro/tree-sitter-robot) | community | `HFIJ ` | @Hubro -[robots](https://github.com/opa-oz/tree-sitter-robots-txt) | community | `H  J ` | @opa-oz -[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 -[runescript](https://github.com/2004Scape/tree-sitter-runescript) | community | `H  J ` | @2004Scape -[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://github.com/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 -[sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | community | `H    ` | @aheber, @xixiaofinland -[slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | core | `HFIJL` | @theHamsta -[slim](https://github.com/theoo/tree-sitter-slim) | community | `HFIJL` | @theoo -[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, @xixiafinland -[sosl](https://github.com/aheber/tree-sitter-sfapex) | community | `H    ` | @aheber, @xixiafinland -[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | community | `H  JL` | @Sarrus1 -[sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | community | `HFIJL` | @GordianDziwis -[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 -[superhtml](https://github.com/kristoff-it/superhtml) | community | `H  J ` | @rockorager -[surface](https://github.com/connorlay/tree-sitter-surface) | community | `HFIJ ` | @connorlay -[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | core | `HFIJL` | @amaanq -[sway](https://github.com/FuelLabs/tree-sitter-sway.git) | core | `HFIJL` | @ribru17 -[swift](https://github.com/alex-pinkus/tree-sitter-swift) | community | `HFIJL` | @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 | `HF 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/GordianDziwis/tree-sitter-turtle) | community | `HFIJL` | @GordianDziwis -[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 | `HF 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/gmlarumbe/tree-sitter-systemverilog) | community | `HF J ` | @zhangwwpeng -[vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | community | `HF J ` | @jpt13653903 -[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 -[vrl](https://github.com/belltoy/tree-sitter-vrl) | community | `HFIJL` | @belltoy -[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 | `HF 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 -[xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | community | `HF JL` | @ValdezFOmar -[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/tree-sitter-grammars/tree-sitter-zig) | stable | `HFIJL` | @amaanq -[ziggy](https://github.com/kristoff-it/ziggy) | community | `H I  ` | @rockorager -[ziggy_schema](https://github.com/kristoff-it/ziggy) | community | `H I  ` | @rockorager +[ada](https://github.com/briot/tree-sitter-ada) | unstable | `HF JL` | @briot +[agda](https://github.com/tree-sitter/tree-sitter-agda) | unstable | `HF J ` | @Decodetalkers +[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJL` | @dlvandenberg +[apex](https://github.com/aheber/tree-sitter-sfapex) | unstable | `HF JL` | @aheber, @xixiafinland +[arduino](https://github.com/tree-sitter-grammars/tree-sitter-arduino) | unstable | `HFIJL` | @ObserverOfTime +[asm](https://github.com/RubixDev/tree-sitter-asm) | unstable | `H  J ` | @RubixDev +[astro](https://github.com/virchau13/tree-sitter-astro) | unstable | `HFIJL` | @virchau13 +[authzed](https://github.com/mleonidas/tree-sitter-authzed) | unstable | `H  J ` | @mattpolzin +[awk](https://github.com/Beaglefoot/tree-sitter-awk) | unstable | `H  J ` | +[bash](https://github.com/tree-sitter/tree-sitter-bash) | unstable | `HF JL` | @TravonteD +[bass](https://github.com/vito/tree-sitter-bass) | unstable | `HFIJL` | @amaanq +[beancount](https://github.com/polarmutex/tree-sitter-beancount) | unstable | `HF J ` | @polarmutex +[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | unstable | `HFIJ ` | @theHamsta, @clason +[bicep](https://github.com/tree-sitter-grammars/tree-sitter-bicep) | unstable | `HFIJL` | @amaanq +[bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) | unstable | `HFIJL` | @amaanq +[blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint) | unstable | `H  J ` | @gabmus +[bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | unstable | `HFIJL` | @ambroisie +[c](https://github.com/tree-sitter/tree-sitter-c) | unstable | `HFIJL` | @amaanq +[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | unstable | `HF JL` | @amaanq +[cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | unstable | `HFIJL` | @amaanq +[capnp](https://github.com/tree-sitter-grammars/tree-sitter-capnp) | unstable | `HFIJL` | @amaanq +[chatito](https://github.com/tree-sitter-grammars/tree-sitter-chatito) | unstable | `HFIJL` | @ObserverOfTime +[circom](https://github.com/Decurity/tree-sitter-circom) | unstable | `HF JL` | @alexandr-martirosyan +[clojure](https://github.com/sogaiu/tree-sitter-clojure) | unstable | `HF JL` | @NoahTheDuke +[cmake](https://github.com/uyha/tree-sitter-cmake) | unstable | `HFIJ ` | @uyha +[comment](https://github.com/stsewd/tree-sitter-comment) | unstable | `H    ` | @stsewd +[commonlisp](https://github.com/tree-sitter-grammars/tree-sitter-commonlisp) | unstable | `HF JL` | @theHamsta +[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | unstable | `H  J ` | @addcninblue +[corn](https://github.com/jakestanger/tree-sitter-corn) | unstable | `HFIJL` | @jakestanger +[cpon](https://github.com/tree-sitter-grammars/tree-sitter-cpon) | unstable | `HFIJL` | @amaanq +[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | unstable | `HFIJL` | @theHamsta +[css](https://github.com/tree-sitter/tree-sitter-css) | unstable | `HFIJ ` | @TravonteD +[csv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq +[cuda](https://github.com/tree-sitter-grammars/tree-sitter-cuda) | unstable | `HFIJL` | @theHamsta +[cue](https://github.com/eonpatapon/tree-sitter-cue) | unstable | `HFIJL` | @amaanq +[cylc](https://github.com/elliotfontaine/tree-sitter-cylc) | unstable | `HFIJ ` | @elliotfontaine +[d](https://github.com/gdamore/tree-sitter-d) | unstable | `HFIJL` | @amaanq +[dart](https://github.com/UserNobody14/tree-sitter-dart) | unstable | `HFIJL` | @akinsho +[desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) | unstable | `HF J ` | @ValdezFOmar +[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | unstable | `HFIJL` | @jedrzejboczar +[dhall](https://github.com/jbellerb/tree-sitter-dhall) | unstable | `HF J ` | @amaanq +[diff](https://github.com/the-mikedavis/tree-sitter-diff) | unstable | `HF J ` | @gbprod +[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | unstable | `H  J ` | @ColinKennedy +[djot](https://github.com/treeman/tree-sitter-djot) | unstable | `HFIJL` | @NoahTheDuke +[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | unstable | `H  J ` | @camdencheek +[dot](https://github.com/rydesun/tree-sitter-dot) | unstable | `H IJ ` | @rydesun +[doxygen](https://github.com/tree-sitter-grammars/tree-sitter-doxygen) | unstable | `H IJ ` | @amaanq +[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HF JL` | @ObserverOfTime +[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | unstable | `H  J ` | @glehmann +[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H  J ` | @RubixDev +ecma (queries only)[^ecma] | unstable | `HFIJL` | @steelsojka +[editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) | unstable | `HF J ` | @ValdezFOmar +[eds](https://github.com/uyha/tree-sitter-eds) | unstable | `HF   ` | @uyha +[eex](https://github.com/connorlay/tree-sitter-eex) | unstable | `H  J ` | @connorlay +[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | unstable | `HFIJL` | @connorlay +[elm](https://github.com/elm-tooling/tree-sitter-elm) | unstable | `HF J ` | @zweimach +[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | unstable | `HFIJL` | @glapa-grossklag, @amaanq +[elvish](https://github.com/elves/tree-sitter-elvish) | unstable | `H  J ` | @elves +[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unstable | `H  J ` | +[enforce](https://github.com/simonvic/tree-sitter-enforce) | unstable | `HFIJL` | @simonvic +[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | unstable | `HF J ` | @filmor +[facility](https://github.com/FacilityApi/tree-sitter-facility) | unstable | `HFIJ ` | @bryankenote +[faust](https://github.com/khiner/tree-sitter-faust) | unstable | `H  J ` | @khiner +[fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | unstable | `HF JL` | @alexmozaidze +[fidl](https://github.com/google/tree-sitter-fidl) | unstable | `HF J ` | @chaopeng +[firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | unstable | `HFIJL` | @amaanq +[fish](https://github.com/ram02z/tree-sitter-fish) | unstable | `HFIJL` | @ram02z +[foam](https://github.com/FoamScience/tree-sitter-foam) | unstable | `HFIJL` | @FoamScience +[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | unstable | `HFIJL` | @amaanq +[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | unstable | `HFIJ ` | @amaanq +[fsh](https://github.com/mgramigna/tree-sitter-fsh) | unstable | `H  J ` | @mgramigna +[fsharp](https://github.com/ionide/tree-sitter-fsharp) | unstable | `H  J ` | @nsidorenco +[func](https://github.com/tree-sitter-grammars/tree-sitter-func) | unstable | `H  J ` | @amaanq +[fusion](https://gitlab.com/jirgn/tree-sitter-fusion) | unstable | `HFIJL` | @jirgn +[gap](https://github.com/gap-system/tree-sitter-gap)[^gap] | unstable | `HF JL` | @reiniscirpons +[gaptst](https://github.com/gap-system/tree-sitter-gaptst)[^gaptst] | unstable | `HF J ` | @reiniscirpons +[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | unstable | `HFIJL` | @PrestonKnopp +[gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | unstable | `H  J ` | @godofavacyn +[git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | unstable | `HF J ` | @amaanq +[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | unstable | `H  J ` | @gbprod +[gitattributes](https://github.com/tree-sitter-grammars/tree-sitter-gitattributes) | unstable | `H  JL` | @ObserverOfTime +[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | unstable | `H  J ` | @gbprod +[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | unstable | `H  J ` | @theHamsta +[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | unstable | `HFIJL` | @amaanq +[glimmer](https://github.com/ember-tooling/tree-sitter-glimmer)[^glimmer] | unstable | `HFIJL` | @NullVoxPopuli +[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | unstable | `H IJL` | @NullVoxPopuli +[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | unstable | `H IJ ` | @NullVoxPopuli +[glsl](https://github.com/tree-sitter-grammars/tree-sitter-glsl) | unstable | `HFIJL` | @theHamsta +[gn](https://github.com/tree-sitter-grammars/tree-sitter-gn) | unstable | `HFIJL` | @amaanq +[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | unstable | `H  J ` | @dpezto +[go](https://github.com/tree-sitter/tree-sitter-go) | unstable | `HFIJL` | @theHamsta, @WinWisely268 +[goctl](https://github.com/chaozwn/tree-sitter-goctl) | unstable | `HFIJ ` | @chaozwn +[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | unstable | `HF JL` | @pierpo +[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | unstable | `H  J ` | @camdencheek +[gosum](https://github.com/tree-sitter-grammars/tree-sitter-go-sum) | unstable | `H    ` | @amaanq +[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | unstable | `HF JL` | @qvalentin +[gowork](https://github.com/omertuc/tree-sitter-go-work) | unstable | `H  J ` | @omertuc +[gpg](https://github.com/tree-sitter-grammars/tree-sitter-gpg-config) | unstable | `H  J ` | @ObserverOfTime +[graphql](https://github.com/bkegley/tree-sitter-graphql) | unstable | `H IJ ` | @bkegley +[gren](https://github.com/MaeBrooks/tree-sitter-gren) | unstable | `H  J ` | @MaeBrooks +[groovy](https://github.com/murtaza64/tree-sitter-groovy) | unstable | `HFIJL` | @murtaza64 +[gstlaunch](https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch) | unstable | `H    ` | @theHamsta +[hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H  J ` | +[hare](https://github.com/tree-sitter-grammars/tree-sitter-hare) | unstable | `HFIJL` | @amaanq +[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | unstable | `HF JL` | @mrcjkb +[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | unstable | `HF   ` | @lykahb +[hcl](https://github.com/tree-sitter-grammars/tree-sitter-hcl) | unstable | `HFIJ ` | @MichaHoffmann +[heex](https://github.com/connorlay/tree-sitter-heex) | unstable | `HFIJL` | @connorlay +[helm](https://github.com/ngalaiko/tree-sitter-go-template) | unstable | `HF JL` | @qvalentin +[hjson](https://github.com/winston0410/tree-sitter-hjson) | unstable | `HFIJL` | @winston0410 +[hlsl](https://github.com/tree-sitter-grammars/tree-sitter-hlsl) | unstable | `HFIJL` | @theHamsta +[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | unstable | `H  J ` | @Freed-Wu +[hocon](https://github.com/antosha417/tree-sitter-hocon) | unstable | `HF J ` | @antosha417 +[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF JL` | @urbit-pilled +[html](https://github.com/tree-sitter/tree-sitter-html) | unstable | `HFIJL` | @TravonteD +html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD +[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | @ObserverOfTime +[http](https://github.com/rest-nvim/tree-sitter-http) | unstable | `HF J ` | @amaanq, @NTBBloodbath +[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | unstable | `HFIJ ` | @pfeiferj +[hyprlang](https://github.com/tree-sitter-grammars/tree-sitter-hyprlang) | unstable | `HFIJ ` | @luckasRanarison +[idl](https://github.com/cathaysia/tree-sitter-idl) | unstable | `H IJ ` | @cathaysia +[idris](https://github.com/kayhide/tree-sitter-idris) | unstable | `HF JL` | @srghma +[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF J ` | @theHamsta +[inko](https://github.com/inko-lang/tree-sitter-inko) | unstable | `HFIJL` | @yorickpeterse +[ipkg](https://github.com/srghma/tree-sitter-ipkg) | unstable | `HFIJL` | @srghma +[ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | unstable | `HFIJL` | @fab4100 +[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | unstable | `HF JL` | @sogaiu +[java](https://github.com/tree-sitter/tree-sitter-java) | unstable | `HFIJL` | @p00f +[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | unstable | `HFIJL` | @steelsojka +[jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | unstable | `H  J ` | @cathaysia +[jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | unstable | `H  J ` | @cathaysia +[jq](https://github.com/flurie/tree-sitter-jq) | unstable | `H  JL` | @ObserverOfTime +[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | unstable | `H    ` | @steelsojka +[json](https://github.com/tree-sitter/tree-sitter-json) | unstable | `HFI L` | @steelsojka +[json5](https://github.com/Joakker/tree-sitter-json5) | unstable | `H  J ` | @Joakker +[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc) | unstable | `HFIJL` | @WhyNotHugo +[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | unstable | `HF JL` | @nawordar +jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka +[julia](https://github.com/tree-sitter/tree-sitter-julia) | unstable | `HFIJL` | @fredrikekre +[just](https://github.com/IndianBoy42/tree-sitter-just) | unstable | `HFIJL` | @Hubro +[kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | unstable | `HFIJL` | @amaanq +[kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | unstable | `HFIJL` | @amaanq +[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | unstable | `HF JL` | @SalBakraa +[koto](https://github.com/koto-lang/tree-sitter-koto) | unstable | `HF JL` | @irh +[kusto](https://github.com/Willem-J-an/tree-sitter-kusto) | unstable | `H  J ` | @Willem-J-an +[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | unstable | `HF JL` | @traxys +[latex](https://github.com/latex-lsp/tree-sitter-latex) | unstable | `HF J ` | @theHamsta, @clason +[ledger](https://github.com/cbarrete/tree-sitter-ledger) | unstable | `HFIJ ` | @cbarrete +[leo](https://github.com/r001/tree-sitter-leo) | unstable | `H IJ ` | @r001 +[linkerscript](https://github.com/tree-sitter-grammars/tree-sitter-linkerscript) | unstable | `HFIJL` | @amaanq +[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | unstable | `H  J ` | @hankthetank27 +[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | unstable | `HFIJL` | @toots +[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | unstable | `H  J ` | @benwilliamgraham +[lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) | unstable | `HFIJL` | @muniftanjim +[luadoc](https://github.com/tree-sitter-grammars/tree-sitter-luadoc) | unstable | `H    ` | @amaanq +[luap](https://github.com/tree-sitter-grammars/tree-sitter-luap)[^luap] | unstable | `H    ` | @amaanq +[luau](https://github.com/tree-sitter-grammars/tree-sitter-luau) | unstable | `HFIJL` | @amaanq +[m68k](https://github.com/grahambates/tree-sitter-m68k) | unstable | `HF JL` | @grahambates +[make](https://github.com/alemuller/tree-sitter-make) | unstable | `HF J ` | @lewis6991 +[markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown] | unstable | `HFIJ ` | @MDeiml +[markdown_inline](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown_inline] | unstable | `H  J ` | @MDeiml +[matlab](https://github.com/acristoffers/tree-sitter-matlab) | unstable | `HFIJL` | @acristoffers +[menhir](https://github.com/Kerl13/tree-sitter-menhir) | unstable | `H  J ` | @Kerl13 +[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `HFIJ ` | +[meson](https://github.com/tree-sitter-grammars/tree-sitter-meson) | unstable | `HFIJ ` | @Decodetalkers +[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H  JL` | @artagnon +[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | unstable | `H  J ` | @Freed-Wu +[nasm](https://github.com/naclsn/tree-sitter-nasm) | unstable | `H  J ` | @ObserverOfTime +[nginx](https://github.com/opa-oz/tree-sitter-nginx) | unstable | `HF J ` | @opa-oz +[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unstable | `H IJ ` | +[nim](https://github.com/alaviss/tree-sitter-nim) | unstable | `HF JL` | @aMOPel +[nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | unstable | `H  J ` | @aMOPel +[ninja](https://github.com/alemuller/tree-sitter-ninja) | unstable | `HFIJ ` | @alemuller +[nix](https://github.com/cstrahan/tree-sitter-nix) | unstable | `HFIJL` | @leo60228 +[nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | unstable | `HFIJL` | @amaanq +[nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | @abhisheksingh0x558 +[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | @amaanq +[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | unstable | `H  J ` | @ColinKennedy +[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu +[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu +[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | unstable | `H  J ` | @undu +[odin](https://github.com/tree-sitter-grammars/tree-sitter-odin) | unstable | `HFIJL` | @amaanq +[pascal](https://github.com/Isopod/tree-sitter-pascal) | unstable | `HFIJL` | @Isopod +[passwd](https://github.com/ath3/tree-sitter-passwd) | unstable | `H    ` | @amaanq +[pem](https://github.com/tree-sitter-grammars/tree-sitter-pem) | unstable | `HF J ` | @ObserverOfTime +[perl](https://github.com/tree-sitter-perl/tree-sitter-perl) | unstable | `HF J ` | @RabbiVeesh, @LeoNerd +[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | unstable | `HFIJL` | @tk-shirasaka, @calebdw +[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | unstable | `HFIJL` | @tk-shirasaka, @calebdw +[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unstable | `H    ` | @mikehaertl +[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | unstable | `H  J ` | @leo60228 +[po](https://github.com/tree-sitter-grammars/tree-sitter-po) | unstable | `HF J ` | @amaanq +[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | unstable | `H    ` | @RabbiVeesh, @LeoNerd +[poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | @ObserverOfTime +[pony](https://github.com/tree-sitter-grammars/tree-sitter-pony) | unstable | `HFIJL` | @amaanq, @mfelsche +[powershell](https://github.com/airbus-cert/tree-sitter-powershell) | unstable | `HFIJL` | @L2jLiga +[printf](https://github.com/tree-sitter-grammars/tree-sitter-printf) | unstable | `H    ` | @ObserverOfTime +[prisma](https://github.com/victorhqc/tree-sitter-prisma) | unstable | `HF J ` | @elianiva +[problog](https://github.com/foxyseta/tree-sitter-prolog) | unstable | `HFIJ ` | @foxyseta +[prolog](https://github.com/foxyseta/tree-sitter-prolog) | unstable | `HFIJ ` | @foxyseta +[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J ` | @MichaHoffmann +[properties](https://github.com/tree-sitter-grammars/tree-sitter-properties)[^properties] | unstable | `H  JL` | @ObserverOfTime +[proto](https://github.com/treywood/tree-sitter-proto) | unstable | `HFIJ ` | @treywood +[prql](https://github.com/PRQL/tree-sitter-prql) | unstable | `H  J ` | @matthias-Q +[psv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq +[pug](https://github.com/zealot128/tree-sitter-pug) | unstable | `H  J ` | @zealot128 +[puppet](https://github.com/tree-sitter-grammars/tree-sitter-puppet) | unstable | `HFIJL` | @amaanq +[purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | @postsolar +[pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | @ObserverOfTime +[python](https://github.com/tree-sitter/tree-sitter-python) | unstable | `HFIJL` | @stsewd, @theHamsta +[ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | @pwntester +[qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | @amaanq +[qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | @Decodetalkers +[query](https://github.com/tree-sitter-grammars/tree-sitter-query)[^query] | unstable | `HFIJL` | @steelsojka +[r](https://github.com/r-lib/tree-sitter-r) | unstable | `H IJL` | @ribru17 +[racket](https://github.com/6cdh/tree-sitter-racket) | unstable | `HF J ` | +[ralph](https://github.com/alephium/tree-sitter-ralph) | unstable | `H  J ` | @tdroxler +[rasi](https://github.com/Fymyte/tree-sitter-rasi) | unstable | `HFIJL` | @Fymyte +[razor](https://github.com/tris203/tree-sitter-razor) | unstable | `HF J ` | @tris203 +[rbs](https://github.com/joker1007/tree-sitter-rbs) | unstable | `HFIJ ` | @joker1007 +[re2c](https://github.com/tree-sitter-grammars/tree-sitter-re2c) | unstable | `HFIJL` | @amaanq +[readline](https://github.com/tree-sitter-grammars/tree-sitter-readline) | unstable | `HFIJ ` | @ribru17 +[regex](https://github.com/tree-sitter/tree-sitter-regex) | unstable | `H    ` | @theHamsta +[rego](https://github.com/FallenAngel97/tree-sitter-rego) | unstable | `H  J ` | @FallenAngel97 +[requirements](https://github.com/tree-sitter-grammars/tree-sitter-requirements) | unstable | `H  J ` | @ObserverOfTime +[rescript](https://github.com/rescript-lang/tree-sitter-rescript) | unstable | `HFIJL` | @ribru17 +[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | unstable | `HF J ` | @bamonroe +[robot](https://github.com/Hubro/tree-sitter-robot) | unstable | `HFIJ ` | @Hubro +[robots](https://github.com/opa-oz/tree-sitter-robots-txt) | unstable | `H  J ` | @opa-oz +[roc](https://github.com/faldor20/tree-sitter-roc) | unstable | `H  JL` | @nat-418 +[ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | unstable | `HFIJL` | @amaanq +[rst](https://github.com/stsewd/tree-sitter-rst) | unstable | `H  JL` | @stsewd +[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | unstable | `HFIJL` | @TravonteD +[runescript](https://github.com/2004Scape/tree-sitter-runescript) | unstable | `H  J ` | @2004Scape +[rust](https://github.com/tree-sitter/tree-sitter-rust) | unstable | `HFIJL` | @amaanq +[scala](https://github.com/tree-sitter/tree-sitter-scala) | unstable | `HF JL` | @stevanmilic +[scfg](https://github.com/rockorager/tree-sitter-scfg) | unstable | `H  J ` | @WhyNotHugo +[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J ` | +[scss](https://github.com/serenadeai/tree-sitter-scss) | unstable | `HFIJ ` | @elianiva +[sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | unstable | `H    ` | @aheber, @xixiaofinland +[slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | unstable | `HFIJL` | @theHamsta +[slim](https://github.com/theoo/tree-sitter-slim) | unstable | `HFIJL` | @theoo +[slint](https://github.com/slint-ui/tree-sitter-slint) | unstable | `HFIJL` | @hunger +[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | unstable | `HFIJL` | @amaanq +[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | unstable | `H  J ` | @amaanq, @keynmol +[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJL` | @osthomas +[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | unstable | `HF J ` | @amaanq +[soql](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | @aheber, @xixiafinland +[sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | @aheber, @xixiafinland +[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | unstable | `H  JL` | @Sarrus1 +[sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | unstable | `HFIJL` | @GordianDziwis +[sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `H IJ ` | @derekstride +[squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | unstable | `HFIJL` | @amaanq +[ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | @ObserverOfTime +[starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | unstable | `HFIJL` | @amaanq +[strace](https://github.com/sigmaSd/tree-sitter-strace) | unstable | `H  J ` | @amaanq +[styled](https://github.com/mskelton/tree-sitter-styled) | unstable | `HFIJ ` | @mskelton +[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | unstable | `HFIJL` | @madskjeldgaard +[superhtml](https://github.com/kristoff-it/superhtml) | unstable | `H  J ` | @rockorager +[surface](https://github.com/connorlay/tree-sitter-surface) | unstable | `HFIJ ` | @connorlay +[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | unstable | `HFIJL` | @amaanq +[sway](https://github.com/FuelLabs/tree-sitter-sway.git) | unstable | `HFIJL` | @ribru17 +[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unstable | `HFIJL` | @alex-pinkus +[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | @RaafatTurki +[systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | @ok-ryoko +[t32](https://gitlab.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | @xasc +[tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | unstable | `HFIJL` | @amaanq +[tact](https://github.com/tact-lang/tree-sitter-tact) | unstable | `HFIJL` | @novusnota +[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | unstable | `HFIJ ` | @lewis6991 +[teal](https://github.com/euclidianAce/tree-sitter-teal) | unstable | `HFIJL` | @euclidianAce +[templ](https://github.com/vrischmann/tree-sitter-templ) | unstable | `HF J ` | @vrischmann +[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | unstable | `HFIJ ` | @MichaHoffmann +[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | unstable | `HFIJ ` | @Porter +[thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | unstable | `HFIJL` | @amaanq, @duskmoon314 +[tiger](https://github.com/ambroisie/tree-sitter-tiger) | unstable | `HFIJL` | @ambroisie +[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | unstable | `HF JL` | @ahelwer, @susliko +[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | unstable | `H  J ` | @Freed-Wu +[todotxt](https://github.com/arnarg/tree-sitter-todotxt) | unstable | `H    ` | @arnarg +[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | unstable | `HFIJL` | @tk-shirasaka +[tsv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq +[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | unstable | `HFIJL` | @steelsojka +[turtle](https://github.com/GordianDziwis/tree-sitter-turtle) | unstable | `HFIJL` | @GordianDziwis +[twig](https://github.com/gbprod/tree-sitter-twig) | unstable | `H  J ` | @gbprod +[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | unstable | `HFIJL` | @steelsojka +[typespec](https://github.com/happenslol/tree-sitter-typespec) | unstable | `H IJ ` | @happenslol +[typoscript](https://github.com/Teddytrombone/tree-sitter-typoscript) | unstable | `HFIJ ` | @Teddytrombone +[typst](https://github.com/uben0/tree-sitter-typst) | unstable | `HFIJ ` | @uben0, @RaafatTurki +[udev](https://github.com/tree-sitter-grammars/tree-sitter-udev) | unstable | `H  JL` | @ObserverOfTime +[ungrammar](https://github.com/tree-sitter-grammars/tree-sitter-ungrammar) | unstable | `HFIJL` | @Philipp-M, @amaanq +[unison](https://github.com/kylegoetz/tree-sitter-unison) | unstable | `HF J ` | @tapegram +[usd](https://github.com/ColinKennedy/tree-sitter-usd) | unstable | `HFIJL` | @ColinKennedy +[uxntal](https://github.com/tree-sitter-grammars/tree-sitter-uxntal) | unstable | `HFIJL` | @amaanq +[v](https://github.com/vlang/v-analyzer) | unstable | `HFIJL` | @kkharji, @amaanq +[vala](https://github.com/vala-lang/tree-sitter-vala) | unstable | `HF J ` | @Prince781 +[vento](https://github.com/ventojs/tree-sitter-vento) | unstable | `H  J ` | @wrapperup, @oscarotero +[verilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | unstable | `HF J ` | @zhangwwpeng +[vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | unstable | `HF J ` | @jpt13653903 +[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | unstable | `H  J ` | @caarlos0 +[vim](https://github.com/tree-sitter-grammars/tree-sitter-vim) | unstable | `HF JL` | @clason +[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | unstable | `H  J ` | @clason +[vrl](https://github.com/belltoy/tree-sitter-vrl) | unstable | `HFIJL` | @belltoy +[vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) | unstable | `HFIJ ` | @WhyNotHugo, @lucario387 +[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | unstable | `HFIJ ` | @szebniok +[wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | @theHamsta +[wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | @gshpychka, @MarkMcCulloh +[wit](https://github.com/liamwh/tree-sitter-wit) | unstable | `HF J ` | @liamwh +[xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | @ObserverOfTime +[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | @ObserverOfTime +[xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | @ValdezFOmar +[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | unstable | `HFIJL` | @amaanq +[yang](https://github.com/Hubro/tree-sitter-yang) | unstable | `HFIJ ` | @Hubro +[yuck](https://github.com/tree-sitter-grammars/tree-sitter-yuck) | unstable | `HFIJL` | @Philipp-M, @amaanq +[zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) | unstable | `H  J ` | @Freed-Wu +[zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) | unstable | `HFIJL` | @amaanq +[ziggy](https://github.com/kristoff-it/ziggy) | unstable | `H I  ` | @rockorager +[ziggy_schema](https://github.com/kristoff-it/ziggy) | unstable | `H I  ` | @rockorager [^bp]: Android Blueprint [^ecma]: queries required by javascript, typescript, tsx, qmljs [^gap]: GAP system diff --git a/TODO.md b/TODO.md index 5aef3991c..add857336 100644 --- a/TODO.md +++ b/TODO.md @@ -6,7 +6,7 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [ ] **`parsers.lua`:** allow specifying version in addition to commit hash (for Tier 1) - [ ] **`parsers.lua`:** add WASM support (tier 1) -- [ ] **`parsers.lua`:** update tiers (stable, dev, unmaintained, broken) +- [ ] **`install.lua`:** migrate to async v2 - [ ] **tests:** fix, update (remove custom crate, plenary dependency) - [ ] **documentation:** consolidate, autogenerate? - [ ] **documentation:** migration guide diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 9ba76be2a..b5028768d 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -42,10 +42,10 @@ To install supported parsers and queries, put this in your `init.lua` file: -- Defaults to the `stdpath('data')/site` dir. install_dir = "/some/path/to/store/parsers", - -- A list of parser names, or "core", "stable", "community", "unstable" - ensure_install = { "core", "rust" }, + -- A list of parser names, or "stable", "unstable", "unmaintained", "unsupported" + ensure_install = { "stable", "rust" }, - -- List of parsers to ignore installing (for "core" etc.) + -- List of parsers to ignore installing (for "stable" etc.) ignore_install = { "javascript" }, } diff --git a/lua/nvim-treesitter/_meta/parsers.lua b/lua/nvim-treesitter/_meta/parsers.lua index e265bf611..f3cb81b6f 100644 --- a/lua/nvim-treesitter/_meta/parsers.lua +++ b/lua/nvim-treesitter/_meta/parsers.lua @@ -35,7 +35,7 @@ error('Cannot require a meta file') ---List of other languages to install (e.g., if queries inherit from them) ---@field requires? string[] --- ----Language support tier, maps to "core", "stable", "community", "unmaintained" +---Language support tier, maps to "stable", "unstable", "unmaintained", "unsupported" ---@field tier integer --- ---Explanatory footnote text to add in SUPPORTED_LANGUAGES.md diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 4781d5a21..b1cb4f761 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -1,6 +1,6 @@ local M = {} -M.tiers = { 'stable', 'core', 'community', 'unsupported' } +M.tiers = { 'stable', 'unstable', 'unmaintained', 'unsupported' } ---@class TSConfig ---@field ensure_install string[] @@ -10,7 +10,7 @@ M.tiers = { 'stable', 'core', 'community', 'unsupported' } ---@type TSConfig local config = { ensure_install = {}, - ignore_install = { 'unsupported' }, + ignore_install = {}, install_dir = vim.fs.joinpath(vim.fn.stdpath('data'), 'site'), } diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 75f202e60..1d2329523 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -6,7 +6,7 @@ return { url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, - tier = 3, + tier = 2, }, agda = { install_info = { @@ -24,16 +24,16 @@ return { }, maintainers = { '@dlvandenberg' }, requires = { 'html', 'html_tags' }, - tier = 3, + tier = 2, }, apex = { install_info = { location = 'apex', - revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', + revision = '3597575a429766dd7ecce9f5bb97f6fec4419d5d', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, - tier = 3, + tier = 2, }, arduino = { install_info = { @@ -51,7 +51,7 @@ return { url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, - tier = 3, + tier = 2, }, astro = { install_info = { @@ -61,7 +61,7 @@ return { }, maintainers = { '@virchau13' }, requires = { 'html', 'html_tags' }, - tier = 3, + tier = 2, }, authzed = { install_info = { @@ -69,14 +69,14 @@ return { url = 'https://github.com/mleonidas/tree-sitter-authzed', }, maintainers = { '@mattpolzin' }, - tier = 3, + tier = 2, }, awk = { install_info = { revision = '34bbdc7cce8e803096f47b625979e34c1be38127', url = 'https://github.com/Beaglefoot/tree-sitter-awk', }, - tier = 4, + tier = 2, }, bash = { install_info = { @@ -84,7 +84,7 @@ return { url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, - tier = 1, + tier = 2, }, bass = { install_info = { @@ -92,7 +92,7 @@ return { url = 'https://github.com/vito/tree-sitter-bass', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, beancount = { install_info = { @@ -100,7 +100,7 @@ return { url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, - tier = 3, + tier = 2, }, bibtex = { install_info = { @@ -108,7 +108,7 @@ return { url = 'https://github.com/latex-lsp/tree-sitter-bibtex', }, maintainers = { '@theHamsta', '@clason' }, - tier = 3, + tier = 2, }, bicep = { install_info = { @@ -140,7 +140,7 @@ return { url = 'https://gitlab.com/gabmus/tree-sitter-blueprint', }, maintainers = { '@gabmus' }, - tier = 4, + tier = 2, }, bp = { install_info = { @@ -149,7 +149,7 @@ return { }, maintainers = { '@ambroisie' }, readme_note = 'Android Blueprint', - tier = 3, + tier = 2, }, brightscript = { install_info = { @@ -165,11 +165,11 @@ return { url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, - tier = 1, + tier = 2, }, c_sharp = { install_info = { - revision = 'b27b091bfdc5f16d0ef76421ea5609c82a57dff0', + revision = 'b5eb5742f6a7e9438bee22ce8026d6b927be2cd7', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -213,7 +213,7 @@ return { url = 'https://github.com/Decurity/tree-sitter-circom', }, maintainers = { '@alexandr-martirosyan' }, - tier = 3, + tier = 2, }, clojure = { install_info = { @@ -221,7 +221,7 @@ return { url = 'https://github.com/sogaiu/tree-sitter-clojure', }, maintainers = { '@NoahTheDuke' }, - tier = 3, + tier = 2, }, cmake = { install_info = { @@ -229,7 +229,7 @@ return { url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, - tier = 3, + tier = 2, }, comment = { install_info = { @@ -237,7 +237,7 @@ return { url = 'https://github.com/stsewd/tree-sitter-comment', }, maintainers = { '@stsewd' }, - tier = 3, + tier = 2, }, commonlisp = { install_info = { @@ -254,7 +254,7 @@ return { url = 'https://github.com/addcninblue/tree-sitter-cooklang', }, maintainers = { '@addcninblue' }, - tier = 3, + tier = 2, }, corn = { install_info = { @@ -262,7 +262,7 @@ return { url = 'https://github.com/jakestanger/tree-sitter-corn', }, maintainers = { '@jakestanger' }, - tier = 3, + tier = 2, }, cpon = { install_info = { @@ -316,7 +316,7 @@ return { url = 'https://github.com/eonpatapon/tree-sitter-cue', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, cylc = { install_info = { @@ -324,7 +324,7 @@ return { url = 'https://github.com/elliotfontaine/tree-sitter-cylc', }, maintainers = { '@elliotfontaine' }, - tier = 3, + tier = 2, }, d = { install_info = { @@ -332,7 +332,7 @@ return { url = 'https://github.com/gdamore/tree-sitter-d', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, dart = { install_info = { @@ -340,7 +340,7 @@ return { url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, - tier = 3, + tier = 2, }, desktop = { install_info = { @@ -348,7 +348,7 @@ return { url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, - tier = 3, + tier = 2, }, devicetree = { install_info = { @@ -356,7 +356,7 @@ return { url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, - tier = 3, + tier = 2, }, dhall = { install_info = { @@ -364,7 +364,7 @@ return { url = 'https://github.com/jbellerb/tree-sitter-dhall', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, diff = { install_info = { @@ -372,7 +372,7 @@ return { url = 'https://github.com/the-mikedavis/tree-sitter-diff', }, maintainers = { '@gbprod' }, - tier = 3, + tier = 2, }, disassembly = { install_info = { @@ -380,7 +380,7 @@ return { url = 'https://github.com/ColinKennedy/tree-sitter-disassembly', }, maintainers = { '@ColinKennedy' }, - tier = 3, + tier = 2, }, djot = { install_info = { @@ -388,7 +388,7 @@ return { url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, - tier = 3, + tier = 2, }, dockerfile = { install_info = { @@ -396,7 +396,7 @@ return { url = 'https://github.com/camdencheek/tree-sitter-dockerfile', }, maintainers = { '@camdencheek' }, - tier = 3, + tier = 2, }, dot = { install_info = { @@ -404,7 +404,7 @@ return { url = 'https://github.com/rydesun/tree-sitter-dot', }, maintainers = { '@rydesun' }, - tier = 3, + tier = 2, }, doxygen = { install_info = { @@ -429,7 +429,7 @@ return { url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, - tier = 3, + tier = 2, }, ebnf = { install_info = { @@ -438,12 +438,12 @@ return { url = 'https://github.com/RubixDev/ebnf', }, maintainers = { '@RubixDev' }, - tier = 3, + tier = 2, }, ecma = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, typescript, tsx, qmljs', - tier = 3, + tier = 2, }, editorconfig = { install_info = { @@ -451,7 +451,7 @@ return { url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, - tier = 3, + tier = 2, }, eds = { install_info = { @@ -459,7 +459,7 @@ return { url = 'https://github.com/uyha/tree-sitter-eds', }, maintainers = { '@uyha' }, - tier = 3, + tier = 2, }, eex = { install_info = { @@ -467,7 +467,7 @@ return { url = 'https://github.com/connorlay/tree-sitter-eex', }, maintainers = { '@connorlay' }, - tier = 3, + tier = 2, }, elixir = { install_info = { @@ -475,7 +475,7 @@ return { url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, - tier = 3, + tier = 2, }, elm = { install_info = { @@ -483,7 +483,7 @@ return { url = 'https://github.com/elm-tooling/tree-sitter-elm', }, maintainers = { '@zweimach' }, - tier = 3, + tier = 2, }, elsa = { install_info = { @@ -491,7 +491,7 @@ return { url = 'https://github.com/glapa-grossklag/tree-sitter-elsa', }, maintainers = { '@glapa-grossklag', '@amaanq' }, - tier = 3, + tier = 2, }, elvish = { install_info = { @@ -499,30 +499,30 @@ return { url = 'https://github.com/elves/tree-sitter-elvish', }, maintainers = { '@elves' }, - tier = 3, + tier = 2, }, embedded_template = { install_info = { revision = '8495d106154741e6d35d37064f864758ece75de6', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, - tier = 4, + tier = 2, }, enforce = { install_info = { - revision = '9db7a49f3d73222c05b75dcfa8892f5e93542d1e', + revision = 'cf853e5f56f1babe5ec573e356f6fbb4784bf5c1', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, - tier = 3, + tier = 2, }, erlang = { install_info = { - revision = '9cea919877741b2ed87cf215c0a06feb9a1930bf', + revision = '370cea629eb62a8686504b9fb3252a5e1ae55313', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, - tier = 3, + tier = 2, }, facility = { install_info = { @@ -530,7 +530,7 @@ return { url = 'https://github.com/FacilityApi/tree-sitter-facility', }, maintainers = { '@bryankenote' }, - tier = 3, + tier = 2, }, faust = { install_info = { @@ -538,7 +538,7 @@ return { url = 'https://github.com/khiner/tree-sitter-faust', }, maintainers = { '@khiner' }, - tier = 3, + tier = 2, }, fennel = { install_info = { @@ -547,7 +547,7 @@ return { url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, - tier = 3, + tier = 2, }, fidl = { install_info = { @@ -555,7 +555,7 @@ return { url = 'https://github.com/google/tree-sitter-fidl', }, maintainers = { '@chaopeng' }, - tier = 3, + tier = 2, }, firrtl = { install_info = { @@ -571,7 +571,7 @@ return { url = 'https://github.com/ram02z/tree-sitter-fish', }, maintainers = { '@ram02z' }, - tier = 3, + tier = 2, }, foam = { install_info = { @@ -579,7 +579,7 @@ return { url = 'https://github.com/FoamScience/tree-sitter-foam', }, maintainers = { '@FoamScience' }, - tier = 3, + tier = 2, }, forth = { install_info = { @@ -587,7 +587,7 @@ return { url = 'https://github.com/AlexanderBrevig/tree-sitter-forth', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, fortran = { install_info = { @@ -595,7 +595,7 @@ return { url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, fsh = { install_info = { @@ -603,7 +603,7 @@ return { url = 'https://github.com/mgramigna/tree-sitter-fsh', }, maintainers = { '@mgramigna' }, - tier = 3, + tier = 2, }, fsharp = { install_info = { @@ -612,7 +612,7 @@ return { url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, - tier = 3, + tier = 2, }, func = { install_info = { @@ -628,7 +628,7 @@ return { url = 'https://gitlab.com/jirgn/tree-sitter-fusion', }, maintainers = { '@jirgn' }, - tier = 3, + tier = 2, }, gap = { install_info = { @@ -637,7 +637,7 @@ return { }, maintainers = { '@reiniscirpons' }, readme_note = 'GAP system', - tier = 3, + tier = 2, }, gaptst = { install_info = { @@ -647,7 +647,7 @@ return { maintainers = { '@reiniscirpons' }, readme_note = 'GAP system test files', requires = { 'gap' }, - tier = 3, + tier = 2, }, gdscript = { install_info = { @@ -656,7 +656,7 @@ return { }, maintainers = { '@PrestonKnopp' }, readme_note = 'Godot', - tier = 3, + tier = 2, }, gdshader = { install_info = { @@ -664,7 +664,7 @@ return { url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', }, maintainers = { '@godofavacyn' }, - tier = 3, + tier = 2, }, git_config = { install_info = { @@ -672,7 +672,7 @@ return { url = 'https://github.com/the-mikedavis/tree-sitter-git-config', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, git_rebase = { install_info = { @@ -680,7 +680,7 @@ return { url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', }, maintainers = { '@gbprod' }, - tier = 3, + tier = 2, }, gitattributes = { install_info = { @@ -696,7 +696,7 @@ return { url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, - tier = 3, + tier = 2, }, gitignore = { install_info = { @@ -704,7 +704,7 @@ return { url = 'https://github.com/shunsambongi/tree-sitter-gitignore', }, maintainers = { '@theHamsta' }, - tier = 3, + tier = 2, }, gleam = { install_info = { @@ -712,7 +712,7 @@ return { url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, glimmer = { install_info = { @@ -721,7 +721,7 @@ return { }, maintainers = { '@NullVoxPopuli' }, readme_note = 'Glimmer and Ember', - tier = 3, + tier = 2, }, glimmer_javascript = { install_info = { @@ -731,7 +731,7 @@ return { }, maintainers = { '@NullVoxPopuli' }, requires = { 'ecma' }, - tier = 3, + tier = 2, }, glimmer_typescript = { install_info = { @@ -741,7 +741,7 @@ return { }, maintainers = { '@NullVoxPopuli' }, requires = { 'typescript' }, - tier = 3, + tier = 2, }, glsl = { install_info = { @@ -768,7 +768,7 @@ return { url = 'https://github.com/dpezto/tree-sitter-gnuplot', }, maintainers = { '@dpezto' }, - tier = 3, + tier = 2, }, go = { install_info = { @@ -784,7 +784,7 @@ return { url = 'https://github.com/chaozwn/tree-sitter-goctl', }, maintainers = { '@chaozwn' }, - tier = 3, + tier = 2, }, godot_resource = { install_info = { @@ -793,7 +793,7 @@ return { }, maintainers = { '@pierpo' }, readme_note = 'Godot Resources', - tier = 3, + tier = 2, }, gomod = { install_info = { @@ -801,7 +801,7 @@ return { url = 'https://github.com/camdencheek/tree-sitter-go-mod', }, maintainers = { '@camdencheek' }, - tier = 3, + tier = 2, }, gosum = { install_info = { @@ -817,7 +817,7 @@ return { url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, - tier = 3, + tier = 2, }, gowork = { install_info = { @@ -825,7 +825,7 @@ return { url = 'https://github.com/omertuc/tree-sitter-go-work', }, maintainers = { '@omertuc' }, - tier = 3, + tier = 2, }, gpg = { install_info = { @@ -841,7 +841,7 @@ return { url = 'https://github.com/bkegley/tree-sitter-graphql', }, maintainers = { '@bkegley' }, - tier = 3, + tier = 2, }, gren = { install_info = { @@ -849,7 +849,7 @@ return { url = 'https://github.com/MaeBrooks/tree-sitter-gren', }, maintainers = { '@MaeBrooks' }, - tier = 3, + tier = 2, }, groovy = { install_info = { @@ -857,7 +857,7 @@ return { url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, - tier = 3, + tier = 2, }, gstlaunch = { install_info = { @@ -872,7 +872,7 @@ return { revision = 'bc5b3a10d6d27e8220a113a9a7fe9bec0a1574b0', url = 'https://github.com/slackhq/tree-sitter-hack', }, - tier = 4, + tier = 2, }, hare = { install_info = { @@ -896,7 +896,7 @@ return { url = 'https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent', }, maintainers = { '@lykahb' }, - tier = 3, + tier = 2, }, hcl = { install_info = { @@ -912,7 +912,7 @@ return { url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, - tier = 3, + tier = 2, }, helm = { install_info = { @@ -921,7 +921,7 @@ return { url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, - tier = 3, + tier = 2, }, hjson = { install_info = { @@ -931,7 +931,7 @@ return { }, maintainers = { '@winston0410' }, requires = { 'json' }, - tier = 3, + tier = 2, }, hlsl = { install_info = { @@ -949,7 +949,7 @@ return { url = 'https://github.com/Freed-Wu/tree-sitter-hlsplaylist', }, maintainers = { '@Freed-Wu' }, - tier = 3, + tier = 2, }, hocon = { install_info = { @@ -958,7 +958,7 @@ return { url = 'https://github.com/antosha417/tree-sitter-hocon', }, maintainers = { '@antosha417' }, - tier = 4, + tier = 2, }, hoon = { install_info = { @@ -966,7 +966,7 @@ return { url = 'https://github.com/urbit-pilled/tree-sitter-hoon', }, maintainers = { '@urbit-pilled' }, - tier = 3, + tier = 2, }, html = { install_info = { @@ -980,7 +980,7 @@ return { html_tags = { maintainers = { '@TravonteD' }, readme_note = 'queries required by html, astro, vue, svelte', - tier = 3, + tier = 2, }, htmldjango = { install_info = { @@ -988,15 +988,15 @@ return { url = 'https://github.com/interdependence/tree-sitter-htmldjango', }, maintainers = { '@ObserverOfTime' }, - tier = 3, + tier = 2, }, http = { install_info = { - revision = 'd2e4e4c7d03f70e0465d436f2b5f67497cd544ca', + revision = '77ecf6385f1b5d422e0bbd12204374d287d61ad2', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, - tier = 3, + tier = 2, }, hurl = { install_info = { @@ -1004,7 +1004,7 @@ return { url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, - tier = 3, + tier = 2, }, hyprlang = { install_info = { @@ -1016,11 +1016,11 @@ return { }, idl = { install_info = { - revision = '86ff7f19747a761dc8ba72f4045fd64aed94ba4c', + revision = 'b14e7971cfbd64fa0ebcdeaa4dfbb3cb0bfabd7c', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, - tier = 3, + tier = 2, }, idris = { install_info = { @@ -1028,7 +1028,7 @@ return { url = 'https://github.com/kayhide/tree-sitter-idris', }, maintainers = { '@srghma' }, - tier = 3, + tier = 2, }, ini = { install_info = { @@ -1036,7 +1036,7 @@ return { url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, - tier = 3, + tier = 2, }, inko = { install_info = { @@ -1044,7 +1044,7 @@ return { url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, - tier = 3, + tier = 2, }, ipkg = { install_info = { @@ -1052,7 +1052,7 @@ return { url = 'https://github.com/srghma/tree-sitter-ipkg', }, maintainers = { '@srghma' }, - tier = 3, + tier = 2, }, ispc = { install_info = { @@ -1070,7 +1070,7 @@ return { url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, - tier = 3, + tier = 2, }, java = { install_info = { @@ -1106,7 +1106,7 @@ return { maintainers = { '@cathaysia' }, readme_note = 'basic highlighting', requires = { 'jinja_inline' }, - tier = 3, + tier = 2, }, jinja_inline = { install_info = { @@ -1116,7 +1116,7 @@ return { }, maintainers = { '@cathaysia' }, readme_note = 'needed for full highlighting', - tier = 3, + tier = 2, }, jq = { install_info = { @@ -1124,7 +1124,7 @@ return { url = 'https://github.com/flurie/tree-sitter-jq', }, maintainers = { '@ObserverOfTime' }, - tier = 3, + tier = 2, }, jsdoc = { install_info = { @@ -1148,7 +1148,7 @@ return { url = 'https://github.com/Joakker/tree-sitter-json5', }, maintainers = { '@Joakker' }, - tier = 3, + tier = 2, }, jsonc = { install_info = { @@ -1158,7 +1158,7 @@ return { }, maintainers = { '@WhyNotHugo' }, requires = { 'json' }, - tier = 3, + tier = 2, }, jsonnet = { install_info = { @@ -1166,20 +1166,20 @@ return { url = 'https://github.com/sourcegraph/tree-sitter-jsonnet', }, maintainers = { '@nawordar' }, - tier = 3, + tier = 2, }, jsx = { maintainers = { '@steelsojka' }, readme_note = 'queries required by javascript, tsx', - tier = 3, + tier = 2, }, julia = { install_info = { - revision = '3f9870ca1f419e480f39fc181fcfb6dad480969a', + revision = '12a3aede757bc7fbdfb1909507c7a6fddd31df37', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, - tier = 3, + tier = 2, }, just = { install_info = { @@ -1187,7 +1187,7 @@ return { url = 'https://github.com/IndianBoy42/tree-sitter-just', }, maintainers = { '@Hubro' }, - tier = 3, + tier = 2, }, kcl = { install_info = { @@ -1219,7 +1219,7 @@ return { url = 'https://github.com/fwcd/tree-sitter-kotlin', }, maintainers = { '@SalBakraa' }, - tier = 3, + tier = 2, }, koto = { install_info = { @@ -1227,7 +1227,7 @@ return { url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, - tier = 3, + tier = 2, }, kusto = { install_info = { @@ -1235,7 +1235,7 @@ return { url = 'https://github.com/Willem-J-an/tree-sitter-kusto', }, maintainers = { '@Willem-J-an' }, - tier = 3, + tier = 2, }, lalrpop = { install_info = { @@ -1243,7 +1243,7 @@ return { url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, - tier = 3, + tier = 2, }, latex = { install_info = { @@ -1252,7 +1252,7 @@ return { url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, - tier = 3, + tier = 2, }, ledger = { install_info = { @@ -1260,7 +1260,7 @@ return { url = 'https://github.com/cbarrete/tree-sitter-ledger', }, maintainers = { '@cbarrete' }, - tier = 3, + tier = 2, }, leo = { install_info = { @@ -1268,7 +1268,7 @@ return { url = 'https://github.com/r001/tree-sitter-leo', }, maintainers = { '@r001' }, - tier = 3, + tier = 2, }, linkerscript = { install_info = { @@ -1284,7 +1284,7 @@ return { url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, - tier = 3, + tier = 2, }, liquidsoap = { install_info = { @@ -1292,7 +1292,7 @@ return { url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, - tier = 3, + tier = 2, }, llvm = { install_info = { @@ -1300,7 +1300,7 @@ return { url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, - tier = 3, + tier = 2, }, lua = { install_info = { @@ -1308,7 +1308,7 @@ return { url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, - tier = 1, + tier = 2, }, luadoc = { install_info = { @@ -1343,7 +1343,7 @@ return { url = 'https://github.com/grahambates/tree-sitter-m68k', }, maintainers = { '@grahambates' }, - tier = 3, + tier = 2, }, make = { install_info = { @@ -1351,7 +1351,7 @@ return { url = 'https://github.com/alemuller/tree-sitter-make', }, maintainers = { '@lewis6991' }, - tier = 3, + tier = 2, }, markdown = { install_info = { @@ -1362,7 +1362,7 @@ return { maintainers = { '@MDeiml' }, readme_note = 'basic highlighting', requires = { 'markdown_inline' }, - tier = 1, + tier = 2, }, markdown_inline = { install_info = { @@ -1372,7 +1372,7 @@ return { }, maintainers = { '@MDeiml' }, readme_note = 'needed for full highlighting', - tier = 1, + tier = 2, }, matlab = { install_info = { @@ -1380,7 +1380,7 @@ return { url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, - tier = 3, + tier = 2, }, menhir = { install_info = { @@ -1388,14 +1388,14 @@ return { url = 'https://github.com/Kerl13/tree-sitter-menhir', }, maintainers = { '@Kerl13' }, - tier = 3, + tier = 2, }, mermaid = { install_info = { revision = '90ae195b31933ceb9d079abfa8a3ad0a36fee4cc', url = 'https://github.com/monaqa/tree-sitter-mermaid', }, - tier = 4, + tier = 2, }, meson = { install_info = { @@ -1408,11 +1408,11 @@ return { mlir = { install_info = { generate = true, - revision = '65bca19232744b920859ce682cd830b5006b8ccd', + revision = '9d83ca263fa7ec8ac7a5fd8ad14891b2dc583a32', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, - tier = 3, + tier = 2, }, muttrc = { install_info = { @@ -1420,7 +1420,7 @@ return { url = 'https://github.com/neomutt/tree-sitter-muttrc', }, maintainers = { '@Freed-Wu' }, - tier = 3, + tier = 2, }, nasm = { install_info = { @@ -1428,7 +1428,7 @@ return { url = 'https://github.com/naclsn/tree-sitter-nasm', }, maintainers = { '@ObserverOfTime' }, - tier = 3, + tier = 2, }, nginx = { install_info = { @@ -1436,14 +1436,14 @@ return { url = 'https://github.com/opa-oz/tree-sitter-nginx', }, maintainers = { '@opa-oz' }, - tier = 3, + tier = 2, }, nickel = { install_info = { revision = '25464b33522c3f609fa512aa9651707c0b66d48b', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, - tier = 4, + tier = 2, }, nim = { install_info = { @@ -1452,7 +1452,7 @@ return { }, maintainers = { '@aMOPel' }, requires = { 'nim_format_string' }, - tier = 3, + tier = 2, }, nim_format_string = { install_info = { @@ -1460,7 +1460,7 @@ return { url = 'https://github.com/aMOPel/tree-sitter-nim-format-string', }, maintainers = { '@aMOPel' }, - tier = 3, + tier = 2, }, ninja = { install_info = { @@ -1468,7 +1468,7 @@ return { url = 'https://github.com/alemuller/tree-sitter-ninja', }, maintainers = { '@alemuller' }, - tier = 3, + tier = 2, }, nix = { install_info = { @@ -1476,7 +1476,7 @@ return { url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, - tier = 3, + tier = 2, }, nqc = { install_info = { @@ -1489,11 +1489,11 @@ return { }, nu = { install_info = { - revision = 'd0b26e45525016ef8e6f2ced05852437c06a00ca', + revision = '2a153c88d5d44d96653057c7cc14292f4e641bef', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, - tier = 3, + tier = 2, }, objc = { install_info = { @@ -1511,7 +1511,7 @@ return { url = 'https://github.com/ColinKennedy/tree-sitter-objdump', }, maintainers = { '@ColinKennedy' }, - tier = 3, + tier = 2, }, ocaml = { install_info = { @@ -1539,7 +1539,7 @@ return { url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', }, maintainers = { '@undu' }, - tier = 3, + tier = 2, }, odin = { install_info = { @@ -1555,7 +1555,7 @@ return { url = 'https://github.com/Isopod/tree-sitter-pascal', }, maintainers = { '@Isopod' }, - tier = 3, + tier = 2, }, passwd = { install_info = { @@ -1563,7 +1563,7 @@ return { url = 'https://github.com/ath3/tree-sitter-passwd', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, pem = { install_info = { @@ -1577,11 +1577,11 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = 'db79ba96ba13e2e89ce9da07c1cc1dfbe6e2e0f6', + revision = 'bb53f204aa3e7507960014642965c9f9a9e84b1d', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, - tier = 3, + tier = 2, }, php = { install_info = { @@ -1611,7 +1611,7 @@ return { url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', }, maintainers = { '@mikehaertl' }, - tier = 3, + tier = 2, }, pioasm = { install_info = { @@ -1619,7 +1619,7 @@ return { url = 'https://github.com/leo60228/tree-sitter-pioasm', }, maintainers = { '@leo60228' }, - tier = 3, + tier = 2, }, po = { install_info = { @@ -1637,7 +1637,7 @@ return { url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, - tier = 3, + tier = 2, }, poe_filter = { install_info = { @@ -1663,7 +1663,7 @@ return { url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, - tier = 3, + tier = 2, }, printf = { install_info = { @@ -1679,7 +1679,7 @@ return { url = 'https://github.com/victorhqc/tree-sitter-prisma', }, maintainers = { '@elianiva' }, - tier = 3, + tier = 2, }, problog = { install_info = { @@ -1689,7 +1689,7 @@ return { }, maintainers = { '@foxyseta' }, requires = { 'prolog' }, - tier = 3, + tier = 2, }, prolog = { install_info = { @@ -1698,7 +1698,7 @@ return { url = 'https://github.com/foxyseta/tree-sitter-prolog', }, maintainers = { '@foxyseta' }, - tier = 3, + tier = 2, }, promql = { install_info = { @@ -1706,7 +1706,7 @@ return { url = 'https://github.com/MichaHoffmann/tree-sitter-promql', }, maintainers = { '@MichaHoffmann' }, - tier = 3, + tier = 2, }, properties = { install_info = { @@ -1723,7 +1723,7 @@ return { url = 'https://github.com/treywood/tree-sitter-proto', }, maintainers = { '@treywood' }, - tier = 3, + tier = 2, }, prql = { install_info = { @@ -1731,7 +1731,7 @@ return { url = 'https://github.com/PRQL/tree-sitter-prql', }, maintainers = { '@matthias-Q' }, - tier = 3, + tier = 2, }, psv = { install_info = { @@ -1749,7 +1749,7 @@ return { url = 'https://github.com/zealot128/tree-sitter-pug', }, maintainers = { '@zealot128' }, - tier = 3, + tier = 2, }, puppet = { install_info = { @@ -1765,7 +1765,7 @@ return { url = 'https://github.com/postsolar/tree-sitter-purescript', }, maintainers = { '@postsolar' }, - tier = 3, + tier = 2, }, pymanifest = { install_info = { @@ -1782,7 +1782,7 @@ return { url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, - tier = 1, + tier = 2, }, ql = { install_info = { @@ -1808,7 +1808,7 @@ return { }, maintainers = { '@Decodetalkers' }, requires = { 'ecma' }, - tier = 3, + tier = 2, }, query = { install_info = { @@ -1817,7 +1817,7 @@ return { }, maintainers = { '@steelsojka' }, readme_note = 'Tree-sitter query language', - tier = 1, + tier = 2, }, r = { install_info = { @@ -1825,14 +1825,14 @@ return { url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, - tier = 3, + tier = 2, }, racket = { install_info = { revision = '5b211bf93021d1c45f39aa96898be9f794f087e4', url = 'https://github.com/6cdh/tree-sitter-racket', }, - tier = 4, + tier = 2, }, ralph = { install_info = { @@ -1840,7 +1840,7 @@ return { url = 'https://github.com/alephium/tree-sitter-ralph', }, maintainers = { '@tdroxler' }, - tier = 3, + tier = 2, }, rasi = { install_info = { @@ -1848,7 +1848,7 @@ return { url = 'https://github.com/Fymyte/tree-sitter-rasi', }, maintainers = { '@Fymyte' }, - tier = 3, + tier = 2, }, razor = { install_info = { @@ -1857,7 +1857,7 @@ return { url = 'https://github.com/tris203/tree-sitter-razor', }, maintainers = { '@tris203' }, - tier = 3, + tier = 2, }, rbs = { install_info = { @@ -1865,7 +1865,7 @@ return { url = 'https://github.com/joker1007/tree-sitter-rbs', }, maintainers = { '@joker1007' }, - tier = 3, + tier = 2, }, re2c = { install_info = { @@ -1897,7 +1897,7 @@ return { url = 'https://github.com/FallenAngel97/tree-sitter-rego', }, maintainers = { '@FallenAngel97' }, - tier = 3, + tier = 2, }, requirements = { install_info = { @@ -1922,7 +1922,7 @@ return { url = 'https://github.com/bamonroe/tree-sitter-rnoweb', }, maintainers = { '@bamonroe' }, - tier = 3, + tier = 2, }, robot = { install_info = { @@ -1930,7 +1930,7 @@ return { url = 'https://github.com/Hubro/tree-sitter-robot', }, maintainers = { '@Hubro' }, - tier = 3, + tier = 2, }, robots = { install_info = { @@ -1938,7 +1938,7 @@ return { url = 'https://github.com/opa-oz/tree-sitter-robots-txt', }, maintainers = { '@opa-oz' }, - tier = 3, + tier = 2, }, roc = { install_info = { @@ -1946,7 +1946,7 @@ return { url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, - tier = 3, + tier = 2, }, ron = { install_info = { @@ -1962,7 +1962,7 @@ return { url = 'https://github.com/stsewd/tree-sitter-rst', }, maintainers = { '@stsewd' }, - tier = 3, + tier = 2, }, ruby = { install_info = { @@ -1978,7 +1978,7 @@ return { url = 'https://github.com/2004Scape/tree-sitter-runescript', }, maintainers = { '@2004Scape' }, - tier = 3, + tier = 2, }, rust = { install_info = { @@ -2003,14 +2003,14 @@ return { url = 'https://github.com/rockorager/tree-sitter-scfg', }, maintainers = { '@WhyNotHugo' }, - tier = 4, + tier = 2, }, scheme = { install_info = { revision = '63e25a4a84142ae7ee0ee01fe3a32c985ca16745', url = 'https://github.com/6cdh/tree-sitter-scheme', }, - tier = 4, + tier = 2, }, scss = { install_info = { @@ -2019,17 +2019,17 @@ return { }, maintainers = { '@elianiva' }, requires = { 'css' }, - tier = 3, + tier = 2, }, sflog = { install_info = { location = 'sflog', - revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', + revision = '3597575a429766dd7ecce9f5bb97f6fec4419d5d', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiaofinland' }, readme_note = 'Salesforce debug log', - tier = 3, + tier = 2, }, slang = { install_info = { @@ -2047,7 +2047,7 @@ return { url = 'https://github.com/theoo/tree-sitter-slim', }, maintainers = { '@theoo' }, - tier = 3, + tier = 2, }, slint = { install_info = { @@ -2055,7 +2055,7 @@ return { url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, - tier = 3, + tier = 2, }, smali = { install_info = { @@ -2071,7 +2071,7 @@ return { url = 'https://github.com/indoorvivants/tree-sitter-smithy', }, maintainers = { '@amaanq', '@keynmol' }, - tier = 3, + tier = 2, }, snakemake = { install_info = { @@ -2080,7 +2080,7 @@ return { url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, - tier = 3, + tier = 2, }, solidity = { install_info = { @@ -2088,25 +2088,25 @@ return { url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, soql = { install_info = { location = 'soql', - revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', + revision = '3597575a429766dd7ecce9f5bb97f6fec4419d5d', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, - tier = 3, + tier = 2, }, sosl = { install_info = { location = 'sosl', - revision = 'eade4054efc897f4bb18a5b7bf4b5a824dbffa74', + revision = '3597575a429766dd7ecce9f5bb97f6fec4419d5d', url = 'https://github.com/aheber/tree-sitter-sfapex', }, maintainers = { '@aheber', '@xixiafinland' }, - tier = 3, + tier = 2, }, sourcepawn = { install_info = { @@ -2114,7 +2114,7 @@ return { url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, - tier = 3, + tier = 2, }, sparql = { install_info = { @@ -2123,7 +2123,7 @@ return { url = 'https://github.com/GordianDziwis/tree-sitter-sparql', }, maintainers = { '@GordianDziwis' }, - tier = 3, + tier = 2, }, sql = { install_info = { @@ -2133,7 +2133,7 @@ return { url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, - tier = 3, + tier = 2, }, squirrel = { install_info = { @@ -2166,7 +2166,7 @@ return { url = 'https://github.com/sigmaSd/tree-sitter-strace', }, maintainers = { '@amaanq' }, - tier = 3, + tier = 2, }, styled = { install_info = { @@ -2175,7 +2175,7 @@ return { url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, - tier = 3, + tier = 2, }, supercollider = { install_info = { @@ -2183,16 +2183,16 @@ return { url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, - tier = 3, + tier = 2, }, superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'e6eba40bf54dd94d842154be0389c53a37be8dc8', + revision = '9266b3131bbcc0705b3b752bcb7478871a143740', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, - tier = 3, + tier = 2, }, surface = { install_info = { @@ -2200,7 +2200,7 @@ return { url = 'https://github.com/connorlay/tree-sitter-surface', }, maintainers = { '@connorlay' }, - tier = 3, + tier = 2, }, svelte = { install_info = { @@ -2227,7 +2227,7 @@ return { url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, - tier = 3, + tier = 2, }, sxhkdrc = { install_info = { @@ -2235,7 +2235,7 @@ return { url = 'https://github.com/RaafatTurki/tree-sitter-sxhkdrc', }, maintainers = { '@RaafatTurki' }, - tier = 3, + tier = 2, }, systemtap = { install_info = { @@ -2243,7 +2243,7 @@ return { url = 'https://github.com/ok-ryoko/tree-sitter-systemtap', }, maintainers = { '@ok-ryoko' }, - tier = 3, + tier = 2, }, t32 = { install_info = { @@ -2251,7 +2251,7 @@ return { url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, - tier = 3, + tier = 2, }, tablegen = { install_info = { @@ -2267,7 +2267,7 @@ return { url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, - tier = 3, + tier = 2, }, tcl = { install_info = { @@ -2292,7 +2292,7 @@ return { url = 'https://github.com/euclidianAce/tree-sitter-teal', }, maintainers = { '@euclidianAce' }, - tier = 3, + tier = 2, }, templ = { install_info = { @@ -2301,7 +2301,7 @@ return { url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, - tier = 3, + tier = 2, }, terraform = { install_info = { @@ -2311,7 +2311,7 @@ return { }, maintainers = { '@MichaHoffmann' }, requires = { 'hcl' }, - tier = 3, + tier = 2, }, textproto = { install_info = { @@ -2319,7 +2319,7 @@ return { url = 'https://github.com/PorterAtGoogle/tree-sitter-textproto', }, maintainers = { '@Porter' }, - tier = 3, + tier = 2, }, thrift = { install_info = { @@ -2335,7 +2335,7 @@ return { url = 'https://github.com/ambroisie/tree-sitter-tiger', }, maintainers = { '@ambroisie' }, - tier = 3, + tier = 2, }, tlaplus = { install_info = { @@ -2343,7 +2343,7 @@ return { url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, - tier = 3, + tier = 2, }, tmux = { install_info = { @@ -2351,7 +2351,7 @@ return { url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, maintainers = { '@Freed-Wu' }, - tier = 3, + tier = 2, }, todotxt = { install_info = { @@ -2359,7 +2359,7 @@ return { url = 'https://github.com/arnarg/tree-sitter-todotxt', }, maintainers = { '@arnarg' }, - tier = 3, + tier = 2, }, toml = { install_info = { @@ -2396,7 +2396,7 @@ return { url = 'https://github.com/GordianDziwis/tree-sitter-turtle', }, maintainers = { '@GordianDziwis' }, - tier = 3, + tier = 2, }, twig = { install_info = { @@ -2404,7 +2404,7 @@ return { url = 'https://github.com/gbprod/tree-sitter-twig', }, maintainers = { '@gbprod' }, - tier = 3, + tier = 2, }, typescript = { install_info = { @@ -2423,7 +2423,7 @@ return { url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, - tier = 3, + tier = 2, }, typoscript = { install_info = { @@ -2431,15 +2431,15 @@ return { url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', }, maintainers = { '@Teddytrombone' }, - tier = 3, + tier = 2, }, typst = { install_info = { - revision = 'cb0ffe14259f7f63ee6f05b57ceb24a35bedef75', + revision = '46cf4ded12ee974a70bf8457263b67ad7ee0379d', url = 'https://github.com/uben0/tree-sitter-typst', }, maintainers = { '@uben0', '@RaafatTurki' }, - tier = 3, + tier = 2, }, udev = { install_info = { @@ -2464,7 +2464,7 @@ return { url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, - tier = 3, + tier = 2, }, usd = { install_info = { @@ -2472,7 +2472,7 @@ return { url = 'https://github.com/ColinKennedy/tree-sitter-usd', }, maintainers = { '@ColinKennedy' }, - tier = 3, + tier = 2, }, uxntal = { install_info = { @@ -2485,11 +2485,11 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '0461bf8addccb4df566827f1601f415d07b1ffbc', + revision = '1047c9d876451c3fcf78343fff26cdfff3855b8c', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, - tier = 3, + tier = 2, }, vala = { install_info = { @@ -2497,7 +2497,7 @@ return { url = 'https://github.com/vala-lang/tree-sitter-vala', }, maintainers = { '@Prince781' }, - tier = 3, + tier = 2, }, vento = { install_info = { @@ -2505,7 +2505,7 @@ return { url = 'https://github.com/ventojs/tree-sitter-vento', }, maintainers = { '@wrapperup', '@oscarotero' }, - tier = 3, + tier = 2, }, verilog = { install_info = { @@ -2513,7 +2513,7 @@ return { url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, - tier = 3, + tier = 2, }, vhdl = { install_info = { @@ -2521,15 +2521,15 @@ return { url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, - tier = 3, + tier = 2, }, vhs = { install_info = { - revision = '966067fe81d78071805d8e55ec836b3926c4ece4', + revision = '3f202326c06f1c4d47aa82b9013a6b71aea70611', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, - tier = 3, + tier = 2, }, vim = { install_info = { @@ -2537,7 +2537,7 @@ return { url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, - tier = 1, + tier = 2, }, vimdoc = { install_info = { @@ -2545,7 +2545,7 @@ return { url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, - tier = 1, + tier = 2, }, vrl = { install_info = { @@ -2553,7 +2553,7 @@ return { url = 'https://github.com/belltoy/tree-sitter-vrl', }, maintainers = { '@belltoy' }, - tier = 3, + tier = 2, }, vue = { install_info = { @@ -2572,7 +2572,7 @@ return { url = 'https://github.com/szebniok/tree-sitter-wgsl', }, maintainers = { '@szebniok' }, - tier = 3, + tier = 2, }, wgsl_bevy = { install_info = { @@ -2589,7 +2589,7 @@ return { url = 'https://github.com/winglang/tree-sitter-wing', }, maintainers = { '@gshpychka', '@MarkMcCulloh' }, - tier = 3, + tier = 2, }, wit = { install_info = { @@ -2597,7 +2597,7 @@ return { url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, - tier = 3, + tier = 2, }, xcompose = { install_info = { @@ -2623,7 +2623,7 @@ return { url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, - tier = 3, + tier = 2, }, yaml = { install_info = { @@ -2639,7 +2639,7 @@ return { url = 'https://github.com/Hubro/tree-sitter-yang', }, maintainers = { '@Hubro' }, - tier = 3, + tier = 2, }, yuck = { install_info = { @@ -2655,7 +2655,7 @@ return { url = 'https://github.com/Freed-Wu/tree-sitter-zathurarc', }, maintainers = { '@Freed-Wu' }, - tier = 3, + tier = 2, }, zig = { install_info = { @@ -2663,7 +2663,7 @@ return { url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, - tier = 1, + tier = 2, }, ziggy = { install_info = { @@ -2672,7 +2672,7 @@ return { url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, - tier = 3, + tier = 2, }, ziggy_schema = { install_info = { @@ -2681,6 +2681,6 @@ return { url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, - tier = 3, + tier = 2, }, } diff --git a/scripts/update-parsers.lua b/scripts/update-parsers.lua index ec1308d77..83f54e9da 100755 --- a/scripts/update-parsers.lua +++ b/scripts/update-parsers.lua @@ -8,7 +8,7 @@ local updates = {} ---@type string[] -- check for new revisions for k, p in pairs(parsers) do - if p.tier < 5 and p.install_info then + if p.tier <= 2 and p.install_info then print('Updating ' .. k) jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url }) end From 02a1a0537c450fe6c9dd525320c688a54aa52baa Mon Sep 17 00:00:00 2001 From: Sebastian Lyng Johansen Date: Mon, 17 Feb 2025 17:18:33 +0100 Subject: [PATCH 054/434] fix(install): early return if parser_info does not exist --- SUPPORTED_LANGUAGES.md | 3 +- lua/nvim-treesitter/install.lua | 1 + lua/nvim-treesitter/parsers.lua | 76 ++++++++++++++++----------------- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 648c0d445..e64daff2d 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -151,6 +151,7 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [julia](https://github.com/tree-sitter/tree-sitter-julia) | unstable | `HFIJL` | @fredrikekre [just](https://github.com/IndianBoy42/tree-sitter-just) | unstable | `HFIJL` | @Hubro +[kcl](https://github.com/kcl-lang/tree-sitter-kcl) | unstable | `HF J ` | @bertbaron [kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | unstable | `HFIJL` | @amaanq [kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | unstable | `HFIJL` | @amaanq [kotlin](https://github.com/fwcd/tree-sitter-kotlin) | unstable | `HF JL` | @SalBakraa @@ -261,7 +262,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | @aheber, @xixiafinland [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | unstable | `H  JL` | @Sarrus1 [sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | unstable | `HFIJL` | @GordianDziwis -[sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `H IJ ` | @derekstride +[sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `HFIJ ` | @derekstride [squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | unstable | `HFIJL` | @amaanq [ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | @ObserverOfTime [starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | unstable | `HFIJL` | @amaanq diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 930a8f8f6..c2a5ea396 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -91,6 +91,7 @@ local function get_parser_install_info(lang) if not parser_config then log.error('Parser not available for language "' .. lang .. '"') + return end return parser_config.install_info diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 1d2329523..fff614bc6 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = 'e409ae33f00e04cde30f2bcffb979caf1a33562a', + revision = 'cd00bbcb77fe31283ca79b0038387ec7411759ae', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -336,7 +336,7 @@ return { }, dart = { install_info = { - revision = 'e81af6ab94a728ed99c30083be72d88e6d56cf9e', + revision = '80e23c07b64494f7e21090bb3450223ef0b192f4', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -384,7 +384,7 @@ return { }, djot = { install_info = { - revision = '67e6e23ba7be81a4373e0f49e21207bdc32d12a5', + revision = 'eb31845d59b9ee8c1b2098e78e9ca72004bd1579', url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, @@ -417,7 +417,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '26e95de449d772bc2dd4f0382580f84e2a0754d6', + revision = '2128a0b249263e238d88cb894dad00c3168fea37', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -425,7 +425,7 @@ return { }, earthfile = { install_info = { - revision = '6695a2dfea5f8d9076b11f9bebcac8184e405e67', + revision = 'ae378d9d1306e9a967698516041f6f8803db5592', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -471,7 +471,7 @@ return { }, elixir = { install_info = { - revision = '86ec2ed45d6d9433b4e0b88cd3d96796bd45625f', + revision = '450a8194f5a66561135962cfc8d7545a27b61c4c', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -510,7 +510,7 @@ return { }, enforce = { install_info = { - revision = 'cf853e5f56f1babe5ec573e356f6fbb4784bf5c1', + revision = '8201c3c354c34b96d5a531c8e63d262209ee06cb', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = '022b032d31299c5d8336cdfd0ece97de20a609c0', + revision = '21b740801794b6570a0380f8aef22bb67214ea65', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -608,7 +608,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = 'ad824dea984734406b50699c5f388a7412e85946', + revision = '02929f084726db969e5b916d144436f248146824', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -1040,7 +1040,7 @@ return { }, inko = { install_info = { - revision = '0b08a8f976456a9271f70d4682143328d7224115', + revision = 'f58a87ac4dc6a7955c64c9e4408fbd693e804686', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, @@ -1100,7 +1100,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '41b17a33f335130ce9861fd21bffeb88fd768ef4', + revision = '07a62adf99c0f41e0cab7ab523541309a8d73dc4', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1111,7 +1111,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '41b17a33f335130ce9861fd21bffeb88fd768ef4', + revision = '07a62adf99c0f41e0cab7ab523541309a8d73dc4', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1191,8 +1191,8 @@ return { }, kcl = { install_info = { + revision = 'b0b2eb38009e04035a6e266c7e11e541f3caab7c', url = 'https://github.com/kcl-lang/tree-sitter-kcl', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@bertbaron' }, tier = 2, @@ -1280,7 +1280,7 @@ return { }, liquid = { install_info = { - revision = '23ac814111e2b4b4b083e2c92219af2d5b74d13d', + revision = '6e03a054a71cd419d9702725243137641e97ba51', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = 'c5fffb8edd39f22644084ab3f73a924a75721ee3', + revision = '12edaf0dfef0a43bc74336a4432b2db1c65788d6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = '9d83ca263fa7ec8ac7a5fd8ad14891b2dc583a32', + revision = 'af14b427119a7428b461277bfc43abe5864d995d', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = 'b3a88cf3e597d48c33657deca4fda7a75c0069c1', + revision = '48057cf966641e7a49b09700550751195c34bcb5', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1489,7 +1489,7 @@ return { }, nu = { install_info = { - revision = '2a153c88d5d44d96653057c7cc14292f4e641bef', + revision = 'b99dc3b7b26337d84f95c0de4dda81077b03e5c7', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '91e4d9106f5da8199ab5158ba65e02da3e664597', + revision = 'db52ba3f7f33c9949bba115a813d7c30a359cd87', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '91e4d9106f5da8199ab5158ba65e02da3e664597', + revision = 'db52ba3f7f33c9949bba115a813d7c30a359cd87', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1551,7 +1551,7 @@ return { }, pascal = { install_info = { - revision = 'd0ebabefaea9ac3f6fc3004cf08cd121b66da9e4', + revision = '78426d96bde7114af979e314283e45d087603428', url = 'https://github.com/Isopod/tree-sitter-pascal', }, maintainers = { '@Isopod' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = 'f3a19ab3217a6e838870fc7142fa492d1fd7a7c9', + revision = 'f7cf7348737d8cff1b13407a0bfedce02ee7b046', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'f3a19ab3217a6e838870fc7142fa492d1fd7a7c9', + revision = 'f7cf7348737d8cff1b13407a0bfedce02ee7b046', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1659,7 +1659,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '32fe49cc5d4a2d5a976dacafc0da16d98787866b', + revision = 'e904962e25858b7e8e19c653e737ad3b7d1c55bd', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1853,7 +1853,7 @@ return { razor = { install_info = { generate_from_json = true, - revision = 'a47cd8ca148685629739a4ab69f58864800fbdab', + revision = 'fe46ce5ea7d844e53d59bc96f2175d33691c61c5', url = 'https://github.com/tris203/tree-sitter-razor', }, maintainers = { '@tris203' }, @@ -1901,7 +1901,7 @@ return { }, requirements = { install_info = { - revision = '5ad9b7581b3334f6ad492847d007f2fac6e6e5f2', + revision = '728910099ddea7f1f94ea95a35a70d1ea76a1639', url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', }, maintainers = { '@ObserverOfTime' }, @@ -1958,7 +1958,7 @@ return { }, rst = { install_info = { - revision = '899e073a10012b8028b643d676c30bbf9c64a45d', + revision = '4e562e1598b95b93db4f3f64fe40ddefbc677a15', url = 'https://github.com/stsewd/tree-sitter-rst', }, maintainers = { '@stsewd' }, @@ -1982,7 +1982,7 @@ return { }, rust = { install_info = { - revision = '2eaf126458a4d6a69401089b6ba78c5e5d6c1ced', + revision = '02da1b25f6dfc7341ddb80f37f708cdd9301be2d', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2043,7 +2043,7 @@ return { }, slim = { install_info = { - revision = 'a0f08e85b787248219ea645423c5916c8d620ef6', + revision = '546e3aa1af8a3b355c7734efccd9a759ffc0b43a', url = 'https://github.com/theoo/tree-sitter-slim', }, maintainers = { '@theoo' }, @@ -2171,7 +2171,7 @@ return { styled = { install_info = { generate_from_json = true, - revision = '75d3ad20818c30c49b445ca2cb35999c278b3453', + revision = '319cdcaa0346ba6db668a222d938e5c3569e2a51', url = 'https://github.com/mskelton/tree-sitter-styled', }, maintainers = { '@mskelton' }, @@ -2188,7 +2188,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '9266b3131bbcc0705b3b752bcb7478871a143740', + revision = '15ff939100f9d52342445407973f3ce125a8437e', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2223,7 +2223,7 @@ return { swift = { install_info = { generate = true, - revision = '1ebc09c38f41d6aab7dd65ca0f8ea032ced0364f', + revision = '42ad8f6b4dc9b46285893cc37b460323b54932d4', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2339,7 +2339,7 @@ return { }, tlaplus = { install_info = { - revision = 'd711f24c93221cdfc9a9b4dbb0998f528fc982ac', + revision = '4ba91b07b97741a67f61221d0d50e6d962e4987e', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2485,7 +2485,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '1047c9d876451c3fcf78343fff26cdfff3855b8c', + revision = '532bebd50742ef15949bdd67c36d46697c847628', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2517,7 +2517,7 @@ return { }, vhdl = { install_info = { - revision = 'cfc522af3e49c1a00ae74e01aa14e19818dab8f2', + revision = 'db1d7446bd07d811981734cd501fe1994cbad99d', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2610,7 +2610,7 @@ return { xml = { install_info = { location = 'xml', - revision = '26e95de449d772bc2dd4f0382580f84e2a0754d6', + revision = '2128a0b249263e238d88cb894dad00c3168fea37', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2668,7 +2668,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'acf2b6b5aa8b9ce93f4a1ef1adf4e95c06db7831', + revision = 'af41bdb5b1d64404c2ec7eb1d9de01083c0d2596', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2677,7 +2677,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'acf2b6b5aa8b9ce93f4a1ef1adf4e95c06db7831', + revision = 'af41bdb5b1d64404c2ec7eb1d9de01083c0d2596', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, From 6fe00326406d1aedd0383c4b8b5e7c1ae02197b0 Mon Sep 17 00:00:00 2001 From: przepompownia Date: Wed, 5 Mar 2025 20:03:30 +0100 Subject: [PATCH 055/434] feat(install): allow pass callback to `update()` Problem: cannot run `:TSUpdate synchronously` Solution: pass callback used after exiting jobs (like in `install-parsers`). --- SUPPORTED_LANGUAGES.md | 3 +- lua/nvim-treesitter/install.lua | 11 +++--- lua/nvim-treesitter/parsers.lua | 64 ++++++++++++++++----------------- scripts/install-parsers.lua | 21 +++++++---- 4 files changed, 56 insertions(+), 43 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index e64daff2d..4a1df1671 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -240,7 +240,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | unstable | `HF J ` | @bamonroe [robot](https://github.com/Hubro/tree-sitter-robot) | unstable | `HFIJ ` | @Hubro [robots](https://github.com/opa-oz/tree-sitter-robots-txt) | unstable | `H  J ` | @opa-oz -[roc](https://github.com/faldor20/tree-sitter-roc) | unstable | `H  JL` | @nat-418 +[roc](https://github.com/faldor20/tree-sitter-roc) | unstable | `H IJL` | @nat-418 [ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | unstable | `HFIJL` | @amaanq [rst](https://github.com/stsewd/tree-sitter-rst) | unstable | `H  JL` | @stsewd [ruby](https://github.com/tree-sitter/tree-sitter-ruby) | unstable | `HFIJL` | @TravonteD @@ -282,6 +282,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | unstable | `HFIJ ` | @lewis6991 [teal](https://github.com/euclidianAce/tree-sitter-teal) | unstable | `HFIJL` | @euclidianAce [templ](https://github.com/vrischmann/tree-sitter-templ) | unstable | `HF J ` | @vrischmann +[tera](https://github.com/uncenter/tree-sitter-tera) | unstable | `H  J ` | @uncenter [terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | unstable | `HFIJ ` | @MichaHoffmann [textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | unstable | `HFIJ ` | @Porter [thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | unstable | `HFIJL` | @amaanq, @duskmoon314 diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index c2a5ea396..9ff245ab6 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -455,8 +455,8 @@ end, 3) ---@param languages? string[]|string ---@param _options? UpdateOptions ----@param _callback function -M.update = a.sync(function(languages, _options, _callback) +---@param callback function +M.update = a.sync(function(languages, _options, callback) reload_parsers() if not languages or #languages == 0 then languages = 'all' @@ -465,11 +465,14 @@ M.update = a.sync(function(languages, _options, _callback) languages = vim.tbl_filter(needs_update, languages) ---@type string[] if #languages > 0 then - install(languages, { force = true }) + install(languages, { force = true }, callback) else log.info('All parsers are up-to-date') + if callback then + callback(true) + end end -end, 2) +end, 3) ---@async ---@param logger Logger diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index fff614bc6..f4d0ea374 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = '745d3c65c2294aca1110b6b6ad6805124be605c9', + revision = 'cba288924f4832abb619c627539f111004ff22e5', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -47,7 +47,7 @@ return { }, asm = { install_info = { - revision = '5bb5b03e3c1ce5853b5282b9fba060f7c7bbf11e', + revision = '04962e15f6b464cf1d75eada59506dc25090e186', url = 'https://github.com/RubixDev/tree-sitter-asm', }, maintainers = { '@RubixDev' }, @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = 'cd00bbcb77fe31283ca79b0038387ec7411759ae', + revision = 'c70336e8db6d3842721d9be40610580908ff45ba', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '370cea629eb62a8686504b9fb3252a5e1ae55313', + revision = '364e323b32d098ad0e7b29e7adb4005c2bb5cf34', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = 'af6043419f5aa0f8b6c2a26db0187aefa46c7f5f', + revision = 'e01c88449b53e2ee5dad222d4020cc7006c5b700', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -1032,7 +1032,7 @@ return { }, ini = { install_info = { - revision = '962568c9efa71d25720ab42c5d36e222626ef3a6', + revision = '32b31863f222bf22eb43b07d4e9be8017e36fb31', url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, @@ -1100,7 +1100,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '07a62adf99c0f41e0cab7ab523541309a8d73dc4', + revision = '9af6ce9380fabd3d5b19d0254b8c8936e879c471', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1111,7 +1111,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '07a62adf99c0f41e0cab7ab523541309a8d73dc4', + revision = '9af6ce9380fabd3d5b19d0254b8c8936e879c471', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = '12edaf0dfef0a43bc74336a4432b2db1c65788d6', + revision = '742a21e11e914096e0172dad2f0b85e7554c95ff', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = 'af14b427119a7428b461277bfc43abe5864d995d', + revision = 'c7c62f37a8612a897d25906d93363fec36c1591c', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1472,7 +1472,7 @@ return { }, nix = { install_info = { - revision = '48057cf966641e7a49b09700550751195c34bcb5', + revision = 'cfc53fd287d23ab7281440a8526c73542984669b', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1489,7 +1489,7 @@ return { }, nu = { install_info = { - revision = 'b99dc3b7b26337d84f95c0de4dda81077b03e5c7', + revision = 'c10340b5bb3789f69182acf8f34c3d4fc24d2fe1', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1516,7 +1516,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = 'db52ba3f7f33c9949bba115a813d7c30a359cd87', + revision = '91708deb10cb4fe68ab3c50891426b9967dbf35a', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1525,7 +1525,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = 'db52ba3f7f33c9949bba115a813d7c30a359cd87', + revision = '91708deb10cb4fe68ab3c50891426b9967dbf35a', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1535,7 +1535,7 @@ return { ocamllex = { install_info = { generate = true, - revision = '5da5bb7508ac9fd3317561670ef18c126a0fe2aa', + revision = 'c5cf996c23e38a1537069fbe2d4bb83a75fc7b2f', url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', }, maintainers = { '@undu' }, @@ -1942,7 +1942,7 @@ return { }, roc = { install_info = { - revision = 'de0839d6c7db2405e827435cf3ac62d22f4bd5e9', + revision = '32e20cb1133a5a189f986c3b5df47ac730fbee3d', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -1982,7 +1982,7 @@ return { }, rust = { install_info = { - revision = '02da1b25f6dfc7341ddb80f37f708cdd9301be2d', + revision = 'e86119bdb4968b9799f6a014ca2401c178d54b5f', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -1990,7 +1990,7 @@ return { }, scala = { install_info = { - revision = 'd67fe3ba3879bd7ba74bd7f56c9a38fed241ba25', + revision = 'ed939ed550ebff7d4ad8aafb4d5aad44de69965d', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2188,7 +2188,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '15ff939100f9d52342445407973f3ce125a8437e', + revision = '91d92846e8baaafc8854d2b9d0ac436bc16234db', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2223,7 +2223,7 @@ return { swift = { install_info = { generate = true, - revision = '42ad8f6b4dc9b46285893cc37b460323b54932d4', + revision = '02db52e14bc303322d22019fff7823d72904dfe5', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2277,14 +2277,6 @@ return { maintainers = { '@lewis6991' }, tier = 2, }, - tera = { - install_info = { - url = 'https://github.com/uncenter/tree-sitter-tera', - files = { 'src/parser.c', 'src/scanner.c' }, - }, - maintainers = { '@uncenter' }, - tier = 2, - }, teal = { install_info = { generate = true, @@ -2303,6 +2295,14 @@ return { maintainers = { '@vrischmann' }, tier = 2, }, + tera = { + install_info = { + revision = '588f14ce363904bebd926492bbd1d2c53f8d5f14', + url = 'https://github.com/uncenter/tree-sitter-tera', + }, + maintainers = { '@uncenter' }, + tier = 2, + }, terraform = { install_info = { location = 'dialects/terraform', @@ -2460,7 +2460,7 @@ return { unison = { install_info = { generate = true, - revision = '3c97db76d3cdbd002dfba493620c2d5df2fd6fa9', + revision = '169e7f748a540ec360c0cb086b448faad012caa4', url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, @@ -2517,7 +2517,7 @@ return { }, vhdl = { install_info = { - revision = 'db1d7446bd07d811981734cd501fe1994cbad99d', + revision = '32d3e3daa745bf9f1665676f323be968444619e1', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2668,7 +2668,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'af41bdb5b1d64404c2ec7eb1d9de01083c0d2596', + revision = '00958faeaeb97d9b7beb76f128a5401441182204', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2677,7 +2677,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'af41bdb5b1d64404c2ec7eb1d9de01083c0d2596', + revision = '00958faeaeb97d9b7beb76f128a5401441182204', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index 36be0b9c4..cb7389e19 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -1,11 +1,14 @@ #!/usr/bin/env -S nvim -l local generate = false +local update = false local max_jobs = nil ---@as integer local parsers = {} for i = 1, #_G.arg do if _G.arg[i] == '--generate' then generate = true + elseif _G.arg[i] == '--update' then + update = true elseif _G.arg[i]:find('^%-%-max%-jobs') then max_jobs = _G.arg[i]:match('=(%d+)') else @@ -19,13 +22,19 @@ vim.opt.runtimepath:append('.') vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') local ok = nil -require('nvim-treesitter.install').install( - #parsers > 0 and parsers or 'all', - { force = true, generate = generate, max_jobs = max_jobs }, - function(success) +if update then + require('nvim-treesitter.install').update('all', {}, function(success) ok = success - end -) + end) +else + require('nvim-treesitter.install').install( + #parsers > 0 and parsers or 'all', + { force = true, generate = generate, max_jobs = max_jobs }, + function(success) + ok = success + end + ) +end vim.wait(6000000, function() return ok ~= nil From 12e0246e4fc2b75742d98a546216234444fdad28 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 12 Mar 2025 09:44:33 +0100 Subject: [PATCH 056/434] fix(formatter): increase match limit Problem: Some very long patterns were not formatted correctly. Solution: Increase the match limit when iterating to 1024. --- SUPPORTED_LANGUAGES.md | 3 + lua/nvim-treesitter/parsers.lua | 98 +++++++++++------------ runtime/queries/commonlisp/highlights.scm | 3 +- runtime/queries/racket/highlights.scm | 3 +- scripts/format-queries.lua | 2 +- 5 files changed, 55 insertions(+), 54 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 4a1df1671..8eac31b73 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -26,10 +26,12 @@ Language | Tier | Queries | Maintainer [bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | unstable | `HFIJ ` | @theHamsta, @clason [bicep](https://github.com/tree-sitter-grammars/tree-sitter-bicep) | unstable | `HFIJL` | @amaanq [bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) | unstable | `HFIJL` | @amaanq +[blade](https://github.com/EmranMR/tree-sitter-blade) | unstable | `HFIJ ` | @calebdw [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint) | unstable | `H  J ` | @gabmus [bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | unstable | `HFIJL` | @ambroisie [c](https://github.com/tree-sitter/tree-sitter-c) | unstable | `HFIJL` | @amaanq [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | unstable | `HF JL` | @amaanq +[caddy](https://github.com/opa-oz/tree-sitter-caddy) | unmaintained | `HFIJ ` | @opa-oz [cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | unstable | `HFIJL` | @amaanq [capnp](https://github.com/tree-sitter-grammars/tree-sitter-capnp) | unstable | `HFIJL` | @amaanq [chatito](https://github.com/tree-sitter-grammars/tree-sitter-chatito) | unstable | `HFIJL` | @ObserverOfTime @@ -139,6 +141,7 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD [ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | unstable | `HFIJL` | @fab4100 [janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | unstable | `HF JL` | @sogaiu [java](https://github.com/tree-sitter/tree-sitter-java) | unstable | `HFIJL` | @p00f +[javadoc](https://github.com/rmuir/tree-sitter-javadoc) | unstable | `H IJ ` | @rmuir [javascript](https://github.com/tree-sitter/tree-sitter-javascript) | unstable | `HFIJL` | @steelsojka [jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | unstable | `H  J ` | @cathaysia [jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | unstable | `H  J ` | @cathaysia diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index f4d0ea374..32ef7cdee 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = 'cba288924f4832abb619c627539f111004ff22e5', + revision = 'be53f2597dded40c90b5f53ed9f4521422f6b6b3', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -128,8 +128,8 @@ return { }, blade = { install_info = { + revision = 'bcdc4b01827cac21205f7453e9be02f906943128', url = 'https://github.com/EmranMR/tree-sitter-blade', - files = { 'src/parser.c' }, }, maintainers = { '@calebdw' }, tier = 2, @@ -175,6 +175,14 @@ return { maintainers = { '@amaanq' }, tier = 2, }, + caddy = { + install_info = { + revision = '2686186edb61be47960431c93a204fb249681360', + url = 'https://github.com/opa-oz/tree-sitter-caddy', + }, + maintainers = { '@opa-oz' }, + tier = 3, + }, cairo = { install_info = { revision = '6238f609bea233040fe927858156dee5515a0745', @@ -183,14 +191,6 @@ return { maintainers = { '@amaanq' }, tier = 2, }, - caddy = { - install_info = { - url = 'https://github.com/opa-oz/tree-sitter-caddy', - files = { 'src/parser.c', 'src/scanner.c' }, - }, - maintainers = { '@opa-oz' }, - tier = 3, - }, capnp = { install_info = { revision = '7b0883c03e5edd34ef7bcf703194204299d7099f', @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = 'c70336e8db6d3842721d9be40610580908ff45ba', + revision = 'fe48221d4d9842d916d66b5e71ab3c6307ec28b3', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -242,7 +242,7 @@ return { commonlisp = { install_info = { generate_from_json = true, - revision = 'bf2a65b1c119898a1a17389e07f2a399c05cdc0c', + revision = '32323509b3d9fe96607d151c2da2c9009eb13a2f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-commonlisp', }, maintainers = { '@theHamsta' }, @@ -303,7 +303,7 @@ return { cuda = { install_info = { generate_from_json = true, - revision = '757e0a61f9d38b3d9eaa299e8d866e8283ffc284', + revision = '014628ae8d2df391b88ddb9fa0260fd97f770829', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -417,7 +417,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '2128a0b249263e238d88cb894dad00c3168fea37', + revision = '0d9a8099c963ed53e183425c1b47fa2622c8eaf7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = '21b740801794b6570a0380f8aef22bb67214ea65', + revision = '64e11001d7ef3e8ac18e55a3a2d811fe36430923', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -692,7 +692,7 @@ return { }, gitcommit = { install_info = { - revision = 'db0e0c4fb9095fdc42a7af34019c0616c071e9eb', + revision = 'a716678c0f00645fed1e6f1d0eb221481dbd6f6d', url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = 'e01c88449b53e2ee5dad222d4020cc7006c5b700', + revision = '99ec4101504452c488b7c835fb65cfef75b090b7', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -726,7 +726,7 @@ return { glimmer_javascript = { install_info = { generate_from_json = true, - revision = '7e8ea8cf39fc360cb97bd253442cd48e4f7a9ce3', + revision = 'babba3fc0c822a633261ce9e96a4d7986050eb0c', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', }, maintainers = { '@NullVoxPopuli' }, @@ -736,7 +736,7 @@ return { glimmer_typescript = { install_info = { generate_from_json = true, - revision = '4006128790efb58ca82a4492d8ef0983b260fc6a', + revision = '48c60295f1ee34ea4ed6e5177102be6d24bfc9d0', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', }, maintainers = { '@NullVoxPopuli' }, @@ -746,7 +746,7 @@ return { glsl = { install_info = { generate_from_json = true, - revision = '66aec57f7119c7e8e40665b723cd7af5594f15ee', + revision = '24a6c8ef698e4480fecf8340d771fbcb5de8fbb4', url = 'https://github.com/tree-sitter-grammars/tree-sitter-glsl', }, maintainers = { '@theHamsta' }, @@ -936,7 +936,7 @@ return { hlsl = { install_info = { generate_from_json = true, - revision = 'b309425a7ab4456605cfe78774b80f7e275ca87d', + revision = 'bab9111922d53d43668fabb61869bec51bbcb915', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hlsl', }, maintainers = { '@theHamsta' }, @@ -1082,8 +1082,8 @@ return { }, javadoc = { install_info = { + revision = 'db9589e9c61cff7d7fcc207744c711b10b60a7a3', url = 'https://github.com/rmuir/tree-sitter-javadoc', - files = { 'src/parser.c', 'src/scanner.c' }, }, maintainers = { '@rmuir' }, tier = 2, @@ -1223,7 +1223,7 @@ return { }, koto = { install_info = { - revision = '329b0e84ef6cc6950665de4accd0bdda1601a2f1', + revision = '673511402dfef07b25cfa43991693b8442695fc7', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1239,7 +1239,7 @@ return { }, lalrpop = { install_info = { - revision = 'a7f5ea297bd621d072ed4cb2cc8ba5ae64ae3c4b', + revision = '8d38e9755c05d37df8a24dadb0fc64f6588ac188', url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, @@ -1280,7 +1280,7 @@ return { }, liquid = { install_info = { - revision = '6e03a054a71cd419d9702725243137641e97ba51', + revision = 'd269f4d52cd08f6cbc6636ee23cc30a9f6c32e42', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1304,7 +1304,7 @@ return { }, lua = { install_info = { - revision = '68d29aa745b68ae22cbbdb5dcb68c20232521ff6', + revision = 'db16e76558122e834ee214c8dc755b4a3edc82a9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1356,7 +1356,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '192407ab5a24bfc24f13332979b5e7967518754a', + revision = '413285231ce8fa8b11e7074bbe265b48aa7277f9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1367,7 +1367,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '192407ab5a24bfc24f13332979b5e7967518754a', + revision = '413285231ce8fa8b11e7074bbe265b48aa7277f9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = '742a21e11e914096e0172dad2f0b85e7554c95ff', + revision = '9c74e8e8917b83d90e38ac040949079437ec0043', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = 'c7c62f37a8612a897d25906d93363fec36c1591c', + revision = '922cbb97f3d20044e6b4362b3d7af5e530ed8f34', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1659,7 +1659,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = 'e904962e25858b7e8e19c653e737ad3b7d1c55bd', + revision = '66d5e61126989c0aca57ff77d19b2064919b51e1', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1684,7 +1684,7 @@ return { problog = { install_info = { location = 'grammars/problog', - revision = '93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8', + revision = 'd8d415f6a1cf80ca138524bcc395810b176d40fa', url = 'https://github.com/foxyseta/tree-sitter-prolog', }, maintainers = { '@foxyseta' }, @@ -1694,7 +1694,7 @@ return { prolog = { install_info = { location = 'grammars/prolog', - revision = '93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8', + revision = 'd8d415f6a1cf80ca138524bcc395810b176d40fa', url = 'https://github.com/foxyseta/tree-sitter-prolog', }, maintainers = { '@foxyseta' }, @@ -1812,7 +1812,7 @@ return { }, query = { install_info = { - revision = '0555ac0da902abff06076e40501102cee3ba68bd', + revision = '930202c2a80965a7a9ca018b5b2a08b25dfa7f12', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1942,7 +1942,7 @@ return { }, roc = { install_info = { - revision = '32e20cb1133a5a189f986c3b5df47ac730fbee3d', + revision = '0b1afe88161cbd81f5ddea1bb4fa786314ed49a7', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -1990,7 +1990,7 @@ return { }, scala = { install_info = { - revision = 'ed939ed550ebff7d4ad8aafb4d5aad44de69965d', + revision = '42a1542248ff611ba2091fe76c6dbf42551ebef8', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2188,7 +2188,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '91d92846e8baaafc8854d2b9d0ac436bc16234db', + revision = 'fc7c594f52528e4a4a08671137850143d55a5bf2', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2223,7 +2223,7 @@ return { swift = { install_info = { generate = true, - revision = '02db52e14bc303322d22019fff7823d72904dfe5', + revision = 'aca5a52aa3cab858944d3c02701ccf5b2d8fd0f9', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2263,7 +2263,7 @@ return { }, tact = { install_info = { - revision = '83e264928fa194b7283428527259e88e54205264', + revision = 'a19be2d4c1956e12facfc717e28f13a6ad0860e0', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2297,7 +2297,7 @@ return { }, tera = { install_info = { - revision = '588f14ce363904bebd926492bbd1d2c53f8d5f14', + revision = '482b475b32e6bae67f9d57abc60545399fd9b0a3', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2331,7 +2331,7 @@ return { }, tiger = { install_info = { - revision = 'a7f11d946b44244f71df41d2a78af0665d618dae', + revision = '4a77b2d7a004587646bddc4e854779044b6db459', url = 'https://github.com/ambroisie/tree-sitter-tiger', }, maintainers = { '@ambroisie' }, @@ -2427,7 +2427,7 @@ return { }, typoscript = { install_info = { - revision = '43b221c0b76e77244efdaa9963e402a17c930fbc', + revision = '5d8fde870b0ded1f429ba5bb249a9d9f8589ff5f', url = 'https://github.com/Teddytrombone/tree-sitter-typoscript', }, maintainers = { '@Teddytrombone' }, @@ -2485,7 +2485,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '532bebd50742ef15949bdd67c36d46697c847628', + revision = '26c2c4c2b3fb4f7a07ae78d298b36998b7ffa956', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2517,7 +2517,7 @@ return { }, vhdl = { install_info = { - revision = '32d3e3daa745bf9f1665676f323be968444619e1', + revision = '35ed277d3e98836796bc764010dc3fb800d14ee4', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2533,7 +2533,7 @@ return { }, vim = { install_info = { - revision = 'f3cd62d8bd043ef20507e84bb6b4b53731ccf3a7', + revision = '11b688a1f0e97c0c4e3dbabf4a38016335f4d237', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, @@ -2541,7 +2541,7 @@ return { }, vimdoc = { install_info = { - revision = 'd2e4b5c172a109966c2ce0378f73df6cede39400', + revision = '2694c3d27e2ca98a0ccde72f33887394300d524e', url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, @@ -2610,7 +2610,7 @@ return { xml = { install_info = { location = 'xml', - revision = '2128a0b249263e238d88cb894dad00c3168fea37', + revision = '0d9a8099c963ed53e183425c1b47fa2622c8eaf7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2668,7 +2668,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = '00958faeaeb97d9b7beb76f128a5401441182204', + revision = '8a29017169f43dc2c3526817e98142eb9a335087', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2677,7 +2677,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = '00958faeaeb97d9b7beb76f128a5401441182204', + revision = '8a29017169f43dc2c3526817e98142eb9a335087', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, diff --git a/runtime/queries/commonlisp/highlights.scm b/runtime/queries/commonlisp/highlights.scm index 7236c84de..dbd41657f 100644 --- a/runtime/queries/commonlisp/highlights.scm +++ b/runtime/queries/commonlisp/highlights.scm @@ -295,8 +295,7 @@ "clear-output" "assoc-if" "string/=" "princ" "directory-namestring" "stream-error-stream" "array-element-type" "setq" "copy-seq" "time" "restart-case" "prog*" "shared-initialize" "array-total-size" "simple-bit-vector-p" "define-method-combination" "write-byte" "constantly" - "caddar" "print-object" "vector" "throw" "reverse" ">=" "upper-case-p" "nbutlast") - ) + "caddar" "print-object" "vector" "throw" "reverse" ">=" "upper-case-p" "nbutlast")) (list_lit . diff --git a/runtime/queries/racket/highlights.scm b/runtime/queries/racket/highlights.scm index 9e3066743..ac6b4de4b 100644 --- a/runtime/queries/racket/highlights.scm +++ b/runtime/queries/racket/highlights.scm @@ -140,8 +140,7 @@ "unit/c" "unit/new-import-export" "unit/s" "unless" "unquote" "unquote-splicing" "unsyntax" "unsyntax-splicing" "values/drop" "when" "with-continuation-mark" "with-contract" "with-contract-continuation-mark" "with-handlers" "with-handlers*" "with-method" "with-syntax" - "~?" "~@" "λ") - ) + "~?" "~@" "λ")) ; builtin procedures ((symbol) @function.builtin diff --git a/scripts/format-queries.lua b/scripts/format-queries.lua index f924b8064..c7362687e 100755 --- a/scripts/format-queries.lua +++ b/scripts/format-queries.lua @@ -446,7 +446,7 @@ local function format(bufnr, queries) } local root = ts.get_parser(bufnr, 'query'):parse(true)[1]:root() local query = ts.query.parse('query', queries) - for id, node, metadata in query:iter_captures(root, bufnr) do + for id, node, metadata in query:iter_captures(root, bufnr, nil, nil, { match_limit = 1024 }) do if query.captures[id]:sub(1, 1) ~= '_' then map[query.captures[id]][node:id()] = metadata and (metadata[id] and metadata[id] or metadata) or {} From 9365cf8a970a00cbb2a16f45319093d2cafe551f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 26 Mar 2025 09:54:22 +0100 Subject: [PATCH 057/434] fix(install): don't prompt on installed parsers (skip) Use `:TSInstall!` or `force = true` to reinstall. --- TODO.md | 2 ++ lua/nvim-treesitter/config.lua | 2 +- lua/nvim-treesitter/install.lua | 12 ++---------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index add857336..330b00d37 100644 --- a/TODO.md +++ b/TODO.md @@ -4,6 +4,8 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO +- [ ] **`config.lua`:** drop ensure_install (replace with install), ignore_install +- [ ] **`install.lua`:** simply skip Tier 4 parsers (`get_install_info`) - [ ] **`parsers.lua`:** allow specifying version in addition to commit hash (for Tier 1) - [ ] **`parsers.lua`:** add WASM support (tier 1) - [ ] **`install.lua`:** migrate to async v2 diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index b1cb4f761..473a97ee9 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -20,7 +20,7 @@ function M.setup(user_data) if user_data then if user_data.install_dir then user_data.install_dir = vim.fs.normalize(user_data.install_dir) - --TODO(clason): insert after/before site, or leave to user? + --TODO(clason): leave to user! vim.opt.runtimepath:append(user_data.install_dir) end config = vim.tbl_deep_extend('force', config, user_data) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 9ff245ab6..d49a7cbc9 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -365,12 +365,8 @@ local install_status = {} ---@type table ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate) if not force and vim.list_contains(config.installed_parsers(), lang) then - local yesno = fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ') - print('\n ') - if yesno:sub(1, 1) ~= 'y' then - install_status[lang] = 'installed' - return 'installed' - end + install_status[lang] = 'installed' + return 'installed' end if install_status[lang] then @@ -444,10 +440,6 @@ M.install = a.sync(function(languages, options, callback) languages = config.norm_languages(languages, options and options.skip) - if languages[1] == 'all' then - options.force = true - end - install(languages, options, callback) end, 3) From 328ee3db548db585208ae2ff0bf4fd06231581aa Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 26 Mar 2025 13:08:49 +0100 Subject: [PATCH 058/434] fix(install): skip tier 4 parsers when installing and updating --- lua/nvim-treesitter/config.lua | 18 ++++++++++--- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/indent.lua | 2 +- lua/nvim-treesitter/install.lua | 19 +++++++------ lua/nvim-treesitter/locals.lua | 2 +- lua/nvim-treesitter/parsers.lua | 48 ++++++++++++++++----------------- 6 files changed, 51 insertions(+), 40 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 473a97ee9..7ef5aeddf 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -27,8 +27,10 @@ function M.setup(user_data) end if #config.ensure_install > 0 then - local to_install = M.norm_languages(config.ensure_install, { ignored = true, installed = true }) - + local to_install = M.norm_languages( + config.ensure_install, + { ignored = true, installed = true, unsupported = true } + ) if #to_install > 0 then require('nvim-treesitter.install').install(to_install, { force = true }) end @@ -103,7 +105,7 @@ end ---Normalize languages ---@param languages? string[]|string ----@param skip? { ignored: boolean, missing: boolean, installed: boolean, dependencies: boolean } +---@param skip? { ignored: boolean, missing: boolean, unsupported: boolean, installed: boolean, dependencies: boolean } ---@return string[] function M.norm_languages(languages, skip) if not languages then @@ -164,6 +166,16 @@ function M.norm_languages(languages, skip) languages ) + if skip and skip.unsupported then + languages = vim.tbl_filter( + --- @param v string + function(v) + return parsers[v].tier < 4 + end, + languages + ) + end + if not (skip and skip.dependencies) then for _, lang in pairs(languages) do if parsers[lang].requires then diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 1776cffe7..68b01bb35 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -25,7 +25,7 @@ local function install_health() do -- nvim check if vim.fn.has('nvim-0.11') ~= 1 then - health.error('Nvim-treesitter requires the latest Neovim nightly') + health.error('Nvim-treesitter requires Neovim 0.11.0 or later.') end if vim.treesitter.language_version then diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 6b674dc63..03489f22e 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -134,7 +134,7 @@ function M.get_indent(lnum) end -- Get language tree with smallest range around node that's not a comment parser - local root, lang_tree ---@type TSNode, LanguageTree + local root, lang_tree ---@type TSNode, vim.treesitter.LanguageTree parser:for_each_tree(function(tstree, tree) if not tstree or M.comment_parsers[tree:lang()] then return diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index d49a7cbc9..c208a2709 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -148,7 +148,7 @@ local function do_generate(logger, repo, compile_location) 'generate', '--abi', tostring(vim.treesitter.language_version), - repo.generate_from_json and 'src/grammar.json', + repo.generate_from_json and 'src/grammar.json' or nil, }, { cwd = compile_location }) if r.code > 0 then return logger:error('Error during "tree-sitter generate": %s', r.stderr) @@ -432,14 +432,12 @@ local function install(languages, options, callback) end end +---@param languages string[] +---@param options? InstallOptions +---@param callback? fun(boolean) M.install = a.sync(function(languages, options, callback) reload_parsers() - if not languages or #languages == 0 then - languages = 'all' - end - - languages = config.norm_languages(languages, options and options.skip) - + languages = config.norm_languages(languages, { ignored = true, unsupported = true }) install(languages, options, callback) end, 3) @@ -447,13 +445,14 @@ end, 3) ---@param languages? string[]|string ---@param _options? UpdateOptions ----@param callback function +---@param callback? function M.update = a.sync(function(languages, _options, callback) reload_parsers() if not languages or #languages == 0 then languages = 'all' end - languages = config.norm_languages(languages, { ignored = true, missing = true }) + languages = + config.norm_languages(languages, { ignored = true, missing = true, unsupported = true }) languages = vim.tbl_filter(needs_update, languages) ---@type string[] if #languages > 0 then @@ -501,7 +500,7 @@ end ---@param languages string[]|string ---@param _options? UpdateOptions ----@param _callback fun() +---@param _callback? fun() M.uninstall = a.sync(function(languages, _options, _callback) languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index c8ebe0b0d..63b3d458c 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -159,7 +159,7 @@ local function get_root(bufnr) end ---@param bufnr integer: the buffer ----@return Query|nil query: `locals` query +---@return vim.treesitter.Query|nil query: `locals` query ---@return TSNode|nil root: root node of the bufferocal function get_query(bufnr) local function get_query(bufnr) local root = get_root(bufnr) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 32ef7cdee..263985ecf 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -19,7 +19,7 @@ return { angular = { install_info = { generate_from_json = true, - revision = 'be53f2597dded40c90b5f53ed9f4521422f6b6b3', + revision = '843525141575e397541e119698f0532755e959f6', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -447,7 +447,7 @@ return { }, editorconfig = { install_info = { - revision = '02f562e71dc28d573187809eecdffaee7c82321c', + revision = '3f2b371537355f6e53cc3af37f79ba450efb5132', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -510,7 +510,7 @@ return { }, enforce = { install_info = { - revision = '8201c3c354c34b96d5a531c8e63d262209ee06cb', + revision = 'aedd0bbab9dcc9caec9cc4e32bd303e86509522b', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '364e323b32d098ad0e7b29e7adb4005c2bb5cf34', + revision = '416ca60d7d2a824c0d346163541153e230710780', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -591,7 +591,7 @@ return { }, fortran = { install_info = { - revision = '64e11001d7ef3e8ac18e55a3a2d811fe36430923', + revision = 'd738334e4a21866a1ab81fb3f27f9b0b2ad2e515', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -726,7 +726,7 @@ return { glimmer_javascript = { install_info = { generate_from_json = true, - revision = 'babba3fc0c822a633261ce9e96a4d7986050eb0c', + revision = '5cc865a2a0a77cbfaf5062c8fcf2a9919bd54f87', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript', }, maintainers = { '@NullVoxPopuli' }, @@ -736,7 +736,7 @@ return { glimmer_typescript = { install_info = { generate_from_json = true, - revision = '48c60295f1ee34ea4ed6e5177102be6d24bfc9d0', + revision = '12d98944c1d5077b957cbdb90d663a7c4d50118c', url = 'https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript', }, maintainers = { '@NullVoxPopuli' }, @@ -900,7 +900,7 @@ return { }, hcl = { install_info = { - revision = '9e3ec9848f28d26845ba300fd73c740459b83e9b', + revision = 'de10d494dbd6b71cdf07a678fecbf404dbfe4398', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -992,7 +992,7 @@ return { }, http = { install_info = { - revision = '77ecf6385f1b5d422e0bbd12204374d287d61ad2', + revision = 'db8b4398de90b6d0b6c780aba96aaa2cd8e9202c', url = 'https://github.com/rest-nvim/tree-sitter-http', }, maintainers = { '@amaanq', '@NTBBloodbath' }, @@ -1082,7 +1082,7 @@ return { }, javadoc = { install_info = { - revision = 'db9589e9c61cff7d7fcc207744c711b10b60a7a3', + revision = '330cc9cb4f33545f7bfce6c3b6aa77fe6db1b537', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1223,7 +1223,7 @@ return { }, koto = { install_info = { - revision = '673511402dfef07b25cfa43991693b8442695fc7', + revision = '46770abba021e2ddd2c51d9fa3087fd1ab6b2aea', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = '9c74e8e8917b83d90e38ac040949079437ec0043', + revision = 'a56af662e8540412fed5e40cc20435b2b9a20502', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1489,7 +1489,7 @@ return { }, nu = { install_info = { - revision = 'c10340b5bb3789f69182acf8f34c3d4fc24d2fe1', + revision = 'd5c71a10b4d1b02e38967b05f8de70e847448dd1', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1577,7 +1577,7 @@ return { install_info = { branch = 'release', generate_from_json = true, - revision = 'bb53f204aa3e7507960014642965c9f9a9e84b1d', + revision = 'ecd90bd8b381bcc7219fed4fe351903630e761c6', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1586,7 +1586,7 @@ return { php = { install_info = { location = 'php', - revision = 'f7cf7348737d8cff1b13407a0bfedce02ee7b046', + revision = '576a56fa7f8b68c91524cdd211eb2ffc43e7bb11', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1597,7 +1597,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'f7cf7348737d8cff1b13407a0bfedce02ee7b046', + revision = '576a56fa7f8b68c91524cdd211eb2ffc43e7bb11', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1803,7 +1803,7 @@ return { qmljs = { install_info = { generate_from_json = true, - revision = '8fef30e231d74b65c713bcbac21956156d8963da', + revision = '0889da4632bba3ec6f39ef4102625654890c15c1', url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, @@ -1990,7 +1990,7 @@ return { }, scala = { install_info = { - revision = '42a1542248ff611ba2091fe76c6dbf42551ebef8', + revision = 'c1189954df854977c3a52003ca8a247c5f4729ba', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2188,7 +2188,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'fc7c594f52528e4a4a08671137850143d55a5bf2', + revision = '16887e9fa3122c36a3d4942470e33c1c282fe859', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2263,7 +2263,7 @@ return { }, tact = { install_info = { - revision = 'a19be2d4c1956e12facfc717e28f13a6ad0860e0', + revision = '47af20264abbd24ea282ded0f8ee9cad3cf3bf2f', url = 'https://github.com/tact-lang/tree-sitter-tact', }, maintainers = { '@novusnota' }, @@ -2271,7 +2271,7 @@ return { }, tcl = { install_info = { - revision = '98015ebe182d94e5a4439e32ffd91beaac32fcb9', + revision = 'f15e711167661d1ba541d4f62b9dbfc4ce61ec56', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, @@ -2297,7 +2297,7 @@ return { }, tera = { install_info = { - revision = '482b475b32e6bae67f9d57abc60545399fd9b0a3', + revision = '25a7c617192253bddfa65e378975d8c476419010', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2306,7 +2306,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = '9e3ec9848f28d26845ba300fd73c740459b83e9b', + revision = 'de10d494dbd6b71cdf07a678fecbf404dbfe4398', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2525,7 +2525,7 @@ return { }, vhs = { install_info = { - revision = '3f202326c06f1c4d47aa82b9013a6b71aea70611', + revision = '0c6fae9d2cfc5b217bfd1fe84a7678f5917116db', url = 'https://github.com/charmbracelet/tree-sitter-vhs', }, maintainers = { '@caarlos0' }, From cbfe8a20c76582b0f2532e94fbd7ea9c80f25455 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 5 Apr 2025 12:22:48 +0200 Subject: [PATCH 059/434] feat(html): use gsub for mimetype lookup --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 2 +- plugin/filetypes.lua | 2 +- plugin/query_predicates.lua | 27 ----------------- runtime/queries/html_tags/injections.scm | 30 +++++++++++++++++-- .../injections/html/test-html-injections.html | 6 ++-- 6 files changed, 33 insertions(+), 35 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 8eac31b73..dbb2934bf 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -29,6 +29,7 @@ Language | Tier | Queries | Maintainer [blade](https://github.com/EmranMR/tree-sitter-blade) | unstable | `HFIJ ` | @calebdw [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint) | unstable | `H  J ` | @gabmus [bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | unstable | `HFIJL` | @ambroisie +[brightscript](https://github.com/ajdelcimmuto/tree-sitter-brightscript) | unstable | `HFIJ ` | @ajdelcimmuto [c](https://github.com/tree-sitter/tree-sitter-c) | unstable | `HFIJL` | @amaanq [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | unstable | `HF JL` | @amaanq [caddy](https://github.com/opa-oz/tree-sitter-caddy) | unmaintained | `HFIJ ` | @opa-oz diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 263985ecf..01c78a63f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -153,8 +153,8 @@ return { }, brightscript = { install_info = { + revision = '48ce1687125c6dfefcc7a1bef19fa0f0f00426cc', url = 'https://github.com/ajdelcimmuto/tree-sitter-brightscript', - files = { 'src/parser.c' }, }, maintainers = { '@ajdelcimmuto' }, tier = 2, diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index 82b2900ac..feb1194a6 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -22,7 +22,7 @@ local filetypes = { haskell_persistent = { 'haskellpersistent' }, idris = { 'idris2' }, janet_simple = { 'janet' }, - javascript = { 'javascriptreact', 'ecma', 'jsx', 'js' }, + javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' }, javascript_glimmer = { 'javascript.glimmer' }, linkerscript = { 'ld' }, latex = { 'tex' }, diff --git a/plugin/query_predicates.lua b/plugin/query_predicates.lua index 06bf957f8..1a500f591 100644 --- a/plugin/query_predicates.lua +++ b/plugin/query_predicates.lua @@ -39,30 +39,3 @@ end, { force = true }) query.add_predicate('any-kind-eq?', function(match, _, _, pred) return predicates['kind-eq'](match, pred, true) end, { force = true }) - --- register custom directives - -local mimetype_aliases = { - ['importmap'] = 'json', - ['module'] = 'javascript', - ['application/ecmascript'] = 'javascript', - ['text/ecmascript'] = 'javascript', -} - ----@param match TSQueryMatch ----@param _ string ----@param bufnr integer ----@param pred string[] ----@return boolean|nil -query.add_directive('set-lang-from-mimetype!', function(match, _, bufnr, pred, metadata) - local id = pred[2] - local node = match[id] - local type_attr_value = vim.treesitter.get_node_text(node, bufnr, { metadata = metadata[id] }) - local configured = mimetype_aliases[type_attr_value] - if configured then - metadata['injection.language'] = configured - else - local parts = vim.split(type_attr_value, '/', {}) - metadata['injection.language'] = parts[#parts] - end -end, { force = true }) diff --git a/runtime/queries/html_tags/injections.scm b/runtime/queries/html_tags/injections.scm index 5b78e37b4..1c8ce012b 100644 --- a/runtime/queries/html_tags/injections.scm +++ b/runtime/queries/html_tags/injections.scm @@ -32,16 +32,40 @@ (#not-lua-match? @_no_type_lang "%stype%s*=") (#set! injection.language "javascript")) -; + + @@ -27,8 +29,6 @@ - - @@ -40,7 +40,7 @@ - +
Test div to test css injections for style attributes From c13511c8842451f4408666ae803b07d030b3782d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 18 Apr 2025 13:14:31 +0200 Subject: [PATCH 060/434] feat(parsers): update nickel, sql, devicetree, dhall, htmldjango, t32, gap, javadoc, templ, jinja, tera, verilog, meson, mlir, typespec, wit, phpdoc, superhtml, git_config, swift, terraform, vim, koto, rasi, rescript, bp, enforce, erlang, jinja_inline, cmake, fennel, comment, slint, elm, rust, hcl --- lua/nvim-treesitter/parsers.lua | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 01c78a63f..58456ecfa 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -144,7 +144,7 @@ return { }, bp = { install_info = { - revision = '16c43068ec30828c5aed11e87262c56f36782595', + revision = 'ee641d15390183d7535777947ce0f2f1fbcee69f', url = 'https://github.com/ambroisie/tree-sitter-bp', }, maintainers = { '@ambroisie' }, @@ -225,7 +225,7 @@ return { }, cmake = { install_info = { - revision = 'fe48221d4d9842d916d66b5e71ab3c6307ec28b3', + revision = 'c2fdefaf7ae3b7c5cf11705fe63c516b1c490590', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -233,7 +233,7 @@ return { }, comment = { install_info = { - revision = '3555706cef8b98d3e4c7379d7260548ff03ad363', + revision = '85eae6644d25bcbdd19f4a35c9946abc71c2d6fe', url = 'https://github.com/stsewd/tree-sitter-comment', }, maintainers = { '@stsewd' }, @@ -352,7 +352,7 @@ return { }, devicetree = { install_info = { - revision = '16f640f3c59117c9e749d581634afdb00e004f4c', + revision = '6557729f4afaf01dec7481d4e5975515ea8f0edd', url = 'https://github.com/joelspadin/tree-sitter-devicetree', }, maintainers = { '@jedrzejboczar' }, @@ -360,7 +360,7 @@ return { }, dhall = { install_info = { - revision = '4a6c08abfb54827db4e722d6cdca81b093898988', + revision = '62013259b26ac210d5de1abf64cf1b047ef88000', url = 'https://github.com/jbellerb/tree-sitter-dhall', }, maintainers = { '@amaanq' }, @@ -479,7 +479,7 @@ return { }, elm = { install_info = { - revision = 'e34bdc5c512918628b05b48e633f711123204e45', + revision = '3b373a3ccb48f31aa4b7ddc9092e2f5e24ab7aed', url = 'https://github.com/elm-tooling/tree-sitter-elm', }, maintainers = { '@zweimach' }, @@ -510,7 +510,7 @@ return { }, enforce = { install_info = { - revision = 'aedd0bbab9dcc9caec9cc4e32bd303e86509522b', + revision = '36064bd71ce22e9a8c73b64b1a3448cc600a4312', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -518,7 +518,7 @@ return { }, erlang = { install_info = { - revision = '416ca60d7d2a824c0d346163541153e230710780', + revision = '067d66937c8eeb6651e349f400c1756c2ea90b2e', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -543,7 +543,7 @@ return { fennel = { install_info = { generate_from_json = true, - revision = 'cfbfa478dc2dbef267ee94ae4323d9c886f45e94', + revision = 'de06b9ad366f0186080056109a8c3be980129538', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, @@ -632,7 +632,7 @@ return { }, gap = { install_info = { - revision = '7db79590d2f8b0e0246008ecfd569b4bfca587a9', + revision = '8dee53cfb962600dd35ca25432f005e7920e89f2', url = 'https://github.com/gap-system/tree-sitter-gap', }, maintainers = { '@reiniscirpons' }, @@ -668,7 +668,7 @@ return { }, git_config = { install_info = { - revision = '9c2a1b7894e6d9eedfe99805b829b4ecd871375e', + revision = 'edc973f498482529ff2a319249d0f43a22860321', url = 'https://github.com/the-mikedavis/tree-sitter-git-config', }, maintainers = { '@amaanq' }, @@ -900,7 +900,7 @@ return { }, hcl = { install_info = { - revision = 'de10d494dbd6b71cdf07a678fecbf404dbfe4398', + revision = '41a2e702413a53f2614533b2aa9c187816116cbc', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -984,7 +984,7 @@ return { }, htmldjango = { install_info = { - revision = 'ea71012d3fe14dd0b69f36be4f96bdfe9155ebae', + revision = '3a643167ad9afac5d61e092f08ff5b054576fadf', url = 'https://github.com/interdependence/tree-sitter-htmldjango', }, maintainers = { '@ObserverOfTime' }, @@ -1082,7 +1082,7 @@ return { }, javadoc = { install_info = { - revision = '330cc9cb4f33545f7bfce6c3b6aa77fe6db1b537', + revision = 'd162cc3344a9be8196b72d8780478474c4e0fd55', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1100,7 +1100,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '9af6ce9380fabd3d5b19d0254b8c8936e879c471', + revision = '258d7fb22fa6cd2dc800f201cfdcbe05111a836c', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1111,7 +1111,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '9af6ce9380fabd3d5b19d0254b8c8936e879c471', + revision = '258d7fb22fa6cd2dc800f201cfdcbe05111a836c', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1223,7 +1223,7 @@ return { }, koto = { install_info = { - revision = '46770abba021e2ddd2c51d9fa3087fd1ab6b2aea', + revision = 'f4e64231b5a2ddd3ff2731896b3bbcaf1c0b32a1', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1399,7 +1399,7 @@ return { }, meson = { install_info = { - revision = 'a56af662e8540412fed5e40cc20435b2b9a20502', + revision = '0e5919d240fd639d81ddc9778152bf487bb9efc7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1408,7 +1408,7 @@ return { mlir = { install_info = { generate = true, - revision = '922cbb97f3d20044e6b4362b3d7af5e530ed8f34', + revision = '8a9c57fe224cbc9194a08c1d5b734290b354edc2', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1440,7 +1440,7 @@ return { }, nickel = { install_info = { - revision = '25464b33522c3f609fa512aa9651707c0b66d48b', + revision = 'f77c02df6dd0845594846beeeedf3715d4b68758', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 2, @@ -1607,7 +1607,7 @@ return { phpdoc = { install_info = { generate_from_json = true, - revision = 'fe3202e468bc17332bec8969f2b50ff1f1da3a46', + revision = '03bb10330704b0b371b044e937d5cc7cd40b4999', url = 'https://github.com/claytonrcarter/tree-sitter-phpdoc', }, maintainers = { '@mikehaertl' }, @@ -1844,7 +1844,7 @@ return { }, rasi = { install_info = { - revision = '6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa', + revision = 'e735c6881d8b475aaa4ef8f0a2bdfd825b438143', url = 'https://github.com/Fymyte/tree-sitter-rasi', }, maintainers = { '@Fymyte' }, @@ -1910,7 +1910,7 @@ return { }, rescript = { install_info = { - revision = '4606cd81c4c31d1d02390fee530858323410a74c', + revision = 'd2df8a285fff95de56a91d2f8152aeceb66f40ef', url = 'https://github.com/rescript-lang/tree-sitter-rescript', }, maintainers = { '@ribru17' }, @@ -1982,7 +1982,7 @@ return { }, rust = { install_info = { - revision = 'e86119bdb4968b9799f6a014ca2401c178d54b5f', + revision = '3691201b01cacb2f96ffca4c632c4e938bfacd88', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2051,7 +2051,7 @@ return { }, slint = { install_info = { - revision = 'f11da7e62051ba8b9d4faa299c26de8aeedfc1cd', + revision = '3493309534cd08ae176c7b917ec79068dca2c1c9', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2129,7 +2129,7 @@ return { install_info = { branch = 'gh-pages', generate_from_json = true, - revision = 'b9d109588d5b5ed986c857464830c2f0bef53f18', + revision = 'b1ec2aa5091624e4729f0a771a6d631afebf1ed4', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2188,7 +2188,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '16887e9fa3122c36a3d4942470e33c1c282fe859', + revision = '13f5a2221cb748bbe50ad702e89362afd5b925a7', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2223,7 +2223,7 @@ return { swift = { install_info = { generate = true, - revision = 'aca5a52aa3cab858944d3c02701ccf5b2d8fd0f9', + revision = '672079db0c0de8d38b018ecc9fe2bb8fa2c722d3', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2247,7 +2247,7 @@ return { }, t32 = { install_info = { - revision = 'e5a12f798f056049642aa03fbb83786e3a5b95d4', + revision = 'dc2a9a3bcc4ad29fff36d3f3bbc62ae117e83028', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2289,7 +2289,7 @@ return { templ = { install_info = { generate_from_json = true, - revision = 'def9849184de71a797c4e2b2837df85abeccf92c', + revision = '7f7f06b3931ca00e8ddfbeab3fc08ad00d297fad', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2297,7 +2297,7 @@ return { }, tera = { install_info = { - revision = '25a7c617192253bddfa65e378975d8c476419010', + revision = 'd006172998fa8b81f96b0f2fc7fa2bf25207c46b', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2306,7 +2306,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = 'de10d494dbd6b71cdf07a678fecbf404dbfe4398', + revision = '41a2e702413a53f2614533b2aa9c187816116cbc', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2419,7 +2419,7 @@ return { }, typespec = { install_info = { - revision = '42fb163442ef2691b9b720fb4e4e846809415d18', + revision = 'b6b6a66a18e98f44cc2f2cdbfd2e1df845b59852', url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, @@ -2509,7 +2509,7 @@ return { }, verilog = { install_info = { - revision = '15fbf73dafaffc89050d247857beb27500ea30e8', + revision = 'ba3c1e305caf948f718293c86c6018a82ed5043e', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2533,7 +2533,7 @@ return { }, vim = { install_info = { - revision = '11b688a1f0e97c0c4e3dbabf4a38016335f4d237', + revision = '0f31cb98e5c0cb3707e097bf95a04c0c2aac573d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, @@ -2593,7 +2593,7 @@ return { }, wit = { install_info = { - revision = '81490b4e74c792369e005f72b0d46fe082d3fed2', + revision = '37bf43c7f11d2b4af7a78d98a19e6d5c2cf04ad2', url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, From 990110336c69f142137992b61b8295c23e5b0387 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 18 Apr 2025 13:16:48 +0200 Subject: [PATCH 061/434] feat(julia)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/julia/locals.scm | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 58456ecfa..a8e782c1c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1175,7 +1175,7 @@ return { }, julia = { install_info = { - revision = '12a3aede757bc7fbdfb1909507c7a6fddd31df37', + revision = '18b739c1563c83fc816170a4241adfa4b69e5c47', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, diff --git a/runtime/queries/julia/locals.scm b/runtime/queries/julia/locals.scm index 500b7fe58..218a84ae9 100644 --- a/runtime/queries/julia/locals.scm +++ b/runtime/queries/julia/locals.scm @@ -9,14 +9,6 @@ (tuple_expression (identifier) @local.definition.var)) -; let/const bindings -(let_binding - (identifier) @local.definition.var) - -(let_binding - (tuple_expression - (identifier) @local.definition.var)) - ; For bindings (for_binding (identifier) @local.definition.var) From 308c9b26c7ee1ce0db19650140dcfa5fb71300ee Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 18 Apr 2025 13:22:20 +0200 Subject: [PATCH 062/434] feat(tcl)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/tcl/indents.scm | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a8e782c1c..791f63328 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2271,7 +2271,7 @@ return { }, tcl = { install_info = { - revision = 'f15e711167661d1ba541d4f62b9dbfc4ce61ec56', + revision = '7b582f8b113bd8a014a44e07d103f70205ac983d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, diff --git a/runtime/queries/tcl/indents.scm b/runtime/queries/tcl/indents.scm index bc0355372..253cd899e 100644 --- a/runtime/queries/tcl/indents.scm +++ b/runtime/queries/tcl/indents.scm @@ -2,7 +2,9 @@ (braced_word_simple) (namespace) (command) - (conditional) + (if) + (else) + (elseif) (foreach) (while) (try) From ed1f573aaeb9570d200fe16a0d041e335ebb070c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 19 Apr 2025 10:33:53 +0200 Subject: [PATCH 063/434] feat(parsers): update ziggy, ziggy_schema, bibtex, latex --- lua/nvim-treesitter/parsers.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 791f63328..4a5bf1479 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -104,7 +104,7 @@ return { }, bibtex = { install_info = { - revision = 'ccfd77db0ed799b6c22c214fe9d2937f47bc8b34', + revision = '8d04ed27b3bc7929f14b7df9236797dab9f3fa66', url = 'https://github.com/latex-lsp/tree-sitter-bibtex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1248,7 +1248,7 @@ return { latex = { install_info = { generate = true, - revision = '7b06f6ed394308e7407a1703d2724128c45fc9d7', + revision = 'f736d24d89acbd90092d92089e5171e6a449db40', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -2668,7 +2668,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = '8a29017169f43dc2c3526817e98142eb9a335087', + revision = 'fe3bf9389e7ff213cf3548caaf9c6f3d4bb38647', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2677,7 +2677,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = '8a29017169f43dc2c3526817e98142eb9a335087', + revision = 'fe3bf9389e7ff213cf3548caaf9c6f3d4bb38647', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, From 037ac775e1bd25577463a4cbdf7991ca3f78fddb Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 22 Apr 2025 10:44:45 +0200 Subject: [PATCH 064/434] feat: add .tsqueryrc.json --- .tsqueryrc.json | 375 ++++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 1 + TODO.md | 1 + 3 files changed, 377 insertions(+) create mode 100644 .tsqueryrc.json diff --git a/.tsqueryrc.json b/.tsqueryrc.json new file mode 100644 index 000000000..129550b46 --- /dev/null +++ b/.tsqueryrc.json @@ -0,0 +1,375 @@ +{ + "$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json", + "parser_install_directories": ["${HOME}/.local/share/nvim/site/parser"], + "parser_aliases": { + "html_tags": "html", + "ecma": "javascript", + "jsx": "javascript" + }, + "valid_captures": { + "highlights": { + "variable": "various variable names", + "variable.builtin": "built-in variable names (e.g. `this`)", + "variable.parameter": "parameters of a function", + "variable.parameter.builtin": "special parameters (e.g. `_`, `it`)", + "variable.member": "object and struct fields", + + "constant": "constant identifiers", + "constant.builtin": "built-in constant values", + "constant.macro": "constants defined by the preprocessor", + + "module": "modules or namespaces", + "module.builtin": "built-in modules or namespaces", + "label": "GOTO and other labels (e.g. `label:` in C), including heredoc labels", + + "string": "string literals", + "string.documentation": "string documenting code (e.g. Python docstrings)", + "string.regexp": "regular expressions", + "string.escape": "escape sequences", + "string.special": "other special strings (e.g. dates)", + "string.special.symbol": "symbols or atoms", + "string.special.url": "URIs (e.g. hyperlinks)", + "string.special.path": "filenames", + + "character": "character literals", + "character.special": "special characters (e.g. wildcards)", + + "boolean": "boolean literals", + "number": "numeric literals", + "number.float": "floating-point number literals", + + "type": "type or class definitions and annotations", + "type.builtin": "built-in types", + "type.definition": "identifiers in type definitions (e.g. `typedef ` in C)", + + "attribute": "attribute annotations (e.g. Python decorators, Rust lifetimes)", + "attribute.builtin": "builtin annotations (e.g. `@property` in Python)", + "property": "the key in key/value pairs", + + "function": "function definitions", + "function.builtin": "built-in functions", + "function.call": "function calls", + "function.macro": "preprocessor macros", + + "function.method": "method definitions", + "function.method.call": "method calls", + + "constructor": "constructor calls and definitions", + "operator": "symbolic operators (e.g. `+` / `*`)", + + "keyword": "keywords not fitting into specific categories", + "keyword.coroutine": "keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)", + "keyword.function": "keywords that define a function (e.g. `func` in Go, `def` in Python)", + "keyword.operator": "operators that are English words (e.g. `and` / `or`)", + "keyword.import": "keywords for including or exporting modules (e.g. `import` / `from` in Python)", + "keyword.type": "keywords describing namespaces and composite types (e.g. `struct`, `enum`)", + "keyword.modifier": "keywords modifying other constructs (e.g. `const`, `static`, `public`)", + "keyword.repeat": "keywords related to loops (e.g. `for` / `while`)", + "keyword.return": "keywords like `return` and `yield`", + "keyword.debug": "keywords related to debugging", + "keyword.exception": "keywords related to exceptions (e.g. `throw` / `catch`)", + "keyword.conditional": "keywords related to conditionals (e.g. `if` / `else`)", + "keyword.conditional.ternary": "ternary operator (e.g. `?` / `:`)", + "keyword.directive": "various preprocessor directives & shebangs", + "keyword.directive.define": "preprocessor definition directives", + + "punctuation.delimiter": "delimiters (e.g. `;` / `.` / `,`)", + "punctuation.bracket": "brackets (e.g. `()` / `{}` / `[]`)", + "punctuation.special": "special symbols (e.g. `{}` in string interpolation)", + + "comment": "line and block comments", + "comment.documentation": "comments documenting code", + "comment.error": "error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED`)", + "comment.warning": "warning-type comments (e.g. `WARNING`, `FIX`, `HACK`)", + "comment.todo": "todo-type comments (e.g. `TODO`, `WIP`)", + "comment.note": "note-type comments (e.g. `NOTE`, `INFO`, `XXX`)", + + "markup.strong": "bold text", + "markup.italic": "italic text", + "markup.strikethrough": "struck-through text", + "markup.underline": "underlined text (only for literal underline markup!)", + "markup.heading": "headings, titles (including markers)", + "markup.heading.1": "top-level heading", + "markup.heading.2": "section heading", + "markup.heading.3": "subsection heading", + "markup.heading.4": "and so on", + "markup.heading.5": "and so forth", + "markup.heading.6": "six levels ought to be enough for anybody", + "markup.quote": "block quotes", + "markup.math": "math environments (e.g. `$ ... $` in LaTeX)", + "markup.link": "text references, footnotes, citations, etc.", + "markup.link.label": "link, reference descriptions", + "markup.link.url": "URL-style links", + "markup.raw": "literal or verbatim text (e.g. inline code)", + "markup.raw.block": "literal or verbatim text as a stand-alone block ; (use priority 90 for blocks with injections)", + "markup.list": "list markers", + "markup.list.checked": "checked todo-style list markers", + "markup.list.unchecked": "unchecked todo-style list markers", + + "diff.plus": "added text (for diff files)", + "diff.minus": "deleted text (for diff files)", + "diff.delta": "changed text (for diff files)", + + "tag": "XML-style tag names (and similar)", + "tag.builtin": "builtin tag names (e.g. HTML5 tags)", + "tag.attribute": "XML-style tag attributes", + "tag.delimiter": "XML-style tag delimiters", + + "conceal": "captures that are only meant to be concealed", + "spell": "for defining regions to be spellchecked", + "nospell": "for defining regions that should NOT be spellchecked", + "none": "completely disable the highlight" + }, + "injections": { + "injection.content": "indicates that the captured node should have its contents re-parsed using another language", + "injection.language": "indicates that the captured node’s text may contain the name of a language that should be used to re-parse the `@injection.content`", + "injection.filename": "indicates that the captured node’s text may contain a filename; the corresponding filetype is then looked-up up via `vim.filetype.match()` and treated as the name of a language that should be used to re-parse the `@injection.content`" + }, + "folds": { + "fold": "fold this node" + }, + "indents": { + "indent.begin": "indent children when matching this node", + "indent.end": "marks the end of indented block", + "indent.align": "behaves like python aligned/hanging indent", + "indent.dedent": "dedent children when matching this node", + "indent.branch": "dedent itself when matching this node", + "indent.ignore": "do not indent in this node", + "indent.auto": "behaves like 'autoindent' buffer option", + "indent.zero": "sets this node at position 0 (no indent)" + }, + "locals": { + "local.definition": "various definitions", + "local.definition.constant": "constants", + "local.definition.function": "functions", + "local.definition.method": "methods", + "local.definition.var": "variables", + "local.definition.parameter": "parameters", + "local.definition.macro": "preprocessor macros", + "local.definition.type": "types or classes", + "local.definition.field": "fields or properties", + "local.definition.enum": "enumerations", + "local.definition.namespace": "modules or namespaces", + "local.definition.import": "imported names", + "local.definition.associated": "the associated type of a variable", + "local.scope": "scope block", + "local.reference": "identifier reference" + } + }, + "valid_predicates": { + "eq": { + "any": true, + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "any", + "arity": "required" + } + ], + "description": "checks for equality between two nodes, or a node and a string" + }, + "any-of": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "variadic" + } + ], + "description": "match any of the given strings against the text corresponding to a node" + }, + "contains": { + "any": true, + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "variadic" + } + ], + "description": "match a string against parts of the text corresponding to a node" + }, + "match": { + "any": true, + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + } + ], + "description": "Match a regexp against the text corresponding to a node" + }, + "lua-match": { + "any": true, + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + } + ], + "description": "match a Lua pattern against the text corresponding to a node" + }, + "has-ancestor": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "variadic" + } + ], + "description": "match any of the given node types against all ancestors of a node" + }, + "has-parent": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "any", + "arity": "required" + }, + { + "type": "any", + "arity": "variadic" + } + ], + "description": "match any of the given node types against the direct ancestor of a node" + }, + "kind-eq": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "variadic" + } + ], + "description": "checks whether a capture corresponds to a given set of nodes" + } + }, + "valid_directives": { + "set": { + "parameters": [ + { + "type": "any", + "arity": "required" + }, + { + "type": "any", + "arity": "optional" + }, + { + "type": "any", + "arity": "optional" + } + ], + "description": "sets key/value metadata for a specific match or capture" + }, + "offset": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + } + ], + "description": "Takes the range of the captured node and applies an offset. This will set a new range in the form of a list like { {start_row}, {start_col}, {end_row}, {end_col} } for the captured node with `capture_id` as `metadata[capture_id].range`." + }, + "gsub": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + }, + { + "type": "string", + "arity": "required" + } + ], + "description": "Transforms the content of the node using a Lua pattern. This will set a new `metadata[capture_id].text`." + }, + "trim": { + "parameters": [ + { + "type": "capture", + "arity": "required" + }, + { + "type": "string", + "arity": "optional" + }, + { + "type": "string", + "arity": "optional" + }, + { + "type": "string", + "arity": "optional" + }, + { + "type": "string", + "arity": "optional" + } + ], + "description": "Trims whitespace from the node. Sets a new `metadata[capture_id].range`. Takes a capture ID and, optionally, four integers to customize trimming behavior (`1` meaning trim, `0` meaning don't trim). When only given a capture ID, trims blank lines (lines that contain only whitespace, or are empty) from the end of the node (for backwards compatibility). Can trim all whitespace from both sides of the node if parameters are given." + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d82c9cd7b..81cd45dbb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -364,6 +364,7 @@ the node describing the language and `@injection.content` to describe the inject ```query @injection.language ; dynamic detection of the injection language (i.e. the text of the captured node describes the language) @injection.content ; region for the dynamically detected language +@injection.filename ; indicates that the captured node’s text may contain a filename; the corresponding filetype is then looked-up up via vim.filetype.match() and treated as the name of a language that should be used to re-parse the `@injection.content` ``` For example, to inject javascript into HTML's ` -``` - -```query -(script_element - (raw_text) @injection.content - (#set! injection.language "javascript")) ; set the parser language for @injection.content region to javascript -``` - -For regions that don't have a corresponding `@injection.language`, you need to manually set the language -through `(#set injection.language "lang_name")` - -To combine all matches of a pattern as one single block of content, add `(#set! injection.combined)` to such pattern - -### Indents - -```query -@indent.begin ; indent children when matching this node -@indent.end ; marks the end of indented block -@indent.align ; behaves like python aligned/hanging indent -@indent.dedent ; dedent children when matching this node -@indent.branch ; dedent itself when matching this node -@indent.ignore ; do not indent in this node -@indent.auto ; behaves like 'autoindent' buffer option -@indent.zero ; sets this node at position 0 (no indent) -``` - -[Matrix channel]: https://matrix.to/#/#nvim-treesitter:matrix.org +[supported languages]: https://github.com/nvim-treesitter/nvim-treesitter/SUPPORTED_LANGUAGES.md +[tree-sitter queries]: https://tree-sitter.github.io/tree-sitter/using-parsers/queries/index.html +[ts_query_ls]: https://github.com/ribru17/ts_query_ls diff --git a/README.md b/README.md index 5b04cf86c..f55b570ad 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,16 @@

-# 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).** The **stable** branch is [`master`](https://github.com/nvim-treesitter/nvim-treesitter/tree/master). +>[!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). 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); 2. a collection of **queries** for enabling tree-sitter features built into Neovim for these languages. +For details on these and how to help improving them, see [CONTRIBUTING.md](./CONTRIBUTING.md). + # Quickstart ## Requirements @@ -37,7 +39,7 @@ The `nvim-treesitter` plugin provides 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 `parser.lua` table). **When upgrading the plugin, you must make sure that all installed parsers are updated to the latest version** via `:TSUpdate`. +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 @@ -46,7 +48,8 @@ require('lazy').setup( ) ``` -**NOTE: This plugin does not support lazy-loading.** +>[!IMPORTANT] +> This plugin does not support lazy-loading. ## Setup @@ -67,7 +70,14 @@ Parsers and queries can then be installed with require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } ``` -(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), adapt [this script](scripts/install-parsers.lua) to your needs. +(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), use something like +```lua +local done = nil +require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }, function(success) + done = success +end) +vim.wait(3000000, function() return done ~= nil end) +``` Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all available commands. @@ -75,7 +85,7 @@ Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all For `nvim-treesitter` to support a specific feature for a specific language requires both a parser for that language and an appropriate language-specific query file for that feature. -A list of the currently supported languages can be found [on this page](SUPPORTED_LANGUAGES.md). If you wish to add a new language or improve the queries for the an existing one, please see our [contributing guide](CONTRIBUTING.md). +A list of the currently supported languages can be found [on this page](SUPPORTED_LANGUAGES.md). If you wish to add a new language or improve the queries for an existing one, please see our [contributing guide](CONTRIBUTING.md). For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information). @@ -134,13 +144,12 @@ callback = function() require('nvim-treesitter.parsers').zimbu = { install_info = { url = 'https://github.com/zimbulang/tree-sitter-zimbu', - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c revision = , -- commit hash for revision to check out; HEAD if missing -- optional entries: branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - generate = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_from_json = true, -- only needed if parser has npm dependencies + generate = true, -- only needed if repo does not contain pre-generated `src/parser.c` + generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` }, } end}) @@ -150,11 +159,10 @@ Alternatively, if you have a local checkout, you can instead use ```lua install_info = { path = '~/parsers/tree-sitter-zimbu', - files = { 'src/parser.c' }, -- note that some parsers also require src/scanner.c -- optional entries - location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" - generate = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_from_json = true, -- only needed if parser has npm dependencies + location = 'parser', + generate = true, + generate_from_json = false, }, ``` This will always use the state of the directory as-is (i.e., `branch` and `revision` will be ignored). @@ -169,7 +177,8 @@ If Neovim does not detect your language's filetype by default, you can use [Neov 3. Start `nvim` and `:TSInstall zimbu`. -**Note:** Parsers using external scanner need to be written in C. C++ scanners are no longer supported. +>[!IMPORTANT] +> Parsers using external scanner need to be written in C. ### Modifying parsers @@ -183,47 +192,9 @@ end}) ## Adding queries -Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see `:h treesitter-query`. +Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see [`:h treesitter-query-modelines`](https://neovim.io/doc/user/treesitter.html#treesitter-query-modeline). E.g., to add queries for `zimbu`, put `highlights.scm` etc. under ```lua vim.fn.stdpath('data') .. 'site/queries/zimbu' ``` - -# Troubleshooting - -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`. - -#### 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. -Try updating the parser that you suspect has changed (`:TSUpdate {language}`) or all of them (`:TSUpdate`). -If the error persists after updating all parsers, -please [open an issue](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose). - -#### I get `query error: invalid node type at position` - -This could be due a query file outside this plugin using outdated nodes, -or due to an outdated parser. - -- Make sure you have the parsers up to date with `:TSUpdate` -- Make sure you don't have more than one `parser` runtime directory. - You can execute this command `:= vim.api.nvim_get_runtime_file('parser', true)` to find all runtime directories. - 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 a mirror instead of "https://github.com/" - -In your Lua config: - -```lua -for _, config in pairs(require("nvim-treesitter.parsers")) do - config.install_info.url = config.install_info.url:gsub("https://github.com/", "something else") -end - -require'nvim-treesitter'.setup { - -- - -- -} -``` diff --git a/TODO.md b/TODO.md index 7bf42c9aa..5f12ac997 100644 --- a/TODO.md +++ b/TODO.md @@ -6,8 +6,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [ ] **`install.lua`:** migrate to async v2 - [ ] **tests:** remove custom crate, plenary dependency -- [ ] **documentation:** consolidate, autogenerate? -- [ ] **documentation:** migration guide - [ ] **indents:** rewrite (Helix or Zed compatible) - [ ] **textobjects:** include simple(!) `node`, `scope` (using `locals`) objects diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index f0abcc779..f95872177 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -11,16 +11,14 @@ Authors: Type |gO| to see the table of contents. ============================================================================== -INTRODUCTION *nvim-treesitter-intro* +INTRODUCTION *nvim-treesitter-intro* Nvim-treesitter provides functionalities for managing treesitter parsers and -compatible queries for core features (highlighting, injections, fold, indent). - -WARNING: This is work in progress and requires the latest commit on Neovim -`master`. +compatible queries for core features (highlighting, injections, folds, +indents). ============================================================================== -QUICK START *nvim-treesitter-quickstart* +QUICK START *nvim-treesitter-quickstart* To configure `nvim-treesitter`, put this in your `init.lua` file: >lua @@ -36,156 +34,141 @@ NOTE: You do not need to call `setup` to use this plugin with the default settings! Parsers and queries can then be installed with >lua - require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } + require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } < -(This is a no-op if the parsers are already installed.) - To check installed parsers and queries, use `:checkhealth nvim-treesitter`. +Treesitter features for installed languages need to be enabled manually in a +|FileType| autocommand or |ftplugin|, e.g. >lua + vim.api.nvim_create_autocmd('FileType', { + pattern = { 'rust', 'javascript', 'zig' }, + callback = function() + -- syntax highlighting, provided by Neovim + vim.treesitter.start() + -- folds, provided by Neovim + vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + -- indentation, provided by nvim-treesitter + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, + }) +< ============================================================================== -COMMANDS *nvim-treesitter-commands* +COMMANDS *nvim-treesitter-commands* - *:TSInstall* -:TSInstall {language} ... ~ +:TSInstall {language} *:TSInstall* -Install one or more treesitter parsers. -You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to -force the reinstallation of already installed parsers. +Install one or more treesitter parsers. {language} can be one or multiple +parsers or tiers (`stable`, `unstable`, or `all` (not recommended)). This is a +no-op of the parser(s) are already installed. Installation is performed +asynchronously. Use *:TSInstall!* to force installation even if a parser is +already installed. - *:TSUpdate* -:TSUpdate {language} ... ~ +:TSInstallFromGrammar {language} *:TSInstallFromGrammar* -Update the installed parser for one more {language} or all installed parsers -if {language} is omitted. The specified parser is installed if it is not already -installed. +Like |:TSInstall| but also regenerates the `parser.c` from the original +grammar. Useful for languages where the provided `parser.c` is outdated (e.g., +uses a no longer supported ABI). - *:TSUninstall* -:TSUninstall {language} ... ~ +:TSUpdate [{language}] *:TSUpdate* -Deletes the parser for one or more {language}. You can use 'all' for language -to uninstall all parsers. +Update parsers to the `revision` specified in the manifest if this is newer +than the installed version. If {language} is specified, update the +corresponding parser or tier; otherwise update all installed parsers. This is +a no-op if all (specified) parsers are up to date. + +Note: It is recommended to add this command as a build step in your plugin +manager. + +:TSUninstall {language} *:TSUninstall* + +Deletes the parser for one or more {language}, or all parsers with `all`. + +:TSLog *:TSLog* + +Shows all messages from previous install, update, or uninstall operations. ============================================================================== -INDENTATION *nvim-treesitter-indentation* +API *nvim-treesitter-api* -Indentation based on treesitter for the |=| operator. -NOTE: this is an experimental feature and will be upstreamed to Neovim when -stable. +setup({opts}) *nvim-treesitter.setup()* -To enable it for a supported parser, add the following to a corresponding -`FileType` autocommand or `ftplugin/.lua`: >lua + Configure installation options. Needs to be specified before any + installation operation. - vim.bo.indentexpr = 'v.lua:require'nvim-treesitter'.indentexpr()' + Note: You only need to call `setup` if you want to set non-default + options! + Parameters: ~ + • {opts} `(table?)` Optional parameters: + • {install_dir} (`string?`, default `stdpath('data')/site/`) + directory to install parsers and queries to. Note: will be + appended to |runtimepath|. + • {ignore_install} (`string[]?`) list of languages to never + install even if specified for an installation operation. + (Useful when specifying tiers instead of individual + languages.) + +install({languages}, {opts}, {callback}) *nvim-treesitter.install()* + + Download, compile, and install the specified treesitter parsers and copy + the corresponding queries to a directory on |runtimepath|, enabling their + use in Neovim. + + Note: This operation is performed asynchronously by default. For + synchronous operation (e.g., in a bootstrapping script), you need to + provide a suitable {callback}: >lua + local done = nil + require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }, + function(success) + done = success + end) + vim.wait(3000000, function() return done ~= nil end) < + Parameters: ~ + • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, + `unstable`) to install. + • {opts} `(table?)` Optional parameters: + • {force} (`boolean?`, default `false`) force installation + of already installed parsers + • {generate} (`boolean?`, default `false`) generate + `parser.c` from `grammar.json` or `grammar.js` before + compiling. + • {max_jobs} (`integer?`) limit parallel tasks (useful in + combination with {generate} on memory-limited systems). + • {callback} `(function?`) Callback for synchronous execution. -Indentation for a language is controlled by `indents.scm` queries. The -following captures are supported: +uninstall({languages}) *nvim-treesitter.uninstall()* + Remove the parser and queries for the specified language(s). -`@indent` *nvim-treesitter-indentation-queries* -Queries can use the following captures: `@indent.begin` and `@indent.dedent`, -`@indent.branch`, `@indent.end` or `@indent.align`. An `@indent.ignore` capture tells -treesitter to ignore indentation and a `@indent.zero` capture sets -the indentation to 0. + Parameters: ~ + • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, + `unstable`) to update. -`@indent.begin` *nvim-treesitter-indentation-indent.begin* -The `@indent.begin` specifies that the next line should be indented. Multiple -indents on the same line get collapsed. Eg. +update({languages}, {callback}) *nvim-treesitter.update()* ->query - ( - (if_statement) - (ERROR "else") @indent.begin - ) + Update the parsers and queries if older than the revision specified in the + manifest. + + Note: This operation is performed asynchronously by default. For + synchronous operation (e.g., in a bootstrapping script), you need to + provide a suitable {callback}: >lua + local done = nil + require('nvim-treesitter').update(), + function(success) + done = success + end) + vim.wait(3000000, function() return done ~= nil end) < -Indent can also have `indent.immediate` set using a `#set!` directive, which -permits the next line to indent even when the block intended to be indented -has no content yet, improving interactive typing. + Parameters: ~ + • {languages} `(string[]|string)` (List of) languages or tiers to + uninstall. + • {callback} `(function?`) Callback for synchronous execution. -eg for python: ->query - ((if_statement) @indent.begin - (#set! indent.immediate 1)) +indentexpr() *nvim-treesitter.indentexpr()* + + Used to enable treesitter indentation for a language via >lua + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" < -Will allow: ->python - if True: - # Auto indent to here - -`@indent.end` *nvim-treesitter-indentation-indent.end* -An `@indent.end` capture is used to specify that the indented region ends and -any text subsequent to the capture should be dedented. - -`@indent.branch` *nvim-treesitter-indentation-indent.branch* -An `@indent.branch` capture is used to specify that a dedented region starts -at the line including the captured nodes. - -`@indent.dedent` *nvim-treesitter-indentation-indent.dedent* -A `@indent.dedent` capture specifies dedenting starting on the next line. -> -`@indent.align` *nvim-treesitter-indentation-aligned_indent.align* -Aligned indent blocks may be specified with the `@indent.align` capture. -This permits - -> - foo(a, - b, - c) -< -As well as -> - foo( - a, - b, - c) -< -and finally -> - foo( - a, - b, - c - ) -< -To specify the delimiters to use `indent.open_delimiter` and -`indent.close_delimiter` should be used. Eg. ->query - ((argument_list) @indent.align - (#set! indent.open_delimiter "(") - (#set! indent.close_delimiter ")")) -< - -For some languages the last line of an `indent.align` block must not be -the same indent as the natural next line. - -For example in python: - ->python - if (a > b and - c < d): - pass - -Is not correct, whereas ->python - if (a > b and - c < d): - pass - -Would be correctly indented. This behavior may be chosen using -`indent.avoid_last_matching_next`. Eg. - ->query - (if_statement - condition: (parenthesized_expression) @indent.align - (#set! indent.open_delimiter "(") - (#set! indent.close_delimiter ")") - (#set! indent.avoid_last_matching_next 1) - ) -< -Could be used to specify that the last line of an `@indent.align` capture -should be additionally indented to avoid clashing with the indent of the first -line of the block inside an if. - vim:tw=78:ts=8:expandtab:noet:ft=help:norl: diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 8ca51814e..6904899f6 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -7,7 +7,7 @@ local health = vim.health local M = {} local NVIM_TREESITTER_MINIMUM_ABI = 13 -local TREE_SITTER_MIN_VER = { 0, 25, 1 } +local TREE_SITTER_MIN_VER = { 0, 25, 4 } ---@param name string ---@return table? From 6b55bc0fab46be886ee81764228ddd8146dcbf9d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 13 May 2025 14:30:27 +0200 Subject: [PATCH 083/434] ci(test): remove parser cache Since installation now installs parsers _and_ queries, caching parsers doesn't allow skipping the installation step (and caching queries does not pay off). --- .github/workflows/test-core.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 05f8078ce..0c0ae594c 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -31,26 +31,14 @@ jobs: run: | bash ./scripts/ci-install.sh - - if: inputs.type == 'generate' - name: Generate and compile parsers - run: $NVIM -l ./scripts/install-parsers.lua --generate --max-jobs=2 - - - if: inputs.type == 'build' - name: Setup Parsers Cache - id: parsers-cache - uses: actions/cache@v4 - with: - path: | - ~/.local/share/nvim/site/parser/ - ~/AppData/Local/nvim-data/site/parser/ - key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles( - './lua/nvim-treesitter/install.lua', - './lua/nvim-treesitter/parsers.lua') }} - - if: inputs.type == 'build' name: Compile parsers run: $NVIM -l ./scripts/install-parsers.lua + - if: inputs.type == 'generate' + name: Generate and compile parsers + run: $NVIM -l ./scripts/install-parsers.lua --generate --max-jobs=2 + - name: Check parsers run: $NVIM -l ./scripts/check-parsers.lua From 25f08b82afd3df904ab13b76106975eae370a91a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 13 May 2025 14:31:03 +0200 Subject: [PATCH 084/434] fix(hcl): remove unnecessary escapes --- runtime/queries/hcl/highlights.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/queries/hcl/highlights.scm b/runtime/queries/hcl/highlights.scm index 4fb7d1fca..f2c784f6f 100644 --- a/runtime/queries/hcl/highlights.scm +++ b/runtime/queries/hcl/highlights.scm @@ -1,10 +1,10 @@ ; highlights.scm [ "!" - "\*" + "*" "/" "%" - "\+" + "+" "-" ">" ">=" @@ -34,7 +34,7 @@ [ (ellipsis) - "\?" + "?" "=>" ] @punctuation.special From 864e75a85d4bbe77745929a1ce4d4c63bef11480 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 13 May 2025 14:47:47 +0200 Subject: [PATCH 085/434] fix(c,cpp,fsharp,idl,powershell,sql,systemtap): remove unneeded escapes --- runtime/queries/c/injections.scm | 2 +- runtime/queries/cpp/injections.scm | 2 +- runtime/queries/fsharp/highlights.scm | 2 +- runtime/queries/idl/injections.scm | 4 ++-- runtime/queries/powershell/highlights.scm | 2 +- runtime/queries/sql/highlights.scm | 2 +- runtime/queries/systemtap/highlights.scm | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/queries/c/injections.scm b/runtime/queries/c/injections.scm index 24634864e..ebedc1ec3 100644 --- a/runtime/queries/c/injections.scm +++ b/runtime/queries/c/injections.scm @@ -9,7 +9,7 @@ (#set! injection.language "re2c")) ((comment) @injection.content - (#lua-match? @injection.content "/[*\/][!*\/] Date: Thu, 15 May 2025 09:45:28 +0200 Subject: [PATCH 086/434] feat(config)!: remove `ignore_install` This was only useful for no longer supported `auto_install` option. --- README.md | 2 -- doc/nvim-treesitter.txt | 6 ------ lua/nvim-treesitter/config.lua | 15 +-------------- lua/nvim-treesitter/install.lua | 5 ++--- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index f55b570ad..fb4691bf3 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,6 @@ require('lazy').setup( require'nvim-treesitter'.setup { -- Directory to install parsers and queries to install_dir = vim.fn.stdpath('data') .. '/site' - -- List of parsers to ignore when installing tiers - ignore_install = { }, } ``` diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index f95872177..c810023f7 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -26,8 +26,6 @@ To configure `nvim-treesitter`, put this in your `init.lua` file: -- A directory to install the parsers and queries to. -- Defaults to the `stdpath('data')/site` dir. install_dir = "/some/path/to/store/parsers", - -- List of parsers to ignore installing (for "stable" etc.) - ignore_install = { "some_parser" }, } NOTE: You do not need to call `setup` to use this plugin with the default @@ -103,10 +101,6 @@ setup({opts}) *nvim-treesitter.setup()* • {install_dir} (`string?`, default `stdpath('data')/site/`) directory to install parsers and queries to. Note: will be appended to |runtimepath|. - • {ignore_install} (`string[]?`) list of languages to never - install even if specified for an installation operation. - (Useful when specifying tiers instead of individual - languages.) install({languages}, {opts}, {callback}) *nvim-treesitter.install()* diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index b7ffbf47c..8dcbdb37e 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -3,12 +3,10 @@ local M = {} M.tiers = { 'stable', 'unstable', 'unmaintained', 'unsupported' } ---@class TSConfig ----@field ignore_install string[] ---@field install_dir string ---@type TSConfig local config = { - ignore_install = {}, install_dir = vim.fs.joinpath(vim.fn.stdpath('data'), 'site'), } @@ -92,7 +90,7 @@ end ---Normalize languages ---@param languages? string[]|string ----@param skip? { ignored: boolean, missing: boolean, unsupported: boolean, installed: boolean, dependencies: boolean } +---@param skip? { missing: boolean, unsupported: boolean, installed: boolean, dependencies: boolean } ---@return string[] function M.norm_languages(languages, skip) if not languages then @@ -110,17 +108,6 @@ function M.norm_languages(languages, skip) languages = expand_tiers(languages) - if skip and skip.ignored then - local ignored = expand_tiers(config.ignore_install) - languages = vim.tbl_filter( - --- @param v string - function(v) - return not vim.list_contains(ignored, v) - end, - languages - ) - end - if skip and skip.installed then local installed = M.installed_parsers() languages = vim.tbl_filter( diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index b36a7ddee..68f4c5ea4 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -439,7 +439,7 @@ end ---@param callback? fun(boolean) M.install = a.sync(function(languages, options, callback) reload_parsers() - languages = config.norm_languages(languages, { ignored = true, unsupported = true }) + languages = config.norm_languages(languages, { unsupported = true }) install(languages, options, callback) end, 3) @@ -451,8 +451,7 @@ M.update = a.sync(function(languages, _options, callback) if not languages or #languages == 0 then languages = 'all' end - languages = - config.norm_languages(languages, { ignored = true, missing = true, unsupported = true }) + languages = config.norm_languages(languages, { missing = true, unsupported = true }) languages = vim.tbl_filter(needs_update, languages) ---@type string[] if #languages > 0 then From 7a4a35de3ebe01e85beba91ebc124b7dd80bd287 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 16 May 2025 14:55:45 +0200 Subject: [PATCH 087/434] refactor(indent): use `node:byte_length() --- lua/nvim-treesitter/indent.lua | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index dda632df3..b0982c6c6 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -39,14 +39,6 @@ local function get_last_node_at_line(root, lnum, col) return root:descendant_for_range(lnum - 1, col, lnum - 1, col + 1) end ----@param node TSNode ----@return number -local function node_length(node) - local _, _, start_byte = node:start() - local _, _, end_byte = node:end_() - return end_byte - start_byte -end - ---@param bufnr integer ---@param node TSNode ---@param delimiter string @@ -133,7 +125,7 @@ function M.get_indent(lnum) end local local_root = tstree:root() if ts.is_in_node_range(local_root, lnum - 1, 0) then - if not root or node_length(root) >= node_length(local_root) then + if not root or root:byte_length() >= local_root:byte_length() then root = local_root lang_tree = tree end From 69371f0148bb96b41047f036a58e7e648e200140 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 16 May 2025 15:44:26 +0100 Subject: [PATCH 088/434] feat(install)!: migrate to latest async.nvim impl (#7856) Provides significantly simpler blocking installation and update. --- .gitattributes | 7 +- README.md | 8 +- TODO.md | 2 +- doc/nvim-treesitter.txt | 29 +- lua/nvim-treesitter/async.lua | 777 ++++++++++++++++++++++++++++---- lua/nvim-treesitter/install.lua | 117 +++-- scripts/install-parsers.lua | 23 +- 7 files changed, 788 insertions(+), 175 deletions(-) diff --git a/.gitattributes b/.gitattributes index 3375d5ce2..f88a2024f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ -runtime/queries/**/*.scm linguist-language=Tree-sitter-Query -doc/*.txt linguist-documentation -SUPPORTED_LANGUAGES.md linguist-generated +runtime/queries/**/*.scm linguist-language=tsq +doc/*.txt linguist-documentation +SUPPORTED_LANGUAGES.md linguist-generated +lua/nvim-treesitter/async.lua linguist-vendored diff --git a/README.md b/README.md index fb4691bf3..703a41781 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,9 @@ Parsers and queries can then be installed with require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } ``` -(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), use something like +(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), you need to `wait()` for it to finish: ```lua -local done = nil -require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }, function(success) - done = success -end) -vim.wait(3000000, function() return done ~= nil end) +require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }):wait(300000) -- wait max. 5 minutes ``` Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all available commands. diff --git a/TODO.md b/TODO.md index 5f12ac997..937a8b63b 100644 --- a/TODO.md +++ b/TODO.md @@ -4,7 +4,6 @@ This document lists the planned and finished changes in this rewrite towards [Nv ## TODO -- [ ] **`install.lua`:** migrate to async v2 - [ ] **tests:** remove custom crate, plenary dependency - [ ] **indents:** rewrite (Helix or Zed compatible) - [ ] **textobjects:** include simple(!) `node`, `scope` (using `locals`) objects @@ -26,3 +25,4 @@ This document lists the planned and finished changes in this rewrite towards [Nv - [X] drop ensure_install (replace with install) - [X] **CI:** switch to ts_query_ls, add update readme as check (remove update job) - [X] **CI:** track versioned releases for tier 1 +- [X] **`install.lua`:** migrate to async v2 diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index c810023f7..b57687961 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -102,7 +102,7 @@ setup({opts}) *nvim-treesitter.setup()* directory to install parsers and queries to. Note: will be appended to |runtimepath|. -install({languages}, {opts}, {callback}) *nvim-treesitter.install()* +install({languages} [, {opts}]) *nvim-treesitter.install()* Download, compile, and install the specified treesitter parsers and copy the corresponding queries to a directory on |runtimepath|, enabling their @@ -110,13 +110,9 @@ install({languages}, {opts}, {callback}) *nvim-treesitter.install()* Note: This operation is performed asynchronously by default. For synchronous operation (e.g., in a bootstrapping script), you need to - provide a suitable {callback}: >lua - local done = nil - require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }, - function(success) - done = success - end) - vim.wait(3000000, function() return done ~= nil end) + `wait()` for it: >lua + require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }) + :wait(300000) -- max. 5 minutes < Parameters: ~ • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, @@ -129,7 +125,6 @@ install({languages}, {opts}, {callback}) *nvim-treesitter.install()* compiling. • {max_jobs} (`integer?`) limit parallel tasks (useful in combination with {generate} on memory-limited systems). - • {callback} `(function?`) Callback for synchronous execution. uninstall({languages}) *nvim-treesitter.uninstall()* @@ -139,25 +134,19 @@ uninstall({languages}) *nvim-treesitter.uninstall() • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, `unstable`) to update. -update({languages}, {callback}) *nvim-treesitter.update()* +update([{languages}]) *nvim-treesitter.update()* Update the parsers and queries if older than the revision specified in the manifest. Note: This operation is performed asynchronously by default. For synchronous operation (e.g., in a bootstrapping script), you need to - provide a suitable {callback}: >lua - local done = nil - require('nvim-treesitter').update(), - function(success) - done = success - end) - vim.wait(3000000, function() return done ~= nil end) + `wait()` for it: >lua + require('nvim-treesitter').update():wait(300000) -- max. 5 minutes < Parameters: ~ - • {languages} `(string[]|string)` (List of) languages or tiers to - uninstall. - • {callback} `(function?`) Callback for synchronous execution. + • {languages} `(string[]|string)?` (List of) languages or tiers to update + (default: all installed). indentexpr() *nvim-treesitter.indentexpr()* diff --git a/lua/nvim-treesitter/async.lua b/lua/nvim-treesitter/async.lua index 8a5e7c8af..e78c0f964 100644 --- a/lua/nvim-treesitter/async.lua +++ b/lua/nvim-treesitter/async.lua @@ -1,112 +1,725 @@ -local co = coroutine +local pcall = copcall or pcall +--- @param ... any +--- @return {[integer]: any, n: integer} +local function pack_len(...) + return { n = select('#', ...), ... } +end + +--- like unpack() but use the length set by F.pack_len if present +--- @param t? { [integer]: any, n?: integer } +--- @param first? integer +--- @return ...any +local function unpack_len(t, first) + if t then + return unpack(t, first or 1, t.n or table.maxn(t)) + end +end + +--- @class async local M = {} ----Executes a future with a callback when it is done ----@param func function ----@param callback function ----@param ... unknown -local function execute(func, callback, ...) - local thread = co.create(func) +--- Weak table to keep track of running tasks +--- @type table +local threads = setmetatable({}, { __mode = 'k' }) - local function step(...) - local ret = { co.resume(thread, ...) } - ---@type boolean, any - local stat, nargs_or_err = unpack(ret) +--- @return async.Task? +local function running() + local task = threads[coroutine.running()] + if task and not (task:_completed() or task._closing) then + return task + end +end - if not stat then - error( - string.format( - 'The coroutine failed with this message: %s\n%s', - nargs_or_err, - debug.traceback(thread) - ) - ) - end +--- Base class for async tasks. Async functions should return a subclass of +--- this. This is designed specifically to be a base class of uv_handle_t +--- @class async.Handle +--- @field close fun(self: async.Handle, callback?: fun()) +--- @field is_closing? fun(self: async.Handle): boolean - if co.status(thread) == 'dead' then - if callback then - callback(unpack(ret, 3, table.maxn(ret))) - end - return - end +--- @alias async.CallbackFn fun(...: any): async.Handle? - ---@type function, any[] - local fn, args = ret[3], { unpack(ret, 4, table.maxn(ret)) } - args[nargs_or_err] = step - fn(unpack(args, 1, nargs_or_err)) +--- @class async.Task : async.Handle +--- @field package _callbacks table +--- @field package _callback_pos integer +--- @field private _thread thread +--- +--- Tasks can call other async functions (task of callback functions) +--- when we are waiting on a child, we store the handle to it here so we can +--- cancel it. +--- @field private _current_child? async.Handle +--- +--- Error result of the task is an error occurs. +--- Must use `await` to get the result. +--- @field private _err? any +--- +--- Result of the task. +--- Must use `await` to get the result. +--- @field private _result? any[] +local Task = {} +Task.__index = Task + +--- @private +--- @param func function +--- @return async.Task +function Task._new(func) + local thread = coroutine.create(func) + + local self = setmetatable({ + _closing = false, + _thread = thread, + _callbacks = {}, + _callback_pos = 1, + }, Task) + + threads[thread] = self + + return self +end + +--- @param callback fun(err?: any, ...: any) +function Task:await(callback) + if self._closing then + callback('closing') + elseif self:_completed() then -- TODO(lewis6991): test + -- Already finished or closed + callback(self._err, unpack_len(self._result)) + else + self._callbacks[self._callback_pos] = callback + self._callback_pos = self._callback_pos + 1 + end +end + +--- @package +function Task:_completed() + return (self._err or self._result) ~= nil +end + +-- Use max 32-bit signed int value to avoid overflow on 32-bit systems. +-- Do not use `math.huge` as it is not interpreted as a positive integer on all +-- platforms. +local MAX_TIMEOUT = 2 ^ 31 - 1 + +--- Synchronously wait (protected) for a task to finish (blocking) +--- +--- If an error is returned, `Task:traceback()` can be used to get the +--- stack trace of the error. +--- +--- Example: +--- ```lua +--- +--- local ok, err_or_result = task:pwait(10) +--- +--- if not ok then +--- error(task:traceback(err_or_result)) +--- end +--- +--- local _, result = assert(task:pwait(10)) +--- ``` +--- +--- Can be called if a task is closing. +--- @param timeout? integer +--- @return boolean status +--- @return any ... result or error +function Task:pwait(timeout) + local done = vim.wait(timeout or MAX_TIMEOUT, function() + -- Note we use self:_completed() instead of self:await() to avoid creating a + -- callback. This avoids having to cleanup/unregister any callback in the + -- case of a timeout. + return self:_completed() + end) + + if not done then + return false, 'timeout' + elseif self._err then + return false, self._err + else + return true, unpack_len(self._result) + end +end + +--- Synchronously wait for a task to finish (blocking) +--- +--- Example: +--- ```lua +--- local result = task:wait(10) -- wait for 10ms or else error +--- +--- local result = task:wait() -- wait indefinitely +--- ``` +--- @param timeout? integer Timeout in milliseconds +--- @return any ... result +function Task:wait(timeout) + local res = pack_len(self:pwait(timeout)) + local stat = res[1] + + if not stat then + error(self:traceback(res[2])) end - step(...) + return unpack_len(res, 2) +end + +--- @private +--- @param msg? string +--- @param _lvl? integer +--- @return string +function Task:_traceback(msg, _lvl) + _lvl = _lvl or 0 + + local thread = ('[%s] '):format(self._thread) + + local child = self._current_child + if getmetatable(child) == Task then + --- @cast child async.Task + msg = child:_traceback(msg, _lvl + 1) + end + + local tblvl = getmetatable(child) == Task and 2 or nil + msg = (msg or '') .. debug.traceback(self._thread, '', tblvl):gsub('\n\t', '\n\t' .. thread) + + if _lvl == 0 then + --- @type string + msg = msg + :gsub('\nstack traceback:\n', '\nSTACK TRACEBACK:\n', 1) + :gsub('\nstack traceback:\n', '\n') + :gsub('\nSTACK TRACEBACK:\n', '\nstack traceback:\n', 1) + end + + return msg +end + +--- Get the traceback of a task when it is not active. +--- Will also get the traceback of nested tasks. +--- +--- @param msg? string +--- @return string +function Task:traceback(msg) + return self:_traceback(msg) +end + +--- If a task completes with an error, raise the error +function Task:raise_on_error() + self:await(function(err) + if err then + error(self:_traceback(err), 0) + end + end) + return self +end + +--- @private +--- @param err? any +--- @param result? {[integer]: any, n: integer} +function Task:_finish(err, result) + self._current_child = nil + self._err = err + self._result = result + threads[self._thread] = nil + + local errs = {} --- @type string[] + for _, cb in pairs(self._callbacks) do + --- @type boolean, string + local ok, cb_err = pcall(cb, err, unpack_len(result)) + if not ok then + errs[#errs + 1] = cb_err + end + end + + if #errs > 0 then + error(table.concat(errs, '\n'), 0) + end +end + +--- @return boolean +function Task:is_closing() + return self._closing +end + +--- Close the task and all its children. +--- If callback is provided it will run asynchronously, +--- else it will run synchronously. +--- +--- @param callback? fun() +function Task:close(callback) + if self:_completed() then + if callback then + callback() + end + return + end + + if self._closing then + return + end + + self._closing = true + + if callback then -- async + if self._current_child then + self._current_child:close(function() + self:_finish('closed') + callback() + end) + else + self:_finish('closed') + callback() + end + else -- sync + if self._current_child then + self._current_child:close(function() + self:_finish('closed') + end) + else + self:_finish('closed') + end + vim.wait(0, function() + return self:_completed() + end) + end +end + +--- @param obj any +--- @return boolean +local function is_async_handle(obj) + local ty = type(obj) + return (ty == 'table' or ty == 'userdata') and vim.is_callable(obj.close) +end + +--- @param ... any +function Task:_resume(...) + --- @type [boolean, string|async.CallbackFn] + local ret = pack_len(coroutine.resume(self._thread, ...)) + local stat = ret[1] + + if not stat then + -- Coroutine had error + self:_finish(ret[2]) + elseif coroutine.status(self._thread) == 'dead' then + -- Coroutine finished + local result = pack_len(unpack_len(ret, 2)) + self:_finish(nil, result) + else + local fn = ret[2] + --- @cast fn -string + + -- TODO(lewis6991): refine error handler to be more specific + local ok, r + ok, r = pcall(fn, function(...) + if is_async_handle(r) then + --- @cast r async.Handle + -- We must close children before we resume to ensure + -- all resources are collected. + local args = pack_len(...) + r:close(function() + self:_resume(unpack_len(args)) + end) + else + self:_resume(...) + end + end) + + if not ok then + self:_finish(r) + elseif is_async_handle(r) then + self._current_child = r + end + end +end + +--- @return 'running'|'suspended'|'normal'|'dead'? +function Task:status() + return coroutine.status(self._thread) +end + +--- Run a function in an async context, asynchronously. +--- +--- Examples: +--- ```lua +--- -- The two below blocks are equivalent: +--- +--- -- Run a uv function and wait for it +--- local stat = async.arun(function() +--- return async.await(2, vim.uv.fs_stat, 'foo.txt') +--- end):wait() +--- +--- -- Since uv functions have sync versions. You can just do: +--- local stat = vim.fs_stat('foo.txt') +--- ``` +--- @param func function +--- @param ... any +--- @return async.Task +function M.arun(func, ...) + local task = Task._new(func) + task:_resume(...) + return task +end + +--- @class async.TaskFun +--- @field package _fun fun(...: any): any +--- @operator call(...): any +local TaskFun = {} +TaskFun.__index = TaskFun + +function TaskFun:__call(...) + return M.arun(self._fun, ...) +end + +--- Create an async function +--- @param fun function +--- @return async.TaskFun +function M.async(fun) + return setmetatable({ _fun = fun }, TaskFun) +end + +--- Returns the status of a task’s thread. +--- +--- @param task? async.Task +--- @return 'running'|'suspended'|'normal'|'dead'? +function M.status(task) + task = task or running() + if task then + assert(getmetatable(task) == Task, 'Expected Task') + return task:status() + end +end + +--- @async +--- @generic R1, R2, R3, R4 +--- @param fun fun(callback: fun(r1: R1, r2: R2, r3: R3, r4: R4)): any? +--- @return R1, R2, R3, R4 +local function yield(fun) + assert(type(fun) == 'function', 'Expected function') + return coroutine.yield(fun) +end + +--- @async +--- @param task async.Task +--- @return any ... +local function await_task(task) + --- @param callback fun(err?: string, ...: any) + --- @return function + local res = pack_len(yield(function(callback) + task:await(callback) + return task + end)) + + local err = res[1] + + if err then + -- TODO(lewis6991): what is the correct level to pass? + error(err, 0) + end + + return unpack_len(res, 2) +end + +--- Asynchronous blocking wait +--- @param argc integer +--- @param fun async.CallbackFn +--- @param ... any func arguments +--- @return any ... +local function await_cbfun(argc, fun, ...) + local args = pack_len(...) + + --- @param callback fun(...:any) + --- @return any? + return yield(function(callback) + args[argc] = callback + args.n = math.max(args.n, argc) + return fun(unpack_len(args)) + end) +end + +--- @param taskfun async.TaskFun +--- @param ... any +--- @return any ... +local function await_taskfun(taskfun, ...) + return taskfun._fun(...) +end + +--- Asynchronous blocking wait +--- +--- Example: +--- ```lua +--- local task = async.arun(function() +--- return 1, 'a' +--- end) +--- +--- local task_fun = async.async(function(arg) +--- return 2, 'b', arg +--- end) +--- +--- async.arun(function() +--- do -- await a callback function +--- async.await(1, vim.schedule) +--- end +--- +--- do -- await a task (new async context) +--- local n, s = async.await(task) +--- assert(n == 1 and s == 'a') +--- end +--- +--- do -- await a started task function (new async context) +--- local n, s, arg = async.await(task_fun('A')) +--- assert(n == 2) +--- assert(s == 'b') +--- assert(args == 'A') +--- end +--- +--- do -- await a task function (re-using the current async context) +--- local n, s, arg = async.await(task_fun, 'B') +--- assert(n == 2) +--- assert(s == 'b') +--- assert(args == 'B') +--- end +--- end) +--- ``` +--- @async +--- @overload fun(argc: integer, func: async.CallbackFn, ...:any): any ... +--- @overload fun(task: async.Task): any ... +--- @overload fun(taskfun: async.TaskFun): any ... +function M.await(...) + assert(running(), 'Not in async context') + + local arg1 = select(1, ...) + + if type(arg1) == 'number' then + return await_cbfun(...) + elseif getmetatable(arg1) == Task then + return await_task(...) + elseif getmetatable(arg1) == TaskFun then + return await_taskfun(...) + end + + error('Invalid arguments, expected Task or (argc, func) got: ' .. type(arg1), 2) end --- Creates an async function with a callback style function. ----@generic F: function ----@param func F ----@param argc integer ----@return F -function M.wrap(func, argc) - vim.validate('func', func, 'function') - vim.validate('argc', argc, 'number') - ---@param ... unknown - ---@return unknown +--- +--- Example: +--- +--- ```lua +--- --- Note the callback argument is not present in the return function +--- --- @type fun(timeout: integer) +--- local sleep = async.awrap(2, function(timeout, callback) +--- local timer = vim.uv.new_timer() +--- timer:start(timeout * 1000, 0, callback) +--- -- uv_timer_t provides a close method so timer will be +--- -- cleaned up when this function finishes +--- return timer +--- end) +--- +--- async.arun(function() +--- print('hello') +--- sleep(2) +--- print('world') +--- end) +--- ``` +--- +--- local atimer = async.awrap( +--- @param argc integer +--- @param func async.CallbackFn +--- @return async function +function M.awrap(argc, func) + assert(type(argc) == 'number') + assert(type(func) == 'function') + --- @async return function(...) - return co.yield(argc, func, ...) + return M.await(argc, func, ...) end end ----Use this to create a function which executes in an async context but ----called from a non-async context. Inherently this cannot return anything ----since it is non-blocking ----@generic F: function ----@param func async F ----@param nargs? integer ----@return F -function M.sync(func, nargs) - nargs = nargs or 0 - return function(...) - local callback = select(nargs + 1, ...) - execute(func, callback, unpack({ ... }, 1, nargs)) - end +if vim.schedule then + --- An async function that when called will yield to the Neovim scheduler to be + --- able to call the API. + M.schedule = M.awrap(1, vim.schedule) end ----@param n integer max number of concurrent jobs ----@param interrupt_check? function ----@param thunks function[] ----@return any -function M.join(n, interrupt_check, thunks) - return co.yield(1, function(finish) - if #thunks == 0 then - return finish() +--- Create a function that runs a function when it is garbage collected. +--- @generic F +--- @param f F +--- @param gc fun() +--- @return F +local function gc_fun(f, gc) + local proxy = newproxy(true) + local proxy_mt = getmetatable(proxy) + proxy_mt.__gc = gc + proxy_mt.__call = function(_, ...) + return f(...) + end + + return proxy +end + +--- @param task_cbs table +local function gc_cbs(task_cbs) + for task, tcb in pairs(task_cbs) do + for j, cb in pairs(task._callbacks) do + if cb == tcb then + task._callbacks[j] = nil + break + end end + end +end - local remaining = { select(n + 1, unpack(thunks)) } - local to_go = #thunks +--- @async +--- Example: +--- ```lua +--- local task1 = async.arun(function() +--- return 1, 'a' +--- end) +--- +--- local task2 = async.arun(function() +--- return 1, 'a' +--- end) +--- +--- local task3 = async.arun(function() +--- error('task3 error') +--- end) +--- +--- async.arun(function() +--- for i, err, r1, r2 in async.iter({task1, task2, task3}) +--- print(i, err, r1, r2) +--- end +--- end) +--- ``` +--- +--- Prints: +--- ``` +--- 1 nil 1 'a' +--- 2 nil 2 'b' +--- 3 'task3 error' nil nil +--- ``` +--- +--- @param tasks async.Task[] +--- @return fun(): (integer?, any?, ...) +function M.iter(tasks) + assert(running(), 'Not in async context') - local ret = {} ---@type any[] + local results = {} --- @type [integer, any, ...][] - local function cb(...) - ret[#ret + 1] = { ... } - to_go = to_go - 1 - if to_go == 0 then - finish(ret) - elseif not interrupt_check or not interrupt_check() then - if #remaining > 0 then - local next_task = table.remove(remaining) - next_task(cb) - end + -- Iter blocks in an async context so only one waiter is needed + local waiter = nil + local task_cbs = {} --- @type table + local remaining = #tasks + + --- If can_gc_cbs is true, then the iterator function has been garbage + --- collected and means any awaiters can also be garbage collected. The + --- only time we can't do this is if with the special case when iter() is + --- called anonymously (`local i = async.iter(tasks)()`), so we should not + --- garbage collect the callbacks until at least one awaiter is called. + local can_gc_cbs = false + + for i, task in ipairs(tasks) do + local function cb(err, ...) + if can_gc_cbs == true then + gc_cbs(task_cbs) + end + + local callback = waiter + + -- Clear waiter before calling it + waiter = nil + + remaining = remaining - 1 + if callback then + -- Iterator is waiting, yield to it + callback(i, err, ...) + else + -- Task finished before Iterator was called. Store results. + table.insert(results, pack_len(i, err, ...)) end end - for i = 1, math.min(n, #thunks) do - thunks[i](cb) + task_cbs[task] = cb + task:await(cb) + end + + return gc_fun( + M.awrap(1, function(callback) + if next(results) then + local res = table.remove(results, 1) + callback(unpack_len(res)) + elseif remaining == 0 then + callback() -- finish + else + assert(not waiter, 'internal error: waiter already set') + waiter = callback + end + end), + function() + -- Don't gc callbacks just yet. Wait until at least one of them is called. + can_gc_cbs = true end - end, 1) + ) end ----An async function that when called will yield to the Neovim scheduler to be ----able to call the API. ----@type fun() -M.main = M.wrap(vim.schedule, 1) +do -- join() + --- @param results table + --- @param i integer + --- @param ... any + --- @return boolean + local function collect(results, i, ...) + if i then + results[i] = pack_len(...) + end + return i ~= nil + end + + --- @param iter fun(): ... + --- @return table + local function drain_iter(iter) + local results = {} --- @type table + while collect(results, iter()) do + end + return results + end + + --- @async + --- Wait for all tasks to finish and return their results. + --- + --- Example: + --- ```lua + --- local task1 = async.arun(function() + --- return 1, 'a' + --- end) + --- + --- local task2 = async.arun(function() + --- return 1, 'a' + --- end) + --- + --- local task3 = async.arun(function() + --- error('task3 error') + --- end) + --- + --- async.arun(function() + --- local results = async.join({task1, task2, task3}) + --- print(vim.inspect(results)) + --- end) + --- ``` + --- + --- Prints: + --- ``` + --- { + --- [1] = { nil, 1, 'a' }, + --- [2] = { nil, 2, 'b' }, + --- [3] = { 'task2 error' }, + --- } + --- ``` + --- @param tasks async.Task[] + --- @return table + function M.join(tasks) + assert(running(), 'Not in async context') + return drain_iter(M.iter(tasks)) + end + + --- @async + --- @param tasks async.Task[] + --- @return integer?, any?, ...? + function M.joinany(tasks) + return M.iter(tasks)() + end +end return M diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 68f4c5ea4..6d60b7921 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -9,23 +9,53 @@ local parsers = require('nvim-treesitter.parsers') local util = require('nvim-treesitter.util') ---@type fun(path: string, new_path: string, flags?: table): string? -local uv_copyfile = a.wrap(uv.fs_copyfile, 4) +local uv_copyfile = a.awrap(4, uv.fs_copyfile) ---@type fun(path: string, mode: integer): string? -local uv_mkdir = a.wrap(uv.fs_mkdir, 3) +local uv_mkdir = a.awrap(3, uv.fs_mkdir) ---@type fun(path: string, new_path: string): string? -local uv_rename = a.wrap(uv.fs_rename, 3) +local uv_rename = a.awrap(3, uv.fs_rename) ---@type fun(path: string, new_path: string, flags?: table): string? -local uv_symlink = a.wrap(uv.fs_symlink, 4) +local uv_symlink = a.awrap(4, uv.fs_symlink) ---@type fun(path: string): string? -local uv_unlink = a.wrap(uv.fs_unlink, 2) +local uv_unlink = a.awrap(2, uv.fs_unlink) local MAX_JOBS = 100 local INSTALL_TIMEOUT = 60000 +--- @async +--- @param max_jobs integer +--- @param task_funs async.TaskFun[] +local function join(max_jobs, task_funs) + if #task_funs == 0 then + return + end + + max_jobs = math.min(max_jobs, #task_funs) + + local remaining = { select(max_jobs + 1, unpack(task_funs)) } + local to_go = #task_funs + + a.await(1, function(finish) + local function cb() + to_go = to_go - 1 + if to_go == 0 then + finish() + elseif #remaining > 0 then + local next_task = table.remove(remaining) + next_task():await(cb) + end + end + + for i = 1, max_jobs do + task_funs[i]():await(cb) + end + end) +end + ---@async ---@param cmd string[] ---@param opts? vim.SystemOpts @@ -33,8 +63,8 @@ local INSTALL_TIMEOUT = 60000 local function system(cmd, opts) local cwd = opts and opts.cwd or uv.cwd() log.trace('running job: (cwd=%s) %s', cwd, table.concat(cmd, ' ')) - local r = a.wrap(vim.system, 3)(cmd, opts) --[[@as vim.SystemCompleted]] - a.main() + local r = a.await(3, vim.system, cmd, opts) --[[@as vim.SystemCompleted]] + a.schedule() if r.stdout and r.stdout ~= '' then log.trace('stdout -> %s', r.stdout) end @@ -190,7 +220,7 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu do -- Create tmp dir logger:debug('Creating temporary directory: %s', tmp) local err = mkpath(tmp) - a.main() + a.schedule() if err then return logger:error('Could not create %s-tmp: %s', project_name, err) end @@ -211,7 +241,7 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu do -- Remove tarball logger:debug('Removing %s...', tarball_path) local err = uv_unlink(tarball_path) - a.main() + a.schedule() if err then return logger:error('Could not remove tarball: %s', err) end @@ -223,7 +253,7 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu local extracted = fs.joinpath(tmp, repo_project_name .. '-' .. dir_rev) logger:debug('Moving %s to %s/...', extracted, output_dir) local err = uv_rename(extracted, output_dir) - a.main() + a.schedule() if err then return logger:error('Could not rename temp: %s', err) end @@ -265,7 +295,7 @@ local function do_install(logger, compile_location, target_location) end local err = uv_copyfile(compile_location, target_location) - a.main() + a.schedule() if err then return logger:error('Error during parser installation: %s', err) end @@ -343,7 +373,7 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) local queries_src = M.get_package_path('runtime', 'queries', lang) uv_unlink(queries) local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) - a.main() + a.schedule() if err then return logger:error(err) end @@ -403,20 +433,20 @@ end ---@field max_jobs? integer --- Install a parser +---@async ---@param languages string[] ---@param options? InstallOptions ----@param callback? fun(boolean) -local function install(languages, options, callback) +local function install(languages, options) options = options or {} local cache_dir = fs.normalize(fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') - local tasks = {} ---@type fun()[] + local task_funs = {} ---@type async.TaskFun[] local done = 0 for _, lang in ipairs(languages) do - tasks[#tasks + 1] = a.sync(function() - a.main() + task_funs[#task_funs + 1] = a.async(function() + a.schedule() local status = install_lang(lang, cache_dir, install_dir, options.force, options.generate) if status ~= 'failed' then done = done + 1 @@ -424,29 +454,24 @@ local function install(languages, options, callback) end) end - a.join(options and options.max_jobs or MAX_JOBS, nil, tasks) - if #tasks > 1 then - a.main() - log.info('Installed %d/%d languages', done, #tasks) - end - if callback then - callback(done == #tasks) + join(options and options.max_jobs or MAX_JOBS, task_funs) + if #task_funs > 1 then + a.schedule() + log.info('Installed %d/%d languages', done, #task_funs) end + return done == #task_funs end ---@param languages string[]|string ---@param options? InstallOptions ----@param callback? fun(boolean) -M.install = a.sync(function(languages, options, callback) +M.install = a.async(function(languages, options) reload_parsers() languages = config.norm_languages(languages, { unsupported = true }) - install(languages, options, callback) -end, 3) + return install(languages, options) +end) ---@param languages? string[]|string ----@param _options? table ----@param callback? function -M.update = a.sync(function(languages, _options, callback) +M.update = a.async(function(languages) reload_parsers() if not languages or #languages == 0 then languages = 'all' @@ -455,14 +480,12 @@ M.update = a.sync(function(languages, _options, callback) languages = vim.tbl_filter(needs_update, languages) ---@type string[] if #languages > 0 then - install(languages, { force = true }, callback) + return install(languages, { force = true }) else log.info('All parsers are up-to-date') - if callback then - callback(true) - end + return true end -end, 3) +end) ---@async ---@param logger Logger @@ -477,7 +500,7 @@ local function uninstall_lang(logger, lang, parser, queries) if fn.filereadable(parser) == 1 then logger:debug('Unlinking ' .. parser) local perr = uv_unlink(parser) - a.main() + a.schedule() if perr then return logger:error(perr) @@ -487,7 +510,7 @@ local function uninstall_lang(logger, lang, parser, queries) if fn.isdirectory(queries) == 1 then logger:debug('Unlinking ' .. queries) local qerr = uv_unlink(queries) - a.main() + a.schedule() if qerr then return logger:error(qerr) @@ -498,16 +521,14 @@ local function uninstall_lang(logger, lang, parser, queries) end ---@param languages string[]|string ----@param _options? table ----@param _callback? fun() -M.uninstall = a.sync(function(languages, _options, _callback) +M.uninstall = a.async(function(languages) languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) local parser_dir = config.get_install_dir('parser') local query_dir = config.get_install_dir('queries') local installed = config.installed_parsers() - local tasks = {} ---@type fun()[] + local task_funs = {} ---@type async.TaskFun[] local done = 0 for _, lang in ipairs(languages) do local logger = log.new('uninstall/' .. lang) @@ -516,7 +537,7 @@ M.uninstall = a.sync(function(languages, _options, _callback) else local parser = fs.joinpath(parser_dir, lang) .. '.so' local queries = fs.joinpath(query_dir, lang) - tasks[#tasks + 1] = a.sync(function() + task_funs[#task_funs + 1] = a.async(function() local err = uninstall_lang(logger, lang, parser, queries) if not err then done = done + 1 @@ -525,11 +546,11 @@ M.uninstall = a.sync(function(languages, _options, _callback) end end - a.join(MAX_JOBS, nil, tasks) - if #tasks > 1 then - a.main() - log.info('Uninstalled %d/%d languages', done, #tasks) + join(MAX_JOBS, task_funs) + if #task_funs > 1 then + a.schedule() + log.info('Uninstalled %d/%d languages', done, #task_funs) end -end, 2) +end) return M diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index 6dbc73d68..f06d3ee46 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -21,24 +21,17 @@ vim.opt.runtimepath:append('.') -- needed on CI vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') -local ok = nil -if update then - require('nvim-treesitter.install').update('all', {}, function(success) - ok = success - end) -else - require('nvim-treesitter.install').install( +---@type async.Task +local task = update and require('nvim-treesitter.install').update('all') + or require('nvim-treesitter.install').install( #parsers > 0 and parsers or 'all', - { force = true, generate = generate, max_jobs = max_jobs }, - function(success) - ok = success - end + { force = true, generate = generate, max_jobs = max_jobs } ) -end -vim.wait(6000000, function() - return ok ~= nil -end) +local ok, err_or_ok = task:pwait(1800000) -- wait max. 30 minutes if not ok then + print('ERROR: ', err_or_ok) + vim.cmd.cq() +elseif not err_or_ok then vim.cmd.cq() end From a663e6944784ca39a285348c5b7e3ac8ba14822d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 16 May 2025 18:12:26 +0200 Subject: [PATCH 089/434] feat(parsers): update javadoc, jq, hcl, query, smithy, earthfile, tcl, llvm, godot_resource, git_config, terraform, teal, gdscript, mlir --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 75278cd02..9007a600c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -419,7 +419,7 @@ return { }, earthfile = { install_info = { - revision = '8c93d89e262d9892ad692b3be05cfbcffbb9614f', + revision = 'a37c5ee95ce401ca311c0ae1369d9cfb953e151d', url = 'https://github.com/glehmann/tree-sitter-earthfile', }, maintainers = { '@glehmann' }, @@ -644,7 +644,7 @@ return { }, gdscript = { install_info = { - revision = '25dadb2beaa2bb0f53d5fe97d2588a01e9b0f0b5', + revision = 'e964ce912b5b835f1caedb600df9d5be77e803a8', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -661,7 +661,7 @@ return { }, git_config = { install_info = { - revision = 'edc973f498482529ff2a319249d0f43a22860321', + revision = '0fbc9f99d5a28865f9de8427fb0672d66f9d83a5', url = 'https://github.com/the-mikedavis/tree-sitter-git-config', }, maintainers = { '@amaanq' }, @@ -778,7 +778,7 @@ return { }, godot_resource = { install_info = { - revision = '99417ca9f4eccbf49e4ce5a69d89228811593bf5', + revision = 'a1a7295b376fbd2531601f4ffff191b031ffc795', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, @@ -890,7 +890,7 @@ return { }, hcl = { install_info = { - revision = '41a2e702413a53f2614533b2aa9c187816116cbc', + revision = '009def4ae38ec30e5b40beeae26efe93484ab286', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -1068,7 +1068,7 @@ return { }, javadoc = { install_info = { - revision = 'e49c8f0e26dc79afc999f377121ecceb30ffcc74', + revision = '001a8e4f8e839b640201c49046fbf5957fe1ee2c', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1106,7 +1106,7 @@ return { }, jq = { install_info = { - revision = '13990f530e8e6709b7978503da9bc8701d366791', + revision = 'c204e36d2c3c6fce1f57950b12cabcc24e5cc4d9', url = 'https://github.com/flurie/tree-sitter-jq', }, maintainers = { '@ObserverOfTime' }, @@ -1281,7 +1281,7 @@ return { }, llvm = { install_info = { - revision = 'c14cb839003348692158b845db9edda201374548', + revision = '1ac83114e71839fa67f4cce2f864ebbbdf6e2a4f', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1392,7 +1392,7 @@ return { mlir = { install_info = { generate = true, - revision = 'fdaa92565f5902afe81d958a48049f56721fd928', + revision = '3b2ae4ce9a8abca997ed3b34625d462248d1bbac', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1790,7 +1790,7 @@ return { }, query = { install_info = { - revision = 'eba45dd965e119cb7cd3d5eea584e5d04bbef9a4', + revision = 'b5d39eab2cf3172d81352e5ef9df4639267c5813', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -2044,7 +2044,7 @@ return { }, smithy = { install_info = { - revision = 'fa898ac0885d1da9a253695c3e0e91f5efc587cd', + revision = 'ec4fe14586f2b0a1bc65d6db17f8d8acd8a90433', url = 'https://github.com/indoorvivants/tree-sitter-smithy', }, maintainers = { '@amaanq', '@keynmol' }, @@ -2243,7 +2243,7 @@ return { }, tcl = { install_info = { - revision = '93ad361b77faa39af410052e1ece22b9e6b8136c', + revision = '8f11ac7206a54ed11210491cee1e0657e2962c47', url = 'https://github.com/tree-sitter-grammars/tree-sitter-tcl', }, maintainers = { '@lewis6991' }, @@ -2252,7 +2252,7 @@ return { teal = { install_info = { generate = true, - revision = '3db655924b2ff1c54fdf6371b5425ea6b5dccefe', + revision = '05d276e737055e6f77a21335b7573c9d3c091e2f', url = 'https://github.com/euclidianAce/tree-sitter-teal', }, maintainers = { '@euclidianAce' }, @@ -2277,7 +2277,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = '41a2e702413a53f2614533b2aa9c187816116cbc', + revision = '009def4ae38ec30e5b40beeae26efe93484ab286', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, From 168fe16cdd9fd441e27e5554bcd9dc02d07e68be Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 17 May 2025 21:10:59 -0700 Subject: [PATCH 090/434] fix: tidy up some query mistakes Revealed by the capture-less patterns lint --- runtime/queries/erlang/highlights.scm | 4 ++-- runtime/queries/linkerscript/injections.scm | 2 +- runtime/queries/nim_format_string/highlights.scm | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm index 8bba348d9..4b5b8ee78 100644 --- a/runtime/queries/erlang/highlights.scm +++ b/runtime/queries/erlang/highlights.scm @@ -93,8 +93,8 @@ lhs: _ @constant.macro (#set! priority 101)) -(_preprocessor_directive) @keyword.directive -(#set! priority 99) +((_preprocessor_directive) @keyword.directive + (#set! priority 99)) ; Attributes (pp_include) @keyword.import diff --git a/runtime/queries/linkerscript/injections.scm b/runtime/queries/linkerscript/injections.scm index 51e6d1f6b..2f0e58eb6 100644 --- a/runtime/queries/linkerscript/injections.scm +++ b/runtime/queries/linkerscript/injections.scm @@ -1,2 +1,2 @@ -((comment) +((comment) @injection.content (#set! injection.language "comment")) diff --git a/runtime/queries/nim_format_string/highlights.scm b/runtime/queries/nim_format_string/highlights.scm index fde9e4ba0..02a75e6a3 100644 --- a/runtime/queries/nim_format_string/highlights.scm +++ b/runtime/queries/nim_format_string/highlights.scm @@ -1,5 +1,3 @@ -(string_literal) - (matching_curlies opening_curly: (opening_curly) @punctuation.special equals: (equals)? @punctuation.special From 40cbddedf7e581caf58bab3fcd114641774178ea Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 18 May 2025 10:15:04 +0200 Subject: [PATCH 091/434] feat(parsers): update markdown_inline, markdown, vimdoc, fsharp, pascal, racket, lua, scheme, gleam, ocamllex, query --- lua/nvim-treesitter/parsers.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 9007a600c..4b75837a8 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -601,7 +601,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = '02929f084726db969e5b916d144436f248146824', + revision = 'f29605148f24199cf4d9c4a203a5debc0cbcc648', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -701,7 +701,7 @@ return { }, gleam = { install_info = { - revision = '5efbe4fdf199f30a90393196bfbf842d866753c2', + revision = '6ece453acf8b14568c10f629f8cd25d3dde3794f', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -1289,7 +1289,7 @@ return { }, lua = { install_info = { - revision = 'db16e76558122e834ee214c8dc755b4a3edc82a9', + revision = 'e5e406935ff3e36529545955e2972646ed97f9e2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1340,7 +1340,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '071b3b70baad138aa28832cf02d16ca48f2e6f4d', + revision = 'efb075cbd57ce33f694c2bb264b99cdba0f31789', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1351,7 +1351,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '071b3b70baad138aa28832cf02d16ca48f2e6f4d', + revision = 'efb075cbd57ce33f694c2bb264b99cdba0f31789', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1517,7 +1517,7 @@ return { ocamllex = { install_info = { generate = true, - revision = 'c5cf996c23e38a1537069fbe2d4bb83a75fc7b2f', + revision = 'ed488aa334d1b4e3235e1efaaf96f00815ebc0e0', url = 'https://github.com/atom-ocaml/tree-sitter-ocamllex', }, maintainers = { '@undu' }, @@ -1533,7 +1533,7 @@ return { }, pascal = { install_info = { - revision = '78426d96bde7114af979e314283e45d087603428', + revision = '5054931bcd022860dd5936864f981e359fb63aef', url = 'https://github.com/Isopod/tree-sitter-pascal', }, maintainers = { '@Isopod' }, @@ -1790,7 +1790,7 @@ return { }, query = { install_info = { - revision = 'b5d39eab2cf3172d81352e5ef9df4639267c5813', + revision = '8bf3112db43bdba3002bb1f88b7cda5f6278fc88', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1807,7 +1807,7 @@ return { }, racket = { install_info = { - revision = '78e147ac9be60e8e752fffaafa22293a785ac3dc', + revision = '6d63a202602eb350e726b5e7814127ba22ed25fc', url = 'https://github.com/6cdh/tree-sitter-racket', }, tier = 2, @@ -1985,7 +1985,7 @@ return { }, scheme = { install_info = { - revision = 'd5b7655bea905f902d099abd539e1b66e1f4bf27', + revision = '1e4d38d650bf6b53930ec9d41a7000775c134039', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 2, @@ -2509,7 +2509,7 @@ return { }, vimdoc = { install_info = { - revision = '6dab95ab84a006e8adfd6966c5fd9dde48224725', + revision = '9f6191a98702edc1084245abd5523279d4b681fb', url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, From b19b5ce17195f830fd2474c625e242cfc3aa5f90 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 18 May 2025 10:37:50 +0200 Subject: [PATCH 092/434] docs: final update after rewrite Make clear this is not the default branch --- CONTRIBUTING.md | 6 +++--- README.md | 47 +++++++++++++++++++++++++---------------------- TODO.md | 28 ---------------------------- 3 files changed, 28 insertions(+), 53 deletions(-) delete mode 100644 TODO.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 983499e81..f665ce1ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,15 +22,15 @@ To add a new parser, edit the following files: zimbu = { install_info = { url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- git repo; use `path` for local path - revision = 'v2.1', -- tag or commit hash, will be updated automatically + revision = 'v2.1', -- tag or commit hash -- optional entries: branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" generate = true, -- only needed if repo does not contain pre-generated src/parser.c - generate_from_json = true, -- only needed if grammar.js has npm-installed dependencies + generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either }, maintainers = { '@me' }, -- the _query_ maintainers - tier = 1, -- stable: track versioned releases + tier = 1, -- stable: track versioned releases instead of latest commit -- optional entries: requires = { 'vim' }, -- if the queries inherit from another language readme_note = "an example language", diff --git a/README.md b/README.md index 703a41781..ef3a9f32c 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,17 @@

nvim-treesitter

- - - ->[!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). 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); -2. a collection of **queries** for enabling tree-sitter features built into Neovim for these languages. +2. a collection of **queries** for enabling tree-sitter features built into Neovim for these languages; +3. a staging ground for [treesitter-based features](#Supported-features) considered for upstreaming to Neovim. For details on these and how to help improving them, see [CONTRIBUTING.md](./CONTRIBUTING.md). +>[!CAUTION] +> This is a full, incompatible, rewrite. If you can't or don't want to update, check out the [`master` branch](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md) (which is locked but will remain available for backward compatibility). + # Quickstart ## Requirements @@ -35,6 +22,12 @@ For details on these and how to help improving them, see [CONTRIBUTING.md](./CON - a C compiler in your path (see ) - `Node` (23.0.0 or later) for some parsers (see the [list of supported languages](SUPPORTED_LANGUAGES.md)) +>[!IMPORTANT] +> The **support policy** for Neovim is +> 1. the _latest_ [stable release](https://github.com/neovim/neovim/releases/tag/stable); +> 2. the _latest_ [nightly prerelease](https://github.com/neovim/neovim/releases/tag/nightly). +> Other versions may work but are neither tested nor considered for fixes. In general, compatibility with Nvim 0.X is removed after the release of Nvim 0.(X+1).1. + ## Installation You can install `nvim-treesitter` with your favorite package manager (or using the native `package` feature of vim, see `:h packages`). @@ -43,14 +36,20 @@ This plugin is only guaranteed to work with specific versions of language parser It is strongly recommended to automate this; e.g., using [lazy.nvim](https://github.com/folke/lazy.nvim) ```lua -require('lazy').setup( - { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', lazy = false } -) +require('lazy').setup({ + 'nvim-treesitter/nvim-treesitter', + lazy = false, + branch = 'main', + build = ':TSUpdate' +}) ``` >[!IMPORTANT] > This plugin does not support lazy-loading. +>[!IMPORTANT] +> Make sure to specify the `main` branch since (for now) the default branch is [`master`](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md). + ## Setup `nvim-treesitter` can be configured by calling `setup`. The following snippet lists the available options and their default values. **You do not need to call `setup` for `nvim-treesitter` to work using default values.** @@ -69,6 +68,7 @@ require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } ``` (This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), you need to `wait()` for it to finish: + ```lua require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }):wait(300000) -- wait max. 5 minutes ``` @@ -143,13 +143,14 @@ callback = function() branch = 'develop', -- only needed if different from default branch location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" generate = true, -- only needed if repo does not contain pre-generated `src/parser.c` - generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` + generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either }, } end}) ``` Alternatively, if you have a local checkout, you can instead use + ```lua install_info = { path = '~/parsers/tree-sitter-zimbu', @@ -177,6 +178,7 @@ If Neovim does not detect your language's filetype by default, you can use [Neov ### Modifying parsers You can use the same approach for overriding parser information. E.g., if you always want to generate the `lua` parser from grammar, add + ```lua vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate', callback = function() @@ -189,6 +191,7 @@ end}) Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see [`:h treesitter-query-modelines`](https://neovim.io/doc/user/treesitter.html#treesitter-query-modeline). E.g., to add queries for `zimbu`, put `highlights.scm` etc. under + ```lua vim.fn.stdpath('data') .. 'site/queries/zimbu' ``` diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 937a8b63b..000000000 --- a/TODO.md +++ /dev/null @@ -1,28 +0,0 @@ -# Roadmap - -This document lists the planned and finished changes in this rewrite towards [Nvim-treesitter 1.0](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767). - -## TODO - -- [ ] **tests:** remove custom crate, plenary dependency -- [ ] **indents:** rewrite (Helix or Zed compatible) -- [ ] **textobjects:** include simple(!) `node`, `scope` (using `locals`) objects - -## DONE - -- [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] rewrite installation using async module (drop support for sync; use callback instead) -- [X] switch to upstream injection format -- [X] remove locals from highlighting (cf. https://github.com/nvim-treesitter/nvim-treesitter/issues/3944#issuecomment-1458782497) -- [X] drop ensure_install (replace with install) -- [X] **CI:** switch to ts_query_ls, add update readme as check (remove update job) -- [X] **CI:** track versioned releases for tier 1 -- [X] **`install.lua`:** migrate to async v2 From d08cf75e1bb52ce86a895dc287f9480a6d3d78b2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 21 May 2025 21:47:18 +0200 Subject: [PATCH 093/434] feat(inko): add scoping to the locals queries This way tooling that makes use of these queries (e.g. snacks.nvim) is aware of the scoping of Inko types and methods. --- runtime/queries/inko/locals.scm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/runtime/queries/inko/locals.scm b/runtime/queries/inko/locals.scm index 09450f525..b69681cd1 100644 --- a/runtime/queries/inko/locals.scm +++ b/runtime/queries/inko/locals.scm @@ -3,8 +3,9 @@ (block) ] @local.scope -(method - name: _ @local.definition.method) +((method + name: _ @local.definition.method) @local.scope + (#set! definition.function.scope "parent")) (external_function name: _ @local.definition.function) @@ -24,10 +25,11 @@ (named_argument name: _ @local.definition.parameter) -(class +((class modifier: (modifier "enum") - name: _ @local.definition.enum) + name: _ @local.definition.enum) @local.scope + (#set! definition.type.scope "parent")) (class modifier: (modifier @@ -36,11 +38,13 @@ (define_case name: _ @local.definition.field))) -(class - name: _ @local.definition.type) +((class + name: _ @local.definition.type) @local.scope + (#set! definition.type.scope "parent")) -(trait - name: _ @local.definition.type) +((trait + name: _ @local.definition.type) @local.scope + (#set! definition.type.scope "parent")) (import (symbols From 011f02936f5c69500315a32df1a1b01fdd2feaf3 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 22 May 2025 08:19:22 +0200 Subject: [PATCH 094/434] fix(install): return task object in API functions --- lua/nvim-treesitter/init.lua | 6 +++--- scripts/install-parsers.lua | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/nvim-treesitter/init.lua b/lua/nvim-treesitter/init.lua index 52eab71c8..561c1697a 100644 --- a/lua/nvim-treesitter/init.lua +++ b/lua/nvim-treesitter/init.lua @@ -5,15 +5,15 @@ function M.setup(...) end function M.install(...) - require('nvim-treesitter.install').install(...) + return require('nvim-treesitter.install').install(...) end function M.uninstall(...) - require('nvim-treesitter.install').uninstall(...) + return require('nvim-treesitter.install').uninstall(...) end function M.update(...) - require('nvim-treesitter.install').update(...) + return require('nvim-treesitter.install').update(...) end function M.indentexpr() diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index f06d3ee46..f2fd56082 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -22,8 +22,8 @@ vim.opt.runtimepath:append('.') vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') ---@type async.Task -local task = update and require('nvim-treesitter.install').update('all') - or require('nvim-treesitter.install').install( +local task = update and require('nvim-treesitter').update('all') + or require('nvim-treesitter').install( #parsers > 0 and parsers or 'all', { force = true, generate = generate, max_jobs = max_jobs } ) From c78594ce064b9072ad94f660c81c1a17b26fcd29 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 22 May 2025 19:44:58 +0200 Subject: [PATCH 095/434] ci(test): throttle all install steps --- .github/workflows/test-core.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 0c0ae594c..d91c1bb4c 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -33,7 +33,7 @@ jobs: - if: inputs.type == 'build' name: Compile parsers - run: $NVIM -l ./scripts/install-parsers.lua + run: $NVIM -l ./scripts/install-parsers.lua --max-jobs=10 - if: inputs.type == 'generate' name: Generate and compile parsers From 652831b231270da36cfaa03af24df85d1bb47ae9 Mon Sep 17 00:00:00 2001 From: Omar Valdez Date: Sun, 23 Mar 2025 01:14:22 -0700 Subject: [PATCH 096/434] feat(bash): highlight variable argument for `printf -v` --- runtime/queries/bash/highlights.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtime/queries/bash/highlights.scm b/runtime/queries/bash/highlights.scm index 58d57d9e5..428207b94 100644 --- a/runtime/queries/bash/highlights.scm +++ b/runtime/queries/bash/highlights.scm @@ -247,6 +247,17 @@ "READLINE_ARGUMENT" "READLINE_LINE" "READLINE_MARK" "READLINE_POINT" "REPLY" "SECONDS" "SHELL" "SHELLOPTS" "SHLVL" "SRANDOM" "TIMEFORMAT" "TMOUT" "TMPDIR" "UID")) +((command + name: (command_name + (word) @_printf) + . + argument: (word) @_v + . + argument: (word) @variable) + (#eq? @_printf "printf") + (#eq? @_v "-v") + (#lua-match? @variable "^[a-zA-Z_][a-zA-Z0-9_]*$")) + (case_item value: (word) @variable.parameter) From 354c30d2a2f0996b56886928cb3d36e9c6664a06 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 24 May 2025 18:25:34 +0200 Subject: [PATCH 097/434] feat(parsers): update desktop, dtd, editorconfig, janet_simple, liquid, c, v, perl, mlir, templ, vhdl, xml, xresources, yaml, tlaplus, cmake --- lua/nvim-treesitter/parsers.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4b75837a8..6583bd3b9 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -158,7 +158,7 @@ return { }, c = { install_info = { - revision = '2a265d69a4caf57108a73ad2ed1e6922dd2f998c', + revision = '091093731389448e10822dd140621cfec1ff96b2', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -222,7 +222,7 @@ return { }, cmake = { install_info = { - revision = 'c2fdefaf7ae3b7c5cf11705fe63c516b1c490590', + revision = 'cf9799600b2ba5e6620fdabddec3b2db8306bc46', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -338,7 +338,7 @@ return { }, desktop = { install_info = { - revision = '6d66eea37afa1d6bc1e25ef457113743df42416d', + revision = 'afec3093f6102b83a72aece728c53d17d3fcb2d4', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -411,7 +411,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '0d9a8099c963ed53e183425c1b47fa2622c8eaf7', + revision = '291b02018c525abe70fec41559cfe8f2f1cc84b2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -441,7 +441,7 @@ return { }, editorconfig = { install_info = { - revision = '3f2b371537355f6e53cc3af37f79ba450efb5132', + revision = '65de8da4ff21a8be40adb5dadcd7a0f39d2f0747', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -1052,7 +1052,7 @@ return { }, janet_simple = { install_info = { - revision = 'b08b402207fba0037d5152ce7c521351147f4388', + revision = '7e28cbf1ca061887ea43591a2898001f4245fddf', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1265,7 +1265,7 @@ return { }, liquid = { install_info = { - revision = 'd269f4d52cd08f6cbc6636ee23cc30a9f6c32e42', + revision = 'd6ebde3974742cd1b61b55d1d94aab1dacb41056', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1392,7 +1392,7 @@ return { mlir = { install_info = { generate = true, - revision = '3b2ae4ce9a8abca997ed3b34625d462248d1bbac', + revision = '4d2396f21722d0c8d2ea285f380b21f1a71668b3', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1558,7 +1558,7 @@ return { perl = { install_info = { branch = 'release', - revision = 'ecd90bd8b381bcc7219fed4fe351903630e761c6', + revision = 'a2d8e5a32a63019d25bb7452455f4d646d11cce5', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -2260,7 +2260,7 @@ return { }, templ = { install_info = { - revision = '54367acb2b250879f39f2afee123c917ed0798e0', + revision = '5504cc96fbf5c9a029add2dfcb6e585e8fdaad75', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2310,7 +2310,7 @@ return { }, tlaplus = { install_info = { - revision = '4ba91b07b97741a67f61221d0d50e6d962e4987e', + revision = '2d831940c782850f64dabf5b7b17e9e51f7f0ebb', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2453,7 +2453,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '59a8889d84a293d7c0366d14c8dbb0eec24fe889', + revision = '0f963ca4c0cc888252f5a31f37c974d5e2527d06', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2485,7 +2485,7 @@ return { }, vhdl = { install_info = { - revision = '35ed277d3e98836796bc764010dc3fb800d14ee4', + revision = 'ec2cb14f68053cf49d1d18cd5742af8e81771ebb', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2576,7 +2576,7 @@ return { xml = { install_info = { location = 'xml', - revision = '0d9a8099c963ed53e183425c1b47fa2622c8eaf7', + revision = '291b02018c525abe70fec41559cfe8f2f1cc84b2', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2585,7 +2585,7 @@ return { }, xresources = { install_info = { - revision = 'd0f9dc7cec4dc15fc6f9d556bb4e9dd5050328a6', + revision = 'dcbce0c5dde0fca01dd83a8f497ebe4d053eab1d', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, @@ -2593,7 +2593,7 @@ return { }, yaml = { install_info = { - revision = '1805917414a9a8ba2473717fd69447277a175fae', + revision = '08c5caaeb34e5ccd614706d3b5359a78f1c9e275', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, From 0d60a092525ed669ae37289f9057988b8313ec59 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 25 May 2025 10:47:20 +0200 Subject: [PATCH 098/434] fix(typst): restore missing injections --- runtime/queries/typst/injections.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/typst/injections.scm b/runtime/queries/typst/injections.scm index 2f0e58eb6..344c6a308 100644 --- a/runtime/queries/typst/injections.scm +++ b/runtime/queries/typst/injections.scm @@ -1,2 +1,6 @@ ((comment) @injection.content (#set! injection.language "comment")) + +(raw_blck + (ident) @injection.language + (blob) @injection.content) From c1dfc39285e4a11983dfbe556fb0be7f2a749977 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 25 May 2025 13:02:26 +0200 Subject: [PATCH 099/434] fix(config): prepend install_dir to rtp --- doc/nvim-treesitter.txt | 2 +- lua/nvim-treesitter/config.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index b57687961..77e6f037f 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -100,7 +100,7 @@ setup({opts}) *nvim-treesitter.setup()* • {opts} `(table?)` Optional parameters: • {install_dir} (`string?`, default `stdpath('data')/site/`) directory to install parsers and queries to. Note: will be - appended to |runtimepath|. + prepended to |runtimepath|. install({languages} [, {opts}]) *nvim-treesitter.install()* diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 8dcbdb37e..d78ee50c4 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -16,7 +16,7 @@ function M.setup(user_data) if user_data then if user_data.install_dir then user_data.install_dir = vim.fs.normalize(user_data.install_dir) - vim.opt.runtimepath:append(user_data.install_dir) + vim.opt.runtimepath:prepend(user_data.install_dir) end config = vim.tbl_deep_extend('force', config, user_data) end From 1043871ef43e009aedfc1d9965335e168a4a0a08 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 26 May 2025 14:52:28 +0200 Subject: [PATCH 100/434] fix(swift): mark as unmaintained Prevent from updating parser with breaking changes until queries are adapted. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 94e105085..bb13fc2f7 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -278,7 +278,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [surface](https://github.com/connorlay/tree-sitter-surface) | unstable | `HFIJ ` | | @connorlay [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | unstable | `HFIJL` | | @amaanq [sway](https://github.com/FuelLabs/tree-sitter-sway.git) | unstable | `HFIJL` | | @ribru17 -[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unstable | `HFIJL` | X | @alex-pinkus +[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unmaintained | `HFIJL` | X | @alex-pinkus [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | | @RaafatTurki [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | | @ok-ryoko [t32](https://gitlab.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | | @xasc diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6583bd3b9..bcd5598cf 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2199,7 +2199,7 @@ return { url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, - tier = 2, + tier = 3, }, sxhkdrc = { install_info = { From 61b0a05ec07280540d839aa9edfb81a84048fdf2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 26 May 2025 14:42:03 +0200 Subject: [PATCH 101/434] fix(install): create cache dir if not existing --- lua/nvim-treesitter/install.lua | 4 ++++ scripts/install-parsers.lua | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 6d60b7921..e6933fe58 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -440,6 +440,10 @@ local function install(languages, options) options = options or {} local cache_dir = fs.normalize(fn.stdpath('cache')) + if not vim.uv.fs_stat(cache_dir) then + vim.fn.mkdir(cache_dir, 'p') + end + local install_dir = config.get_install_dir('parser') local task_funs = {} ---@type async.TaskFun[] diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index f2fd56082..e3804cab8 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -18,9 +18,6 @@ end vim.opt.runtimepath:append('.') --- needed on CI -vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') - ---@type async.Task local task = update and require('nvim-treesitter').update('all') or require('nvim-treesitter').install( From dd63d7141faa8bb551c1ed76e6d0d0006aa1db2d Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 27 May 2025 10:17:09 +0200 Subject: [PATCH 102/434] fix(haskell): properly set inline-python injection language --- runtime/queries/haskell/injections.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/queries/haskell/injections.scm b/runtime/queries/haskell/injections.scm index a82addbce..98a396e5e 100644 --- a/runtime/queries/haskell/injections.scm +++ b/runtime/queries/haskell/injections.scm @@ -79,6 +79,7 @@ ; Python ; inline-python (quasiquote - (quoter) @injection.language - (#any-of? @injection.language "pymain" "pye" "py_" "pyf") - (quasiquote_body) @injection.content) + (quoter) @_name + (#any-of? @_name "pymain" "pye" "py_" "pyf") + (quasiquote_body) @injection.content + (#set! injection.language "python")) From 0140c29b31d56be040697176ae809ba0c709da02 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 27 May 2025 15:20:55 +0200 Subject: [PATCH 103/434] fix(health): only require ts>=v0.25 --- lua/nvim-treesitter/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 6904899f6..57131f778 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -7,7 +7,7 @@ local health = vim.health local M = {} local NVIM_TREESITTER_MINIMUM_ABI = 13 -local TREE_SITTER_MIN_VER = { 0, 25, 4 } +local TREE_SITTER_MIN_VER = { 0, 25, 0 } ---@param name string ---@return table? From 024e6c5e46f8ec4237695b9e3020ecb601d817df Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 May 2025 09:41:11 +0200 Subject: [PATCH 104/434] fix(queries): fix rebase errors on main --- runtime/queries/agda/injections.scm | 12 ------------ runtime/queries/scala/injections.scm | 3 +++ runtime/queries/solidity/injections.scm | 12 ++++++++++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/runtime/queries/agda/injections.scm b/runtime/queries/agda/injections.scm index a772e0bd9..2f0e58eb6 100644 --- a/runtime/queries/agda/injections.scm +++ b/runtime/queries/agda/injections.scm @@ -1,14 +1,2 @@ ((comment) @injection.content (#set! injection.language "comment")) - -((comment) @injection.content - (#lua-match? @injection.content "^///[^/]") - (#set! injection.language "doxygen")) - -((comment) @injection.content - (#lua-match? @injection.content "^///$") - (#set! injection.language "doxygen")) - -((comment) @injection.content - (#lua-match? @injection.content "^/[*][*][^*].*[*]/$") - (#set! injection.language "doxygen")) diff --git a/runtime/queries/scala/injections.scm b/runtime/queries/scala/injections.scm index 2f0e58eb6..1c2fe3cc9 100644 --- a/runtime/queries/scala/injections.scm +++ b/runtime/queries/scala/injections.scm @@ -1,2 +1,5 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((block_comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/solidity/injections.scm b/runtime/queries/solidity/injections.scm index 2f0e58eb6..a772e0bd9 100644 --- a/runtime/queries/solidity/injections.scm +++ b/runtime/queries/solidity/injections.scm @@ -1,2 +1,14 @@ ((comment) @injection.content (#set! injection.language "comment")) + +((comment) @injection.content + (#lua-match? @injection.content "^///[^/]") + (#set! injection.language "doxygen")) + +((comment) @injection.content + (#lua-match? @injection.content "^///$") + (#set! injection.language "doxygen")) + +((comment) @injection.content + (#lua-match? @injection.content "^/[*][*][^*].*[*]/$") + (#set! injection.language "doxygen")) From 71d2fd1bd410da85d03ee1da7a35e895ee7a8494 Mon Sep 17 00:00:00 2001 From: Noah Bogart Date: Wed, 28 May 2025 16:44:34 -0400 Subject: [PATCH 105/434] fix(just): do not restrict `@function.call` to explicit list (#7905) --- runtime/queries/just/highlights.scm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/runtime/queries/just/highlights.scm b/runtime/queries/just/highlights.scm index fbbf4eece..743de4314 100644 --- a/runtime/queries/just/highlights.scm +++ b/runtime/queries/just/highlights.scm @@ -135,15 +135,5 @@ argument: (string) @string.special.path)) (#eq? @_dir "working-directory")) -; Ref: https://just.systems/man/en/chapter_31.html -;(function_call (identifier) @error) (function_call - (identifier) @function.call - (#any-of? @function.call - "arch" "num_cpus" "os" "os_family" "env_var" "env_var_or_default" "env" "invocation_directory" - "invocation_directory_native" "justfile" "justfile_directory" "just_executable" "quote" - "replace" "replace_regex" "trim" "trim_end" "trim_end_match" "trim_end_matches" "trim_start" - "trim_start_match" "trim_start_matches" "capitalize" "kebabcase" "lowercamelcase" "lowercase" - "shoutykebabcase" "shoutysnakecase" "snakecase" "titlecase" "uppercamelcase" "uppercase" - "absolute_path" "extension" "file_name" "file_stem" "parent_directory" "without_extension" - "clean" "join" "path_exists" "error" "sha256" "sha256_file" "uuid" "semver_matches")) + (identifier) @function.call) From c59004f1e03e111099978932e86bb2f479b5ea73 Mon Sep 17 00:00:00 2001 From: Christian Buttner Date: Wed, 28 May 2025 23:04:10 +0200 Subject: [PATCH 106/434] feat: add c3 (#7891) --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 + runtime/queries/c3/folds.scm | 35 +++ runtime/queries/c3/highlights.scm | 408 ++++++++++++++++++++++++++++++ runtime/queries/c3/indents.scm | 73 ++++++ runtime/queries/c3/injections.scm | 5 + 6 files changed, 530 insertions(+) create mode 100644 runtime/queries/c3/folds.scm create mode 100644 runtime/queries/c3/highlights.scm create mode 100644 runtime/queries/c3/indents.scm create mode 100644 runtime/queries/c3/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index bb13fc2f7..0e6417529 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -32,6 +32,7 @@ Language | Tier | Queries | Node | Maintainer [bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | unstable | `HFIJL` | | @ambroisie [brightscript](https://github.com/ajdelcimmuto/tree-sitter-brightscript) | unstable | `HFIJ ` | | @ajdelcimmuto [c](https://github.com/tree-sitter/tree-sitter-c) | unstable | `HFIJL` | | @amaanq +[c3](https://github.com/c3lang/tree-sitter-c3) | unstable | `HFIJ ` | | @cbuttner [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | unstable | `HF JL` | | @amaanq [caddy](https://github.com/opa-oz/tree-sitter-caddy) | unmaintained | `HFIJ ` | | @opa-oz [cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | unstable | `HFIJL` | | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index bcd5598cf..5b30d8003 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -164,6 +164,14 @@ return { maintainers = { '@amaanq' }, tier = 2, }, + c3 = { + install_info = { + revision = 'dce56ccc5d2731ac14a0f6bb3fd1666d994b2a25', + url = 'https://github.com/c3lang/tree-sitter-c3', + }, + maintainers = { '@cbuttner' }, + tier = 2, + }, c_sharp = { install_info = { revision = 'b5eb5742f6a7e9438bee22ce8026d6b927be2cd7', diff --git a/runtime/queries/c3/folds.scm b/runtime/queries/c3/folds.scm new file mode 100644 index 000000000..0776e7678 --- /dev/null +++ b/runtime/queries/c3/folds.scm @@ -0,0 +1,35 @@ +[ + ; Top-level declarations + (bitstruct_declaration) + (enum_declaration) + (faultdef_declaration) + (func_definition) + (import_declaration)+ + (interface_declaration) + (macro_declaration) + (struct_declaration) + ; Statements + (asm_block_stmt) + (case_stmt) + (defer_stmt) + (do_stmt) + (for_stmt) + (foreach_stmt) + (if_stmt) + (switch_stmt) + (while_stmt) + (ct_for_stmt) + (ct_foreach_stmt) + (ct_switch_stmt) + (ct_case_stmt) + (ct_if_stmt) + (ct_else_stmt) + ; Comments + (block_comment) + (doc_comment) + ; Initializer list + (initializer_list) +] @fold + +(compound_stmt + (compound_stmt) @fold) diff --git a/runtime/queries/c3/highlights.scm b/runtime/queries/c3/highlights.scm new file mode 100644 index 000000000..1f02496b8 --- /dev/null +++ b/runtime/queries/c3/highlights.scm @@ -0,0 +1,408 @@ +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" + "[<" + ">]" +] @punctuation.bracket + +[ + ";" + "," + ":" + "::" +] @punctuation.delimiter + +; Constant +(const_ident) @constant + +[ + "true" + "false" +] @boolean + +"null" @constant.builtin + +; Variable +[ + (ident) + (ct_ident) + (hash_ident) +] @variable + +; 1) Member +(field_expr + field: (access_ident + (ident) @variable.member)) + +(struct_member_declaration + (ident) @variable.member) + +(struct_member_declaration + (identifier_list + (ident) @variable.member)) + +(bitstruct_member_declaration + (ident) @variable.member) + +(initializer_list + (initializer_element + (param_path + (param_path_element + (access_ident + (ident) @variable.member))))) + +; 2) Parameter +(param + name: (_) @variable.parameter) + +(trailing_block_param + (at_ident) @variable.parameter) + +(call_arg_list + (call_arg + name: (_) @variable.parameter)) + +(enum_param + (ident) @variable.parameter) + +; Keyword (from `c3c --list-keywords`) +[ + "alias" + "asm" + "attrdef" + "catch" + "defer" + "try" + "var" +] @keyword + +[ + "$alignof" + "$assert" + "$assignable" + "$case" + "$default" + "$defined" + "$echo" + "$else" + "$embed" + "$endfor" + "$endforeach" + "$endif" + "$endswitch" + "$eval" + "$evaltype" + "$error" + "$exec" + "$extnameof" + "$feature" + "$for" + "$foreach" + "$if" + "$include" + "$is_const" + "$nameof" + "$offsetof" + "$qnameof" + "$sizeof" + "$stringify" + "$switch" + "$typefrom" + "$typeof" + "$vacount" + "$vatype" + "$vaconst" + "$vaarg" + "$vaexpr" + "$vasplat" +] @keyword.directive + +"assert" @keyword.debug + +"fn" @keyword.function + +"macro" @keyword.function + +"return" @keyword.return + +[ + "import" + "module" +] @keyword.import + +[ + "bitstruct" + "enum" + "faultdef" + "interface" + "struct" + "typedef" + "union" +] @keyword.type + +[ + "case" + "default" + "else" + "if" + "nextcase" + "switch" +] @keyword.conditional + +[ + "break" + "continue" + "do" + "for" + "foreach" + "foreach_r" + "while" +] @keyword.repeat + +[ + "const" + "extern" + "inline" + "static" + "tlocal" +] @keyword.modifier + +; Operator (from `c3c --list-operators`) +[ + "&" + "!" + "~" + "|" + "^" + "=" + ">" + "/" + "." + "<" + "-" + "%" + "+" + "?" + "*" + "&&" + "!!" + "&=" + "|=" + "^=" + "/=" + ".." + "?:" + "==" + ">=" + "=>" + "<=" + "-=" + "--" + "%=" + "*=" + "!=" + "||" + "+=" + "++" + "??" + "<<" + ">>" + "..." + "<<=" + ">>=" + "&&&" + "+++" + "|||" +] @operator + +(range_expr + ":" @operator) + +(foreach_cond + ":" @operator) + +(ct_foreach_cond + ":" @operator) + +(ternary_expr + [ + "?" + ":" + ] @keyword.conditional.ternary) + +(elvis_orelse_expr + [ + "?:" + "??" + ] @keyword.conditional.ternary) + +; Literal +(integer_literal) @number + +(real_literal) @number.float + +(char_literal) @character + +(bytes_literal) @number + +; String +(string_literal) @string + +(raw_string_literal) @string + +; Escape Sequence +(escape_sequence) @string.escape + +; Builtin (constants) +(builtin_const) @constant.builtin + +; Type Property (from `c3c --list-type-properties`) +(type_access_expr + (access_ident + (ident) @variable.builtin + (#any-of? @variable.builtin + "alignof" "associated" "elements" "extnameof" "from_ordinal" "get" "inf" "is_eq" "is_ordered" + "is_substruct" "len" "lookup" "lookup_field" "max" "membersof" "methodsof" "min" "nan" "inner" + "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "tagof" + "has_tagof" "values" "typeid"))) + +; Label +[ + (label) + (label_target) +] @label + +; Module +(module_resolution + (ident) @module) + +(module_declaration + (path_ident + (ident) @module)) + +(import_declaration + (path_ident + (ident) @module)) + +; Attribute +(attribute + name: (at_ident) @attribute) + +(at_type_ident) @attribute + +(call_inline_attributes + (at_ident) @attribute) + +(asm_block_stmt + (at_ident) @attribute) + +; Type +[ + (type_ident) + (ct_type_ident) +] @type + +(base_type_name) @type.builtin + +; Function Definition +(func_header + name: (_) @function) + +(func_header + method_type: (_) + name: (_) @function.method) + +(macro_header + name: (_) @function) + +(macro_header + method_type: (_) + name: (_) @function.method) + +; Function Call +(call_expr + function: (ident_expr + [ + (ident) + (at_ident) + ] @function.call)) + +(call_expr + function: (trailing_generic_expr + argument: (ident_expr + [ + (ident) + (at_ident) + ] @function.call))) + +; Method call +(call_expr + function: (field_expr + field: (access_ident + [ + (ident) + (at_ident) + ] @function.method.call))) + +; Method on type +(call_expr + function: (type_access_expr + field: (access_ident + [ + (ident) + (at_ident) + ] @function.method.call))) + +; Builtin call +(call_expr + function: (builtin) @function.builtin) + +; Asm +(asm_instr + [ + (ident) + "int" + ] @function.builtin) + +(asm_expr + [ + (ct_ident) + (ct_const_ident) + ] @variable.builtin) + +; Comment +[ + (line_comment) + (block_comment) +] @comment @spell + +(doc_comment) @comment.documentation + +(doc_comment_text) @spell + +(doc_comment_contract + name: (_) @attribute) + +(doc_comment_contract + parameter: [ + (ident) + (ct_ident) + (hash_ident) + ] @variable.parameter + (#set! priority 110)) + +(doc_comment_contract + [ + ":" + "?" + ] @comment.documentation + (#set! priority 110)) + +(doc_comment_contract + description: (_) @comment.documentation + (#set! priority 110)) diff --git a/runtime/queries/c3/indents.scm b/runtime/queries/c3/indents.scm new file mode 100644 index 000000000..61758ce32 --- /dev/null +++ b/runtime/queries/c3/indents.scm @@ -0,0 +1,73 @@ +[ + (compound_stmt) + (initializer_list) + (implies_body) + (struct_body) + (bitstruct_body) + (enum_body) + (interface_body) + (switch_body) + (ct_if_stmt) + (ct_for_stmt) + (ct_foreach_stmt) + (ct_switch_stmt) +] @indent.begin + +([ + (case_stmt) + (default_stmt) + (ct_case_stmt) +] @indent.begin + (#set! indent.immediate 1)) + +(expr_stmt + ";" @indent.end) @indent.begin + +(declaration + ";" @indent.end) @indent.begin + +(const_declaration + ";" @indent.end) @indent.begin + +(return_stmt + ";" @indent.end) @indent.begin + +(faultdef_declaration + ";" @indent.end) @indent.begin + +(macro_func_body + ";" @indent.end) + +[ + ")" + "}" + "$endfor" + "$endforeach" + "$endswitch" + "$endif" +] @indent.branch @indent.end + +"$else" @indent.branch + +([ + (func_param_list) + (macro_param_list) + (enum_param_list) + (attribute_param_list) + (call_arg_list) + (paren_cond) + (for_cond) + (foreach_cond) + (paren_expr) +] @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) + +[ + (block_comment) + (doc_comment) + (raw_string_literal) + (bytes_literal) +] @indent.auto + +(string_literal) @indent.ignore diff --git a/runtime/queries/c3/injections.scm b/runtime/queries/c3/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/runtime/queries/c3/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) From f9ab837ca15b08628a43027623011ab96cba5bb7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 May 2025 09:25:08 +0200 Subject: [PATCH 107/434] fix(install): don't skip un-tiered parsers --- lua/nvim-treesitter/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index d78ee50c4..d073e3516 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -144,7 +144,7 @@ function M.norm_languages(languages, skip) languages = vim.tbl_filter( --- @param v string function(v) - return parsers[v].tier < 4 + return not (parsers[v].tier and parsers[v].tier == 4) end, languages ) From 03c90480907fd4ec7ce3f76bbf3264100223b5df Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 May 2025 09:23:55 +0200 Subject: [PATCH 108/434] fix(install): only install queries for bundled parsers --- lua/nvim-treesitter/install.lua | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index e6933fe58..b669127ad 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -369,14 +369,20 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) end end - local queries = fs.joinpath(config.get_install_dir('queries'), lang) - local queries_src = M.get_package_path('runtime', 'queries', lang) - uv_unlink(queries) - local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) - a.schedule() - if err then - return logger:error(err) + do -- install queries + local queries_src = M.get_package_path('runtime', 'queries', lang) + if uv.fs_stat(queries_src) then + local queries = fs.joinpath(config.get_install_dir('queries'), lang) + + uv_unlink(queries) + local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) + a.schedule() + if err then + return logger:error(err) + end + end end + logger:info('Language installed') end @@ -440,8 +446,8 @@ local function install(languages, options) options = options or {} local cache_dir = fs.normalize(fn.stdpath('cache')) - if not vim.uv.fs_stat(cache_dir) then - vim.fn.mkdir(cache_dir, 'p') + if not uv.fs_stat(cache_dir) then + fn.mkdir(cache_dir, 'p') end local install_dir = config.get_install_dir('parser') @@ -526,6 +532,7 @@ end ---@param languages string[]|string M.uninstall = a.async(function(languages) + reload_parsers() languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) local parser_dir = config.get_install_dir('parser') @@ -537,7 +544,7 @@ M.uninstall = a.async(function(languages) for _, lang in ipairs(languages) do local logger = log.new('uninstall/' .. lang) if not vim.list_contains(installed, lang) then - log.warn('Parser for ' .. lang .. ' is is not managed by nvim-treesitter') + log.warn('Parser for ' .. lang .. ' is not managed by nvim-treesitter') else local parser = fs.joinpath(parser_dir, lang) .. '.so' local queries = fs.joinpath(query_dir, lang) From 0860b9b1070c4e1bcce66416844b633acd8e0d2a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 28 May 2025 13:55:33 +0200 Subject: [PATCH 109/434] fix(config): check both installed parsers and queries Problem: Can't uninstall custom parsers without queries since `installed_parsers` only iterates over installed queries (to include query-only languages, and to avoid string manipulation). Solution: Iterate over both queries and parsers to collect list of installed languages (optionally only queries or only parsers). --- lua/nvim-treesitter/config.lua | 28 +++++++++++++++++----------- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/install.lua | 6 +++--- plugin/nvim-treesitter.lua | 2 +- scripts/check-parsers.lua | 2 +- scripts/check-queries.lua | 2 +- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index d073e3516..e46e2d5d1 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -39,22 +39,28 @@ function M.get_install_dir(dir_name) return dir end +---@param type 'queries'|'parsers'? ---@return string[] -function M.installed_parsers() - local install_dir = M.get_install_dir('queries') - - local installed = {} --- @type string[] - for f in vim.fs.dir(install_dir) do - installed[#installed + 1] = f +function M.installed_languages(type) + local installed = {} --- @type table + if not (type and type == 'parsers') then + for f in vim.fs.dir(M.get_install_dir('queries')) do + installed[f] = true + end end - - return installed + if not (type and type == 'queries') then + for f in vim.fs.dir(M.get_install_dir('parser')) do + installed[vim.fn.fnamemodify(f, ':r')] = true + end + end + return vim.tbl_keys(installed) end -- Get a list of all available parsers ---@param tier integer? only get parsers of specified tier ---@return string[] function M.get_available(tier) + vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' }) local parsers = require('nvim-treesitter.parsers') --- @type string[] local languages = vim.tbl_keys(parsers) @@ -101,7 +107,7 @@ function M.norm_languages(languages, skip) if vim.list_contains(languages, 'all') then if skip and skip.missing then - return M.installed_parsers() + return M.installed_languages() end languages = M.get_available() end @@ -109,7 +115,7 @@ function M.norm_languages(languages, skip) languages = expand_tiers(languages) if skip and skip.installed then - local installed = M.installed_parsers() + local installed = M.installed_languages() languages = vim.tbl_filter( --- @param v string function(v) @@ -120,7 +126,7 @@ function M.norm_languages(languages, skip) end if skip and skip.missing then - local installed = M.installed_parsers() + local installed = M.installed_languages() languages = vim.tbl_filter( --- @param v string function(v) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 57131f778..4095bce00 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -136,7 +136,7 @@ function M.check() -- Parser installation checks health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J') - local languages = config.installed_parsers() + local languages = config.installed_languages() for _, lang in pairs(languages) do local parser = parsers[lang] local out = lang .. string.rep(' ', 22 - #lang) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index b669127ad..6391beba9 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -402,7 +402,7 @@ local install_status = {} ---@type table ---@param generate? boolean ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate) - if not force and vim.list_contains(config.installed_parsers(), lang) then + if not force and vim.list_contains(config.installed_languages(), lang) then install_status[lang] = 'installed' return 'installed' end @@ -532,12 +532,12 @@ end ---@param languages string[]|string M.uninstall = a.async(function(languages) - reload_parsers() + vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' }) languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) local parser_dir = config.get_install_dir('parser') local query_dir = config.get_install_dir('queries') - local installed = config.installed_parsers() + local installed = config.installed_languages() local task_funs = {} ---@type async.TaskFun[] local done = 0 diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index b007ca29b..d4ccf3049 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -21,7 +21,7 @@ local function complete_installed_parsers(arglead) function(v) return v:find(arglead) ~= nil end, - require('nvim-treesitter.config').installed_parsers() + require('nvim-treesitter.config').installed_languages() ) end diff --git a/scripts/check-parsers.lua b/scripts/check-parsers.lua index 08e48740d..152c8f7ea 100755 --- a/scripts/check-parsers.lua +++ b/scripts/check-parsers.lua @@ -3,7 +3,7 @@ vim.opt.runtimepath:append('.') local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_parsers() + or require('nvim-treesitter.config').installed_languages('parsers') local data = {} ---@type table[] local errors = {} ---@type string[] diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 0a684f5eb..27869b6b5 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -4,7 +4,7 @@ vim.opt.runtimepath:append('.') local query_types = require('nvim-treesitter.health').bundled_queries local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_parsers() + or require('nvim-treesitter.config').installed_languages('queries') -- Check queries for each installed parser in parsers local errors = {} ---@type string[] From ce903fde5d36d7955d34faaf0b812a186417e746 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 29 May 2025 12:04:37 +0200 Subject: [PATCH 110/434] feat(api): expose list of available and installed languages --- doc/nvim-treesitter.txt | 21 ++++++++++++++++++--- lua/nvim-treesitter/config.lua | 8 ++++---- lua/nvim-treesitter/health.lua | 2 +- lua/nvim-treesitter/init.lua | 8 ++++++++ lua/nvim-treesitter/install.lua | 4 ++-- plugin/nvim-treesitter.lua | 2 +- scripts/check-parsers.lua | 2 +- scripts/check-queries.lua | 2 +- 8 files changed, 36 insertions(+), 13 deletions(-) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 77e6f037f..9ba6909b7 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -102,7 +102,7 @@ setup({opts}) *nvim-treesitter.setup()* directory to install parsers and queries to. Note: will be prepended to |runtimepath|. -install({languages} [, {opts}]) *nvim-treesitter.install()* +install({languages} [, {opts}]) *nvim-treesitter.install()* Download, compile, and install the specified treesitter parsers and copy the corresponding queries to a directory on |runtimepath|, enabling their @@ -126,7 +126,7 @@ install({languages} [, {opts}]) *nvim-treesitter.install()* • {max_jobs} (`integer?`) limit parallel tasks (useful in combination with {generate} on memory-limited systems). -uninstall({languages}) *nvim-treesitter.uninstall()* +uninstall({languages}) *nvim-treesitter.uninstall()* Remove the parser and queries for the specified language(s). @@ -134,7 +134,7 @@ uninstall({languages}) *nvim-treesitter.uninstall() • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, `unstable`) to update. -update([{languages}]) *nvim-treesitter.update()* +update([{languages}]) *nvim-treesitter.update()* Update the parsers and queries if older than the revision specified in the manifest. @@ -153,5 +153,20 @@ indentexpr() *nvim-treesitter.indentexpr()* Used to enable treesitter indentation for a language via >lua vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" < +get_available([{tier}]) *nvim-treesitter.get_available()* + + Return list of languages available for installation. + + Parameters: ~ + • {tier} `(integer?)` Only return languages of specified {tier} (`1`: + stable, `2`: unstable, `3`: unmaintained, `4`: unsupported) + +get_installed([{type}]) *nvim-treesitter.get_installed()* + + Return list of languages installed via `nvim-treesitter`. + + Parameters: ~ + • {type} `('queries'|parsers'?)` If specified, only show languages with + installed queries or parsers, respectively. vim:tw=78:ts=8:expandtab:noet:ft=help:norl: diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index e46e2d5d1..1a5b56cdb 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -41,7 +41,7 @@ end ---@param type 'queries'|'parsers'? ---@return string[] -function M.installed_languages(type) +function M.get_installed(type) local installed = {} --- @type table if not (type and type == 'parsers') then for f in vim.fs.dir(M.get_install_dir('queries')) do @@ -107,7 +107,7 @@ function M.norm_languages(languages, skip) if vim.list_contains(languages, 'all') then if skip and skip.missing then - return M.installed_languages() + return M.get_installed() end languages = M.get_available() end @@ -115,7 +115,7 @@ function M.norm_languages(languages, skip) languages = expand_tiers(languages) if skip and skip.installed then - local installed = M.installed_languages() + local installed = M.get_installed() languages = vim.tbl_filter( --- @param v string function(v) @@ -126,7 +126,7 @@ function M.norm_languages(languages, skip) end if skip and skip.missing then - local installed = M.installed_languages() + local installed = M.get_installed() languages = vim.tbl_filter( --- @param v string function(v) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 4095bce00..3f5058996 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -136,7 +136,7 @@ function M.check() -- Parser installation checks health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J') - local languages = config.installed_languages() + local languages = config.get_installed() for _, lang in pairs(languages) do local parser = parsers[lang] local out = lang .. string.rep(' ', 22 - #lang) diff --git a/lua/nvim-treesitter/init.lua b/lua/nvim-treesitter/init.lua index 561c1697a..c5a9201f3 100644 --- a/lua/nvim-treesitter/init.lua +++ b/lua/nvim-treesitter/init.lua @@ -4,6 +4,14 @@ function M.setup(...) require('nvim-treesitter.config').setup(...) end +function M.get_available(...) + return require('nvim-treesitter.config').get_available(...) +end + +function M.get_installed(...) + return require('nvim-treesitter.config').get_installed(...) +end + function M.install(...) return require('nvim-treesitter.install').install(...) end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 6391beba9..eb55d0191 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -402,7 +402,7 @@ local install_status = {} ---@type table ---@param generate? boolean ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate) - if not force and vim.list_contains(config.installed_languages(), lang) then + if not force and vim.list_contains(config.get_installed(), lang) then install_status[lang] = 'installed' return 'installed' end @@ -537,7 +537,7 @@ M.uninstall = a.async(function(languages) local parser_dir = config.get_install_dir('parser') local query_dir = config.get_install_dir('queries') - local installed = config.installed_languages() + local installed = config.get_installed() local task_funs = {} ---@type async.TaskFun[] local done = 0 diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index d4ccf3049..8bf2dbfde 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -21,7 +21,7 @@ local function complete_installed_parsers(arglead) function(v) return v:find(arglead) ~= nil end, - require('nvim-treesitter.config').installed_languages() + require('nvim-treesitter.config').get_installed() ) end diff --git a/scripts/check-parsers.lua b/scripts/check-parsers.lua index 152c8f7ea..c2eefd7c9 100755 --- a/scripts/check-parsers.lua +++ b/scripts/check-parsers.lua @@ -3,7 +3,7 @@ vim.opt.runtimepath:append('.') local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_languages('parsers') + or require('nvim-treesitter.config').get_installed('parsers') local data = {} ---@type table[] local errors = {} ---@type string[] diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 27869b6b5..796e3f5fc 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -4,7 +4,7 @@ vim.opt.runtimepath:append('.') local query_types = require('nvim-treesitter.health').bundled_queries local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_languages('queries') + or require('nvim-treesitter.config').get_installed('queries') -- Check queries for each installed parser in parsers local errors = {} ---@type string[] From ff770d718b34db10e33d18594153b4d1e0954882 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 29 May 2025 12:25:13 +0200 Subject: [PATCH 111/434] fix(install): don't print operation summary by default Problem: People complain about noisy `install()`. Solution: Gate operation summary behind `summary` install option (default false, set to true for interactive `:TS*` commands). --- doc/nvim-treesitter.txt | 20 ++++++++++++++++++-- lua/nvim-treesitter/install.lua | 25 +++++++++++++++++++------ plugin/nvim-treesitter.lua | 7 ++++--- scripts/install-parsers.lua | 4 ++-- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index 9ba6909b7..f77cb061b 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -125,16 +125,21 @@ install({languages} [, {opts}]) *nvim-treesitter.install()* compiling. • {max_jobs} (`integer?`) limit parallel tasks (useful in combination with {generate} on memory-limited systems). + • {summary} (`boolean?`, default `false`) print summary of + successful and total operations for multiple languages. -uninstall({languages}) *nvim-treesitter.uninstall()* +uninstall({languages} [, {opts}]) *nvim-treesitter.uninstall()* Remove the parser and queries for the specified language(s). Parameters: ~ • {languages} `(string[]|string)` (List of) languages or tiers (`stable`, `unstable`) to update. + • {opts} `(table?)` Optional parameters: + • {summary} (`boolean?`, default `false`) print summary of + successful and total operations for multiple languages. -update([{languages}]) *nvim-treesitter.update()* +update([{languages}, {opts}]) *nvim-treesitter.update()* Update the parsers and queries if older than the revision specified in the manifest. @@ -147,6 +152,11 @@ update([{languages}]) *nvim-treesitter.update()* Parameters: ~ • {languages} `(string[]|string)?` (List of) languages or tiers to update (default: all installed). + • {opts} `(table?)` Optional parameters: + • {max_jobs} (`integer?`) limit parallel tasks (useful in + combination with {generate} on memory-limited systems). + • {summary} (`boolean?`, default `false`) print summary of + successful and total operations for multiple languages. indentexpr() *nvim-treesitter.indentexpr()* @@ -165,6 +175,12 @@ get_installed([{type}]) *nvim-treesitter.get_installed()* Return list of languages installed via `nvim-treesitter`. + Note: This only searches `nvim-treesitter`'s (configured or default) + installation directory; parsers and queries from other sources can be + placed anywhere on 'runtimepath' and are not included. To list all, e.g., + parsers that are installed from any source, use >lua + vim.api.nvim_get_runtime_file('parser/*', true) +< Parameters: ~ • {type} `('queries'|parsers'?)` If specified, only show languages with installed queries or parsers, respectively. diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index eb55d0191..a5a2eb2a5 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -437,6 +437,7 @@ end ---@field force? boolean ---@field generate? boolean ---@field max_jobs? integer +---@field summary? boolean --- Install a parser ---@async @@ -467,7 +468,9 @@ local function install(languages, options) join(options and options.max_jobs or MAX_JOBS, task_funs) if #task_funs > 1 then a.schedule() - log.info('Installed %d/%d languages', done, #task_funs) + if options and options.summary then + log.info('Installed %d/%d languages', done, #task_funs) + end end return done == #task_funs end @@ -481,7 +484,8 @@ M.install = a.async(function(languages, options) end) ---@param languages? string[]|string -M.update = a.async(function(languages) +---@param options? InstallOptions +M.update = a.async(function(languages, options) reload_parsers() if not languages or #languages == 0 then languages = 'all' @@ -489,10 +493,16 @@ M.update = a.async(function(languages) languages = config.norm_languages(languages, { missing = true, unsupported = true }) languages = vim.tbl_filter(needs_update, languages) ---@type string[] + local summary = options and options.summary if #languages > 0 then - return install(languages, { force = true }) + return install( + languages, + { force = true, summary = summary, max_jobs = options and options.max_jobs } + ) else - log.info('All parsers are up-to-date') + if summary then + log.info('All parsers are up-to-date') + end return true end end) @@ -531,7 +541,8 @@ local function uninstall_lang(logger, lang, parser, queries) end ---@param languages string[]|string -M.uninstall = a.async(function(languages) +---@param options? InstallOptions +M.uninstall = a.async(function(languages, options) vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' }) languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true }) @@ -560,7 +571,9 @@ M.uninstall = a.async(function(languages) join(MAX_JOBS, task_funs) if #task_funs > 1 then a.schedule() - log.info('Uninstalled %d/%d languages', done, #task_funs) + if options and options.summary then + log.info('Uninstalled %d/%d languages', done, #task_funs) + end end end) diff --git a/plugin/nvim-treesitter.lua b/plugin/nvim-treesitter.lua index 8bf2dbfde..adeb41425 100644 --- a/plugin/nvim-treesitter.lua +++ b/plugin/nvim-treesitter.lua @@ -27,7 +27,7 @@ end -- create user commands api.nvim_create_user_command('TSInstall', function(args) - require('nvim-treesitter.install').install(args.fargs, { force = args.bang }) + require('nvim-treesitter.install').install(args.fargs, { force = args.bang, summary = true }) end, { nargs = '+', bang = true, @@ -39,6 +39,7 @@ end, { api.nvim_create_user_command('TSInstallFromGrammar', function(args) require('nvim-treesitter.install').install(args.fargs, { generate = true, + summary = true, force = args.bang, }) end, { @@ -50,7 +51,7 @@ end, { }) api.nvim_create_user_command('TSUpdate', function(args) - require('nvim-treesitter.install').update(args.fargs) + require('nvim-treesitter.install').update(args.fargs, { summary = true }) end, { nargs = '*', bar = true, @@ -59,7 +60,7 @@ end, { }) api.nvim_create_user_command('TSUninstall', function(args) - require('nvim-treesitter.install').uninstall(args.fargs) + require('nvim-treesitter.install').uninstall(args.fargs, { summary = true }) end, { nargs = '+', bar = true, diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index e3804cab8..2d083f3c3 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua @@ -19,10 +19,10 @@ end vim.opt.runtimepath:append('.') ---@type async.Task -local task = update and require('nvim-treesitter').update('all') +local task = update and require('nvim-treesitter').update('all', { summary = true }) or require('nvim-treesitter').install( #parsers > 0 and parsers or 'all', - { force = true, generate = generate, max_jobs = max_jobs } + { force = true, summary = true, generate = generate, max_jobs = max_jobs } ) local ok, err_or_ok = task:pwait(1800000) -- wait max. 30 minutes From fa0bb30ebdd032f485f44b5caaae1db2b773c0c8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 30 May 2025 10:21:19 +0200 Subject: [PATCH 112/434] feat(parsers): update gdscript, gitattributes, godot_resource, xresources, yaml, ocaml, koto, ocaml_interface, c, ini, mlir, scheme, slint, c3, r, clojure, desktop, editorconfig, fortran --- lua/nvim-treesitter/parsers.lua | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 5b30d8003..b1c39501f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -158,7 +158,7 @@ return { }, c = { install_info = { - revision = '091093731389448e10822dd140621cfec1ff96b2', + revision = '7fa1be1b694b6e763686793d97da01f36a0e5c12', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -166,7 +166,7 @@ return { }, c3 = { install_info = { - revision = 'dce56ccc5d2731ac14a0f6bb3fd1666d994b2a25', + revision = '6eb8acc275961d137b4b4dd7fe84a19a0680c893', url = 'https://github.com/c3lang/tree-sitter-c3', }, maintainers = { '@cbuttner' }, @@ -222,7 +222,7 @@ return { }, clojure = { install_info = { - revision = 'f4236d4da8aa92bc105d9c118746474c608e6af7', + revision = '40c5fc2e2a0f511a802a82002553c5de00feeaf4', url = 'https://github.com/sogaiu/tree-sitter-clojure', }, maintainers = { '@NoahTheDuke' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'afec3093f6102b83a72aece728c53d17d3fcb2d4', + revision = '752bab671c3a4ad0e566fa2c680af895f7fd1b77', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '65de8da4ff21a8be40adb5dadcd7a0f39d2f0747', + revision = '301edd3fff4486acca5ca9991ba76ba372059451', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -592,7 +592,7 @@ return { }, fortran = { install_info = { - revision = 'd738334e4a21866a1ab81fb3f27f9b0b2ad2e515', + revision = 'c687ba7b469cc22e22db6c90396ff2c98ba00d3b', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = 'e964ce912b5b835f1caedb600df9d5be77e803a8', + revision = '2ed3ef9e30a7998a98eea4dfbcd308678f93b88f', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -685,7 +685,7 @@ return { }, gitattributes = { install_info = { - revision = '5425944fd61bf2b3bad2c17c2dc9f53172b0f01d', + revision = 'f23072a51e1c764d6c5bf461194a775c8a5c7a95', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', }, maintainers = { '@ObserverOfTime' }, @@ -786,7 +786,7 @@ return { }, godot_resource = { install_info = { - revision = 'a1a7295b376fbd2531601f4ffff191b031ffc795', + revision = '9bbb540e8a2734101c6857bd437f04baa974e03d', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, @@ -1027,7 +1027,7 @@ return { }, ini = { install_info = { - revision = '32b31863f222bf22eb43b07d4e9be8017e36fb31', + revision = '0e152b17fc0e929dd71f4bc4e317b3421ed39029', url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, @@ -1216,7 +1216,7 @@ return { }, koto = { install_info = { - revision = '1e610746f48c24607733fac158d5bae79accd845', + revision = '620ff8a32143f24f6f8e157bd1836183599d334d', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1400,7 +1400,7 @@ return { mlir = { install_info = { generate = true, - revision = '4d2396f21722d0c8d2ea285f380b21f1a71668b3', + revision = '56753db408dbcc098e514c73cbb2351d344039e0', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1506,7 +1506,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = 'ef6ed4a773a260545f0b03c43d2ca78235e9a488', + revision = '029b1b6a87a8f1e8a9a7913a8a5bdecd36720789', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1515,7 +1515,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = 'ef6ed4a773a260545f0b03c43d2ca78235e9a488', + revision = '029b1b6a87a8f1e8a9a7913a8a5bdecd36720789', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1807,7 +1807,7 @@ return { }, r = { install_info = { - revision = 'a0d3e3307489c3ca54da8c7b5b4e0c5f5fd6953a', + revision = '7a7d4e04a325b336d53dbfef508918edba5ba240', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1993,7 +1993,7 @@ return { }, scheme = { install_info = { - revision = '1e4d38d650bf6b53930ec9d41a7000775c134039', + revision = 'e35b41a183164f4a12e10da3d0c430e837c3d75a', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 2, @@ -2036,7 +2036,7 @@ return { }, slint = { install_info = { - revision = '3493309534cd08ae176c7b917ec79068dca2c1c9', + revision = '32f970b57720010e77a486bc2001ee9e6c7c8250', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2593,7 +2593,7 @@ return { }, xresources = { install_info = { - revision = 'dcbce0c5dde0fca01dd83a8f497ebe4d053eab1d', + revision = 'd09b560bb78a3304211db5110f9bd6b053becba4', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, @@ -2601,7 +2601,7 @@ return { }, yaml = { install_info = { - revision = '08c5caaeb34e5ccd614706d3b5359a78f1c9e275', + revision = '3431ec21da1dde751bab55520963cf3a4f1121f3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, From 01dd4b05cf83bf3e4aaac7133a227de7226c1d1e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 30 May 2025 15:55:30 +0200 Subject: [PATCH 113/434] fix(check-queries): only show timings for existing queries --- scripts/check-queries.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 796e3f5fc..d951cf2d6 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -19,8 +19,10 @@ do local before = vim.uv.hrtime() local ok, query = pcall(vim.treesitter.query.get, lang, query_type) local duration = vim.uv.hrtime() - before - table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) - print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6)) + if query then + table.insert(timings, { duration = duration, lang = lang, query_type = query_type }) + print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6)) + end if not ok then errors[#errors + 1] = string.format('%s (%s): %s', lang, query_type, query) end From 9a51f860c123ee072c08ff3e093d480d32699390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20NICOLAS?= Date: Sat, 31 May 2025 02:26:17 +0200 Subject: [PATCH 114/434] fix(git_config): match lowercase Git config vars Git config's sections, variable names, and (sometimes) subsections are case-insensitive. This commit proposes to match the full lowercase variants in addition to the non-normalised, lowerCamelCase ones. See `git help config` --- runtime/queries/git_config/highlights.scm | 4 ++-- runtime/queries/git_config/injections.scm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/queries/git_config/highlights.scm b/runtime/queries/git_config/highlights.scm index 6b37e9090..557ac60ec 100644 --- a/runtime/queries/git_config/highlights.scm +++ b/runtime/queries/git_config/highlights.scm @@ -7,7 +7,7 @@ ((section_header (section_name) @keyword.import (subsection_name)) - (#eq? @keyword.import "includeIf")) + (#any-of? @keyword.import "includeIf" "includeif")) (variable (name) @property) @@ -47,7 +47,7 @@ ((variable (name) @_name value: (string) @string.special.url) - (#eq? @_name "insteadOf")) + (#any-of? @_name "insteadOf" "insteadof")) ; Punctuation [ diff --git a/runtime/queries/git_config/injections.scm b/runtime/queries/git_config/injections.scm index 7bda6979c..8b4d69282 100644 --- a/runtime/queries/git_config/injections.scm +++ b/runtime/queries/git_config/injections.scm @@ -4,7 +4,7 @@ ((variable (name) @_name value: (string) @injection.content) - (#any-of? @_name "cmd" "command" "textconv" "sendmailCmd") + (#any-of? @_name "cmd" "command" "textconv" "sendmailCmd" "sendmailcmd") (#set! injection.language "bash")) (section @@ -29,7 +29,7 @@ (name) @_name value: (string) @injection.content) (#eq? @_interactive "interactive") - (#eq? @_name "diffFilter") + (#any-of? @_name "diffFilter" "difffilter") (#set! injection.language "bash")) ; https://github.com/git-lfs/git-lfs From 3cad4eb434ba886a1a7035ae8955b7391a42aa05 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 31 May 2025 11:26:24 +0200 Subject: [PATCH 115/434] fix(lua): fix some emmyluals warnings --- lua/nvim-treesitter/config.lua | 6 ++--- lua/nvim-treesitter/health.lua | 44 ++++++++++++++++----------------- lua/nvim-treesitter/indent.lua | 2 +- lua/nvim-treesitter/install.lua | 7 +++--- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 1a5b56cdb..9a586b7b5 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -96,7 +96,7 @@ end ---Normalize languages ---@param languages? string[]|string ----@param skip? { missing: boolean, unsupported: boolean, installed: boolean, dependencies: boolean } +---@param skip? { missing: boolean?, unsupported: boolean?, installed: boolean?, dependencies: boolean? } ---@return string[] function M.norm_languages(languages, skip) if not languages then @@ -150,7 +150,7 @@ function M.norm_languages(languages, skip) languages = vim.tbl_filter( --- @param v string function(v) - return not (parsers[v].tier and parsers[v].tier == 4) + return not (parsers[v] and parsers[v].tier and parsers[v].tier == 4) end, languages ) @@ -158,7 +158,7 @@ function M.norm_languages(languages, skip) if not (skip and skip.dependencies) then for _, lang in pairs(languages) do - if parsers[lang].requires then + if parsers[lang] and parsers[lang].requires then vim.list_extend(languages, parsers[lang].requires) end end diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 3f5058996..e284381dd 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -28,27 +28,25 @@ local function install_health() health.error('Nvim-treesitter requires Neovim 0.11.0 or later.') 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 + 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 @@ -140,7 +138,7 @@ function M.check() for _, lang in pairs(languages) do local parser = parsers[lang] local out = lang .. string.rep(' ', 22 - #lang) - if parser.install_info then + if parser and parser.install_info then for _, query_group in pairs(M.bundled_queries) do local status, err = query_status(lang, query_group) out = out .. status .. ' ' @@ -149,7 +147,7 @@ function M.check() end end end - if parser.requires then + if parser and parser.requires then for _, p in pairs(parser.requires) do if not vim.list_contains(languages, p) then table.insert(error_collection, { lang, 'queries', 'dependency ' .. p .. ' missing' }) diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index b0982c6c6..13f7b2740 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -106,7 +106,7 @@ end, function(bufnr, root, lang) return tostring(bufnr) .. root:id() .. '_' .. lang end) ----@param lnum number (1-indexed) +---@param lnum integer (1-indexed) ---@return integer function M.get_indent(lnum) local bufnr = vim.api.nvim_get_current_buf() diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index a5a2eb2a5..c56069621 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -97,15 +97,14 @@ end ---@async ---@param path string ----@param mode? string ---@return string? err -local function mkpath(path, mode) +local function mkpath(path) local parent = fs.dirname(path) if not parent:match('^[./]$') and not uv.fs_stat(parent) then - mkpath(parent, mode) + mkpath(parent) end - return uv_mkdir(path, tonumber(mode or '755', 8)) + return uv_mkdir(path, 493) -- tonumber('755', 8) end local M = {} From 6d54a47f44e5e441cd546c89fb6462b1f50aaca9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 2 Jun 2025 13:23:26 +0200 Subject: [PATCH 116/434] feat(parsers): update desktop, javadoc, t32, templ, fortran, editorconfig, mlir, xresources, ocaml_interface, r, ocaml --- lua/nvim-treesitter/parsers.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b1c39501f..843fb16df 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '752bab671c3a4ad0e566fa2c680af895f7fd1b77', + revision = '6eb323a20db2f1e8736c3a05915afe1687283965', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '301edd3fff4486acca5ca9991ba76ba372059451', + revision = '4a00eb4b0e8fbf8f1594efa9b5b15386fbd7d563', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -592,7 +592,7 @@ return { }, fortran = { install_info = { - revision = 'c687ba7b469cc22e22db6c90396ff2c98ba00d3b', + revision = 'ab9aa007a8d982a5a7926663a8ab989cea0f5d9e', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -1076,7 +1076,7 @@ return { }, javadoc = { install_info = { - revision = '001a8e4f8e839b640201c49046fbf5957fe1ee2c', + revision = 'c1bc2b76d8ff9fbc5aed7f823421bd5661f96828', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1400,7 +1400,7 @@ return { mlir = { install_info = { generate = true, - revision = '56753db408dbcc098e514c73cbb2351d344039e0', + revision = '0f77bc710f61ec6be658ddf51851b2ed2cdaa20d', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1506,7 +1506,7 @@ return { ocaml = { install_info = { location = 'grammars/ocaml', - revision = '029b1b6a87a8f1e8a9a7913a8a5bdecd36720789', + revision = '3ef7c00b29e41e3a0c1d18e82ea37c64d72b93fc', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1515,7 +1515,7 @@ return { ocaml_interface = { install_info = { location = 'grammars/interface', - revision = '029b1b6a87a8f1e8a9a7913a8a5bdecd36720789', + revision = '3ef7c00b29e41e3a0c1d18e82ea37c64d72b93fc', url = 'https://github.com/tree-sitter/tree-sitter-ocaml', }, maintainers = { '@undu' }, @@ -1807,7 +1807,7 @@ return { }, r = { install_info = { - revision = '7a7d4e04a325b336d53dbfef508918edba5ba240', + revision = '29c816328a086ef056799e3924ef6e09e6a9a8cb', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -2227,7 +2227,7 @@ return { }, t32 = { install_info = { - revision = '61607b32915fdeda275b2346e6a76a7c9b363251', + revision = '15f0032f3eadf95988293338e883c095fd5936f6', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2268,7 +2268,7 @@ return { }, templ = { install_info = { - revision = '5504cc96fbf5c9a029add2dfcb6e585e8fdaad75', + revision = 'de35706f89beed5087670a9c4421b7794ef02411', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2593,7 +2593,7 @@ return { }, xresources = { install_info = { - revision = 'd09b560bb78a3304211db5110f9bd6b053becba4', + revision = '7e9f6fa9a6e9e4e5ced1683afc89a0d5b32a4ebc', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 27b0bd487c4a1c72c9b53d0ca6f67f0ac6956b0a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 2 Jun 2025 13:25:17 +0200 Subject: [PATCH 117/434] feat(nickel)!: update parser and queries Breaking change: `(record_field)` -> `field_decl` --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/nickel/highlights.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 843fb16df..dd7d3c75e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1432,7 +1432,7 @@ return { }, nickel = { install_info = { - revision = 'f77c02df6dd0845594846beeeedf3715d4b68758', + revision = '9a05ab045c000cf37f02cff5c4de32b081444244', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 2, diff --git a/runtime/queries/nickel/highlights.scm b/runtime/queries/nickel/highlights.scm index 07673d797..c5ebfe166 100644 --- a/runtime/queries/nickel/highlights.scm +++ b/runtime/queries/nickel/highlights.scm @@ -61,7 +61,7 @@ (interpolation_end) @punctuation.bracket -(record_field) @variable.member +(field_decl) @variable.member (builtin) @function.builtin From fb9b2cfdc3e9b2488c315606e159022acb24f129 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 4 Jun 2025 10:32:50 +0200 Subject: [PATCH 118/434] feat(parsers): update bash, scala, slang, hyprlang, ini, query, javadoc, xml, php_only, angular, dtd, nu, php --- lua/nvim-treesitter/parsers.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index dd7d3c75e..d901ab810 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = '843525141575e397541e119698f0532755e959f6', + revision = '820566bb4eb3d288822dbfee42417a5a9491aea6', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -77,7 +77,7 @@ return { }, bash = { install_info = { - revision = '0c46d792d54c536be5ff7eb18eb95c70fccdb232', + revision = '8509e3229b863c255ab6b61f3bf74ad0bf14e8bc', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -419,7 +419,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '291b02018c525abe70fec41559cfe8f2f1cc84b2', + revision = '87be254e12169240a0e0214dbee5e208df96fa75', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -1003,7 +1003,7 @@ return { }, hyprlang = { install_info = { - revision = 'd0441fd4b883ecc0e70140723a1cf5907992639a', + revision = 'd626ec06e4d876fc41200a30b3e6f2b4714c7367', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, @@ -1027,7 +1027,7 @@ return { }, ini = { install_info = { - revision = '0e152b17fc0e929dd71f4bc4e317b3421ed39029', + revision = '31899dfa3b91622ea39e5c0bcddc88f45a9a3cfe', url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, @@ -1076,7 +1076,7 @@ return { }, javadoc = { install_info = { - revision = 'c1bc2b76d8ff9fbc5aed7f823421bd5661f96828', + revision = 'ddf03959c0152bb61ed567f301ad6ecdab72f6ab', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1480,7 +1480,7 @@ return { }, nu = { install_info = { - revision = 'd5c71a10b4d1b02e38967b05f8de70e847448dd1', + revision = '100d06e29d13a8ebfc3f29173c07a5c4f2050586', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1575,7 +1575,7 @@ return { php = { install_info = { location = 'php', - revision = 'eb289f127fc341ae7129902a2dd1c6c197a4c1e7', + revision = 'e771eb9fb5ccc65af35879487b66751568d10e48', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1586,7 +1586,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'eb289f127fc341ae7129902a2dd1c6c197a4c1e7', + revision = 'e771eb9fb5ccc65af35879487b66751568d10e48', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1798,7 +1798,7 @@ return { }, query = { install_info = { - revision = '8bf3112db43bdba3002bb1f88b7cda5f6278fc88', + revision = '55baffbdc6bd00bf177b796950497a01bb496241', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1975,7 +1975,7 @@ return { }, scala = { install_info = { - revision = 'c1189954df854977c3a52003ca8a247c5f4729ba', + revision = 'a2e91c845064bb4031e31b103e32bcdaefeea139', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2019,7 +2019,7 @@ return { }, slang = { install_info = { - revision = '327b1b821c255867a4fb724c8eee48887e3d014b', + revision = 'a4454e3004a9e8fea2df7fd2535fbaa05500da21', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2584,7 +2584,7 @@ return { xml = { install_info = { location = 'xml', - revision = '291b02018c525abe70fec41559cfe8f2f1cc84b2', + revision = '87be254e12169240a0e0214dbee5e208df96fa75', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, From 057e845518222c968251da7c7e7d4074c9620a1b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 29 May 2025 18:23:42 +0200 Subject: [PATCH 119/434] feat(install): support custom queries --- README.md | 10 +- lua/nvim-treesitter/_meta/parsers.lua | 3 + lua/nvim-treesitter/install.lua | 133 +++++++++++++++++++------- lua/nvim-treesitter/util.lua | 6 -- 4 files changed, 107 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index ef3a9f32c..921b11002 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ These queries can be used to look up definitions and references to identifiers i # Advanced setup -## Adding parsers +## Adding custom languages If you have a parser that is not on the list of supported languages (either as a repository on Github or in a local directory), you can add it manually for use by `nvim-treesitter` as follows: @@ -144,6 +144,7 @@ callback = function() location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo" generate = true, -- only needed if repo does not contain pre-generated `src/parser.c` generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either + queries = 'queries/neovim', -- also install queries from given directory }, } end}) @@ -158,6 +159,7 @@ Alternatively, if you have a local checkout, you can instead use location = 'parser', generate = true, generate_from_json = false, + queries = 'queries/neovim', -- symlink queries from given directory }, ``` This will always use the state of the directory as-is (i.e., `branch` and `revision` will be ignored). @@ -189,9 +191,3 @@ end}) ## Adding queries Queries can be placed anywhere in your `runtimepath` under `queries/`, with earlier directories taking precedence unless the queries are marked with `; extends`; see [`:h treesitter-query-modelines`](https://neovim.io/doc/user/treesitter.html#treesitter-query-modeline). - -E.g., to add queries for `zimbu`, put `highlights.scm` etc. under - -```lua -vim.fn.stdpath('data') .. 'site/queries/zimbu' -``` diff --git a/lua/nvim-treesitter/_meta/parsers.lua b/lua/nvim-treesitter/_meta/parsers.lua index 9ec2f0b9a..5af809bb0 100644 --- a/lua/nvim-treesitter/_meta/parsers.lua +++ b/lua/nvim-treesitter/_meta/parsers.lua @@ -23,6 +23,9 @@ error('Cannot require a meta file') --- ---Parser repo is a local directory; overrides `url`, `revision`, and `branch` ---@field path? string +--- +---Directory with queries to be installed +---@field queries? string ---@class ParserInfo --- diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index c56069621..336f83717 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -14,6 +14,9 @@ local uv_copyfile = a.awrap(4, uv.fs_copyfile) ---@type fun(path: string, mode: integer): string? local uv_mkdir = a.awrap(3, uv.fs_mkdir) +---@type fun(path: string): string? +local uv_rmdir = a.awrap(2, uv.fs_rmdir) + ---@type fun(path: string, new_path: string): string? local uv_rename = a.awrap(3, uv.fs_rename) @@ -23,6 +26,36 @@ local uv_symlink = a.awrap(4, uv.fs_symlink) ---@type fun(path: string): string? local uv_unlink = a.awrap(2, uv.fs_unlink) +---@async +---@param path string +---@return string? err +local function mkpath(path) + local parent = fs.dirname(path) + if not parent:match('^[./]$') and not uv.fs_stat(parent) then + mkpath(parent) + end + + return uv_mkdir(path, 493) -- tonumber('755', 8) +end + +---@async +---@param path string +local function rmdir(path) + local stat = uv.fs_lstat(path) + if not stat then + return + end + + if stat.type == 'directory' then + for file in fs.dir(path) do + rmdir(fs.joinpath(path, file)) + end + return uv_rmdir(path) + else + return uv_unlink(path) + end +end + local MAX_JOBS = 100 local INSTALL_TIMEOUT = 60000 @@ -95,18 +128,6 @@ local function download_file(url, output) end end ----@async ----@param path string ----@return string? err -local function mkpath(path) - local parent = fs.dirname(path) - if not parent:match('^[./]$') and not uv.fs_stat(parent) then - mkpath(parent) - end - - return uv_mkdir(path, 493) -- tonumber('755', 8) -end - local M = {} --- @@ -199,7 +220,8 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu local tmp = output_dir .. '-tmp' - util.delete(tmp) + rmdir(tmp) + a.schedule() url = url:gsub('.git$', '') local target = is_gitlab @@ -258,7 +280,8 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu end end - util.delete(tmp) + rmdir(tmp) + a.schedule() end ---@async @@ -300,6 +323,38 @@ local function do_install(logger, compile_location, target_location) end end +---@async +---@param logger Logger +---@param query_src string +---@param query_dir string +---@return string? err +local function do_link_queries(logger, query_src, query_dir) + uv_unlink(query_dir) + local err = uv_symlink(query_src, query_dir, { dir = true, junction = true }) + a.schedule() + if err then + return logger:error(err) + end +end + +---@async +---@param logger Logger +---@param query_src string +---@param query_dir string +---@return string? err +local function do_copy_queries(logger, query_src, query_dir) + rmdir(query_dir) + local err = uv_mkdir(query_dir, 493) -- tonumber('755', 8) + + for f in fs.dir(query_src) do + err = uv_copyfile(fs.joinpath(query_src, f), fs.joinpath(query_dir, f)) + end + a.schedule() + if err then + return logger:error(err) + end +end + ---@async ---@param lang string ---@param cache_dir string @@ -310,9 +365,8 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) local logger = log.new('install/' .. lang) local repo = get_parser_install_info(lang) + local project_name = 'tree-sitter-' .. lang if repo then - local project_name = 'tree-sitter-' .. lang - local revision = repo.revision local compile_location ---@type string @@ -320,7 +374,7 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) compile_location = fs.normalize(repo.path) else local project_dir = fs.joinpath(cache_dir, project_name) - util.delete(project_dir) + rmdir(project_dir) revision = revision or repo.branch or 'main' @@ -362,26 +416,37 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision') util.write_file(revfile, revision or '') end - - if not repo.path then - util.delete(fs.joinpath(cache_dir, project_name)) - end end do -- install queries - local queries_src = M.get_package_path('runtime', 'queries', lang) - if uv.fs_stat(queries_src) then - local queries = fs.joinpath(config.get_install_dir('queries'), lang) + local query_src = M.get_package_path('runtime', 'queries', lang) + local query_dir = fs.joinpath(config.get_install_dir('queries'), lang) + local task ---@type function - uv_unlink(queries) - local err = uv_symlink(queries_src, queries, { dir = true, junction = true }) - a.schedule() + if repo and repo.queries and repo.path then -- link queries from local repo + query_src = fs.joinpath(fs.normalize(repo.path), repo.queries) + task = do_link_queries + elseif repo and repo.queries then -- copy queries from tarball + query_src = fs.joinpath(cache_dir, project_name, repo.queries) + task = do_copy_queries + elseif uv.fs_stat(query_src) then -- link queries from runtime + task = do_link_queries + end + + if task then + local err = task(logger, query_src, query_dir) if err then - return logger:error(err) + return err end end end + -- clean up + if repo and not repo.path then + rmdir(fs.joinpath(cache_dir, project_name)) + a.schedule() + end + logger:info('Language installed') end @@ -520,17 +585,21 @@ local function uninstall_lang(logger, lang, parser, queries) logger:debug('Unlinking ' .. parser) local perr = uv_unlink(parser) a.schedule() - if perr then return logger:error(perr) end end - if fn.isdirectory(queries) == 1 then + local stat = uv.fs_lstat(queries) + if stat then logger:debug('Unlinking ' .. queries) - local qerr = uv_unlink(queries) + local qerr ---@type string? + if stat.type == 'link' then + qerr = uv_unlink(queries) + else + qerr = rmdir(queries) + end a.schedule() - if qerr then return logger:error(qerr) end diff --git a/lua/nvim-treesitter/util.lua b/lua/nvim-treesitter/util.lua index 8a9779617..f2ff2f77f 100644 --- a/lua/nvim-treesitter/util.lua +++ b/lua/nvim-treesitter/util.lua @@ -17,10 +17,4 @@ function M.write_file(filename, content) file:close() end ---- Recursively delete a directory ---- @param name string -function M.delete(name) - vim.fs.rm(name, { recursive = true, force = true }) -end - return M From f976acdc9c8214145a11372d2a7ae4a032f62a39 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 31 May 2025 15:45:59 +0200 Subject: [PATCH 120/434] refactor(install): inline, rename, annotate --- lua/nvim-treesitter/install.lua | 90 +++++++++++++++------------------ 1 file changed, 41 insertions(+), 49 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 336f83717..c179600b6 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -40,7 +40,7 @@ end ---@async ---@param path string -local function rmdir(path) +local function rmpath(path) local stat = uv.fs_lstat(path) if not stat then return @@ -48,7 +48,7 @@ local function rmdir(path) if stat.type == 'directory' then for file in fs.dir(path) do - rmdir(fs.joinpath(path, file)) + rmpath(fs.joinpath(path, file)) end return uv_rmdir(path) else @@ -61,16 +61,16 @@ local INSTALL_TIMEOUT = 60000 --- @async --- @param max_jobs integer ---- @param task_funs async.TaskFun[] -local function join(max_jobs, task_funs) - if #task_funs == 0 then +--- @param tasks async.TaskFun[] +local function join(max_jobs, tasks) + if #tasks == 0 then return end - max_jobs = math.min(max_jobs, #task_funs) + max_jobs = math.min(max_jobs, #tasks) - local remaining = { select(max_jobs + 1, unpack(task_funs)) } - local to_go = #task_funs + local remaining = { select(max_jobs + 1, unpack(tasks)) } + local to_go = #tasks a.await(1, function(finish) local function cb() @@ -84,7 +84,7 @@ local function join(max_jobs, task_funs) end for i = 1, max_jobs do - task_funs[i]():await(cb) + tasks[i]():await(cb) end end) end @@ -108,26 +108,6 @@ local function system(cmd, opts) return r end ----@async ----@param url string ----@param output string ----@return string? err -local function download_file(url, output) - local r = system({ - 'curl', - '--silent', - '--fail', - '--show-error', - '-L', -- follow redirects - url, - '--output', - output, - }) - if r.code > 0 then - return r.stderr - end -end - local M = {} --- @@ -220,7 +200,7 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu local tmp = output_dir .. '-tmp' - rmdir(tmp) + rmpath(tmp) a.schedule() url = url:gsub('.git$', '') @@ -232,9 +212,18 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu do -- Download tarball logger:info('Downloading %s...', project_name) - local err = download_file(target, tarball_path) - if err then - return logger:error('Error during download: %s', err) + local r = system({ + 'curl', + '--silent', + '--fail', + '--show-error', + '-L', -- follow redirects + target, + '--output', + tarball_path, + }) + if r.code > 0 then + return logger:error('Error during download: %s', r.stderr) end end @@ -280,7 +269,7 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu end end - rmdir(tmp) + rmpath(tmp) a.schedule() end @@ -343,7 +332,7 @@ end ---@param query_dir string ---@return string? err local function do_copy_queries(logger, query_src, query_dir) - rmdir(query_dir) + rmpath(query_dir) local err = uv_mkdir(query_dir, 493) -- tonumber('755', 8) for f in fs.dir(query_src) do @@ -374,7 +363,7 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) compile_location = fs.normalize(repo.path) else local project_dir = fs.joinpath(cache_dir, project_name) - rmdir(project_dir) + rmpath(project_dir) revision = revision or repo.branch or 'main' @@ -443,7 +432,7 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) -- clean up if repo and not repo.path then - rmdir(fs.joinpath(cache_dir, project_name)) + rmpath(fs.joinpath(cache_dir, project_name)) a.schedule() end @@ -517,10 +506,10 @@ local function install(languages, options) local install_dir = config.get_install_dir('parser') - local task_funs = {} ---@type async.TaskFun[] + local tasks = {} ---@type async.TaskFun[] local done = 0 for _, lang in ipairs(languages) do - task_funs[#task_funs + 1] = a.async(function() + tasks[#tasks + 1] = a.async(--[[@async]] function() a.schedule() local status = install_lang(lang, cache_dir, install_dir, options.force, options.generate) if status ~= 'failed' then @@ -529,16 +518,17 @@ local function install(languages, options) end) end - join(options and options.max_jobs or MAX_JOBS, task_funs) - if #task_funs > 1 then + join(options and options.max_jobs or MAX_JOBS, tasks) + if #tasks > 1 then a.schedule() if options and options.summary then - log.info('Installed %d/%d languages', done, #task_funs) + log.info('Installed %d/%d languages', done, #tasks) end end - return done == #task_funs + return done == #tasks end +---@async ---@param languages string[]|string ---@param options? InstallOptions M.install = a.async(function(languages, options) @@ -547,6 +537,7 @@ M.install = a.async(function(languages, options) return install(languages, options) end) +---@async ---@param languages? string[]|string ---@param options? InstallOptions M.update = a.async(function(languages, options) @@ -597,7 +588,7 @@ local function uninstall_lang(logger, lang, parser, queries) if stat.type == 'link' then qerr = uv_unlink(queries) else - qerr = rmdir(queries) + qerr = rmpath(queries) end a.schedule() if qerr then @@ -608,6 +599,7 @@ local function uninstall_lang(logger, lang, parser, queries) logger:info('Language uninstalled') end +---@async ---@param languages string[]|string ---@param options? InstallOptions M.uninstall = a.async(function(languages, options) @@ -618,7 +610,7 @@ M.uninstall = a.async(function(languages, options) local query_dir = config.get_install_dir('queries') local installed = config.get_installed() - local task_funs = {} ---@type async.TaskFun[] + local tasks = {} ---@type async.TaskFun[] local done = 0 for _, lang in ipairs(languages) do local logger = log.new('uninstall/' .. lang) @@ -627,7 +619,7 @@ M.uninstall = a.async(function(languages, options) else local parser = fs.joinpath(parser_dir, lang) .. '.so' local queries = fs.joinpath(query_dir, lang) - task_funs[#task_funs + 1] = a.async(function() + tasks[#tasks + 1] = a.async(--[[@async]] function() local err = uninstall_lang(logger, lang, parser, queries) if not err then done = done + 1 @@ -636,11 +628,11 @@ M.uninstall = a.async(function(languages, options) end end - join(MAX_JOBS, task_funs) - if #task_funs > 1 then + join(MAX_JOBS, tasks) + if #tasks > 1 then a.schedule() if options and options.summary then - log.info('Uninstalled %d/%d languages', done, #task_funs) + log.info('Uninstalled %d/%d languages', done, #tasks) end end end) From 27d0bef81e4086c00ed0dde7dc53ec8151bd7c89 Mon Sep 17 00:00:00 2001 From: Omar Valdez Date: Thu, 5 Jun 2025 02:11:40 -0700 Subject: [PATCH 121/434] feat(desktop): update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/desktop/highlights.scm | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index d901ab810..3447c273d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '6eb323a20db2f1e8736c3a05915afe1687283965', + revision = 'b2cad1212116f23b3e8d0607b628bc6f72224c51', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, diff --git a/runtime/queries/desktop/highlights.scm b/runtime/queries/desktop/highlights.scm index 7a5ebf241..ce55d7432 100644 --- a/runtime/queries/desktop/highlights.scm +++ b/runtime/queries/desktop/highlights.scm @@ -5,9 +5,6 @@ (entry key: (identifier) @property) -(localized_key - name: (identifier) @property) - [ (language) (country) From faf63903ffa05a9dadd56258d737a0243393c0f5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 6 Jun 2025 16:41:38 +0200 Subject: [PATCH 122/434] fix(ipkg)!: remove parser and queries grammar repo is 404 (user removed) and no forks exist --- SUPPORTED_LANGUAGES.md | 3 +- lua/nvim-treesitter/parsers.lua | 9 ----- runtime/queries/ipkg/folds.scm | 13 ------- runtime/queries/ipkg/highlights.scm | 56 ----------------------------- runtime/queries/ipkg/indents.scm | 33 ----------------- runtime/queries/ipkg/injections.scm | 5 --- runtime/queries/ipkg/locals.scm | 24 ------------- 7 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 runtime/queries/ipkg/folds.scm delete mode 100644 runtime/queries/ipkg/highlights.scm delete mode 100644 runtime/queries/ipkg/indents.scm delete mode 100644 runtime/queries/ipkg/injections.scm delete mode 100644 runtime/queries/ipkg/locals.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 0e6417529..d9c56c4f2 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -137,10 +137,9 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | | @TravonteD [hurl](https://github.com/pfeiferj/tree-sitter-hurl) | unstable | `HFIJ ` | | @pfeiferj [hyprlang](https://github.com/tree-sitter-grammars/tree-sitter-hyprlang) | unstable | `HFIJ ` | | @luckasRanarison [idl](https://github.com/cathaysia/tree-sitter-idl) | unstable | `H IJ ` | | @cathaysia -[idris](https://github.com/kayhide/tree-sitter-idris) | unstable | `HF JL` | | @srghma +[idris](https://github.com/kayhide/tree-sitter-idris) | unstable | `HF JL` | | [ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF J ` | | @theHamsta [inko](https://github.com/inko-lang/tree-sitter-inko) | unstable | `HFIJL` | | @yorickpeterse -[ipkg](https://github.com/srghma/tree-sitter-ipkg) | unstable | `HFIJL` | | @srghma [ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | unstable | `HFIJL` | | @fab4100 [janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | unstable | `HF JL` | | @sogaiu [java](https://github.com/tree-sitter/tree-sitter-java) | unstable | `HFIJL` | | @p00f diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3447c273d..cbe6aac12 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1022,7 +1022,6 @@ return { revision = 'c56a25cf57c68ff929356db25505c1cc4c7820f6', url = 'https://github.com/kayhide/tree-sitter-idris', }, - maintainers = { '@srghma' }, tier = 2, }, ini = { @@ -1041,14 +1040,6 @@ return { maintainers = { '@yorickpeterse' }, tier = 2, }, - ipkg = { - install_info = { - revision = '8d3e9782f2d091d0cd39c13bfb3068db0c675960', - url = 'https://github.com/srghma/tree-sitter-ipkg', - }, - maintainers = { '@srghma' }, - tier = 2, - }, ispc = { install_info = { revision = '9b2f9aec2106b94b4e099fe75e73ebd8ae707c04', diff --git a/runtime/queries/ipkg/folds.scm b/runtime/queries/ipkg/folds.scm deleted file mode 100644 index 271654f9a..000000000 --- a/runtime/queries/ipkg/folds.scm +++ /dev/null @@ -1,13 +0,0 @@ -[ - (source_file) - (dependency_list) - (module_list) - (dependency_declaration) - (module_declaration) - (module_declaration) - (package_declaration) - (main_declaration) - (executable_declaration) - (version_declaration) - (langversion_declaration) -] @fold diff --git a/runtime/queries/ipkg/highlights.scm b/runtime/queries/ipkg/highlights.scm deleted file mode 100644 index 13c102018..000000000 --- a/runtime/queries/ipkg/highlights.scm +++ /dev/null @@ -1,56 +0,0 @@ -; Keywords -"package" @keyword.import - -[ - "authors" - "maintainers" - "license" - "brief" - "readme" - "homepage" - "sourceloc" - "bugtracker" - "opts" - "sourcedir" - "builddir" - "outputdir" - "prebuild" - "postbuild" - "preinstall" - "postinstall" - "preclean" - "postclean" - "version" - "langversion" - "modules" - "main" - "executable" - "depends" -] @keyword - -[ - "=" - (version_range_op) -] @operator - -"," @punctuation.delimiter - -; Field values -(string_value) @string - -(boolean_value) @boolean - -; Version numbers and ranges -(version_number) @string.special - -[ - (dependency_item) - (package_name) - (module_name) -] @module - -; Comments -[ - (line_comment) - (block_comment) -] @comment @spell diff --git a/runtime/queries/ipkg/indents.scm b/runtime/queries/ipkg/indents.scm deleted file mode 100644 index a596e9ebe..000000000 --- a/runtime/queries/ipkg/indents.scm +++ /dev/null @@ -1,33 +0,0 @@ -; Indentation rules for Idris .ipkg files -[ - (package_declaration) - (field_declaration) - (main_declaration) - (executable_declaration) - (version_declaration) - (langversion_declaration) -] @indent.begin - -(dependency_declaration - "=" @indent.begin - (dependency_list - "," @indent.begin)) - -(module_declaration - "=" @indent.begin - (module_list - "," @indent.begin)) - -(field_declaration - "=" @indent.begin) - -"=" @indent.branch - -(string_value) @indent.begin - -[ - (line_comment) - (block_comment) -] @indent.ignore - -(ERROR) @indent.auto diff --git a/runtime/queries/ipkg/injections.scm b/runtime/queries/ipkg/injections.scm deleted file mode 100644 index 3cd6aac8e..000000000 --- a/runtime/queries/ipkg/injections.scm +++ /dev/null @@ -1,5 +0,0 @@ -([ - (line_comment) - (block_comment) -] @injection.content - (#set! injection.language "comment")) diff --git a/runtime/queries/ipkg/locals.scm b/runtime/queries/ipkg/locals.scm deleted file mode 100644 index c1970fcdf..000000000 --- a/runtime/queries/ipkg/locals.scm +++ /dev/null @@ -1,24 +0,0 @@ -; Scopes -(source_file) @local.scope - -; Definitions -(package_declaration - (package_name) @local.definition.import) - -(module_declaration - (module_list - (module_name) @local.definition.namespace)) - -(main_declaration - (module_name) @local.definition.import) - -(executable_declaration - (package_name) @local.definition.import) - -; References -(dependency_declaration - (dependency_list - (dependency_item - (package_name) @local.reference))) - -(module_name) @local.reference From c48b37a3c9cb8baedcb667c8c5f22b62185c8916 Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Fri, 6 Jun 2025 19:36:48 +0900 Subject: [PATCH 123/434] feat(cpp): highlight template method call --- runtime/queries/cpp/highlights.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm index 85ff2dc40..ac0315275 100644 --- a/runtime/queries/cpp/highlights.scm +++ b/runtime/queries/cpp/highlights.scm @@ -154,6 +154,11 @@ (field_expression (field_identifier) @function.method.call)) +(call_expression + (field_expression + (template_method + (field_identifier) @function.method.call))) + ; constructors ((function_declarator (qualified_identifier From 9c03c835fb2c7f0348742221d9c9540a69f47bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20NICOLAS?= Date: Thu, 5 Jun 2025 15:04:43 +0200 Subject: [PATCH 124/434] fix(bash): highlight shebang also when spaced This commit aligns the shebang highlighting in bash syntax to what the Linux kernel will recognise as a valid shebang construct. In summary, the kernel will accept both headers: #!/usr/bin/env lua #! /usr/bin/env lua The second one is quite prominently used throughout documentation online, such as on Wikipedia's page for Shebang (Unix) [1]. Some sources are adamant it wouldn't be supported at a kernel level, but it looks to me, upon closer inspection of the current kernel code [2], that it is indeed quite evidently valid. It'll simply skip over to the first character that's neither a space 0x20 nor a tab 0x09. [1] https://en.wikipedia.org/wiki/Shebang_(Unix) [2] https://github.com/torvalds/linux/blob/ec7714e4947909190ffb3041a03311a975350fe0/fs/binfmt_script.c#L44-L71 --- runtime/queries/bash/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/bash/highlights.scm b/runtime/queries/bash/highlights.scm index 428207b94..6fe370011 100644 --- a/runtime/queries/bash/highlights.scm +++ b/runtime/queries/bash/highlights.scm @@ -269,4 +269,4 @@ ((program . (comment) @keyword.directive @nospell) - (#lua-match? @keyword.directive "^#!/")) + (#lua-match? @keyword.directive "^#![ \t]*/")) From 0fb1c6e92e6a03374d578b362301dbd22abd3840 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 9 Jun 2025 17:42:54 +0200 Subject: [PATCH 125/434] feat(parsers): update bash, purescript, r, cylc, meson, mlir, xresources, markdown, markdown_inline, scala, javadoc, slint, desktop, enforce, editorconfig, query --- lua/nvim-treesitter/parsers.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index cbe6aac12..72d4f69ad 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -77,7 +77,7 @@ return { }, bash = { install_info = { - revision = '8509e3229b863c255ab6b61f3bf74ad0bf14e8bc', + revision = '56b54c61fb48bce0c63e3dfa2240b5d274384763', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -322,7 +322,7 @@ return { }, cylc = { install_info = { - revision = '1f3cb70200b4e238e19652705336e7f2c52b8e2f', + revision = '5517ecade85b1de85ed8e0cb742b81decc64183a', url = 'https://github.com/elliotfontaine/tree-sitter-cylc', }, maintainers = { '@elliotfontaine' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'b2cad1212116f23b3e8d0607b628bc6f72224c51', + revision = '35db988d318c0ddfb8445adec1fd006095e73d89', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '4a00eb4b0e8fbf8f1594efa9b5b15386fbd7d563', + revision = 'cbe0d13e8d67d3a97856f29e5b1d4233cbf32577', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -512,7 +512,7 @@ return { }, enforce = { install_info = { - revision = '36064bd71ce22e9a8c73b64b1a3448cc600a4312', + revision = '8e4c84144153deaf2b8461def43126cea6790020', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = 'ddf03959c0152bb61ed567f301ad6ecdab72f6ab', + revision = '32c3d81dda0e4dd70fef7e93f15dc8861d3f5818', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1339,7 +1339,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = 'efb075cbd57ce33f694c2bb264b99cdba0f31789', + revision = '9dca2b6834df9be17bed2ec0fc05c215fa10acf3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1350,7 +1350,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = 'efb075cbd57ce33f694c2bb264b99cdba0f31789', + revision = '9dca2b6834df9be17bed2ec0fc05c215fa10acf3', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1382,7 +1382,7 @@ return { }, meson = { install_info = { - revision = 'b1ff0037b665e7e84715390820d6ecbe763a9c79', + revision = '243aa33382d6ac7b8b66d962024d339cb3bae3f6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = '0f77bc710f61ec6be658ddf51851b2ed2cdaa20d', + revision = '3e214fc380b1159dd157cd6ed489a3b8fd8888a8', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1739,7 +1739,7 @@ return { }, purescript = { install_info = { - revision = '4cacfdaa75090bb790965674fe387bb215bab64b', + revision = '603daa9178bcef3386b3040d86435794965fc6f2', url = 'https://github.com/postsolar/tree-sitter-purescript', }, maintainers = { '@postsolar' }, @@ -1789,7 +1789,7 @@ return { }, query = { install_info = { - revision = '55baffbdc6bd00bf177b796950497a01bb496241', + revision = '2b3669919b22f1a6e5bfcf3753caaa63fd14e8ec', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1798,7 +1798,7 @@ return { }, r = { install_info = { - revision = '29c816328a086ef056799e3924ef6e09e6a9a8cb', + revision = '95aff097aa927a66bb357f715b58cde821be8867', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1966,7 +1966,7 @@ return { }, scala = { install_info = { - revision = 'a2e91c845064bb4031e31b103e32bcdaefeea139', + revision = '2d55e74b0485fe05058ffe5e8155506c9710c767', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2027,7 +2027,7 @@ return { }, slint = { install_info = { - revision = '32f970b57720010e77a486bc2001ee9e6c7c8250', + revision = 'cd04d91ff4eaff3467a6a0968e29fa9e4ac8f024', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2584,7 +2584,7 @@ return { }, xresources = { install_info = { - revision = '7e9f6fa9a6e9e4e5ced1683afc89a0d5b32a4ebc', + revision = '45c020e74e924d8e3a0656a0dbe18688c063f5f0', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From c29969e8efbea20b65dcc398d3fc403d5e51d006 Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 12 Jun 2025 23:14:30 -0300 Subject: [PATCH 126/434] feat(dot): fold queries --- SUPPORTED_LANGUAGES.md | 2 +- runtime/queries/dot/folds.scm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/dot/folds.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index d9c56c4f2..4e3fe466d 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -61,7 +61,7 @@ Language | Tier | Queries | Node | Maintainer [disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | unstable | `H  J ` | | @ColinKennedy [djot](https://github.com/treeman/tree-sitter-djot) | unstable | `HFIJL` | | @NoahTheDuke [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | unstable | `H  J ` | | @camdencheek -[dot](https://github.com/rydesun/tree-sitter-dot) | unstable | `H IJ ` | | @rydesun +[dot](https://github.com/rydesun/tree-sitter-dot) | unstable | `HFIJ ` | | @rydesun [doxygen](https://github.com/tree-sitter-grammars/tree-sitter-doxygen) | unstable | `H IJ ` | | @amaanq [dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HF JL` | | @ObserverOfTime [earthfile](https://github.com/glehmann/tree-sitter-earthfile) | unstable | `H  J ` | | @glehmann diff --git a/runtime/queries/dot/folds.scm b/runtime/queries/dot/folds.scm new file mode 100644 index 000000000..280bbb465 --- /dev/null +++ b/runtime/queries/dot/folds.scm @@ -0,0 +1,4 @@ +[ + (edge_stmt)+ + (node_stmt) +] @fold From a64ef334be4f47cab7effdd08b57d7b38235eeb7 Mon Sep 17 00:00:00 2001 From: uncenter Date: Sat, 14 Jun 2025 05:01:04 -0400 Subject: [PATCH 127/434] fix(css): universal selector "*" has precedence over operator (#7948) --- runtime/queries/css/highlights.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/queries/css/highlights.scm b/runtime/queries/css/highlights.scm index 49471fdb2..5b43c014a 100644 --- a/runtime/queries/css/highlights.scm +++ b/runtime/queries/css/highlights.scm @@ -27,11 +27,6 @@ (feature_name) ] @property -[ - (nesting_selector) - (universal_selector) -] @character.special - (function_name) @function [ @@ -58,6 +53,11 @@ (important) @keyword.modifier +[ + (nesting_selector) + (universal_selector) +] @character.special + (attribute_selector (plain_value) @string) From 43b7f16c50cda8f0bd571594d63f9ba8a46f0e45 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 15 Jun 2025 10:48:01 +0200 Subject: [PATCH 128/434] feat(parsers): update php_only, javadoc, erlang, faust, php, roc, slim, fortran, terraform, fish, mlir, sourcepawn, latex, matlab, hcl, vhdl --- lua/nvim-treesitter/parsers.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 72d4f69ad..b493d0917 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -520,7 +520,7 @@ return { }, erlang = { install_info = { - revision = '067d66937c8eeb6651e349f400c1756c2ea90b2e', + revision = '07dad1469ecb7df80f2b6d5178f79564d19d67e0', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -536,7 +536,7 @@ return { }, faust = { install_info = { - revision = 'f3b9274514b5f9bf6b0dd4a01c30f9cc15c58bc4', + revision = 'aa033eb46c3b40e936db5847e0e91445ab606ee4', url = 'https://github.com/khiner/tree-sitter-faust', }, maintainers = { '@khiner' }, @@ -568,7 +568,7 @@ return { }, fish = { install_info = { - revision = '70640c0696abde32622afc43291a385681afbd32', + revision = 'aa074a0bacde8b5823c592574d7138f156a95776', url = 'https://github.com/ram02z/tree-sitter-fish', }, maintainers = { '@ram02z' }, @@ -592,7 +592,7 @@ return { }, fortran = { install_info = { - revision = 'ab9aa007a8d982a5a7926663a8ab989cea0f5d9e', + revision = '1b08f4c65fb47c76d3532cd3f7432d03abb9ef69', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -898,7 +898,7 @@ return { }, hcl = { install_info = { - revision = '009def4ae38ec30e5b40beeae26efe93484ab286', + revision = '28e327cd3f5be4816020b1230c0602a6deb40290', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = '32c3d81dda0e4dd70fef7e93f15dc8861d3f5818', + revision = '573ff1f5e909daade4fba984fc5e8b14afe278ef', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1232,7 +1232,7 @@ return { latex = { install_info = { generate = true, - revision = 'f736d24d89acbd90092d92089e5171e6a449db40', + revision = '8e130cd5394487f5b686fbbb547f4ad7dbe811db', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1359,7 +1359,7 @@ return { }, matlab = { install_info = { - revision = '88ccb5ee90711e9961582d421c42bc8c6bd53f59', + revision = 'a419361e4a6f2ec435dac4465fb0c0e5b2446b08', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = '3e214fc380b1159dd157cd6ed489a3b8fd8888a8', + revision = 'eb78968fdb3728510f9260129a2dd57b7c04f761', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1566,7 +1566,7 @@ return { php = { install_info = { location = 'php', - revision = 'e771eb9fb5ccc65af35879487b66751568d10e48', + revision = 'b2278dbac9d58b02653fe6a8530ccebc492e4ed4', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1577,7 +1577,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'e771eb9fb5ccc65af35879487b66751568d10e48', + revision = 'b2278dbac9d58b02653fe6a8530ccebc492e4ed4', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1918,7 +1918,7 @@ return { }, roc = { install_info = { - revision = '0b1afe88161cbd81f5ddea1bb4fa786314ed49a7', + revision = '94634c7e882d3c55066aa074cab4911284326deb', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -2019,7 +2019,7 @@ return { }, slim = { install_info = { - revision = 'd8a79d15c7b9a68d2d1616c319d2b04d1999ab9f', + revision = 'a06113f5175b805a37d20df0a6f9d722e0ab6cfe', url = 'https://github.com/theoo/tree-sitter-slim', }, maintainers = { '@theoo' }, @@ -2085,7 +2085,7 @@ return { }, sourcepawn = { install_info = { - revision = 'f2af8d0dc14c6790130cceb2a20027eb41a8297c', + revision = '5a8fdd446b516c81e218245c12129c6ad4bccfa2', url = 'https://github.com/nilshelmig/tree-sitter-sourcepawn', }, maintainers = { '@Sarrus1' }, @@ -2276,7 +2276,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = '009def4ae38ec30e5b40beeae26efe93484ab286', + revision = '28e327cd3f5be4816020b1230c0602a6deb40290', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2484,7 +2484,7 @@ return { }, vhdl = { install_info = { - revision = 'ec2cb14f68053cf49d1d18cd5742af8e81771ebb', + revision = '5840549516f2faf8c45cae5a3b16c1b81a2498a1', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, From 9807487fe90afb7f53ddc22179272dad19c1044a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 17 Jun 2025 15:49:02 +0200 Subject: [PATCH 129/434] feat(parsers): update desktop, query, editorconfig, xresources, hcl, slint, markdown_inline, matlab, terraform, templ, nu, vhdl, tera, markdown, javadoc --- lua/nvim-treesitter/parsers.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b493d0917..c230e6979 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '35db988d318c0ddfb8445adec1fd006095e73d89', + revision = '5fc42b211b261d7c10f97f2c7fa9665cd0d3c8a0', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = 'cbe0d13e8d67d3a97856f29e5b1d4233cbf32577', + revision = '9281e7d8522cc0d06b61f97920e27936fa12be11', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -898,7 +898,7 @@ return { }, hcl = { install_info = { - revision = '28e327cd3f5be4816020b1230c0602a6deb40290', + revision = 'fad991865fee927dd1de5e172fb3f08ac674d914', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = '573ff1f5e909daade4fba984fc5e8b14afe278ef', + revision = '3f2ed5575909874927489d2d47a3a2fda36959ee', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1339,7 +1339,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '9dca2b6834df9be17bed2ec0fc05c215fa10acf3', + revision = '7462bb66ac7e90312082269007fac2772fe5efd1', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1350,7 +1350,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '9dca2b6834df9be17bed2ec0fc05c215fa10acf3', + revision = '7462bb66ac7e90312082269007fac2772fe5efd1', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1359,7 +1359,7 @@ return { }, matlab = { install_info = { - revision = 'a419361e4a6f2ec435dac4465fb0c0e5b2446b08', + revision = 'd5fd97c7aec0881d3429642a240ad536c74582b9', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = '100d06e29d13a8ebfc3f29173c07a5c4f2050586', + revision = '7983592fe54750b750f2ee9dc8e89449257855d4', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1789,7 +1789,7 @@ return { }, query = { install_info = { - revision = '2b3669919b22f1a6e5bfcf3753caaa63fd14e8ec', + revision = '8a43889f89fd0667289936341bff3a77bafade17', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -2027,7 +2027,7 @@ return { }, slint = { install_info = { - revision = 'cd04d91ff4eaff3467a6a0968e29fa9e4ac8f024', + revision = '03f24aa22d6712f79004286df6dd416ca6d2a91d', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2259,7 +2259,7 @@ return { }, templ = { install_info = { - revision = 'de35706f89beed5087670a9c4421b7794ef02411', + revision = 'a35a02cb608291ac8c12082dcbd2b5f34a7ad45f', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2267,7 +2267,7 @@ return { }, tera = { install_info = { - revision = 'd006172998fa8b81f96b0f2fc7fa2bf25207c46b', + revision = '53ca9100f231b72474225d98c9e53d1a4275046d', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2276,7 +2276,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = '28e327cd3f5be4816020b1230c0602a6deb40290', + revision = 'fad991865fee927dd1de5e172fb3f08ac674d914', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2484,7 +2484,7 @@ return { }, vhdl = { install_info = { - revision = '5840549516f2faf8c45cae5a3b16c1b81a2498a1', + revision = 'eacafa5d612fdea1d12332fe0f83e089e5571cf3', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2584,7 +2584,7 @@ return { }, xresources = { install_info = { - revision = '45c020e74e924d8e3a0656a0dbe18688c063f5f0', + revision = '65d52b286af0b2dd7153e045869a566b33a28f44', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 7e6fbcaa20e70b48990b199eb1310bee22adee0f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 17 Jun 2025 15:49:52 +0200 Subject: [PATCH 130/434] feat(purescript)!: update parser and queries removed note: `(constructor_operator)` --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/purescript/highlights.scm | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index c230e6979..3194af27c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1739,7 +1739,7 @@ return { }, purescript = { install_info = { - revision = '603daa9178bcef3386b3040d86435794965fc6f2', + revision = '03bafc129e390d65178caaa72d8a1b91439d170e', url = 'https://github.com/postsolar/tree-sitter-purescript', }, maintainers = { '@postsolar' }, diff --git a/runtime/queries/purescript/highlights.scm b/runtime/queries/purescript/highlights.scm index 02426b0ab..33b62725c 100644 --- a/runtime/queries/purescript/highlights.scm +++ b/runtime/queries/purescript/highlights.scm @@ -52,7 +52,6 @@ [ (operator) - (constructor_operator) (type_operator) (all_names) "=" From 2a677dede2ea45d872ee32ea55e2f93bec0b0f4f Mon Sep 17 00:00:00 2001 From: guilhas07 Date: Wed, 18 Jun 2025 16:22:31 +0100 Subject: [PATCH 131/434] feat(vue): add template commentstring metadata --- runtime/queries/vue/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/vue/highlights.scm b/runtime/queries/vue/highlights.scm index 64195c346..66b7ea61e 100644 --- a/runtime/queries/vue/highlights.scm +++ b/runtime/queries/vue/highlights.scm @@ -41,3 +41,6 @@ (attribute_value) @none)) (directive_modifier) @function.method + +((template_element) @_template + (#set! @_template bo.commentstring "")) From 1bfa557b7d6bd7b3a594e89652ba7117a2b7d04d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 22 Jun 2025 15:40:36 +0200 Subject: [PATCH 132/434] feat(parsers): update gleam, latex, typespec, purescript, heex, nu --- lua/nvim-treesitter/parsers.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3194af27c..24fdded9c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -709,7 +709,7 @@ return { }, gleam = { install_info = { - revision = '6ece453acf8b14568c10f629f8cd25d3dde3794f', + revision = 'ee93c639dc82148d716919df336ad612fd33538e', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -906,7 +906,7 @@ return { }, heex = { install_info = { - revision = '008626a3fad379d17c81d5ed576edd9bd7a4fbf7', + revision = '6603380caf806b3e6c7f0bf61627bb47023d79f1', url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, @@ -1232,7 +1232,7 @@ return { latex = { install_info = { generate = true, - revision = '8e130cd5394487f5b686fbbb547f4ad7dbe811db', + revision = '73c9b8992f72203386092ffd2a05f2dcba02d2cb', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = '7983592fe54750b750f2ee9dc8e89449257855d4', + revision = 'b64f0d1c93a76d167fabb01271905f0d18c5f10c', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1739,7 +1739,7 @@ return { }, purescript = { install_info = { - revision = '03bafc129e390d65178caaa72d8a1b91439d170e', + revision = 'f541f95ffd6852fbbe88636317c613285bc105af', url = 'https://github.com/postsolar/tree-sitter-purescript', }, maintainers = { '@postsolar' }, @@ -2386,7 +2386,7 @@ return { }, typespec = { install_info = { - revision = 'b6b6a66a18e98f44cc2f2cdbfd2e1df845b59852', + revision = '814c98283fd92a248ba9d49ebfe61bc672a35875', url = 'https://github.com/happenslol/tree-sitter-typespec', }, maintainers = { '@happenslol' }, From 8867a9d6bf85a7847e3dff35b049880dbffb44d6 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 22 Jun 2025 15:45:57 +0200 Subject: [PATCH 133/434] feat(powershell)!: update parser and queries removed nodes: `"class"`, `"enum"` --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/powershell/highlights.scm | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 24fdded9c..ade94c60c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1637,7 +1637,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '66d5e61126989c0aca57ff77d19b2064919b51e1', + revision = '01b67e81917482fb714409a40a8fea8fe21c42f6', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, diff --git a/runtime/queries/powershell/highlights.scm b/runtime/queries/powershell/highlights.scm index 7d334ba2a..d26864275 100644 --- a/runtime/queries/powershell/highlights.scm +++ b/runtime/queries/powershell/highlights.scm @@ -62,11 +62,6 @@ "return" @keyword.return -[ - "class" - "enum" -] @keyword.type - [ "data" (class_attribute) From 231724189636fc31950f071bca0d2d35c228035b Mon Sep 17 00:00:00 2001 From: Luis Calle <53507599+TheLeoP@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:15:08 -0500 Subject: [PATCH 134/434] fix: register `powershell` language for `ps1` filetype (#7965) * chore: sort languages * fix: register `powershell` language for `ps1` filetype --- plugin/filetypes.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index feb1194a6..fdfaefe30 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -24,8 +24,8 @@ local filetypes = { janet_simple = { 'janet' }, javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' }, javascript_glimmer = { 'javascript.glimmer' }, - linkerscript = { 'ld' }, latex = { 'tex' }, + linkerscript = { 'ld' }, m68k = { 'asm68k' }, make = { 'automake' }, markdown = { 'pandoc' }, @@ -33,6 +33,7 @@ local filetypes = { ocaml_interface = { 'ocamlinterface' }, perl = { 'pl' }, poe_filter = { 'poefilter' }, + powershell = { 'ps1' }, properties = { 'jproperties' }, python = { 'py', 'gyp' }, qmljs = { 'qml' }, From 6c503103710e6ba95632b540f0f337c648b92f17 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Jun 2025 19:28:22 +0200 Subject: [PATCH 135/434] chore(wit): mark as unmaintained --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 4e3fe466d..9367de7db 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -322,7 +322,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [wgsl](https://github.com/szebniok/tree-sitter-wgsl) | unstable | `HFIJ ` | | @szebniok [wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | | @theHamsta [wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | | @gshpychka, @MarkMcCulloh -[wit](https://github.com/liamwh/tree-sitter-wit) | unstable | `HF J ` | | @liamwh +[wit](https://github.com/liamwh/tree-sitter-wit) | unmaintained | `HF J ` | | @liamwh [xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | | @ObserverOfTime [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | | @ObserverOfTime [xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | | @ValdezFOmar diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ade94c60c..fcfcbd45d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2562,7 +2562,7 @@ return { url = 'https://github.com/liamwh/tree-sitter-wit', }, maintainers = { '@liamwh' }, - tier = 2, + tier = 3, }, xcompose = { install_info = { From 13ddd4d7522ce3e5a1abc0ea34e10ec4e445908a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Jun 2025 10:48:39 +0200 Subject: [PATCH 136/434] feat(swift)!: update parser and queries --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 5 ++--- runtime/queries/swift/folds.scm | 2 +- runtime/queries/swift/highlights.scm | 23 ++++++----------------- runtime/queries/swift/indents.scm | 2 +- runtime/queries/swift/injections.scm | 3 +++ 6 files changed, 14 insertions(+), 23 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 9367de7db..3fa4621d5 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -278,7 +278,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [surface](https://github.com/connorlay/tree-sitter-surface) | unstable | `HFIJ ` | | @connorlay [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | unstable | `HFIJL` | | @amaanq [sway](https://github.com/FuelLabs/tree-sitter-sway.git) | unstable | `HFIJL` | | @ribru17 -[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unmaintained | `HFIJL` | X | @alex-pinkus +[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unstable | `HFIJL` | | @alex-pinkus [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | | @RaafatTurki [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | | @ok-ryoko [t32](https://gitlab.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | | @xasc diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index fcfcbd45d..591fcf25e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2193,12 +2193,11 @@ return { swift = { install_info = { generate = true, - generate_from_json = false, - revision = '99a5241ceac351a4af57bcc3571cef5064bde0a3', + revision = 'ebefe3134fba71f61c1103cbf27047f749f2b587', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, - tier = 3, + tier = 2, }, sxhkdrc = { install_info = { diff --git a/runtime/queries/swift/folds.scm b/runtime/queries/swift/folds.scm index cfbc6d0b1..ca7f72593 100644 --- a/runtime/queries/swift/folds.scm +++ b/runtime/queries/swift/folds.scm @@ -26,7 +26,7 @@ (tuple_expression) ; ( foo + bar ) (array_literal) ; [ foo, bar ] (dictionary_literal) ; [ foo: bar, x: y ] - (lambda_literal) + (lambda_literal) (willset_didset_block) (willset_clause) (didset_clause) diff --git a/runtime/queries/swift/highlights.scm b/runtime/queries/swift/highlights.scm index 5c52ee9d6..b911183d1 100644 --- a/runtime/queries/swift/highlights.scm +++ b/runtime/queries/swift/highlights.scm @@ -158,25 +158,14 @@ ; See https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#Keywords-and-Punctuation [ (diagnostic) - "#available" - "#unavailable" - "#fileLiteral" - "#colorLiteral" - "#imageLiteral" - "#keyPath" - "#selector" - "#externalMacro" + (availability_condition) + (playground_literal) + (key_path_string_expression) + (selector_expression) + (external_macro_definition) ] @function.macro -[ - "#column" - "#dsohandle" - "#fileID" - "#filePath" - "#file" - "#function" - "#line" -] @constant.macro +(special_literal) @constant.macro ; Statements (for_statement diff --git a/runtime/queries/swift/indents.scm b/runtime/queries/swift/indents.scm index 2366c3bd6..21a11bfa5 100644 --- a/runtime/queries/swift/indents.scm +++ b/runtime/queries/swift/indents.scm @@ -33,7 +33,7 @@ (tuple_expression) ; ( foo + bar ) (array_literal) ; [ foo, bar ] (dictionary_literal) ; [ foo: bar, x: y ] - (lambda_literal) + (lambda_literal) (willset_didset_block) (willset_clause) (didset_clause) diff --git a/runtime/queries/swift/injections.scm b/runtime/queries/swift/injections.scm index 19aae904e..6e01e2d4c 100644 --- a/runtime/queries/swift/injections.scm +++ b/runtime/queries/swift/injections.scm @@ -1,3 +1,6 @@ +((regex_literal) @injection.content + (#set! injection.language "regex")) + ([ (comment) (multiline_comment) From 1181cd9a25360194b208bb9296ec26dc16433699 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Jun 2025 13:32:46 +0200 Subject: [PATCH 137/434] feat(verilog)!: rename to systemverilog Grammar name was changed to coincide with repository name --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 16 ++++++++-------- plugin/filetypes.lua | 2 +- .../queries/{verilog => systemverilog}/folds.scm | 0 .../{verilog => systemverilog}/highlights.scm | 0 .../{verilog => systemverilog}/injections.scm | 0 6 files changed, 10 insertions(+), 10 deletions(-) rename runtime/queries/{verilog => systemverilog}/folds.scm (100%) rename runtime/queries/{verilog => systemverilog}/highlights.scm (100%) rename runtime/queries/{verilog => systemverilog}/injections.scm (100%) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 3fa4621d5..a3aabea78 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -281,6 +281,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [swift](https://github.com/alex-pinkus/tree-sitter-swift) | unstable | `HFIJL` | | @alex-pinkus [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | | @RaafatTurki [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | | @ok-ryoko +[systemverilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | unstable | `HF J ` | | @zhangwwpeng [t32](https://gitlab.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | | @xasc [tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | unstable | `HFIJL` | | @amaanq [tact](https://github.com/tact-lang/tree-sitter-tact) | unstable | `HFIJL` | | @novusnota @@ -312,7 +313,6 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [v](https://github.com/vlang/v-analyzer) | unstable | `HFIJL` | | @kkharji, @amaanq [vala](https://github.com/vala-lang/tree-sitter-vala) | unstable | `HF J ` | | @Prince781 [vento](https://github.com/ventojs/tree-sitter-vento) | unstable | `H  J ` | | @wrapperup, @oscarotero -[verilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | unstable | `HF J ` | | @zhangwwpeng [vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | unstable | `HF J ` | | @jpt13653903 [vhs](https://github.com/charmbracelet/tree-sitter-vhs) | unstable | `H  J ` | | @caarlos0 [vim](https://github.com/tree-sitter-grammars/tree-sitter-vim) | unstable | `HF JL` | | @clason diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 591fcf25e..3cc89a884 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2215,6 +2215,14 @@ return { maintainers = { '@ok-ryoko' }, tier = 2, }, + systemverilog = { + install_info = { + revision = 'a412f4a00a6e56c65f519117969c926c35e80ce4', + url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', + }, + maintainers = { '@zhangwwpeng' }, + tier = 2, + }, t32 = { install_info = { revision = '15f0032f3eadf95988293338e883c095fd5936f6', @@ -2473,14 +2481,6 @@ return { maintainers = { '@wrapperup', '@oscarotero' }, tier = 2, }, - verilog = { - install_info = { - revision = 'ba3c1e305caf948f718293c86c6018a82ed5043e', - url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', - }, - maintainers = { '@zhangwwpeng' }, - tier = 2, - }, vhdl = { install_info = { revision = 'eacafa5d612fdea1d12332fe0f83e089e5571cf3', diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index fdfaefe30..ecddea292 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -44,6 +44,7 @@ local filetypes = { ssh_config = { 'sshconfig' }, starlark = { 'bzl' }, surface = { 'sface' }, + systemverilog = { 'verilog' }, t32 = { 'trace32' }, tcl = { 'expect' }, terraform = { 'terraform-vars' }, @@ -56,7 +57,6 @@ local filetypes = { udev = { 'udevrules' }, uxntal = { 'tal', 'uxn' }, v = { 'vlang' }, - verilog = { 'systemverilog' }, vhs = { 'tape' }, xml = { 'xsd', 'xslt', 'svg' }, xresources = { 'xdefaults' }, diff --git a/runtime/queries/verilog/folds.scm b/runtime/queries/systemverilog/folds.scm similarity index 100% rename from runtime/queries/verilog/folds.scm rename to runtime/queries/systemverilog/folds.scm diff --git a/runtime/queries/verilog/highlights.scm b/runtime/queries/systemverilog/highlights.scm similarity index 100% rename from runtime/queries/verilog/highlights.scm rename to runtime/queries/systemverilog/highlights.scm diff --git a/runtime/queries/verilog/injections.scm b/runtime/queries/systemverilog/injections.scm similarity index 100% rename from runtime/queries/verilog/injections.scm rename to runtime/queries/systemverilog/injections.scm From 98459ffcf7dfbeea83081166a2d732a8083a91c2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 24 Jun 2025 12:18:54 +0200 Subject: [PATCH 138/434] fix(health): sort language names --- lua/nvim-treesitter/health.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index e284381dd..b4d0c62d5 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -135,7 +135,8 @@ function M.check() -- Parser installation checks health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J') local languages = config.get_installed() - for _, lang in pairs(languages) do + table.sort(languages) + for _, lang in ipairs(languages) do local parser = parsers[lang] local out = lang .. string.rep(' ', 22 - #lang) if parser and parser.install_info then From 77ba555ceffaedd61ee1034e417368da24b9e540 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 25 Jun 2025 11:55:16 +0200 Subject: [PATCH 139/434] ci: bump luals to 3.15.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 54fb96ed4..15482e03b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NVIM_VERSION ?= nightly -LUALS_VERSION := 3.14.0 +LUALS_VERSION := 3.15.0 DEPDIR ?= .test-deps CURL ?= curl -sL --create-dirs From 7110df63e1172eb9fa98cde61bbd38a4d325f97a Mon Sep 17 00:00:00 2001 From: Eric Mrak Date: Thu, 26 Jun 2025 00:04:48 -0700 Subject: [PATCH 140/434] feat(fish): more builtin commands and variables (#7972) builtin commands: * abbr * path builtin variables: * fish_cursor_* --- runtime/queries/fish/highlights.scm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm index a7c451175..549bceda0 100644 --- a/runtime/queries/fish/highlights.scm +++ b/runtime/queries/fish/highlights.scm @@ -117,10 +117,10 @@ name: [ (word) @function.builtin (#any-of? @function.builtin - "." ":" "_" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" "command" - "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" "exit" "fg" - "functions" "history" "isatty" "jobs" "math" "printf" "pwd" "random" "read" "realpath" "set" - "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait") + "." ":" "_" "abbr" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" + "command" "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" + "exit" "fg" "functions" "history" "isatty" "jobs" "math" "path" "printf" "pwd" "random" "read" + "realpath" "set" "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait") ]) ; Functions @@ -179,11 +179,12 @@ "fish_term24bit" "fish_term256" "fish_ambiguous_width" "fish_emoji_width" "fish_autosuggestion_enabled" "fish_handle_reflow" "fish_key_bindings" "fish_escape_delay_ms" "fish_sequence_key_delay_ms" "fish_complete_path" "fish_cursor_selection_mode" - "fish_function_path" "fish_greeting" "fish_history" "fish_trace" "FISH_DEBUG" - "FISH_DEBUG_OUTPUT" "fish_user_paths" "umask" "BROWSER" "_" "argv" "CMD_DURATION" "COLUMNS" - "LINES" "fish_kill_signal" "fish_killring" "fish_read_limit" "fish_pid" "history" "HOME" - "hostname" "IFS" "last_pid" "PWD" "pipestatus" "SHLVL" "status" "status_generation" "TERM" - "USER" "EUID" "version" "FISH_VERSION")) + "fish_cursor_default" "fish_cursor_insert" "fish_cursor_replace" "fish_cursor_replace_one" + "fish_cursor_visual" "fish_cursor_external" "fish_function_path" "fish_greeting" "fish_history" + "fish_trace" "FISH_DEBUG" "FISH_DEBUG_OUTPUT" "fish_user_paths" "umask" "BROWSER" "_" "argv" + "CMD_DURATION" "COLUMNS" "LINES" "fish_kill_signal" "fish_killring" "fish_read_limit" "fish_pid" + "history" "HOME" "hostname" "IFS" "last_pid" "PWD" "pipestatus" "SHLVL" "status" + "status_generation" "TERM" "USER" "EUID" "version" "FISH_VERSION")) ; Nodes [ From 2e8f8562e6e32bfd4554f38ae00ffd72a2b4515d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 29 Jun 2025 11:34:46 +0200 Subject: [PATCH 141/434] fix(scripts): sort list of updated parsers --- scripts/update-parsers.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update-parsers.lua b/scripts/update-parsers.lua index fb09b9933..83f724970 100755 --- a/scripts/update-parsers.lua +++ b/scripts/update-parsers.lua @@ -83,6 +83,7 @@ if #updates > 0 then end util.write_file('lua/nvim-treesitter/parsers.lua', parser_file) + table.sort(updates) local update_list = table.concat(updates, ', ') print(string.format('\nUpdated parsers: %s', update_list)) -- pass list to workflow From 5948977de47457de10f2b0fb55d851cdf988e2dc Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 29 Jun 2025 11:35:00 +0200 Subject: [PATCH 142/434] feat(parsers): update angular, clojure, gleam, idl, javadoc, jinja, jinja_inline, liquidsoap, nim, nu, poe_filter, r, ssh_config, systemverilog, v --- lua/nvim-treesitter/parsers.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3cc89a884..69ac17aa8 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = '820566bb4eb3d288822dbfee42417a5a9491aea6', + revision = '93bb92f1289b7fe765da6cc747c82ccdc0afeb8d', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -222,7 +222,7 @@ return { }, clojure = { install_info = { - revision = '40c5fc2e2a0f511a802a82002553c5de00feeaf4', + revision = 'be514eec2c86d560c18fab146e9298e21b8eab62', url = 'https://github.com/sogaiu/tree-sitter-clojure', }, maintainers = { '@NoahTheDuke' }, @@ -709,7 +709,7 @@ return { }, gleam = { install_info = { - revision = 'ee93c639dc82148d716919df336ad612fd33538e', + revision = '21e0e7ba6f4f60ee80934cb368aa13c00d370734', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -1011,7 +1011,7 @@ return { }, idl = { install_info = { - revision = 'b14e7971cfbd64fa0ebcdeaa4dfbb3cb0bfabd7c', + revision = 'da50751d826030fcf8b1424de9f56cec2a274b38', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = '3f2ed5575909874927489d2d47a3a2fda36959ee', + revision = 'ac58d03fde1aaf7dbf499e57bfed9ce87e36188d', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1085,7 +1085,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '258d7fb22fa6cd2dc800f201cfdcbe05111a836c', + revision = '251101981d86ccb2901741eddf3e7cf21567a66d', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1096,7 +1096,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '258d7fb22fa6cd2dc800f201cfdcbe05111a836c', + revision = '251101981d86ccb2901741eddf3e7cf21567a66d', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1272,7 +1272,7 @@ return { }, liquidsoap = { install_info = { - revision = '8e51fa63ddb93ac179d4e34a311d3d3f03780b42', + revision = '68e6b247c880d1521f7b454663fb3735609eacf2', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, @@ -1430,7 +1430,7 @@ return { }, nim = { install_info = { - revision = '897e5d346f0b59ed62b517cfb0f1a845ad8f0ab7', + revision = '9ed4696d7f76e4937e2b63512a249a3ead7a0399', url = 'https://github.com/alaviss/tree-sitter-nim', }, maintainers = { '@aMOPel' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = 'b64f0d1c93a76d167fabb01271905f0d18c5f10c', + revision = 'd62bb4a0c78e9476a6dd0081761444f6870252ed', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1619,7 +1619,7 @@ return { }, poe_filter = { install_info = { - revision = '2902dc45439125b9386812c1089a8e9b5f71c4ab', + revision = 'e449216700449f1bccaebbd3820cce794d6fd687', url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', }, maintainers = { '@ObserverOfTime' }, @@ -1798,7 +1798,7 @@ return { }, r = { install_info = { - revision = '95aff097aa927a66bb357f715b58cde821be8867', + revision = '7b4eb04dfcc86e6705cade825f8c1edbd46584b2', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -2118,7 +2118,7 @@ return { }, ssh_config = { install_info = { - revision = '0dd3c7e9f301758f6c69a6efde43d3048deb4d8a', + revision = '2d620d0ad636705800cf0ddb92c30afe703cd84f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', }, maintainers = { '@ObserverOfTime' }, @@ -2217,7 +2217,7 @@ return { }, systemverilog = { install_info = { - revision = 'a412f4a00a6e56c65f519117969c926c35e80ce4', + revision = '3089b3fe310dd6cf9531e5e45f123202053a29a1', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2459,7 +2459,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '0f963ca4c0cc888252f5a31f37c974d5e2527d06', + revision = '5720fd00538ed069b43917fe377ca3fc21c89cb3', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, From 4b2e9b049c288754dcc27fadccce97a1b16c0a53 Mon Sep 17 00:00:00 2001 From: przepompownia Date: Sun, 29 Jun 2025 14:42:16 +0200 Subject: [PATCH 143/434] feat(php): fold array_creation_expression --- runtime/queries/php_only/folds.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/queries/php_only/folds.scm b/runtime/queries/php_only/folds.scm index 43453b174..0c744f88a 100644 --- a/runtime/queries/php_only/folds.scm +++ b/runtime/queries/php_only/folds.scm @@ -14,4 +14,5 @@ (function_static_declaration) (method_declaration) (namespace_use_declaration)+ + (array_creation_expression) ] @fold From dbb63c8b7ae4789a128a4176d9f99bff2cdf1bdf Mon Sep 17 00:00:00 2001 From: przepompownia Date: Sun, 29 Jun 2025 15:37:58 +0200 Subject: [PATCH 144/434] feat(php): fold match_expression --- runtime/queries/php_only/folds.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/queries/php_only/folds.scm b/runtime/queries/php_only/folds.scm index 0c744f88a..7724cea93 100644 --- a/runtime/queries/php_only/folds.scm +++ b/runtime/queries/php_only/folds.scm @@ -15,4 +15,5 @@ (method_declaration) (namespace_use_declaration)+ (array_creation_expression) + (match_expression) ] @fold From 1f069f1bc610493d38276023165075f7424ca7b4 Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Sun, 29 Jun 2025 19:10:29 +0300 Subject: [PATCH 145/434] feat(D): highlight `(string)` etc. as `@keyword.type` (#7978) Co-authored-by: Baruch Even --- runtime/queries/d/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/d/highlights.scm b/runtime/queries/d/highlights.scm index 11d08a1b7..50428d20c 100644 --- a/runtime/queries/d/highlights.scm +++ b/runtime/queries/d/highlights.scm @@ -265,6 +265,9 @@ (creal) (double) (cfloat) + (string) + (dstring) + (wstring) ] @type.builtin ; Functions From 04935dec426a366f097ec8ae78dab6cc02ddafa0 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Thu, 3 Jul 2025 17:10:05 +0200 Subject: [PATCH 146/434] fix: remove import references to jsx/locals.scm There are no JSX locals (yet...?) --- runtime/queries/javascript/locals.scm | 2 +- runtime/queries/tsx/locals.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/queries/javascript/locals.scm b/runtime/queries/javascript/locals.scm index 6d6846fc7..f13db46bf 100644 --- a/runtime/queries/javascript/locals.scm +++ b/runtime/queries/javascript/locals.scm @@ -1,4 +1,4 @@ -; inherits: ecma,jsx +; inherits: ecma ; Both properties are matched here. ; diff --git a/runtime/queries/tsx/locals.scm b/runtime/queries/tsx/locals.scm index 07391231c..1b61e36da 100644 --- a/runtime/queries/tsx/locals.scm +++ b/runtime/queries/tsx/locals.scm @@ -1 +1 @@ -; inherits: typescript,jsx +; inherits: typescript From dafb3cb3cb066774526c1103f3d1d6b34578800b Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 3 Jul 2025 21:13:31 -0300 Subject: [PATCH 147/434] fix(http): prefer folding requests --- runtime/queries/http/folds.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/http/folds.scm b/runtime/queries/http/folds.scm index f7108a551..bd45f8013 100644 --- a/runtime/queries/http/folds.scm +++ b/runtime/queries/http/folds.scm @@ -1,5 +1,5 @@ [ - (section) + (request) (json_body) (variable_declaration)+ ] @fold From 80281c19fd2dacce60958a3c29bab5ab6b721006 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 5 Jul 2025 12:12:53 +0200 Subject: [PATCH 148/434] feat(parsers): update c3, cpp, d, faust, fsharp, javadoc, julia, liquidsoap, meson, mlir, nu, powershell, roc, swift, systemverilog, t32, v --- lua/nvim-treesitter/parsers.lua | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 69ac17aa8..8f7ea231b 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -166,7 +166,7 @@ return { }, c3 = { install_info = { - revision = '6eb8acc275961d137b4b4dd7fe84a19a0680c893', + revision = '5abce05689bf46999c17bd0dcda2f75b8de61d0d', url = 'https://github.com/c3lang/tree-sitter-c3', }, maintainers = { '@cbuttner' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = '56455f4245baf4ea4e0881c5169de69d7edd5ae7', + revision = '2871652b9893ab19e621628da03e670227a5d9d0', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -330,7 +330,7 @@ return { }, d = { install_info = { - revision = '45e5f1e9d6de2c68591bc8e5ec662cf18e950b4a', + revision = 'fb028c8f14f4188286c2eef143f105def6fbf24f', url = 'https://github.com/gdamore/tree-sitter-d', }, maintainers = { '@amaanq' }, @@ -536,7 +536,7 @@ return { }, faust = { install_info = { - revision = 'aa033eb46c3b40e936db5847e0e91445ab606ee4', + revision = '122dd101919289ea809bad643712fcb483a1bed0', url = 'https://github.com/khiner/tree-sitter-faust', }, maintainers = { '@khiner' }, @@ -609,7 +609,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = 'f29605148f24199cf4d9c4a203a5debc0cbcc648', + revision = '5141851c278a99958469eb1736c7afc4ec738e47', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = 'ac58d03fde1aaf7dbf499e57bfed9ce87e36188d', + revision = 'c5b7341f62498ea139d591a5d6f450dc879b53b0', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1159,7 +1159,7 @@ return { }, julia = { install_info = { - revision = '18b739c1563c83fc816170a4241adfa4b69e5c47', + revision = '73d1539a51b8a202d6d2471cc594cf4d7c5e673f', url = 'https://github.com/tree-sitter/tree-sitter-julia', }, maintainers = { '@fredrikekre' }, @@ -1272,7 +1272,7 @@ return { }, liquidsoap = { install_info = { - revision = '68e6b247c880d1521f7b454663fb3735609eacf2', + revision = '05a5dbb23addd207a295b904e44dbdd321b3b332', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, @@ -1382,7 +1382,7 @@ return { }, meson = { install_info = { - revision = '243aa33382d6ac7b8b66d962024d339cb3bae3f6', + revision = '280b6e59186f18528bab1567f5cc43b78b9cd881', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = 'eb78968fdb3728510f9260129a2dd57b7c04f761', + revision = 'ddd4cd2e274813b97624fd3f30803f1db2001474', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = 'd62bb4a0c78e9476a6dd0081761444f6870252ed', + revision = '436b3f94578974d6e0c89c201d4b99329ad0e944', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1637,7 +1637,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '01b67e81917482fb714409a40a8fea8fe21c42f6', + revision = '103a700af551ba8d3402fd68e6f3cd4bf45cbe80', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1918,7 +1918,7 @@ return { }, roc = { install_info = { - revision = '94634c7e882d3c55066aa074cab4911284326deb', + revision = '40e52f343f1b1f270d6ecb2ca898ca9b8cba6936', url = 'https://github.com/faldor20/tree-sitter-roc', }, maintainers = { '@nat-418' }, @@ -2193,7 +2193,7 @@ return { swift = { install_info = { generate = true, - revision = 'ebefe3134fba71f61c1103cbf27047f749f2b587', + revision = 'd8816ef1aae8d1e7cf23adff2ace9d556d4b369f', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2217,7 +2217,7 @@ return { }, systemverilog = { install_info = { - revision = '3089b3fe310dd6cf9531e5e45f123202053a29a1', + revision = '0dc5d86af86120094d9f1268613b529142212ddd', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2225,7 +2225,7 @@ return { }, t32 = { install_info = { - revision = '15f0032f3eadf95988293338e883c095fd5936f6', + revision = '412cf98b2784dfe9c95ce0d7de840605c6953417', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2459,7 +2459,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '5720fd00538ed069b43917fe377ca3fc21c89cb3', + revision = '6c511fc884312720e30ef5d169c63fe5f3d0209f', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, From 0d32ec3c3efd1c26daa47796287e31fdd3307148 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 5 Jul 2025 14:47:35 +0200 Subject: [PATCH 149/434] feat(latex)!: update parser and queries Breaking change: `label_definition`, `label_text` patterns --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/latex/highlights.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8f7ea231b..cf9368840 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1232,7 +1232,7 @@ return { latex = { install_info = { generate = true, - revision = '73c9b8992f72203386092ffd2a05f2dcba02d2cb', + revision = '9410012b3eba659da5de5a655b4041593b493cb7', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm index c39cd1b14..ec39afcf5 100644 --- a/runtime/queries/latex/highlights.scm +++ b/runtime/queries/latex/highlights.scm @@ -87,7 +87,7 @@ (label_definition command: _ @function.macro - name: (curly_group_text + name: (curly_group_label (_) @markup.link @nospell)) (label_reference_range @@ -99,7 +99,7 @@ (label_reference command: _ @function.macro - names: (curly_group_text_list + names: (curly_group_label_list (_) @markup.link)) (label_number From 4400990e7362e2769bb1ff96895f623deb0380fa Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 7 Jul 2025 12:17:33 +0200 Subject: [PATCH 150/434] feat(vim): highlight "trim" in script heredocs Allow the optional "trim", as documented in ":help :lua-heredoc". --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/vim/highlights.scm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index cf9368840..c25daedaa 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2499,7 +2499,7 @@ return { }, vim = { install_info = { - revision = 'ccc312e878aa84f32d180b8528a3585c7b86a545', + revision = 'a93e834bea0975ec0ccb3f6d18540e9bd8170a4d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, diff --git a/runtime/queries/vim/highlights.scm b/runtime/queries/vim/highlights.scm index 20a044a60..c35986fa3 100644 --- a/runtime/queries/vim/highlights.scm +++ b/runtime/queries/vim/highlights.scm @@ -253,6 +253,9 @@ (heredoc (parameter) @keyword) +(script + (parameter) @keyword) + [ (marker_definition) (endmarker) From 3dc6834b30c96b0b11f467136d0a03bb100d868a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 8 Jul 2025 16:53:58 +0200 Subject: [PATCH 151/434] feat(parsers): update blueprint, desktop, fortran, javadoc, llvm, mlir, nu, requirements, superhtml, swift, v, xresources --- lua/nvim-treesitter/parsers.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index c25daedaa..cadffc13f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -133,7 +133,7 @@ return { }, blueprint = { install_info = { - revision = '60ba73739c6083c693d86a1a7cf039c07eb4ed59', + revision = '355ef84ef8a958ac822117b652cf4d49bac16c79', url = 'https://gitlab.com/gabmus/tree-sitter-blueprint', }, maintainers = { '@gabmus' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '5fc42b211b261d7c10f97f2c7fa9665cd0d3c8a0', + revision = '6096afc7b7a9e208036dff9103c71ddfe9580c54', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -592,7 +592,7 @@ return { }, fortran = { install_info = { - revision = '1b08f4c65fb47c76d3532cd3f7432d03abb9ef69', + revision = '7021f9f0f44bbcb7c646b594b6ef8db3ed787f8e', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = 'c5b7341f62498ea139d591a5d6f450dc879b53b0', + revision = 'e3420bd8b3e6fa996348c4bbcf627b812a8c1422', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1280,7 +1280,7 @@ return { }, llvm = { install_info = { - revision = '1ac83114e71839fa67f4cce2f864ebbbdf6e2a4f', + revision = 'badf46daedc7b469f5e849b53f2fb34e881962f1', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = 'ddd4cd2e274813b97624fd3f30803f1db2001474', + revision = '78eb123cab8bb0dfaacb6b1ee617ef3fcc29d8b1', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = '436b3f94578974d6e0c89c201d4b99329ad0e944', + revision = '6810930d133af12aed8fe4557935b635934ab61a', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1877,7 +1877,7 @@ return { }, requirements = { install_info = { - revision = '728910099ddea7f1f94ea95a35a70d1ea76a1639', + revision = 'caeb2ba854dea55931f76034978de1fd79362939', url = 'https://github.com/tree-sitter-grammars/tree-sitter-requirements', }, maintainers = { '@ObserverOfTime' }, @@ -2159,7 +2159,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '13f5a2221cb748bbe50ad702e89362afd5b925a7', + revision = '0b9bd0e8fd6284c0cfca85f7997535fe7f051046', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2193,7 +2193,7 @@ return { swift = { install_info = { generate = true, - revision = 'd8816ef1aae8d1e7cf23adff2ace9d556d4b369f', + revision = '370a4261d702c51d5d830b06bd4c25e44677d01b', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2459,7 +2459,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '6c511fc884312720e30ef5d169c63fe5f3d0209f', + revision = '236d51bba1bccd57fd2950956fbffe5fe0248735', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2583,7 +2583,7 @@ return { }, xresources = { install_info = { - revision = '65d52b286af0b2dd7153e045869a566b33a28f44', + revision = 'db9bf1aeca3e54dd390ae1d3994c665ca7ef5fa2', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 4eb12d7a1f82b6c8db9929bf2c4b38dc3177dd82 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 8 Jul 2025 17:01:38 +0200 Subject: [PATCH 152/434] feat(ziggy,ziggy-schema): update parser and queries Breaking change: ziggy-schema removed "map" node --- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/ziggy_schema/highlights.scm | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index cadffc13f..91ab94f1f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2632,7 +2632,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'fe3bf9389e7ff213cf3548caaf9c6f3d4bb38647', + revision = 'eeb21acc0a369dca503167fe963f4f5a7eda2659', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2641,7 +2641,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'fe3bf9389e7ff213cf3548caaf9c6f3d4bb38647', + revision = 'eeb21acc0a369dca503167fe963f4f5a7eda2659', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, diff --git a/runtime/queries/ziggy_schema/highlights.scm b/runtime/queries/ziggy_schema/highlights.scm index 4e1770127..8555c79cc 100644 --- a/runtime/queries/ziggy_schema/highlights.scm +++ b/runtime/queries/ziggy_schema/highlights.scm @@ -9,9 +9,18 @@ "struct" "root" "enum" - "map" + "null" ] @keyword +(string) @string + +(number) @number + +[ + "true" + "false" +] @boolean + (identifier) @type "?" @type @@ -27,6 +36,7 @@ [ "," + ":" "|" ] @punctuation.delimiter From c9e4edc127a90c3969e1bf5cdeab8892247e9c41 Mon Sep 17 00:00:00 2001 From: Caleb White Date: Thu, 19 Jun 2025 10:42:38 -0500 Subject: [PATCH 153/434] feat(blade): update blade parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/blade/folds.scm | 3 +- runtime/queries/blade/highlights.scm | 21 ++++----- runtime/queries/blade/indents.scm | 16 ++++++- runtime/queries/blade/injections.scm | 66 ++++++++++++++++++++++++---- 5 files changed, 86 insertions(+), 22 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 91ab94f1f..8270b58a5 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -125,7 +125,7 @@ return { }, blade = { install_info = { - revision = 'fbe5f81b54f0f6153961824ce306ffc805134980', + revision = '5dd29dd50fa6c3de0bb5a2d24ec03f99ddb960bf', url = 'https://github.com/EmranMR/tree-sitter-blade', }, maintainers = { '@calebdw' }, diff --git a/runtime/queries/blade/folds.scm b/runtime/queries/blade/folds.scm index cc081a754..07c1fd86f 100644 --- a/runtime/queries/blade/folds.scm +++ b/runtime/queries/blade/folds.scm @@ -1,5 +1,6 @@ +; inherits: html + [ - (authorization) (conditional) (envoy) (fragment) diff --git a/runtime/queries/blade/highlights.scm b/runtime/queries/blade/highlights.scm index c05d2845f..b20999a5f 100644 --- a/runtime/queries/blade/highlights.scm +++ b/runtime/queries/blade/highlights.scm @@ -1,15 +1,16 @@ -([ +; inherits: html + +[ (directive) (directive_start) (directive_end) ] @tag - (#set! priority 101)) -([ - (bracket_start) - (bracket_end) -] @tag.delimiter - (#set! priority 101)) - -((comment) @comment @spell - (#set! priority 101)) +[ + "{{" + "}}" + "{!!" + "!!}" + "(" + ")" +] @punctuation.bracket diff --git a/runtime/queries/blade/indents.scm b/runtime/queries/blade/indents.scm index bd3e84d16..a52bb3697 100644 --- a/runtime/queries/blade/indents.scm +++ b/runtime/queries/blade/indents.scm @@ -1,3 +1,15 @@ -(directive_start) @indent.begin +; inherits: html -(directive_end) @indent.end +[ + (conditional) + (envoy) + (fragment) + (livewire) + (loop) + (once) + (php_statement) + (section) + (stack) + (switch) + (verbatim) +] @indent.begin diff --git a/runtime/queries/blade/injections.scm b/runtime/queries/blade/injections.scm index 12fa9f953..e8a0d708d 100644 --- a/runtime/queries/blade/injections.scm +++ b/runtime/queries/blade/injections.scm @@ -1,15 +1,65 @@ -((text) @injection.content - (#set! injection.combined) - (#set! injection.language html)) +; inherits: html + +((php_only) @injection.content + (#set! injection.language "php_only")) + +((parameter) @injection.content + (#set! injection.include-children) + (#set! injection.language "php_only")) ((text) @injection.content (#has-ancestor? @injection.content "envoy") (#set! injection.combined) (#set! injection.language bash)) -((php_only) @injection.content - (#set! injection.combined) - (#set! injection.language php_only)) +; Livewire attributes +;
+(attribute + (attribute_name) @_attr + (#any-of? @_attr "wire:model" "wire:click" "wire:stream" "wire:text" "wire:show") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")) -((parameter) @injection.content - (#set! injection.language php_only)) +; AlpineJS attributes +;
+(attribute + (attribute_name) @_attr + (#lua-match? @_attr "^x%-%l+") + (#not-any-of? @_attr "x-teleport" "x-ref" "x-transition") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")) + +(attribute + (attribute_name) @_attr + (#lua-match? @_attr "^[:@]%l+") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")) + +; Blade escaped JS attributes +; +(element + (_ + (tag_name) @_tag + (#lua-match? @_tag "^x%-%l+") + (attribute + (attribute_name) @_attr + (#lua-match? @_attr "^::%l+") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "javascript")))) + +; Blade PHP attributes +; +(element + (_ + (tag_name) @_tag + (#lua-match? @_tag "^x%-%l+") + (attribute + (attribute_name) @_attr + (#lua-match? @_attr "^:%l+") + (quoted_attribute_value + (attribute_value) @injection.content) + (#set! injection.language "php_only")))) From c3ecec599b09684d900f4dd888676589a195a719 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 13 Jul 2025 11:31:00 +0200 Subject: [PATCH 154/434] feat(parsers): update beancount, blade, cpp, desktop, gosum, javadoc, liquidsoap, mlir, nix, slint, systemverilog, t32, vim, xresources --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8270b58a5..4bd000d80 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -93,7 +93,7 @@ return { }, beancount = { install_info = { - revision = '9bc460a05b5f096d69568b5fb36105032ff4ff97', + revision = '97b46e5f37aa9030e9701c816e20760760ab4907', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -125,7 +125,7 @@ return { }, blade = { install_info = { - revision = '5dd29dd50fa6c3de0bb5a2d24ec03f99ddb960bf', + revision = '59ce5b68e288002e3aee6cf5a379bbef21adbe6c', url = 'https://github.com/EmranMR/tree-sitter-blade', }, maintainers = { '@calebdw' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = '2871652b9893ab19e621628da03e670227a5d9d0', + revision = '5cb9b693cfd7bfacab1d9ff4acac1a4150700609', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '6096afc7b7a9e208036dff9103c71ddfe9580c54', + revision = 'deb91f587c97814058aea2cbd790e0b85c9bb361', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -803,7 +803,7 @@ return { }, gosum = { install_info = { - revision = 'e2ac513b2240c7ff1069ae33b2df29ce90777c11', + revision = '27816eb6b7315746ae9fcf711e4e1396dc1cf237', url = 'https://github.com/tree-sitter-grammars/tree-sitter-go-sum', }, maintainers = { '@amaanq' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = 'e3420bd8b3e6fa996348c4bbcf627b812a8c1422', + revision = '1a55fc4c0f9c24cf927a84cb7d382665523d45c5', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1272,7 +1272,7 @@ return { }, liquidsoap = { install_info = { - revision = '05a5dbb23addd207a295b904e44dbdd321b3b332', + revision = '4de01f44de2c051c33832ce523cf44690561320d', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = '78eb123cab8bb0dfaacb6b1ee617ef3fcc29d8b1', + revision = '36f08b4c39997ee7b864ddeff1c64e5507be438e', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1455,7 +1455,7 @@ return { }, nix = { install_info = { - revision = 'cfc53fd287d23ab7281440a8526c73542984669b', + revision = 'cd4f6594508c820dca196d931c6bd4d21ef18520', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -2027,7 +2027,7 @@ return { }, slint = { install_info = { - revision = '03f24aa22d6712f79004286df6dd416ca6d2a91d', + revision = '6ee7d053feabfff5d401491043a7286e30ffd7a8', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2217,7 +2217,7 @@ return { }, systemverilog = { install_info = { - revision = '0dc5d86af86120094d9f1268613b529142212ddd', + revision = '48dfe3c2579b851e1ef38a326b0aee9900afb9ae', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2225,7 +2225,7 @@ return { }, t32 = { install_info = { - revision = '412cf98b2784dfe9c95ce0d7de840605c6953417', + revision = '55b387ceead98ceaf38878ecc88f280e7f56f64c', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2499,7 +2499,7 @@ return { }, vim = { install_info = { - revision = 'a93e834bea0975ec0ccb3f6d18540e9bd8170a4d', + revision = '3dd4747082d1b717b8978211c06ef7b6cd16125b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, @@ -2583,7 +2583,7 @@ return { }, xresources = { install_info = { - revision = 'db9bf1aeca3e54dd390ae1d3994c665ca7ef5fa2', + revision = '9901f4f25f656a58bc7129098371d99279717efe', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 6c2234f7ba98ee8fec3b079939449a2d3e5c16b6 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Mon, 14 Jul 2025 17:48:23 -0700 Subject: [PATCH 155/434] feat(c_sharp): highlight `::` (#8002) --- runtime/queries/c_sharp/highlights.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm index f23d7ec65..5055990b0 100644 --- a/runtime/queries/c_sharp/highlights.scm +++ b/runtime/queries/c_sharp/highlights.scm @@ -439,6 +439,7 @@ "." "," ":" + "::" ] @punctuation.delimiter (conditional_expression From 96f51adf716c2e289e88b9e291faa393c03f85c9 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Mon, 14 Jul 2025 17:55:29 -0700 Subject: [PATCH 156/434] fix(c_sharp): "<", ">" in type param lists are brackets (#8003) --- runtime/queries/c_sharp/highlights.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm index 5055990b0..ce9911151 100644 --- a/runtime/queries/c_sharp/highlights.scm +++ b/runtime/queries/c_sharp/highlights.scm @@ -459,6 +459,12 @@ (interpolation_brace) @punctuation.special +(type_parameter_list + [ + "<" + ">" + ] @punctuation.bracket) + (type_argument_list [ "<" From 8d8ca0996c79348cd59cf31065954f40fcf1679f Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 29 Jun 2025 19:53:33 +0200 Subject: [PATCH 157/434] docs: specify fold dos and don'ts --- CONTRIBUTING.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f665ce1ed..f376ed802 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -345,12 +345,35 @@ The valid captures are: ### Folds -You can define folds for a given language by adding a `folds.scm` query. This is implemented in Neovim. The only valid capture is +You can define folds for a given language by adding a `folds.scm` query. This is implemented in Neovim. The only valid capture is `@fold`: ```query -@fold ; fold this node +(function_definition) @fold ; fold this node ``` +Folds should be given to nodes with defined start and end delimiters/patterns, or to consecutive nodes which are part of the same conceptual "grouping", such as consecutive line comments or import statements. The following items are valid fold candidates: + +- Function/method definitions +- Class/interface/trait definitions +- Switch/match statements, and individual match arms +- Execution blocks (such as those found in conditional statements or loops) +- Parameter/argument lists +- Array/object/string expressions +- Consecutive import statements, consecutive line comments + +The following items would *not* be valid fold candidates: + +- Multiline assignment statements +- Multiline property access expressions + +As a rule of thumb, these highlight captures usually reside in or around objects which should be folded: + +- `@function`, `@function.method` +- `@keyword.import`, `@keyword.conditional`, `@keyword.repeat` +- `@comment`, `@comment.documentation` +- `@string`, `@string.documentation` +- `@markup.heading.x`, `@markup.list` + ### Indents >[!WARNING] From 992e9ef3d09c3a52adf847c426b52e32bafad519 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Tue, 15 Jul 2025 09:37:41 -0700 Subject: [PATCH 158/434] ci: ensure parsers have a supported ABI version --- .tsqueryrc.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.tsqueryrc.json b/.tsqueryrc.json index 6d020e987..e8e7fd920 100644 --- a/.tsqueryrc.json +++ b/.tsqueryrc.json @@ -1,6 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json", "parser_install_directories": ["${HOME}/.local/share/nvim/site/parser"], + "supported_abi_versions": { + "start": 13, + "end": 15 + }, "parser_aliases": { "html_tags": "html", "ecma": "javascript", From a5edb0a274d0881dcb4670e2f9e06d2a146f74dd Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 17 Jul 2025 11:37:40 +0200 Subject: [PATCH 159/434] feat(parsers): update arduino, editorconfig, gdscript, idl, javadoc, koto, matlab, mlir, nix, nu, powershell, printf, properties, slint, superhtml, systemverilog, t32, tera, twig, xcompose, xresources, ziggy, ziggy_schema --- lua/nvim-treesitter/parsers.lua | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4bd000d80..ba034d42b 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -36,7 +36,7 @@ return { }, arduino = { install_info = { - revision = '017696bdf47ca2b10948c5a511f9ab387722d0f3', + revision = '1b1fd5dbd196e80342cf79f6fc5de154232c2829', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '9281e7d8522cc0d06b61f97920e27936fa12be11', + revision = '8ed36589b5d0b3ebfdba45e1fd0ebefa01aafaea', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = '2ed3ef9e30a7998a98eea4dfbcd308678f93b88f', + revision = 'cfe20d13767bdede420a6349077fc7dca11c9ad1', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -1011,7 +1011,7 @@ return { }, idl = { install_info = { - revision = 'da50751d826030fcf8b1424de9f56cec2a274b38', + revision = 'd5d7f57dd303b35169bd38c3a2268a24d3d76e38', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1067,7 +1067,7 @@ return { }, javadoc = { install_info = { - revision = '1a55fc4c0f9c24cf927a84cb7d382665523d45c5', + revision = '51cbb3daa9b8a5ba9d6467db40ef45682a06811f', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1207,7 +1207,7 @@ return { }, koto = { install_info = { - revision = '620ff8a32143f24f6f8e157bd1836183599d334d', + revision = 'c379c2c0fdc68e56bb1efe0d933b8fcdf9ff203c', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1359,7 +1359,7 @@ return { }, matlab = { install_info = { - revision = 'd5fd97c7aec0881d3429642a240ad536c74582b9', + revision = 'c9abaedbc342e6c421fd37d8aa4d43389da0834a', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1391,7 +1391,7 @@ return { mlir = { install_info = { generate = true, - revision = '36f08b4c39997ee7b864ddeff1c64e5507be438e', + revision = '98b7d2c6d69c0c83e44386a40ede09924e658189', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1455,7 +1455,7 @@ return { }, nix = { install_info = { - revision = 'cd4f6594508c820dca196d931c6bd4d21ef18520', + revision = 'bae4c4fb39a4cc87a838817c5e2da7effac75183', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1471,7 +1471,7 @@ return { }, nu = { install_info = { - revision = '6810930d133af12aed8fe4557935b635934ab61a', + revision = '6544c4383643cf8608d50def2247a7af8314e148', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1637,7 +1637,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '103a700af551ba8d3402fd68e6f3cd4bf45cbe80', + revision = 'b59f9dd34f17998139877316995e796073faf84b', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1645,7 +1645,7 @@ return { }, printf = { install_info = { - revision = 'df6b69967db7d74ab338a86a9ab45c0966c5ee3c', + revision = 'ec4e5674573d5554fccb87a887c97d4aec489da7', url = 'https://github.com/tree-sitter-grammars/tree-sitter-printf', }, maintainers = { '@ObserverOfTime' }, @@ -1688,7 +1688,7 @@ return { }, properties = { install_info = { - revision = '579b62f5ad8d96c2bb331f07d1408c92767531d9', + revision = '6310671b24d4e04b803577b1c675d765cbd5773b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-properties', }, maintainers = { '@ObserverOfTime' }, @@ -2027,7 +2027,7 @@ return { }, slint = { install_info = { - revision = '6ee7d053feabfff5d401491043a7286e30ffd7a8', + revision = '96bc969d20ff347030519184ea2467f4046a524d', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2159,7 +2159,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '0b9bd0e8fd6284c0cfca85f7997535fe7f051046', + revision = 'a67317fb81afe76cc04e6d92124cfc20a903cee7', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2217,7 +2217,7 @@ return { }, systemverilog = { install_info = { - revision = '48dfe3c2579b851e1ef38a326b0aee9900afb9ae', + revision = 'e5a589a76ce480db5a939ad4a4393c398eed35e9', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2225,7 +2225,7 @@ return { }, t32 = { install_info = { - revision = '55b387ceead98ceaf38878ecc88f280e7f56f64c', + revision = '2fcca1fd8d84c582478f1aebca7c8379346f3a04', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2274,7 +2274,7 @@ return { }, tera = { install_info = { - revision = '53ca9100f231b72474225d98c9e53d1a4275046d', + revision = 'c0a0ebcd70a0e6a9f9ec1157308e4e0ea18b446e', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2375,7 +2375,7 @@ return { }, twig = { install_info = { - revision = '085648e01d1422163a1702a44e72303b4e2a0bd1', + revision = '7195ee573ab5c3b3bb0e91b042e6f83ac1b11104', url = 'https://github.com/gbprod/tree-sitter-twig', }, maintainers = { '@gbprod' }, @@ -2565,7 +2565,7 @@ return { }, xcompose = { install_info = { - revision = 'fff3e72242aa110ebba6441946ea4d12d200fa68', + revision = 'a51d6366f041dbefec4da39a7eb3168a9b1cbc0e', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xcompose', }, maintainers = { '@ObserverOfTime' }, @@ -2583,7 +2583,7 @@ return { }, xresources = { install_info = { - revision = '9901f4f25f656a58bc7129098371d99279717efe', + revision = 'b0822f2ea47600c6e11ee64b2dec8353c9684e8d', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, @@ -2632,7 +2632,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'eeb21acc0a369dca503167fe963f4f5a7eda2659', + revision = 'de703372b2da6fd2c25a8a3c424663ff6bece4ac', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2641,7 +2641,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'eeb21acc0a369dca503167fe963f4f5a7eda2659', + revision = 'de703372b2da6fd2c25a8a3c424663ff6bece4ac', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, From 61ec748ef7624b1962f392191aad61b91c0f9829 Mon Sep 17 00:00:00 2001 From: Alan Russell Date: Fri, 18 Jul 2025 17:04:42 +0100 Subject: [PATCH 160/434] feat(groq): add parser and queries (#8008) --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 +++ runtime/queries/ecma/injections.scm | 11 +++ runtime/queries/groq/folds.scm | 5 ++ runtime/queries/groq/highlights.scm | 104 ++++++++++++++++++++++++++++ runtime/queries/groq/indents.scm | 11 +++ runtime/queries/groq/injections.scm | 2 + 7 files changed, 142 insertions(+) create mode 100644 runtime/queries/groq/folds.scm create mode 100644 runtime/queries/groq/highlights.scm create mode 100644 runtime/queries/groq/indents.scm create mode 100644 runtime/queries/groq/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a3aabea78..ded6c7a66 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -117,6 +117,7 @@ ecma (queries only)[^ecma] | unstable | `HFIJL` | | @steelsojka [graphql](https://github.com/bkegley/tree-sitter-graphql) | unstable | `H IJ ` | | @bkegley [gren](https://github.com/MaeBrooks/tree-sitter-gren) | unstable | `H  J ` | | @MaeBrooks [groovy](https://github.com/murtaza64/tree-sitter-groovy) | unstable | `HFIJL` | | @murtaza64 +[groq](https://github.com/ajrussellaudio/tree-sitter-groq) | unstable | `HFIJ ` | | @ajrussellaudio [gstlaunch](https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch) | unstable | `H    ` | | @theHamsta [hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H  J ` | | [hare](https://github.com/tree-sitter-grammars/tree-sitter-hare) | unstable | `HFIJL` | | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ba034d42b..ef84595de 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -857,6 +857,14 @@ return { maintainers = { '@murtaza64' }, tier = 2, }, + groq = { + install_info = { + revision = '9959049ddeb4416101653a071ee923ba9f7a5cb1', + url = 'https://github.com/ajrussellaudio/tree-sitter-groq', + }, + maintainers = { '@ajrussellaudio' }, + tier = 2, + }, gstlaunch = { install_info = { revision = '549aef253fd38a53995cda1bf55c501174372bf7', diff --git a/runtime/queries/ecma/injections.scm b/runtime/queries/ecma/injections.scm index 04abafcde..669c75671 100644 --- a/runtime/queries/ecma/injections.scm +++ b/runtime/queries/ecma/injections.scm @@ -48,6 +48,17 @@ (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children)) +; Sanity CMS GROQ query +; defineQuery(`...`) +(call_expression + function: (identifier) @_name + (#eq? @_name "defineQuery") + arguments: (arguments + (template_string) @injection.content) + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "groq")) + (call_expression function: (identifier) @_name (#eq? @_name "gql") diff --git a/runtime/queries/groq/folds.scm b/runtime/queries/groq/folds.scm new file mode 100644 index 000000000..1eb05837d --- /dev/null +++ b/runtime/queries/groq/folds.scm @@ -0,0 +1,5 @@ +[ + (object) + (projection) + (array) +] @fold diff --git a/runtime/queries/groq/highlights.scm b/runtime/queries/groq/highlights.scm new file mode 100644 index 000000000..e320e42c3 --- /dev/null +++ b/runtime/queries/groq/highlights.scm @@ -0,0 +1,104 @@ +; Keywords +[ + "select" + "asc" + "desc" +] @keyword + +[ + "in" + "match" +] @keyword.operator + +; Operators +[ + "==" + "!=" + ">" + ">=" + "<" + "<=" + "&&" + "||" + "!" + "+" + "-" + "*" + "/" + "%" + "**" + ".." + "..." + "=>" + "->" + "|" +] @operator + +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + ":" + "." +] @punctuation.delimiter + +; Literals +(string) @string + +(number) @number + +[ + (true) + (false) +] @boolean + +; Special references +[ + (null) + (star) + (parent) + (this) +] @constant.builtin + +; Identifiers +(identifier) @variable + +; Parameters +(parameter + "$" @variable.parameter + (identifier) @variable.parameter) + +; Function calls +(function_call + (identifier) @function) + +(order_function + "order" @function.builtin) + +; Comments +(comment) @comment @spell + +; String keys in projections/objects +(pair + (literal + (string) @property)) + +; Highlight field names in projections +(projection + (identifier) @property) + +; Built-in functions (essential GROQ functions) +(function_call + (identifier) @function.builtin + (#any-of? @function.builtin + "count" "length" "defined" "references" "now" "dateTime" "coalesce" "unique" "max" "min" "sum" + "avg" "round" "floor" "ceil" "abs" "sqrt" "upper" "lower" "string" "number" "boolean" "array" + "object" "type" "global" "sanity" "path" "delta" "after" "before")) diff --git a/runtime/queries/groq/indents.scm b/runtime/queries/groq/indents.scm new file mode 100644 index 000000000..b8ce9713d --- /dev/null +++ b/runtime/queries/groq/indents.scm @@ -0,0 +1,11 @@ +[ + (object) + (projection) +] @indent.begin + +[ + "{" + "}" +] @indent.branch + +"}" @indent.end diff --git a/runtime/queries/groq/injections.scm b/runtime/queries/groq/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/groq/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) From fba060b623f32c6d2e72a2d2954beb87433aecea Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 19 Jul 2025 02:36:38 -0700 Subject: [PATCH 161/434] feat(pkl): add parser and queries (#8011) --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++ runtime/queries/pkl/folds.scm | 6 + runtime/queries/pkl/highlights.scm | 203 +++++++++++++++++++++++++++++ runtime/queries/pkl/injections.scm | 6 + 5 files changed, 224 insertions(+) create mode 100644 runtime/queries/pkl/folds.scm create mode 100644 runtime/queries/pkl/highlights.scm create mode 100644 runtime/queries/pkl/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ded6c7a66..764b96e3c 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -208,6 +208,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | unstable | `HFIJL` | | @tk-shirasaka, @calebdw [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unstable | `H    ` | | @mikehaertl [pioasm](https://github.com/leo60228/tree-sitter-pioasm) | unstable | `H  J ` | | @leo60228 +[pkl](https://github.com/apple/tree-sitter-pkl) | unstable | `HF J ` | | @ribru17 [po](https://github.com/tree-sitter-grammars/tree-sitter-po) | unstable | `HF J ` | | @amaanq [pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | unstable | `H    ` | | @RabbiVeesh, @LeoNerd [poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | | @ObserverOfTime diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ef84595de..5c611a3f8 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1608,6 +1608,14 @@ return { maintainers = { '@leo60228' }, tier = 2, }, + pkl = { + install_info = { + revision = '4fc94a102c25ea383d70397dac7e677ca3731f1e', + url = 'https://github.com/apple/tree-sitter-pkl', + }, + maintainers = { '@ribru17' }, + tier = 2, + }, po = { install_info = { revision = 'bd860a0f57f697162bf28e576674be9c1500db5e', diff --git a/runtime/queries/pkl/folds.scm b/runtime/queries/pkl/folds.scm new file mode 100644 index 000000000..385c4ceb9 --- /dev/null +++ b/runtime/queries/pkl/folds.scm @@ -0,0 +1,6 @@ +[ + (clazz) + (objectBody) +] @fold + +(importClause)+ @fold diff --git a/runtime/queries/pkl/highlights.scm b/runtime/queries/pkl/highlights.scm new file mode 100644 index 000000000..bc7e72757 --- /dev/null +++ b/runtime/queries/pkl/highlights.scm @@ -0,0 +1,203 @@ +(identifier) @variable + +(qualifiedAccessExpr + (identifier) @function.method.call + . + (argumentList)) + +(qualifiedAccessExpr + (identifier) @variable.member .) + +; Operators +[ + "??" + "@" + "=" + "<" + ">" + "!" + "==" + "!=" + "<=" + ">=" + "&&" + "||" + "+" + "-" + "**" + "*" + "/" + "~/" + "%" + "|>" + "..." + "|" + "->" +] @operator + +[ + "," + ":" + "." + "?." +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +; Types +(clazz + (identifier) @type.definition) + +(typeAlias + (identifier) @type.definition) + +((identifier) @type + (#lua-match? @type "^[A-Z]")) + +(typeArgumentList + [ + "<" + ">" + ] @punctuation.bracket) + +; Method definitions +(classMethod + (methodHeader + (identifier) @function.method)) + +(objectMethod + (methodHeader + (identifier) @function.method)) + +; Identifiers +(classProperty + (identifier) @property) + +(objectProperty + (identifier) @property) + +(parameterList + (typedIdentifier + (identifier) @variable.parameter)) + +(objectBodyParameters + (typedIdentifier + (identifier) @variable.parameter)) + +; Literals +[ + (stringConstant) + (slStringLiteralExpr) + (mlStringLiteralExpr) +] @string + +(escapeSequence) @string.escape + +(intLiteralExpr) @number + +(floatLiteralExpr) @number.float + +(stringInterpolation + [ + "\\(" + "\\#(" + "\\##(" + "\\###(" + "\\####(" + "\\#####(" + "\\######(" + ] @punctuation.special + ")" @punctuation.special) + +(nullableType + "?" @punctuation.special) + +[ + (lineComment) + (blockComment) +] @comment @spell + +(docComment) @comment.documentation @spell + +(shebangComment) @keyword.directive + +; Keywords +[ + "abstract" + "external" + "for" + "is" + "let" + "new" + "out" +] @keyword + +"function" @keyword.function + +[ + "as" + "in" +] @keyword.operator + +[ + "typealias" + "class" + "module" +] @keyword.type + +[ + "import" + "import*" + "amends" + "extends" +] @keyword.import + +[ + "when" + "if" + "else" +] @keyword.conditional + +(modifier) @keyword.modifier + +(importExpr + [ + "import" + "import*" + ] @function.builtin) + +(moduleExpr + "module" @type.builtin) + +[ + (outerExpr) + "super" + (thisExpr) +] @variable.builtin + +[ + "read" + "read?" + "read*" + "throw" + "trace" +] @function.builtin + +(nullLiteralExpr) @constant.builtin + +[ + (falseLiteralExpr) + (trueLiteralExpr) +] @boolean + +(newExpr + (declaredType + (qualifiedIdentifier + (identifier) @constructor .))) diff --git a/runtime/queries/pkl/injections.scm b/runtime/queries/pkl/injections.scm new file mode 100644 index 000000000..9d563b440 --- /dev/null +++ b/runtime/queries/pkl/injections.scm @@ -0,0 +1,6 @@ +([ + (lineComment) + (blockComment) + (docComment) +] @injection.content + (#set! injection.language "comment")) From a98e67ad40e4ac97deee8ea97ce2d1c8c27352cc Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 19 Jul 2025 15:00:01 +0200 Subject: [PATCH 162/434] fix(wit): update repo url --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 764b96e3c..8c6cd3ace 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -324,7 +324,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [wgsl](https://github.com/szebniok/tree-sitter-wgsl) | unstable | `HFIJ ` | | @szebniok [wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | | @theHamsta [wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | | @gshpychka, @MarkMcCulloh -[wit](https://github.com/liamwh/tree-sitter-wit) | unmaintained | `HF J ` | | @liamwh +[wit](https://github.com/bytecodealliance/tree-sitter-wit) | unstable | `HF J ` | | @liamwh [xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | | @ObserverOfTime [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | | @ObserverOfTime [xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | | @ValdezFOmar diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 5c611a3f8..b1d21fbd5 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2574,10 +2574,10 @@ return { wit = { install_info = { revision = '37bf43c7f11d2b4af7a78d98a19e6d5c2cf04ad2', - url = 'https://github.com/liamwh/tree-sitter-wit', + url = 'https://github.com/bytecodealliance/tree-sitter-wit', }, maintainers = { '@liamwh' }, - tier = 3, + tier = 2, }, xcompose = { install_info = { From 1e3b7562c2497ec5a9adfa8a2f036cb3da46ec3a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 19 Jul 2025 15:15:04 +0200 Subject: [PATCH 163/434] feat(wit)!: update parser and queries --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/wit/folds.scm | 9 ++------- runtime/queries/wit/highlights.scm | 23 ++++++++++++++--------- runtime/queries/wit/injections.scm | 5 ++++- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 8c6cd3ace..cd6846f25 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -324,7 +324,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [wgsl](https://github.com/szebniok/tree-sitter-wgsl) | unstable | `HFIJ ` | | @szebniok [wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | | @theHamsta [wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | | @gshpychka, @MarkMcCulloh -[wit](https://github.com/bytecodealliance/tree-sitter-wit) | unstable | `HF J ` | | @liamwh +[wit](https://github.com/bytecodealliance/tree-sitter-wit) | unstable | `HF J ` | | @mkatychev [xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | | @ObserverOfTime [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | | @ObserverOfTime [xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | | @ValdezFOmar diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b1d21fbd5..aa9009430 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2573,10 +2573,10 @@ return { }, wit = { install_info = { - revision = '37bf43c7f11d2b4af7a78d98a19e6d5c2cf04ad2', + revision = 'a0fd28afe24511160f0601ab45044690c1cb7d92', url = 'https://github.com/bytecodealliance/tree-sitter-wit', }, - maintainers = { '@liamwh' }, + maintainers = { '@mkatychev' }, tier = 2, }, xcompose = { diff --git a/runtime/queries/wit/folds.scm b/runtime/queries/wit/folds.scm index 7f84ddd2e..d2a12f122 100644 --- a/runtime/queries/wit/folds.scm +++ b/runtime/queries/wit/folds.scm @@ -1,11 +1,6 @@ -[ - (world_items) - (world_body) - (interface_items) - (interface_body) -] @fold +(body) @fold -(world_items +(body [ (use_item) (import_item) diff --git a/runtime/queries/wit/highlights.scm b/runtime/queries/wit/highlights.scm index 1f4b01cce..6bccf5ba0 100644 --- a/runtime/queries/wit/highlights.scm +++ b/runtime/queries/wit/highlights.scm @@ -1,12 +1,10 @@ -(comment) @comment @spell - (ty (id)) @type (package_decl (id) @module) -(valid_semver) @string.special +(version) @string.special (world_item name: (id) @module) @@ -17,7 +15,7 @@ (import_item name: (id) @module (extern_type - (interface_body))) + (body))) (import_item name: (id) @function @@ -27,7 +25,7 @@ (export_item name: (id) @module (extern_type - (interface_body))) + (body))) (export_item name: (id) @function @@ -55,7 +53,7 @@ (flags_items name: (id) @type) -(flags_body +(body (id) @variable.member) (variant_items @@ -128,8 +126,6 @@ "s64" "f32" "f64" - "float32" ; deprecated - "float64" ; deprecated "char" "bool" "string" @@ -163,4 +159,13 @@ "<" ] @punctuation.bracket -"=" @operator +[ + (line_comment) + (block_comment) +] @comment @spell + +(line_comment + (doc_comment)) @comment.documentation + +(block_comment + (doc_comment)) @comment.documentation diff --git a/runtime/queries/wit/injections.scm b/runtime/queries/wit/injections.scm index 2f0e58eb6..3cd6aac8e 100644 --- a/runtime/queries/wit/injections.scm +++ b/runtime/queries/wit/injections.scm @@ -1,2 +1,5 @@ -((comment) @injection.content +([ + (line_comment) + (block_comment) +] @injection.content (#set! injection.language "comment")) From 20d77c2e5ba71315dee7dcf47456557413b1481e Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 17 Jul 2025 22:12:23 -0400 Subject: [PATCH 164/434] fix(jinja): assign highlights to all variables and functions The majority of jinja variables aren't assigned any highlights at all. Assign @variable to all identifiers. Jinja filters without parameters are not highlighted as functions: add a query for these. Refine the existing @variable.member to only capture identifiers instead of broader nodes. --- runtime/queries/jinja_inline/highlights.scm | 30 ++++++++++++++++---- tests/query/highlights/jinja/filters.jinja | 19 +++++++++++++ tests/query/highlights/jinja/tests.jinja | 13 +++++++++ tests/query/highlights/jinja/variables.jinja | 21 ++++++++++++++ 4 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 tests/query/highlights/jinja/filters.jinja create mode 100644 tests/query/highlights/jinja/tests.jinja create mode 100644 tests/query/highlights/jinja/variables.jinja diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index 69dba77b3..3a9660471 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -71,11 +71,7 @@ "as" ] @keyword.import -(import_statement - (identifier) @variable) - -(import_as - (identifier) @variable) +(identifier) @variable [ "if" @@ -109,12 +105,34 @@ (expression "." - (expression)+ @variable.member) + (expression + (binary_expression + . + (unary_expression + (primary_expression + (identifier) @variable.member))))) + +(expression + "." + (expression + (binary_expression + (binary_expression + (unary_expression + (primary_expression + (identifier) @variable.member)))))) (assignment_expression "." (identifier)+ @variable.member) +; jinja filters +(binary_expression + (binary_operator + "|") + (unary_expression + (primary_expression + (identifier) @function.call))) + (inline_trans "_" @function.builtin) diff --git a/tests/query/highlights/jinja/filters.jinja b/tests/query/highlights/jinja/filters.jinja new file mode 100644 index 000000000..a084cdc1a --- /dev/null +++ b/tests/query/highlights/jinja/filters.jinja @@ -0,0 +1,19 @@ +{{ name|striptags|title }} +{# ^^^^ @variable #} +{# ^^^^^ @function.call #} +{# ^^^^^ @function.call #} + +{{ listx|join(', ') }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^^ @string #} + +{{ listx|join(str) }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^ @variable.parameter #} + +{{ foo.bar|random }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^^^^ @function.call #} diff --git a/tests/query/highlights/jinja/tests.jinja b/tests/query/highlights/jinja/tests.jinja new file mode 100644 index 000000000..0a138fb80 --- /dev/null +++ b/tests/query/highlights/jinja/tests.jinja @@ -0,0 +1,13 @@ +{% if loop.index is divisibleby 3 %} +{# ^^^^ @variable #} +{# ^^^^^ @variable.member #} +{# ^^^^^^^^^^ @keyword.operator #} + +{% if loop.index is divisibleby(3) %} +{# ^^^^ @variable #} +{# ^^^^^ @variable.member #} + +{% if foo.bar.baz is divisibleby 3 %} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^ @variable.member #} diff --git a/tests/query/highlights/jinja/variables.jinja b/tests/query/highlights/jinja/variables.jinja new file mode 100644 index 000000000..1ab78c35a --- /dev/null +++ b/tests/query/highlights/jinja/variables.jinja @@ -0,0 +1,21 @@ +{{ foo }} +{# ^^^ @variable #} + +{{ foo.bar }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} + +{{ foo['bar'] }} +{# ^^^ @variable #} +{# ^^^^^ @string #} + +{{ foo.bar.baz }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^ @variable.member #} + +{{ foo.bar + baz.qux }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^ @variable #} +{# ^^^ @variable.member #} From d6bce02b89eb8f0d7ef4b128238d03a87aaf584b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 20 Jul 2025 11:38:50 +0200 Subject: [PATCH 165/434] feat(parsers): update beancount, brightscript, enforce, gdscript, gpg, groq, matlab, mlir, nix, pem, pymanifest, t32, udev, vhdl --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index aa9009430..3710da058 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -93,7 +93,7 @@ return { }, beancount = { install_info = { - revision = '97b46e5f37aa9030e9701c816e20760760ab4907', + revision = 'b8309e6856fe207f0425efa4f7a1d1f27890f8e8', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -150,7 +150,7 @@ return { }, brightscript = { install_info = { - revision = '48ce1687125c6dfefcc7a1bef19fa0f0f00426cc', + revision = '55168264ea174085d2e91377a33f216190df2f51', url = 'https://github.com/ajdelcimmuto/tree-sitter-brightscript', }, maintainers = { '@ajdelcimmuto' }, @@ -512,7 +512,7 @@ return { }, enforce = { install_info = { - revision = '8e4c84144153deaf2b8461def43126cea6790020', + revision = 'a194046e64bdec2c9e2e1a7caa35326387f78b95', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = 'cfe20d13767bdede420a6349077fc7dca11c9ad1', + revision = 'c370d711dc9ead679d40bb7e9364ceed0b3bfc28', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -827,7 +827,7 @@ return { }, gpg = { install_info = { - revision = '63e80cfe1302da9f9c7ee8d9df295f47d7d181bf', + revision = '50482a322cf1fa00dfe327ef8b00e4607eeeaa1d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', }, maintainers = { '@ObserverOfTime' }, @@ -859,7 +859,7 @@ return { }, groq = { install_info = { - revision = '9959049ddeb4416101653a071ee923ba9f7a5cb1', + revision = '1fa1ab0eb391a270957e8ad8c731b492e3645649', url = 'https://github.com/ajrussellaudio/tree-sitter-groq', }, maintainers = { '@ajrussellaudio' }, @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = 'c9abaedbc342e6c421fd37d8aa4d43389da0834a', + revision = 'dfed7b4bc548f2c036837c3e7e09cae7d1835289', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = '98b7d2c6d69c0c83e44386a40ede09924e658189', + revision = 'e2818d616fc43cbbba316723cbd68a53c66a2704', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1463,7 +1463,7 @@ return { }, nix = { install_info = { - revision = 'bae4c4fb39a4cc87a838817c5e2da7effac75183', + revision = 'ea1d87f7996be1329ef6555dcacfa63a69bd55c6', url = 'https://github.com/cstrahan/tree-sitter-nix', }, maintainers = { '@leo60228' }, @@ -1556,7 +1556,7 @@ return { }, pem = { install_info = { - revision = '1d16b8e063fdf4385e389096c4bc4999eaaef05f', + revision = '7374eab76f2caae02396721850f87af437b66c06', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', }, maintainers = { '@ObserverOfTime' }, @@ -1763,7 +1763,7 @@ return { }, pymanifest = { install_info = { - revision = 'be062582956165019d3253794b4d712f66dfeaaa', + revision = 'debbdb83fe6356adc7261c41c69b45ba49c97294', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pymanifest', }, maintainers = { '@ObserverOfTime' }, @@ -2241,7 +2241,7 @@ return { }, t32 = { install_info = { - revision = '2fcca1fd8d84c582478f1aebca7c8379346f3a04', + revision = '335e5533de72a4ac8c6763958df1befbdc855a30', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2433,7 +2433,7 @@ return { }, udev = { install_info = { - revision = '18a1d183c4c0cc40438bae2ebf8191aaf2dee8dc', + revision = '2fcb563a4d56a6b8e8c129252325fc6335e4acbf', url = 'https://github.com/tree-sitter-grammars/tree-sitter-udev', }, maintainers = { '@ObserverOfTime' }, @@ -2499,7 +2499,7 @@ return { }, vhdl = { install_info = { - revision = 'eacafa5d612fdea1d12332fe0f83e089e5571cf3', + revision = 'edf824ba11b445b7e43827587e83716b34b30fe5', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, From afe267b50e72ce2f79d8ae9f7693b8290e8a15ef Mon Sep 17 00:00:00 2001 From: Jonas Chevalier Date: Sun, 20 Jul 2025 11:50:56 +0200 Subject: [PATCH 166/434] chore(nix): update url and maintainers --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index cd6846f25..a6ff7cd52 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -191,7 +191,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [nim](https://github.com/alaviss/tree-sitter-nim) | unstable | `HF JL` | | @aMOPel [nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | unstable | `H  J ` | | @aMOPel [ninja](https://github.com/alemuller/tree-sitter-ninja) | unstable | `HFIJ ` | | @alemuller -[nix](https://github.com/cstrahan/tree-sitter-nix) | unstable | `HFIJL` | | @leo60228 +[nix](https://github.com/nix-community/tree-sitter-nix) | unstable | `HFIJL` | | @leo60228, @zimbatm [nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | unstable | `HFIJL` | | @amaanq [nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | | @abhisheksingh0x558 [objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3710da058..7680de928 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1464,9 +1464,9 @@ return { nix = { install_info = { revision = 'ea1d87f7996be1329ef6555dcacfa63a69bd55c6', - url = 'https://github.com/cstrahan/tree-sitter-nix', + url = 'https://github.com/nix-community/tree-sitter-nix', }, - maintainers = { '@leo60228' }, + maintainers = { '@leo60228', '@zimbatm' }, tier = 2, }, nqc = { From f14b356d548eafb6e0270aad904907424e16f9cd Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 20 Jul 2025 11:47:34 +0200 Subject: [PATCH 167/434] feat(chatito)!: update parser and queries node `(eq)` is replaced by field `eq: _` --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/chatito/highlights.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 7680de928..034a59a7e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -206,7 +206,7 @@ return { }, chatito = { install_info = { - revision = 'b4cbe9ab7672d5106e9550d8413835395a1be362', + revision = '433a7a150da013f380d2bd435e0c4373f7f4481c', url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', }, maintainers = { '@ObserverOfTime' }, diff --git a/runtime/queries/chatito/highlights.scm b/runtime/queries/chatito/highlights.scm index 47113f2cf..e756064b3 100644 --- a/runtime/queries/chatito/highlights.scm +++ b/runtime/queries/chatito/highlights.scm @@ -11,7 +11,7 @@ "," @punctuation.delimiter -(eq) @operator +eq: _ @operator ([ "\"" From d116118addd7444e7bd1b65a50de2d25bec32d28 Mon Sep 17 00:00:00 2001 From: MeanderingProgrammer Date: Wed, 9 Jul 2025 15:39:16 -0700 Subject: [PATCH 168/434] fix(install): don't make "installed" status persistent Problem: Setting `install_status` to "installed" skips any future install or update operation (even if forced). In particular, this breaks `:TSUpdate` when calling `install()` in config files. Solution: Don't set "installed" when skipping install and clear status on successful operations. --- lua/nvim-treesitter/install.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index c179600b6..233ea83fe 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -456,7 +456,6 @@ local install_status = {} ---@type table ---@return InstallStatus status local function install_lang(lang, cache_dir, install_dir, force, generate) if not force and vim.list_contains(config.get_installed(), lang) then - install_status[lang] = 'installed' return 'installed' end @@ -475,6 +474,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate) local status = install_status[lang] assert(status and status ~= 'installing') + install_status[lang] = nil return status end @@ -570,7 +570,6 @@ end) ---@return string? err local function uninstall_lang(logger, lang, parser, queries) logger:debug('Uninstalling ' .. lang) - install_status[lang] = nil if fn.filereadable(parser) == 1 then logger:debug('Unlinking ' .. parser) From 3650b4ef6a0c2eff49d59db6d30b2549557447a4 Mon Sep 17 00:00:00 2001 From: MeanderingProgrammer Date: Sun, 20 Jul 2025 15:36:06 -0700 Subject: [PATCH 169/434] refactor(install): replace status enum with boolean --- lua/nvim-treesitter/install.lua | 40 +++++++++++---------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 233ea83fe..6d672908a 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -439,13 +439,7 @@ local function try_install_lang(lang, cache_dir, install_dir, generate) logger:info('Language installed') end ----@alias InstallStatus ---- | 'installing' ---- | 'installed' ---- | 'failed' ---- | 'timeout' - -local install_status = {} ---@type table +local installing = {} ---@type table ---@async ---@param lang string @@ -453,29 +447,21 @@ local install_status = {} ---@type table ---@param install_dir string ---@param force? boolean ---@param generate? boolean ----@return InstallStatus status +---@return boolean success local function install_lang(lang, cache_dir, install_dir, force, generate) if not force and vim.list_contains(config.get_installed(), lang) then - return 'installed' - end - - if install_status[lang] then - if install_status[lang] == 'installing' then - vim.wait(INSTALL_TIMEOUT, function() - return install_status[lang] ~= 'installing' - end) - install_status[lang] = 'timeout' - end + return true + elseif installing[lang] then + local success = vim.wait(INSTALL_TIMEOUT, function() + return not installing[lang] + end) + return success else - install_status[lang] = 'installing' + installing[lang] = true local err = try_install_lang(lang, cache_dir, install_dir, generate) - install_status[lang] = err and 'failed' or 'installed' + installing[lang] = nil + return not err end - - local status = install_status[lang] - assert(status and status ~= 'installing') - install_status[lang] = nil - return status end --- Reload the parser table and user modifications in case of update @@ -511,8 +497,8 @@ local function install(languages, options) for _, lang in ipairs(languages) do tasks[#tasks + 1] = a.async(--[[@async]] function() a.schedule() - local status = install_lang(lang, cache_dir, install_dir, options.force, options.generate) - if status ~= 'failed' then + local success = install_lang(lang, cache_dir, install_dir, options.force, options.generate) + if success then done = done + 1 end end) From 6b3bf164b207a8d1e80dffa9c5b64f8ddbd7d585 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Mon, 21 Jul 2025 03:40:37 -0400 Subject: [PATCH 170/434] feat(glimmer): add fold queries (#8020) --- SUPPORTED_LANGUAGES.md | 4 ++-- runtime/queries/glimmer_javascript/folds.scm | 1 + runtime/queries/glimmer_typescript/folds.scm | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/glimmer_javascript/folds.scm create mode 100644 runtime/queries/glimmer_typescript/folds.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a6ff7cd52..7a7f23505 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -101,8 +101,8 @@ ecma (queries only)[^ecma] | unstable | `HFIJL` | | @steelsojka [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | unstable | `H  J ` | | @theHamsta [gleam](https://github.com/gleam-lang/tree-sitter-gleam) | unstable | `HFIJL` | | @amaanq [glimmer](https://github.com/ember-tooling/tree-sitter-glimmer)[^glimmer] | unstable | `HFIJL` | | @NullVoxPopuli -[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | unstable | `H IJL` | | @NullVoxPopuli -[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | unstable | `H IJ ` | | @NullVoxPopuli +[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | unstable | `HFIJL` | | @NullVoxPopuli +[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | unstable | `HFIJ ` | | @NullVoxPopuli [glsl](https://github.com/tree-sitter-grammars/tree-sitter-glsl) | unstable | `HFIJL` | | @theHamsta [gn](https://github.com/tree-sitter-grammars/tree-sitter-gn) | unstable | `HFIJL` | | @amaanq [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | unstable | `H  J ` | | @dpezto diff --git a/runtime/queries/glimmer_javascript/folds.scm b/runtime/queries/glimmer_javascript/folds.scm new file mode 100644 index 000000000..04328f099 --- /dev/null +++ b/runtime/queries/glimmer_javascript/folds.scm @@ -0,0 +1 @@ +; inherits: ecma diff --git a/runtime/queries/glimmer_typescript/folds.scm b/runtime/queries/glimmer_typescript/folds.scm new file mode 100644 index 000000000..1b61e36da --- /dev/null +++ b/runtime/queries/glimmer_typescript/folds.scm @@ -0,0 +1 @@ +; inherits: typescript From 8c8742871a1489afd7878bfee4bc40465f4a116a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 21 Jul 2025 11:00:40 +0200 Subject: [PATCH 171/434] fix(jinja): remove crashing pattern https://github.com/cathaysia/tree-sitter-jinja/issues/37 --- runtime/queries/jinja_inline/highlights.scm | 16 ++++++++-------- tests/query/highlights/jinja/filters.jinja | 19 ------------------- 2 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 tests/query/highlights/jinja/filters.jinja diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index 3a9660471..c072eea66 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -125,14 +125,14 @@ "." (identifier)+ @variable.member) -; jinja filters -(binary_expression - (binary_operator - "|") - (unary_expression - (primary_expression - (identifier) @function.call))) - +; crashes parser: https://github.com/cathaysia/tree-sitter-jinja/issues/37 +; ; jinja filters +; (binary_expression +; (binary_operator +; "|") +; (unary_expression +; (primary_expression +; (identifier) @function.call))) (inline_trans "_" @function.builtin) diff --git a/tests/query/highlights/jinja/filters.jinja b/tests/query/highlights/jinja/filters.jinja deleted file mode 100644 index a084cdc1a..000000000 --- a/tests/query/highlights/jinja/filters.jinja +++ /dev/null @@ -1,19 +0,0 @@ -{{ name|striptags|title }} -{# ^^^^ @variable #} -{# ^^^^^ @function.call #} -{# ^^^^^ @function.call #} - -{{ listx|join(', ') }} -{# ^^^^^ @variable #} -{# ^^^^ @function.call #} -{# ^^^^ @string #} - -{{ listx|join(str) }} -{# ^^^^^ @variable #} -{# ^^^^ @function.call #} -{# ^^^ @variable.parameter #} - -{{ foo.bar|random }} -{# ^^^ @variable #} -{# ^^^ @variable.member #} -{# ^^^^^^ @function.call #} From 40cca05b40438ddd74125132b0cec58c9afdccb2 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Mon, 21 Jul 2025 19:09:00 -0700 Subject: [PATCH 172/434] fix(c, ecma): remove invalid predicate parameters These are not valid named nodes in their respective languages. --- runtime/queries/c/highlights.scm | 2 +- runtime/queries/ecma/indents.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm index ea65075f2..442343abf 100644 --- a/runtime/queries/c/highlights.scm +++ b/runtime/queries/c/highlights.scm @@ -149,7 +149,7 @@ ((field_expression (field_identifier) @property) @_parent - (#not-has-parent? @_parent template_method function_declarator call_expression)) + (#not-has-parent? @_parent function_declarator call_expression)) (field_designator) @property diff --git a/runtime/queries/ecma/indents.scm b/runtime/queries/ecma/indents.scm index d56741670..b613426ee 100644 --- a/runtime/queries/ecma/indents.scm +++ b/runtime/queries/ecma/indents.scm @@ -33,11 +33,11 @@ (assignment_expression right: (_) @_right - (#not-kind-eq? @_right "arrow_function" "function")) @indent.begin + (#not-kind-eq? @_right "arrow_function")) @indent.begin (variable_declarator value: (_) @_value - (#not-kind-eq? @_value "arrow_function" "call_expression" "function")) @indent.begin + (#not-kind-eq? @_value "arrow_function" "call_expression")) @indent.begin (arguments ")" @indent.end) From 5d539943c6a8b7e4aa7c77c7b79517f07be5454f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 23 Jul 2025 13:30:47 +0200 Subject: [PATCH 173/434] feat(parsers): update angular, beancount, fennel, gleam, idl, javadoc, jinja, jinja_inline, koto, llvm, swift, systemverilog, tera, vhdl --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 034a59a7e..8e55982ec 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = '93bb92f1289b7fe765da6cc747c82ccdc0afeb8d', + revision = 'd1f24a8890462cb740909ff62a3a079cded288bc', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -93,7 +93,7 @@ return { }, beancount = { install_info = { - revision = 'b8309e6856fe207f0425efa4f7a1d1f27890f8e8', + revision = 'b7a2557e6c8cf1dc70a52cece1861522ad3903fc', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -544,7 +544,7 @@ return { }, fennel = { install_info = { - revision = 'de06b9ad366f0186080056109a8c3be980129538', + revision = 'cf7c000d934f2ff0a282a2c276b1f72e7fb2a099', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, @@ -709,7 +709,7 @@ return { }, gleam = { install_info = { - revision = '21e0e7ba6f4f60ee80934cb368aa13c00d370734', + revision = 'dae1551a9911b24f41d876c23f2ab05ece0a9d4c', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -1019,7 +1019,7 @@ return { }, idl = { install_info = { - revision = 'd5d7f57dd303b35169bd38c3a2268a24d3d76e38', + revision = 'fb1bd480b84a5b75a0c7a44a8fed45c4fe2d9247', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '51cbb3daa9b8a5ba9d6467db40ef45682a06811f', + revision = 'de50fbed2cc4c83e5fa2ec2d4231496e06d55e32', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1093,7 +1093,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '251101981d86ccb2901741eddf3e7cf21567a66d', + revision = '129184fb7bbc2d3e29967002432a869ac3758f2e', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1104,7 +1104,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '251101981d86ccb2901741eddf3e7cf21567a66d', + revision = '129184fb7bbc2d3e29967002432a869ac3758f2e', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1215,7 +1215,7 @@ return { }, koto = { install_info = { - revision = 'c379c2c0fdc68e56bb1efe0d933b8fcdf9ff203c', + revision = '2ffc77c14f0ac1674384ff629bfc207b9c57ed89', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1288,7 +1288,7 @@ return { }, llvm = { install_info = { - revision = 'badf46daedc7b469f5e849b53f2fb34e881962f1', + revision = '00c5389a4598e1dce66fbc3b3d34733d308f2751', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -2209,7 +2209,7 @@ return { swift = { install_info = { generate = true, - revision = '370a4261d702c51d5d830b06bd4c25e44677d01b', + revision = 'fc65dc2cc87047c3a45f1d26cce79ab9062a4881', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2233,7 +2233,7 @@ return { }, systemverilog = { install_info = { - revision = 'e5a589a76ce480db5a939ad4a4393c398eed35e9', + revision = '140a6d96aa753f550d01c0d6c95dbf7c0cfae3fb', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2290,7 +2290,7 @@ return { }, tera = { install_info = { - revision = 'c0a0ebcd70a0e6a9f9ec1157308e4e0ea18b446e', + revision = '692937d52c8dfd91ce0dde722b9b4febbc9bc712', url = 'https://github.com/uncenter/tree-sitter-tera', }, maintainers = { '@uncenter' }, @@ -2499,7 +2499,7 @@ return { }, vhdl = { install_info = { - revision = 'edf824ba11b445b7e43827587e83716b34b30fe5', + revision = '73ff9d3e7bc42b8cc123bf5f0b2db12a900ee9b7', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, From 57aa15d4cc6f6459f7f8d864d16f970eb801faff Mon Sep 17 00:00:00 2001 From: MeanderingProgrammer Date: Thu, 24 Jul 2025 14:41:44 -0700 Subject: [PATCH 174/434] fix(install): skip duplicate dependencies --- lua/nvim-treesitter/config.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 9a586b7b5..09ea2b7dc 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -164,7 +164,8 @@ function M.norm_languages(languages, skip) end end - return languages + table.sort(languages) + return vim.fn.uniq(languages) --[=[@as string[]]=] end return M From 12be0e9f245398b51d85927e6ed514222132aa0a Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 24 Jul 2025 18:59:16 -0300 Subject: [PATCH 175/434] fix(ini): register dosini and confini filetypes --- plugin/filetypes.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index ecddea292..a7bb3bcc0 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -21,6 +21,7 @@ local filetypes = { haskell = { 'hs' }, haskell_persistent = { 'haskellpersistent' }, idris = { 'idris2' }, + ini = { 'confini', 'dosini' }, janet_simple = { 'janet' }, javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' }, javascript_glimmer = { 'javascript.glimmer' }, From b26b4258294c742c2613a7d98fe53014d1c8fe49 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 26 Jul 2025 17:30:10 +0200 Subject: [PATCH 176/434] feat(parsers): update gdscript, javadoc, lua, solidity, superhtml, systemverilog, zig, ziggy, ziggy_schema --- lua/nvim-treesitter/parsers.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8e55982ec..97d8c00f0 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = 'c370d711dc9ead679d40bb7e9364ceed0b3bfc28', + revision = '8d30b8dbb84a5f786b93726dca158ae8ea3c413f', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = 'de50fbed2cc4c83e5fa2ec2d4231496e06d55e32', + revision = 'c0d918967afc2f4d3e2276a75722e1b268730855', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1296,7 +1296,7 @@ return { }, lua = { install_info = { - revision = 'e5e406935ff3e36529545955e2972646ed97f9e2', + revision = 'd76023017f7485eae629cb60d406c7a1ca0f40c9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -2075,7 +2075,7 @@ return { }, solidity = { install_info = { - revision = 'd38dcd0b58b223c43e3f9265914fb3167dc624c6', + revision = '322a3ddffca3ed96e559003fd03fa9881d7b4e20', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2175,7 +2175,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'a67317fb81afe76cc04e6d92124cfc20a903cee7', + revision = '8bb212b1044b4740c14bc73b649adab58a0cb481', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2233,7 +2233,7 @@ return { }, systemverilog = { install_info = { - revision = '140a6d96aa753f550d01c0d6c95dbf7c0cfae3fb', + revision = 'b2c95d30954fbd3cf9be6d96a3ad82e023c2fa12', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2639,7 +2639,7 @@ return { }, zig = { install_info = { - revision = 'b670c8df85a1568f498aa5c8cae42f51a90473c0', + revision = 'b71affffdb4222ff2d2dea6e164f76603b0be6bc', url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, @@ -2648,7 +2648,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'de703372b2da6fd2c25a8a3c424663ff6bece4ac', + revision = 'e95c85cb58773c43e9d94c0b9422ae84697e68a1', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2657,7 +2657,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'de703372b2da6fd2c25a8a3c424663ff6bece4ac', + revision = 'e95c85cb58773c43e9d94c0b9422ae84697e68a1', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, From 3561e1fb19bcd9f03ba074d769a8a78d01717b19 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 1 Aug 2025 18:01:39 +0200 Subject: [PATCH 177/434] feat(parsers): update ada, fortran, idl, javadoc, matlab, nim, powershell, slang, superhtml, swift, templ --- lua/nvim-treesitter/parsers.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 97d8c00f0..6a2ac8f4c 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,7 @@ return { ada = { install_info = { - revision = 'e8e2515465cc2d7c444498e68bdb9f1d86767f95', + revision = '0a4c27dc1308a9d2742de22e5fcfc0c137b3d3f3', url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, @@ -592,7 +592,7 @@ return { }, fortran = { install_info = { - revision = '7021f9f0f44bbcb7c646b594b6ef8db3ed787f8e', + revision = '8334abca785db3a041292e3b3b818a82a55b238f', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -1019,7 +1019,7 @@ return { }, idl = { install_info = { - revision = 'fb1bd480b84a5b75a0c7a44a8fed45c4fe2d9247', + revision = '777b39538f9dc4ece1d891733bb4c91fc0627b16', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = 'c0d918967afc2f4d3e2276a75722e1b268730855', + revision = '26ef3becea1ff51f0025a8e0c38a6b3a39c09341', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = 'dfed7b4bc548f2c036837c3e7e09cae7d1835289', + revision = '2d30fdbb8fc7ec55d2fbf05172437ff0299878a5', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1438,7 +1438,7 @@ return { }, nim = { install_info = { - revision = '9ed4696d7f76e4937e2b63512a249a3ead7a0399', + revision = '4ad352773688deb84a95eeaa9872acda5b466439', url = 'https://github.com/alaviss/tree-sitter-nim', }, maintainers = { '@aMOPel' }, @@ -1653,7 +1653,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = 'b59f9dd34f17998139877316995e796073faf84b', + revision = '96ab1da05cfb55b52ee7000b4be8a4b6fad232f5', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -2026,7 +2026,7 @@ return { }, slang = { install_info = { - revision = 'a4454e3004a9e8fea2df7fd2535fbaa05500da21', + revision = '5b0adf65710c3a7c265f0451ed6b4789410cbe63', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2175,7 +2175,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '8bb212b1044b4740c14bc73b649adab58a0cb481', + revision = 'c6111e7134c64b69a2934ccbba83460cb532d442', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2209,7 +2209,7 @@ return { swift = { install_info = { generate = true, - revision = 'fc65dc2cc87047c3a45f1d26cce79ab9062a4881', + revision = '78d84ef82c387fceeb6094038da28717ea052e39', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2282,7 +2282,7 @@ return { }, templ = { install_info = { - revision = 'a35a02cb608291ac8c12082dcbd2b5f34a7ad45f', + revision = '47594c5cbef941e6a3ccf4ddb934a68cf4c68075', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, From 05f29103552dcdd7faa77ce7c5152759c733f988 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 1 Aug 2025 18:15:49 +0200 Subject: [PATCH 178/434] feat(systemverilog)!: update parser and queries Breaking changes: 1. `(comment)` node split into `(one_line_comment)` and `(block_comment)` 2. named `(directive_foo)` nodes replaced by anonymous `"'foo"` (with backtick!) nodes -- but not consistently --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/systemverilog/highlights.scm | 32 ++++++++++---------- runtime/queries/systemverilog/injections.scm | 5 ++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6a2ac8f4c..a79361c15 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2233,7 +2233,7 @@ return { }, systemverilog = { install_info = { - revision = 'b2c95d30954fbd3cf9be6d96a3ad82e023c2fa12', + revision = '3bd2c5d2f60ed7b07c2177b34e2976ad9a87c659', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, diff --git a/runtime/queries/systemverilog/highlights.scm b/runtime/queries/systemverilog/highlights.scm index 1e004ef76..21542941f 100644 --- a/runtime/queries/systemverilog/highlights.scm +++ b/runtime/queries/systemverilog/highlights.scm @@ -234,10 +234,13 @@ [ "include" "import" - "directive_include" + "`include" ] @keyword.import -(comment) @comment @spell +[ + (one_line_comment) + (block_comment) +] @comment @spell [ "@" @@ -300,9 +303,6 @@ port_name: (simple_identifier) @variable (net_decl_assignment (simple_identifier) @variable) -(ERROR - (simple_identifier) @variable) - ; variable.member (hierarchical_identifier (simple_identifier) @@ -570,17 +570,17 @@ c_name: (c_identifier) @function ; directive [ - "directive_define" - "directive_default_nettype" - "directive_resetall" - "directive_timescale" - "directive_undef" - "directive_undefineall" - "directive_ifdef" - "directive_ifndef" - "directive_elsif" - "directive_endif" - "directive_else" + "`define" + "`default_nettype" + (resetall_compiler_directive) + "`timescale" + "`undef" + (undefineall_compiler_directive) + "`ifdef" + "`ifndef" + "`elsif" + "`endif" + "`else" ] @keyword.directive.define (include_compiler_directive diff --git a/runtime/queries/systemverilog/injections.scm b/runtime/queries/systemverilog/injections.scm index 05aa24d8f..a6f3ca45e 100644 --- a/runtime/queries/systemverilog/injections.scm +++ b/runtime/queries/systemverilog/injections.scm @@ -1,4 +1,7 @@ -((comment) @injection.content +([ + (one_line_comment) + (block_comment) +] @injection.content (#set! injection.language "comment")) ((macro_text) @injection.content From a4fa3e2d187ad98eb74d27c566ab3c330397ed75 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 21 Jul 2025 11:49:54 -0400 Subject: [PATCH 179/434] Revert "fix(jinja): remove crashing pattern" This reverts commit 8c8742871a1489afd7878bfee4bc40465f4a116a. --- runtime/queries/jinja_inline/highlights.scm | 16 ++++++++-------- tests/query/highlights/jinja/filters.jinja | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 tests/query/highlights/jinja/filters.jinja diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index c072eea66..3a9660471 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -125,14 +125,14 @@ "." (identifier)+ @variable.member) -; crashes parser: https://github.com/cathaysia/tree-sitter-jinja/issues/37 -; ; jinja filters -; (binary_expression -; (binary_operator -; "|") -; (unary_expression -; (primary_expression -; (identifier) @function.call))) +; jinja filters +(binary_expression + (binary_operator + "|") + (unary_expression + (primary_expression + (identifier) @function.call))) + (inline_trans "_" @function.builtin) diff --git a/tests/query/highlights/jinja/filters.jinja b/tests/query/highlights/jinja/filters.jinja new file mode 100644 index 000000000..a084cdc1a --- /dev/null +++ b/tests/query/highlights/jinja/filters.jinja @@ -0,0 +1,19 @@ +{{ name|striptags|title }} +{# ^^^^ @variable #} +{# ^^^^^ @function.call #} +{# ^^^^^ @function.call #} + +{{ listx|join(', ') }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^^ @string #} + +{{ listx|join(str) }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^ @variable.parameter #} + +{{ foo.bar|random }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^^^^ @function.call #} From 4d9916e477e5d4e3b245845dfd285edf429f3252 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 21 Jul 2025 11:53:16 -0400 Subject: [PATCH 180/434] fix(jinja_inline): fix crashing query pattern If jinja_inline parser is regenerated, then this pattern hits an "impossible" assert in tree-sitter query processing. --- runtime/queries/jinja_inline/highlights.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index 3a9660471..b66d7fb2e 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -127,11 +127,11 @@ ; jinja filters (binary_expression - (binary_operator - "|") + (binary_operator) @_operator (unary_expression (primary_expression - (identifier) @function.call))) + (identifier) @function.call)) + (#eq? @_operator "|")) (inline_trans "_" @function.builtin) From 37bcfdc6eba87334b58f43a19528751d3fe12f4e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 6 Aug 2025 13:16:08 +0200 Subject: [PATCH 181/434] refactor(config): prefer `vim.list.unique` for normalization Also fix some emmyluals warnings --- lua/nvim-treesitter/config.lua | 11 ++++++++--- lua/nvim-treesitter/indent.lua | 3 ++- lua/nvim-treesitter/install.lua | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index 09ea2b7dc..8150ad8a8 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -69,7 +69,7 @@ function M.get_available(tier) languages = vim.tbl_filter( --- @param p string function(p) - return parsers[p].tier == tier + return parsers[p] ~= nil and parsers[p].tier == tier end, languages ) @@ -164,8 +164,13 @@ function M.norm_languages(languages, skip) end end - table.sort(languages) - return vim.fn.uniq(languages) --[=[@as string[]]=] + -- TODO(clason): remove Nvim 0.11 compat + if vim.list then + return vim.list.unique(languages) + else + table.sort(languages) + return vim.fn.uniq(languages) --[=[@as string[] ]=] + end end return M diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 13f7b2740..6f8e4d8ff 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -52,7 +52,8 @@ local function find_delimiter(bufnr, node, delimiter) local end_char = { child:end_() } local trimmed_after_delim local escaped_delimiter = delimiter:gsub('[%-%.%+%[%]%(%)%$%^%%%?%*]', '%%%1') - trimmed_after_delim = line:sub(end_char[2] + 1):gsub('[%s' .. escaped_delimiter .. ']*', '') + trimmed_after_delim = + assert(line):sub(end_char[2] + 1):gsub('[%s' .. escaped_delimiter .. ']*', '') return child, #trimmed_after_delim == 0 end end diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 6d672908a..29c91356c 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -40,6 +40,7 @@ end ---@async ---@param path string +---@return string? err local function rmpath(path) local stat = uv.fs_lstat(path) if not stat then @@ -482,6 +483,7 @@ end ---@async ---@param languages string[] ---@param options? InstallOptions +---@return boolean true if installation successful local function install(languages, options) options = options or {} From 4eb35c03443742a4c3b2db13d36da9cddb6268c3 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Wed, 6 Aug 2025 09:44:56 -0700 Subject: [PATCH 182/434] feat(gdscript): misc operators, semicolon highlight --- runtime/queries/gdscript/highlights.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm index d7d3a648c..f3fd3b62f 100644 --- a/runtime/queries/gdscript/highlights.scm +++ b/runtime/queries/gdscript/highlights.scm @@ -148,6 +148,7 @@ "," "." ":" + ";" ] @punctuation.delimiter [ @@ -171,6 +172,7 @@ "~" "-" "*" + "**" "/" "%" "+" @@ -193,10 +195,13 @@ "+=" "-=" "*=" + "**=" "/=" "%=" "&=" "|=" + "<<=" + ">>=" "->" ] @operator From 9866036ec3c5db40700a9178494e0cfdcfe6ecfd Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 8 Aug 2025 10:09:54 +0200 Subject: [PATCH 183/434] feat(parsers): update c3, c_sharp, desktop, editorconfig, fennel, gdshader, javadoc, llvm, matlab, nix, perl, scala, solidity, superhtml, xresource --- lua/nvim-treesitter/parsers.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a79361c15..2cb92ef3b 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -166,7 +166,7 @@ return { }, c3 = { install_info = { - revision = '5abce05689bf46999c17bd0dcda2f75b8de61d0d', + revision = 'be8c7fcfb424a93f541ebd21d23611b92dff0444', url = 'https://github.com/c3lang/tree-sitter-c3', }, maintainers = { '@cbuttner' }, @@ -174,7 +174,7 @@ return { }, c_sharp = { install_info = { - revision = 'b5eb5742f6a7e9438bee22ce8026d6b927be2cd7', + revision = '3431444351c871dffb32654f1299a00019280f2f', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'deb91f587c97814058aea2cbd790e0b85c9bb361', + revision = '8d6931b05ccc70eb4f88b384524ea5dd3d795958', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '8ed36589b5d0b3ebfdba45e1fd0ebefa01aafaea', + revision = '2d92f8bb8304d0b56883bb9df8f17cb351a07cc3', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -544,7 +544,7 @@ return { }, fennel = { install_info = { - revision = 'cf7c000d934f2ff0a282a2c276b1f72e7fb2a099', + revision = '653c8abc72d1415cb85e032108d39022feb460be', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, @@ -661,7 +661,7 @@ return { }, gdshader = { install_info = { - revision = 'ffd9f958df13cae04593781d7d2562295a872455', + revision = '14e834063e136fa69b6d91f711f4f1981acf424b', url = 'https://github.com/GodOfAvacyn/tree-sitter-gdshader', }, maintainers = { '@godofavacyn' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '26ef3becea1ff51f0025a8e0c38a6b3a39c09341', + revision = '76ed31dff40686b350c994ceb4da90ad7f3a7f44', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1288,7 +1288,7 @@ return { }, llvm = { install_info = { - revision = '00c5389a4598e1dce66fbc3b3d34733d308f2751', + revision = 'be4864bec38412aa2987b6dad01d1e389e9e9ca9', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = '2d30fdbb8fc7ec55d2fbf05172437ff0299878a5', + revision = '37941b272862ba52983f44cb6ec7b0eec6972c95', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1463,7 +1463,7 @@ return { }, nix = { install_info = { - revision = 'ea1d87f7996be1329ef6555dcacfa63a69bd55c6', + revision = '42d2e0e2996dec99ea7eb82d64a138e12a7ba006', url = 'https://github.com/nix-community/tree-sitter-nix', }, maintainers = { '@leo60228', '@zimbatm' }, @@ -1565,7 +1565,7 @@ return { perl = { install_info = { branch = 'release', - revision = 'a2d8e5a32a63019d25bb7452455f4d646d11cce5', + revision = 'e95676fa54559c71f15ad73e871c1e44db8a9b05', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1982,7 +1982,7 @@ return { }, scala = { install_info = { - revision = '2d55e74b0485fe05058ffe5e8155506c9710c767', + revision = '97aead18d97708190a51d4f551ea9b05b60641c9', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -2075,7 +2075,7 @@ return { }, solidity = { install_info = { - revision = '322a3ddffca3ed96e559003fd03fa9881d7b4e20', + revision = '4e938a46c7030dd001bc99e1ac0f0c750ac98254', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2175,7 +2175,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'c6111e7134c64b69a2934ccbba83460cb532d442', + revision = '6ce62c9f0683f909de7e1601bc866f1db9cf92c9', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2599,7 +2599,7 @@ return { }, xresources = { install_info = { - revision = 'b0822f2ea47600c6e11ee64b2dec8353c9684e8d', + revision = '3b1445a48e5ce26b43e37b51dec5abb3bf1fb3e4', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 13e3ce3bf41521551b8d1daf401d31938f62e7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Mon, 11 Aug 2025 15:21:23 +0800 Subject: [PATCH 184/434] feat(sproto): add parser --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 +++++ runtime/queries/sproto/folds.scm | 6 ++++ runtime/queries/sproto/highlights.scm | 47 +++++++++++++++++++++++++++ runtime/queries/sproto/indents.scm | 10 ++++++ runtime/queries/sproto/injections.scm | 2 ++ 6 files changed, 74 insertions(+) create mode 100644 runtime/queries/sproto/folds.scm create mode 100644 runtime/queries/sproto/highlights.scm create mode 100644 runtime/queries/sproto/indents.scm create mode 100644 runtime/queries/sproto/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 7a7f23505..ceb928e72 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -269,6 +269,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | | @aheber, @xixiafinland [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | unstable | `H  JL` | | @Sarrus1 [sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | unstable | `HFIJL` | | @GordianDziwis +[sproto](https://github.com/hanxi/tree-sitter-sproto) | unstable | `HFIJ ` | | @hanxi [sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `HFIJ ` | | @derekstride [squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | unstable | `HFIJL` | | @amaanq [ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | | @ObserverOfTime diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 2cb92ef3b..98e9ef78a 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2115,6 +2115,14 @@ return { maintainers = { '@GordianDziwis' }, tier = 2, }, + sproto = { + install_info = { + revision = 'd554c1456e35e7b2690552d52921c987d0cf6799', + url = 'https://github.com/hanxi/tree-sitter-sproto', + }, + maintainers = { '@hanxi' }, + tier = 2, + }, sql = { install_info = { branch = 'gh-pages', diff --git a/runtime/queries/sproto/folds.scm b/runtime/queries/sproto/folds.scm new file mode 100644 index 000000000..03253d108 --- /dev/null +++ b/runtime/queries/sproto/folds.scm @@ -0,0 +1,6 @@ +[ + (type_definition) + (protocol_definition) + (request_block) + (response_block) +] @fold diff --git a/runtime/queries/sproto/highlights.scm b/runtime/queries/sproto/highlights.scm new file mode 100644 index 000000000..cd86ed22d --- /dev/null +++ b/runtime/queries/sproto/highlights.scm @@ -0,0 +1,47 @@ +(comment) @comment @spell + +[ + "." + ":" +] @punctuation.delimiter + +"*" @operator + +[ + "request" + "response" +] @keyword + +(type_definition + name: (identifier) @type) + +(nested_type_definition + name: (identifier) @type) + +(type_specifier) @type + +[ + "integer" + "boolean" + "string" + "binary" + "double" +] @type.builtin + +(protocol_definition + name: (identifier) @function) + +(field_definition + name: (identifier) @property) + +(map_specifier + key: (identifier) @property) + +(integer) @number + +[ + "(" + ")" + "{" + "}" +] @punctuation.bracket diff --git a/runtime/queries/sproto/indents.scm b/runtime/queries/sproto/indents.scm new file mode 100644 index 000000000..33147d540 --- /dev/null +++ b/runtime/queries/sproto/indents.scm @@ -0,0 +1,10 @@ +[ + (type_definition) + (protocol_definition) + (request_block) + (response_block) +] @indent.begin + +"}" @indent.end @indent.branch + +(comment) @indent.auto diff --git a/runtime/queries/sproto/injections.scm b/runtime/queries/sproto/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/sproto/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) From 42ea5392432253188c11c31af420a0b83bb111dc Mon Sep 17 00:00:00 2001 From: Caleb White Date: Mon, 16 Jun 2025 22:29:40 -0500 Subject: [PATCH 185/434] feat(php): update php and php_only parsers to v0.24.0 --- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/php_only/highlights.scm | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 98e9ef78a..5802d3c4d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1574,7 +1574,7 @@ return { php = { install_info = { location = 'php', - revision = 'b2278dbac9d58b02653fe6a8530ccebc492e4ed4', + revision = '182f034cd19a2f41f751eee0d57378fbfc96ab3a', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1585,7 +1585,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = 'b2278dbac9d58b02653fe6a8530ccebc492e4ed4', + revision = '182f034cd19a2f41f751eee0d57378fbfc96ab3a', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, diff --git a/runtime/queries/php_only/highlights.scm b/runtime/queries/php_only/highlights.scm index 2d473dd0c..8258e29ad 100644 --- a/runtime/queries/php_only/highlights.scm +++ b/runtime/queries/php_only/highlights.scm @@ -44,21 +44,16 @@ "protected" "public" "readonly" - (static_modifier) + "static" ] @keyword.modifier -(function_static_declaration - "static" @keyword.modifier) - [ "return" "exit" "yield" + "yield from" ] @keyword.return -(yield_expression - "from" @keyword.return) - [ "case" "else" @@ -107,7 +102,7 @@ [ (php_tag) - "?>" + (php_end_tag) "(" ")" "[" @@ -477,3 +472,9 @@ (comment) @comment @spell (named_label_statement) @label + +(property_hook + (name) @label) + +(visibility_modifier + (operation) @label) From 21da8ac2510bc2d4e9239e866a341ab0abc24959 Mon Sep 17 00:00:00 2001 From: Alexei Mozaidze Date: Mon, 11 Aug 2025 01:10:03 +0400 Subject: [PATCH 186/434] fix(fennel): highlight $ in multi-symbol context properly Highlights the dollar symbol properly in multi-symbol contexts like `$.some.properties` --- runtime/queries/fennel/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/fennel/highlights.scm b/runtime/queries/fennel/highlights.scm index 2f0b5f738..c02f7bd14 100644 --- a/runtime/queries/fennel/highlights.scm +++ b/runtime/queries/fennel/highlights.scm @@ -104,6 +104,9 @@ ((symbol) @variable.parameter (#any-of? @variable.parameter "$" "$...")) +((symbol_fragment) @variable.parameter + (#eq? @variable.parameter "$")) + ((symbol) @variable.parameter (#lua-match? @variable.parameter "^%$[1-9]$")) From 4d43480167512deb7eed798147355d7f09e56d5c Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Mon, 21 Jul 2025 18:44:11 -0700 Subject: [PATCH 187/434] ci: validate predicate/directive string parameters --- .tsqueryrc.json | 54 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.tsqueryrc.json b/.tsqueryrc.json index e8e7fd920..cd3a692d5 100644 --- a/.tsqueryrc.json +++ b/.tsqueryrc.json @@ -246,11 +246,13 @@ }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "named_node" }, { "type": "string", - "arity": "variadic" + "arity": "variadic", + "constraint": "named_node" } ], "description": "match any of the given node types against all ancestors of a node" @@ -262,12 +264,14 @@ "arity": "required" }, { - "type": "any", - "arity": "required" + "type": "string", + "arity": "required", + "constraint": "named_node" }, { - "type": "any", - "arity": "variadic" + "type": "string", + "arity": "variadic", + "constraint": "named_node" } ], "description": "match any of the given node types against the direct ancestor of a node" @@ -280,11 +284,13 @@ }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "named_node" }, { "type": "string", - "arity": "variadic" + "arity": "variadic", + "constraint": "named_node" } ], "description": "checks whether a capture corresponds to a given set of nodes" @@ -316,19 +322,23 @@ }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "integer" }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "integer" }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "integer" }, { "type": "string", - "arity": "required" + "arity": "required", + "constraint": "integer" } ], "description": "Takes the range of the captured node and applies an offset. This will set a new range in the form of a list like { {start_row}, {start_col}, {end_row}, {end_col} } for the captured node with `capture_id` as `metadata[capture_id].range`." @@ -358,19 +368,31 @@ }, { "type": "string", - "arity": "optional" + "arity": "optional", + "constraint": { + "enum": ["0", "1"] + } }, { "type": "string", - "arity": "optional" + "arity": "optional", + "constraint": { + "enum": ["0", "1"] + } }, { "type": "string", - "arity": "optional" + "arity": "optional", + "constraint": { + "enum": ["0", "1"] + } }, { "type": "string", - "arity": "optional" + "arity": "optional", + "constraint": { + "enum": ["0", "1"] + } } ], "description": "Trims whitespace from the node. Sets a new `metadata[capture_id].range`. Takes a capture ID and, optionally, four integers to customize trimming behavior (`1` meaning trim, `0` meaning don't trim). When only given a capture ID, trims blank lines (lines that contain only whitespace, or are empty) from the end of the node (for backwards compatibility). Can trim all whitespace from both sides of the node if parameters are given." From bf0234010a49dc1df5de93390f197cfd0abcb9aa Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 12 Aug 2025 11:04:13 +0200 Subject: [PATCH 188/434] ci: bump actions/checkout to v5 --- .github/workflows/lint.yml | 6 +++--- .github/workflows/test-core.yml | 2 +- .github/workflows/update-parsers.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cf9e9364f..27a75f8c0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: name: Lint Lua files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Format run: | @@ -28,7 +28,7 @@ jobs: name: Lint query files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Format run: | @@ -42,7 +42,7 @@ jobs: name: Lint docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Check SUPPORTED_LANGUAGES run: | diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index d91c1bb4c..f20f1939d 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -21,7 +21,7 @@ jobs: env: NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: tree-sitter/setup-action/cli@v1 - uses: ilammy/msvc-dev-cmd@v1 diff --git a/.github/workflows/update-parsers.yml b/.github/workflows/update-parsers.yml index 351beef67..533fc2ddd 100644 --- a/.github/workflows/update-parsers.yml +++ b/.github/workflows/update-parsers.yml @@ -17,7 +17,7 @@ jobs: name: Update parsers tier ${{ matrix.tier }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: main From cabbd52bb8d461ca1e6858c0476933256917de62 Mon Sep 17 00:00:00 2001 From: hsi <53867065+hsi@users.noreply.github.com> Date: Mon, 11 Aug 2025 21:38:15 +0200 Subject: [PATCH 189/434] fix(health): highlights legend label --- lua/nvim-treesitter/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index b4d0c62d5..856e2183e 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -157,7 +157,7 @@ function M.check() end health.info(vim.fn.trim(out, ' ', 2)) end - health.start(' Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[J]ections') + health.start(' Legend: H[ighlights], L[ocals], F[olds], I[ndents], In[J]ections') if #error_collection > 0 then health.start('The following errors have been detected in query files:') From 32cb9f9b9db71b0dc2454817727cd9a5d840658c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 16 Aug 2025 10:07:22 +0200 Subject: [PATCH 190/434] feat(parsers): update fennel, javadoc, llvm, matlab, mlir, nickel, nix, php, php_only, query, superhtml, vimdoc, wit --- lua/nvim-treesitter/parsers.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 5802d3c4d..391a7ef74 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -544,7 +544,7 @@ return { }, fennel = { install_info = { - revision = '653c8abc72d1415cb85e032108d39022feb460be', + revision = 'fd4a24e349bcbac8a03a5a00d0dfa207baf53ca5', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '76ed31dff40686b350c994ceb4da90ad7f3a7f44', + revision = '08f1977ad27b8d9a908193255ad0c94cc8742748', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1288,7 +1288,7 @@ return { }, llvm = { install_info = { - revision = 'be4864bec38412aa2987b6dad01d1e389e9e9ca9', + revision = '470886ddd635e0ee48a4cb169e33d0c6d9bff32e', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = '37941b272862ba52983f44cb6ec7b0eec6972c95', + revision = 'da410185c1fabf823ab92798590f9a6606e5699b', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = 'e2818d616fc43cbbba316723cbd68a53c66a2704', + revision = '04630ec19f198c3ac2a0b98a004eeae083990c96', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1431,7 +1431,7 @@ return { }, nickel = { install_info = { - revision = '9a05ab045c000cf37f02cff5c4de32b081444244', + revision = 'a0a5d98a6f0edb5d00a18e62e7d1d02a5607c391', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 2, @@ -1463,7 +1463,7 @@ return { }, nix = { install_info = { - revision = '42d2e0e2996dec99ea7eb82d64a138e12a7ba006', + revision = 'ff4e2b4c5a3598e8be3edf16bc69f6677af32145', url = 'https://github.com/nix-community/tree-sitter-nix', }, maintainers = { '@leo60228', '@zimbatm' }, @@ -1574,7 +1574,7 @@ return { php = { install_info = { location = 'php', - revision = '182f034cd19a2f41f751eee0d57378fbfc96ab3a', + revision = '1269143868747e3b8e50f221ca0a2e5a1a2f2b44', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1585,7 +1585,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '182f034cd19a2f41f751eee0d57378fbfc96ab3a', + revision = '1269143868747e3b8e50f221ca0a2e5a1a2f2b44', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1805,7 +1805,7 @@ return { }, query = { install_info = { - revision = '8a43889f89fd0667289936341bff3a77bafade17', + revision = '2668cc53024953224a40b1e6546d7b8ec5a11150', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -2183,7 +2183,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '6ce62c9f0683f909de7e1601bc866f1db9cf92c9', + revision = '0daae5239bd9366dda0c28c7540d7503b0c104d4', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2531,7 +2531,7 @@ return { }, vimdoc = { install_info = { - revision = '9f6191a98702edc1084245abd5523279d4b681fb', + revision = 'ffa29e863738adfc1496717c4acb7aae92a80ed4', url = 'https://github.com/neovim/tree-sitter-vimdoc', }, maintainers = { '@clason' }, @@ -2581,7 +2581,7 @@ return { }, wit = { install_info = { - revision = 'a0fd28afe24511160f0601ab45044690c1cb7d92', + revision = '8fd7cfd90be29b363922b2e09bf6a7db50de04a8', url = 'https://github.com/bytecodealliance/tree-sitter-wit', }, maintainers = { '@mkatychev' }, From 2f28a14ed229bb534a9ef92591d1d17b392b0c0e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 19 Aug 2025 11:46:44 +0200 Subject: [PATCH 191/434] feat(parsers): update arduino, chatito, desktop, editorconfig, gitattributes, gpg, idl, javadoc, mlir, pem, php, php_only, poe_filter, xresources --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 391a7ef74..a76195b55 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -36,7 +36,7 @@ return { }, arduino = { install_info = { - revision = '1b1fd5dbd196e80342cf79f6fc5de154232c2829', + revision = '3b5ddcdbcac43c6084358d3d14a30e10e2d36b88', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -206,7 +206,7 @@ return { }, chatito = { install_info = { - revision = '433a7a150da013f380d2bd435e0c4373f7f4481c', + revision = 'c0ed82c665b732395073f635c74c300f09530a7f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-chatito', }, maintainers = { '@ObserverOfTime' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '8d6931b05ccc70eb4f88b384524ea5dd3d795958', + revision = '0169df0e69bd2844e0d8bb167d030a0e4c021846', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '2d92f8bb8304d0b56883bb9df8f17cb351a07cc3', + revision = '17be0e84ac012b6731626baf6920ff24e1865a03', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -685,7 +685,7 @@ return { }, gitattributes = { install_info = { - revision = 'f23072a51e1c764d6c5bf461194a775c8a5c7a95', + revision = '1b7af09d45b579f9f288453b95ad555f1f431645', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gitattributes', }, maintainers = { '@ObserverOfTime' }, @@ -827,7 +827,7 @@ return { }, gpg = { install_info = { - revision = '50482a322cf1fa00dfe327ef8b00e4607eeeaa1d', + revision = '4024eb268c59204280f8ac71ef146b8ff5e737f6', url = 'https://github.com/tree-sitter-grammars/tree-sitter-gpg-config', }, maintainers = { '@ObserverOfTime' }, @@ -1019,7 +1019,7 @@ return { }, idl = { install_info = { - revision = '777b39538f9dc4ece1d891733bb4c91fc0627b16', + revision = '6ab5582bd47b86df75afe90cdd8dc55d2d480ce1', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '08f1977ad27b8d9a908193255ad0c94cc8742748', + revision = '77afe93bc6fc10f2cf4935857b8e055b2a47bb94', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = '04630ec19f198c3ac2a0b98a004eeae083990c96', + revision = 'b209a18d1a0f440acd3a85b6d633dac2660114e1', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1556,7 +1556,7 @@ return { }, pem = { install_info = { - revision = '7374eab76f2caae02396721850f87af437b66c06', + revision = 'e525b177a229b1154fd81bc0691f943028d9e685', url = 'https://github.com/tree-sitter-grammars/tree-sitter-pem', }, maintainers = { '@ObserverOfTime' }, @@ -1574,7 +1574,7 @@ return { php = { install_info = { location = 'php', - revision = '1269143868747e3b8e50f221ca0a2e5a1a2f2b44', + revision = '5b5627faaa290d89eb3d01b9bf47c3bb9e797dea', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1585,7 +1585,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '1269143868747e3b8e50f221ca0a2e5a1a2f2b44', + revision = '5b5627faaa290d89eb3d01b9bf47c3bb9e797dea', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1635,7 +1635,7 @@ return { }, poe_filter = { install_info = { - revision = 'e449216700449f1bccaebbd3820cce794d6fd687', + revision = '205a7d576984feb38a9fc2d8cfe729617f9e0548', url = 'https://github.com/tree-sitter-grammars/tree-sitter-poe-filter', }, maintainers = { '@ObserverOfTime' }, @@ -2607,7 +2607,7 @@ return { }, xresources = { install_info = { - revision = '3b1445a48e5ce26b43e37b51dec5abb3bf1fb3e4', + revision = '6113943ab0847a307f3f3c38ff91d9cdfce9d0d9', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 6fd7117c1dc4e279f4153af70ae60bd4134b0f01 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 19 Aug 2025 11:52:35 +0200 Subject: [PATCH 192/434] feat(matlab)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/matlab/highlights.scm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index a76195b55..88732ab19 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = 'da410185c1fabf823ab92798590f9a6606e5699b', + revision = '93020b226bf341de02336cdf1c19a7ce0b509cf2', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, diff --git a/runtime/queries/matlab/highlights.scm b/runtime/queries/matlab/highlights.scm index d2ab6053e..91fdae2a9 100644 --- a/runtime/queries/matlab/highlights.scm +++ b/runtime/queries/matlab/highlights.scm @@ -134,7 +134,8 @@ (identifier) @function) (validation_functions - (identifier) @function) + (property_name + (identifier) @function)) (command (command_name) @function.call) From 44e90ec66e44f7dbb60030f453a48282b3a1125a Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 21 Aug 2025 18:31:55 +0200 Subject: [PATCH 193/434] feat(inko): add support for array patterns This updates the version of the Inko parser to the latest version and includes indent support for the new array pattern node. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/inko/indents.scm | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 88732ab19..d658b5d18 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1042,7 +1042,7 @@ return { }, inko = { install_info = { - revision = 'f58a87ac4dc6a7955c64c9e4408fbd693e804686', + revision = '74cbd0f69053b4a9ad4fed8831dee983ec7e4990', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, diff --git a/runtime/queries/inko/indents.scm b/runtime/queries/inko/indents.scm index d2d9a5724..260249343 100644 --- a/runtime/queries/inko/indents.scm +++ b/runtime/queries/inko/indents.scm @@ -27,6 +27,7 @@ (trait) (tuple) (tuple_pattern) + (array_pattern) (type_arguments) ] @indent.begin From 9f15c2b050ef2fa66462636eb48674d6b6562989 Mon Sep 17 00:00:00 2001 From: Caleb White Date: Mon, 25 Aug 2025 08:29:26 -0500 Subject: [PATCH 194/434] fix(blade): fix highlighting of php tags --- runtime/queries/blade/highlights.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/queries/blade/highlights.scm b/runtime/queries/blade/highlights.scm index b20999a5f..dd8024bda 100644 --- a/runtime/queries/blade/highlights.scm +++ b/runtime/queries/blade/highlights.scm @@ -7,6 +7,8 @@ ] @tag [ + (php_tag) + (php_end_tag) "{{" "}}" "{!!" From 35a124cb608fb137814d9af95d43a8b980206d8a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Aug 2025 18:59:47 +0200 Subject: [PATCH 195/434] feat(parsers): update arduino, blade, desktop, elixir, javadoc, llvm, mlir, perl, superhtml, vhdl, xresources, ziggy, ziggy_schema --- lua/nvim-treesitter/parsers.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index d658b5d18..9f14b2038 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -36,7 +36,7 @@ return { }, arduino = { install_info = { - revision = '3b5ddcdbcac43c6084358d3d14a30e10e2d36b88', + revision = '2f0c1223c50aa4b754136db544204c6fc99ffc77', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -125,7 +125,7 @@ return { }, blade = { install_info = { - revision = '59ce5b68e288002e3aee6cf5a379bbef21adbe6c', + revision = 'cc764dadcbbceb3f259396fef66f970c72e94f96', url = 'https://github.com/EmranMR/tree-sitter-blade', }, maintainers = { '@calebdw' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '0169df0e69bd2844e0d8bb167d030a0e4c021846', + revision = 'cbf82f2b3f75c4f2367d11ef85d34fbad89a974d', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -473,7 +473,7 @@ return { }, elixir = { install_info = { - revision = 'b848e63e9f2a68accff0332392f07582c046295a', + revision = 'd24cecee673c4c770f797bac6f87ae4b6d7ddec5', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '77afe93bc6fc10f2cf4935857b8e055b2a47bb94', + revision = '384952d91ebc176fcf8f1933dff93b9c32430911', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1288,7 +1288,7 @@ return { }, llvm = { install_info = { - revision = '470886ddd635e0ee48a4cb169e33d0c6d9bff32e', + revision = '2914786ae6774d4c4e25a230f4afe16aa68fe1c1', url = 'https://github.com/benwilliamgraham/tree-sitter-llvm', }, maintainers = { '@benwilliamgraham' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = 'b209a18d1a0f440acd3a85b6d633dac2660114e1', + revision = '09666cead2c001cbbfc82b395007f6d8158113a5', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1565,7 +1565,7 @@ return { perl = { install_info = { branch = 'release', - revision = 'e95676fa54559c71f15ad73e871c1e44db8a9b05', + revision = '0c24d001dd1921e418fb933d208a7bd7dd3f923a', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -2183,7 +2183,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '0daae5239bd9366dda0c28c7540d7503b0c104d4', + revision = '8cb16babb0c66b6512d6aeb4cbc37ed90641d980', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2507,7 +2507,7 @@ return { }, vhdl = { install_info = { - revision = '73ff9d3e7bc42b8cc123bf5f0b2db12a900ee9b7', + revision = '02523d7fb0321344c19c1f3f4ec6b83424c7d6c8', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2607,7 +2607,7 @@ return { }, xresources = { install_info = { - revision = '6113943ab0847a307f3f3c38ff91d9cdfce9d0d9', + revision = 'f40778ff42f2119aebacd46d4b6d785a4181a9ba', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, @@ -2656,7 +2656,7 @@ return { ziggy = { install_info = { location = 'tree-sitter-ziggy', - revision = 'e95c85cb58773c43e9d94c0b9422ae84697e68a1', + revision = '4353b20ef2ac750e35c6d68e4eb2a07c2d7cf901', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, @@ -2665,7 +2665,7 @@ return { ziggy_schema = { install_info = { location = 'tree-sitter-ziggy-schema', - revision = 'e95c85cb58773c43e9d94c0b9422ae84697e68a1', + revision = '4353b20ef2ac750e35c6d68e4eb2a07c2d7cf901', url = 'https://github.com/kristoff-it/ziggy', }, maintainers = { '@rockorager' }, From 37cec5ec59d09db15ef364e237f8593b48754539 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Aug 2025 19:09:38 +0200 Subject: [PATCH 196/434] feat(gotmpl,helm)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/gotmpl/highlights.scm | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 9f14b2038..cae9df413 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -811,7 +811,7 @@ return { }, gotmpl = { install_info = { - revision = '5f19a36bb1eebb30454e277b222b278ceafed0dd', + revision = '65f4f86c3aaa9dabab36e3482584e8a111cf7db1', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -923,7 +923,7 @@ return { helm = { install_info = { location = 'dialects/helm', - revision = '5f19a36bb1eebb30454e277b222b278ceafed0dd', + revision = '65f4f86c3aaa9dabab36e3482584e8a111cf7db1', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, diff --git a/runtime/queries/gotmpl/highlights.scm b/runtime/queries/gotmpl/highlights.scm index 4ee768c28..80c977717 100644 --- a/runtime/queries/gotmpl/highlights.scm +++ b/runtime/queries/gotmpl/highlights.scm @@ -59,7 +59,6 @@ [ "if" "else" - "else if" "end" ] @keyword.conditional (#set! priority 110)) @@ -98,6 +97,14 @@ ] @keyword.conditional (#set! priority 110)) +(continue_action + "continue" @keyword.repeat + (#set! priority 110)) + +(break_action + "break" @keyword.repeat + (#set! priority 110)) + ; Literals ([ (interpreted_string_literal) From 85ec015f3be42a3c2c04648ff99d617d9609e5f0 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Aug 2025 19:19:32 +0200 Subject: [PATCH 197/434] feat(nu)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/nu/highlights.scm | 52 +++++++++++++------------------ 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index cae9df413..ffa103213 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1479,7 +1479,7 @@ return { }, nu = { install_info = { - revision = '6544c4383643cf8608d50def2247a7af8314e148', + revision = 'cc4624fbc6ec3563d98fbe8f215a8b8e10b16f32', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, diff --git a/runtime/queries/nu/highlights.scm b/runtime/queries/nu/highlights.scm index f8342fab4..fc73d3483 100644 --- a/runtime/queries/nu/highlights.scm +++ b/runtime/queries/nu/highlights.scm @@ -2,13 +2,8 @@ ; keywords [ "let" - "let-env" "mut" "const" - "hide-env" - "source" - "source-env" - "overlay" ] @keyword [ @@ -20,16 +15,9 @@ [ "loop" "while" - "break" - "continue" ] @keyword.repeat -[ - "def" - "do" -] @keyword.function - -"return" @keyword.return +"def" @keyword.function [ "try" @@ -49,9 +37,6 @@ "extern" ] @keyword.modifier -(hide_mod - "hide" @keyword) - (decl_use module: (unquoted) @module) @@ -59,21 +44,6 @@ "for" @keyword "in" @keyword) -(overlay_list - "list" @keyword.import) - -(overlay_hide - "hide" @keyword.import) - -(overlay_new - "new" @keyword.import) - -(overlay_use - "as" @keyword) - -(ctrl_error - "make" @keyword.import) - ; --- ; literals (val_number) @number @@ -316,6 +286,26 @@ key: (identifier) @property "zip") ]) +(command + head: (cmd_identifier) @keyword + (#any-of? @keyword "do" "source" "source-env" "hide" "hide-env")) + +(command + head: (cmd_identifier) @keyword.repeat + (#any-of? @keyword.repeat "break" "continue" "return")) + +(command + head: (cmd_identifier) @keyword + . + arg_str: (val_string) @keyword.import + (#any-of? @keyword "overlay" "error")) + +(command + head: (cmd_identifier) @_cmd + arg_str: (val_string) @keyword + (#eq? @_cmd "overlay") + (#eq? @keyword "as")) + (command "^" @punctuation.delimiter head: (_) @function) From 8302d4f547ce8881f06ff1ec2cf1c9748a43cb12 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Aug 2025 14:45:10 +0200 Subject: [PATCH 198/434] feat(parsers): update bash, c, clojure, cpp, embedded_template, gap, go, html, java, javascript, json, json5, pkl, rust, supercollider --- lua/nvim-treesitter/parsers.lua | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ffa103213..ea48f3ad1 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -77,7 +77,7 @@ return { }, bash = { install_info = { - revision = '56b54c61fb48bce0c63e3dfa2240b5d274384763', + revision = 'b930fed16910a74c230e09ea5b97f671448d2116', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -158,7 +158,7 @@ return { }, c = { install_info = { - revision = '7fa1be1b694b6e763686793d97da01f36a0e5c12', + revision = 'd8d0503aa0152119149ecad76685f37682c0d03f', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -222,7 +222,7 @@ return { }, clojure = { install_info = { - revision = 'be514eec2c86d560c18fab146e9298e21b8eab62', + revision = 'e43eff80d17cf34852dcd92ca5e6986d23a7040f', url = 'https://github.com/sogaiu/tree-sitter-clojure', }, maintainers = { '@NoahTheDuke' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = '5cb9b693cfd7bfacab1d9ff4acac1a4150700609', + revision = '077f14ffd2de226ac95808596989c705f6dee289', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -505,7 +505,7 @@ return { }, embedded_template = { install_info = { - revision = '8495d106154741e6d35d37064f864758ece75de6', + revision = 'c70c1de07dedd532089c0c90835c8ed9fa694f5c', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 2, @@ -633,7 +633,7 @@ return { }, gap = { install_info = { - revision = '8dee53cfb962600dd35ca25432f005e7920e89f2', + revision = '2bac14863b76ad0ff6fd7204c50574732acd66df', url = 'https://github.com/gap-system/tree-sitter-gap', }, maintainers = { '@reiniscirpons' }, @@ -770,7 +770,7 @@ return { }, go = { install_info = { - revision = '5e73f476efafe5c768eda19bbe877f188ded6144', + revision = '1547678a9da59885853f5f5cc8a99cc203fa2e2c', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -973,7 +973,7 @@ return { }, html = { install_info = { - revision = 'cbb91a0ff3621245e890d1c50cc811bffb77a26b', + revision = '9fc04b9ef21a92e3ea9258f5690e4461394d7811', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -1067,7 +1067,7 @@ return { }, java = { install_info = { - revision = 'a7db5227ec40fcfe94489559d8c9bc7c8181e25a', + revision = '968afb3c9be2d4dba4cd36f3580ee0b1a9c1c537', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1083,7 +1083,7 @@ return { }, javascript = { install_info = { - revision = '6fbef40512dcd9f0a61ce03a4c9ae7597b36ab5c', + revision = 'b131ccbf414a720cce088610539241a1eb170054', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1129,7 +1129,7 @@ return { }, json = { install_info = { - revision = '46aa487b3ade14b7b05ef92507fdaa3915a662a3', + revision = 'fd38547e2fe5738e5b173e5f40a27df261224bba', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1137,7 +1137,7 @@ return { }, json5 = { install_info = { - revision = 'ab0ba8229d639ec4f3fa5f674c9133477f4b77bd', + revision = '5ebe24e210f0fbcd6180fd673ed184ed81f3bcc6', url = 'https://github.com/Joakker/tree-sitter-json5', }, maintainers = { '@Joakker' }, @@ -1610,7 +1610,7 @@ return { }, pkl = { install_info = { - revision = '4fc94a102c25ea383d70397dac7e677ca3731f1e', + revision = '97d0f3d32e8915a72fa6cf6b1832ba3884f8e82b', url = 'https://github.com/apple/tree-sitter-pkl', }, maintainers = { '@ribru17' }, @@ -1974,7 +1974,7 @@ return { }, rust = { install_info = { - revision = '3691201b01cacb2f96ffca4c632c4e938bfacd88', + revision = '3bfef41a01ab49a25ffdecf998823b4b82fcaf69', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2174,7 +2174,7 @@ return { }, supercollider = { install_info = { - revision = '1a8ee0da9a4f2df5a8a22f4d637ac863623a78a7', + revision = 'fd7f3bd457c8ef13cb547c4e79588cf1d2569997', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, From 16da7ded58b41a4c320f32661264c6283ce8cd18 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 29 Aug 2025 14:50:43 +0200 Subject: [PATCH 199/434] feat(matlab)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/matlab/highlights.scm | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ea48f3ad1..3abe166a1 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1367,7 +1367,7 @@ return { }, matlab = { install_info = { - revision = '93020b226bf341de02336cdf1c19a7ce0b509cf2', + revision = '96a3e8fb0a4ebd0db64db6b52043483937e9ca3a', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, diff --git a/runtime/queries/matlab/highlights.scm b/runtime/queries/matlab/highlights.scm index 91fdae2a9..66ec69465 100644 --- a/runtime/queries/matlab/highlights.scm +++ b/runtime/queries/matlab/highlights.scm @@ -134,8 +134,7 @@ (identifier) @function) (validation_functions - (property_name - (identifier) @function)) + (identifier) @function) (command (command_name) @function.call) @@ -205,7 +204,11 @@ (number) @number -(boolean) @boolean +((identifier) @boolean + (#eq? @boolean "true")) + +((identifier) @boolean + (#eq? @boolean "false")) ; Comments [ From cd64fd3f448eb6cc529830c7f265f7584168572b Mon Sep 17 00:00:00 2001 From: BlockLune <39331194+BlockLune@users.noreply.github.com> Date: Sat, 30 Aug 2025 00:30:18 +0800 Subject: [PATCH 200/434] feat(wxml): add parser and queries --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++++ runtime/queries/wxml/folds.scm | 7 +++ runtime/queries/wxml/highlights.scm | 66 +++++++++++++++++++++++++++++ runtime/queries/wxml/indents.scm | 32 ++++++++++++++ runtime/queries/wxml/injections.scm | 10 +++++ 6 files changed, 124 insertions(+) create mode 100644 runtime/queries/wxml/folds.scm create mode 100644 runtime/queries/wxml/highlights.scm create mode 100644 runtime/queries/wxml/indents.scm create mode 100644 runtime/queries/wxml/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index ceb928e72..25c5e1137 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -326,6 +326,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | | @theHamsta [wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | | @gshpychka, @MarkMcCulloh [wit](https://github.com/bytecodealliance/tree-sitter-wit) | unstable | `HF J ` | | @mkatychev +[wxml](https://github.com/BlockLune/tree-sitter-wxml) | unstable | `HFIJ ` | | @BlockLune [xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | | @ObserverOfTime [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | | @ObserverOfTime [xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | | @ValdezFOmar diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 3abe166a1..027c8f745 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2587,6 +2587,14 @@ return { maintainers = { '@mkatychev' }, tier = 2, }, + wxml = { + install_info = { + revision = '7b821c748dc410332f59496c0dea2632168c4e5a', + url = 'https://github.com/BlockLune/tree-sitter-wxml', + }, + maintainers = { '@BlockLune' }, + tier = 2, + }, xcompose = { install_info = { revision = 'a51d6366f041dbefec4da39a7eb3168a9b1cbc0e', diff --git a/runtime/queries/wxml/folds.scm b/runtime/queries/wxml/folds.scm new file mode 100644 index 000000000..df3eeeef7 --- /dev/null +++ b/runtime/queries/wxml/folds.scm @@ -0,0 +1,7 @@ +[ + (element) + (block_element) + (slot_element) + (template_element) + (wxs_element) +] @fold diff --git a/runtime/queries/wxml/highlights.scm b/runtime/queries/wxml/highlights.scm new file mode 100644 index 000000000..5bdbd5d50 --- /dev/null +++ b/runtime/queries/wxml/highlights.scm @@ -0,0 +1,66 @@ +; Comments +(comment) @comment @spell + +; Text +(text) @spell + +; Tag names +(tag_name) @tag + +((tag_name) @tag.builtin + (#any-of? @tag.builtin "wxs" "template" "import" "include" "slot" "block")) + +; Attributes +(attribute_name) @tag.attribute + +(attribute_value) @string + +(quoted_attribute_value) @string + +; WeChat specific attributes +((attribute_name) @keyword.directive + (#lua-match? @keyword.directive "^wx:")) + +((attribute_name) @keyword.conditional + (#any-of? @keyword.conditional "wx:if" "wx:elif" "wx:else")) + +((attribute_name) @keyword.repeat + (#any-of? @keyword.repeat "wx:for" "wx:for-index" "wx:for-item")) + +((attribute_name) @keyword + (#lua-match? @keyword "^bind")) + +((attribute_name) @keyword + (#lua-match? @keyword "^catch")) + +((attribute_name) @keyword + (#lua-match? @keyword "^mut%-bind")) + +((attribute_name) @keyword + (#lua-match? @keyword "^model:")) + +((attribute_name) @keyword + (#lua-match? @keyword "^data-")) + +((attribute + (attribute_name) @_attr + (quoted_attribute_value) @string.special.url) + (#any-of? @_attr "href" "src") + (#offset! @string.special.url 0 1 0 -1)) + +; Entity references +(entity) @character.special + +; Interpolation delimiters +(interpolation_start) @punctuation.special + +(interpolation_end) @punctuation.special + +[ + "<" + ">" + "" +] @tag.delimiter + +"=" @operator diff --git a/runtime/queries/wxml/indents.scm b/runtime/queries/wxml/indents.scm new file mode 100644 index 000000000..30172bb37 --- /dev/null +++ b/runtime/queries/wxml/indents.scm @@ -0,0 +1,32 @@ +; inherits: html_tags + +(block_element) @indent.begin + +(template_element) @indent.begin + +(wxs_element) @indent.begin + +(block_element + (block_end_tag + ">" @indent.end)) + +(template_element + (template_end_tag + ">" @indent.end)) + +(wxs_element + (wxs_end_tag + ">" @indent.end)) + +(block_element + (block_end_tag) @indent.branch) + +(template_element + (template_end_tag) @indent.branch) + +(wxs_element + (wxs_end_tag) @indent.branch) + +(import_statement) @indent.ignore + +(include_statement) @indent.ignore diff --git a/runtime/queries/wxml/injections.scm b/runtime/queries/wxml/injections.scm new file mode 100644 index 000000000..09f615d38 --- /dev/null +++ b/runtime/queries/wxml/injections.scm @@ -0,0 +1,10 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((raw_text) @injection.content + (#set! injection.language "javascript") + (#set! injection.include-children)) + +((expression) @injection.content + (#set! injection.language "javascript") + (#set! injection.include-children)) From 8fccdb3d493178994aca43ec1f6ff74740eed7ee Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 30 Aug 2025 20:39:35 -0700 Subject: [PATCH 201/434] feat(proto): more delimiter, property highlights --- runtime/queries/proto/highlights.scm | 18 +++++++ tests/query/highlights/proto/test.proto | 62 +++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 tests/query/highlights/proto/test.proto diff --git a/runtime/queries/proto/highlights.scm b/runtime/queries/proto/highlights.scm index 51f44a754..894686dd4 100644 --- a/runtime/queries/proto/highlights.scm +++ b/runtime/queries/proto/highlights.scm @@ -1,3 +1,19 @@ +(full_ident + (identifier) @variable) + +(full_ident + (identifier) + (identifier) @variable.member) + +(field + (identifier) @property) + +(field_option + (identifier) @property) + +(block_lit + (identifier) @property) + [ "extend" "extensions" @@ -77,6 +93,8 @@ [ ";" "," + "." + ":" ] @punctuation.delimiter "=" @operator diff --git a/tests/query/highlights/proto/test.proto b/tests/query/highlights/proto/test.proto new file mode 100644 index 000000000..fdc610782 --- /dev/null +++ b/tests/query/highlights/proto/test.proto @@ -0,0 +1,62 @@ +syntax = "proto2"; +// ^^^^^^^^ @string.special +package sls.asfd.asfd; +// ^^^ @variable +// ^ @punctuation.delimiter +// ^^^^ @variable.member +// ^ @punctuation.delimiter +// ^^^^ @variable.member +// ^ @punctuation.delimiter + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +//<- @keyword.import + +option (gogoproto.sizer_all) = true; +option (gogoproto.marshaler_all) = true; +option (gogoproto.unmarshaler_all.foo) = true; +// ^^^^^^^^^ @variable +// ^^^^^^^^^^^^^^^ @variable.member +// ^ @punctuation.delimiter +// ^^^ @variable.member + +message LogContent +//<- @keyword.type +{ + required string Key = 1; +// ^^^^^^ @type +// ^^^ @property +// ^ @operator +// ^ @number + required string Value = 2; +// ^^^^^^ @type +// ^^^^^ @property + required CustomType Value = 2; +// ^^^^^^^^ @keyword.modifier +// ^^^^^^^^^^ @type + + optional string cgroup_pids_mount = 76 [default = "/sys/fs/cgroup/pids"]; + + optional JsonFormat json_format = 6 [ +// ^^^^^^^^ @keyword.modifier + retention = RETENTION_RUNTIME, +// ^^^^^^^^^^^^^^^^^ @variable +// ^ @punctuation.delimiter + targets = TARGET_TYPE_MESSAGE, +// ^^^^^^^ @property + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: "2023", value: "ALLOW" } +// ^^^^^^^ @property +// ^ @punctuation.delimiter +// ^ @punctuation.delimiter +// ^ @punctuation.bracket + ]; +} + From 802195d8f1980db25a7a39a55f9a25df21756c73 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 30 Aug 2025 20:40:45 -0700 Subject: [PATCH 202/434] feat(proto): folds for import statements --- runtime/queries/proto/folds.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/queries/proto/folds.scm b/runtime/queries/proto/folds.scm index 645ac1819..76f688b7d 100644 --- a/runtime/queries/proto/folds.scm +++ b/runtime/queries/proto/folds.scm @@ -3,3 +3,5 @@ (message) (service) ] @fold + +(import)+ @fold From 9addcdd01568a7c80333d5169dea0164ede5dd3d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 6 Sep 2025 11:08:43 +0200 Subject: [PATCH 203/434] feat(parsers): update agda, c3, embedded_template, javadoc, javascript, jinja, jinja_inline, pkl, slang, supercollider, sway, systemverilog --- lua/nvim-treesitter/parsers.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 027c8f745..b8e2493f5 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -10,7 +10,7 @@ return { }, agda = { install_info = { - revision = 'b9b32fa042c2952a7bfca86847ea325e44ccc897', + revision = 'e8d47a6987effe34d5595baf321d82d3519a8527', url = 'https://github.com/tree-sitter/tree-sitter-agda', }, maintainers = { '@Decodetalkers' }, @@ -166,7 +166,7 @@ return { }, c3 = { install_info = { - revision = 'be8c7fcfb424a93f541ebd21d23611b92dff0444', + revision = '057a75df0c866034d8edce989f701ee2cb0481d8', url = 'https://github.com/c3lang/tree-sitter-c3', }, maintainers = { '@cbuttner' }, @@ -505,7 +505,7 @@ return { }, embedded_template = { install_info = { - revision = 'c70c1de07dedd532089c0c90835c8ed9fa694f5c', + revision = '3499d85f0a0d937c507a4a65368f2f63772786e1', url = 'https://github.com/tree-sitter/tree-sitter-embedded-template', }, tier = 2, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '384952d91ebc176fcf8f1933dff93b9c32430911', + revision = 'fea74f50f5a6dcef575687703b82a96f9e6d1312', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1083,7 +1083,7 @@ return { }, javascript = { install_info = { - revision = 'b131ccbf414a720cce088610539241a1eb170054', + revision = '44c892e0be055ac465d5eeddae6d3e194424e7de', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1093,7 +1093,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = '129184fb7bbc2d3e29967002432a869ac3758f2e', + revision = 'e589222a1ad44361bc376d5abdccd08e1fecfee5', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1104,7 +1104,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = '129184fb7bbc2d3e29967002432a869ac3758f2e', + revision = 'e589222a1ad44361bc376d5abdccd08e1fecfee5', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1610,7 +1610,7 @@ return { }, pkl = { install_info = { - revision = '97d0f3d32e8915a72fa6cf6b1832ba3884f8e82b', + revision = 'd62e832b69a0aa3d4f87fc34ba62d931d6c23f55', url = 'https://github.com/apple/tree-sitter-pkl', }, maintainers = { '@ribru17' }, @@ -2026,7 +2026,7 @@ return { }, slang = { install_info = { - revision = '5b0adf65710c3a7c265f0451ed6b4789410cbe63', + revision = '1dbcc4abc7b3cdd663eb03d93031167d6ed19f56', url = 'https://github.com/tree-sitter-grammars/tree-sitter-slang', }, maintainers = { '@theHamsta' }, @@ -2174,7 +2174,7 @@ return { }, supercollider = { install_info = { - revision = 'fd7f3bd457c8ef13cb547c4e79588cf1d2569997', + revision = 'c6145cad24e19485f6ceb86e0a1be479d6537fb0', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, @@ -2208,7 +2208,7 @@ return { }, sway = { install_info = { - revision = '395006713db3bbb90d267ebdfcbf1881b399b05c', + revision = '9b7845ce06ecb38b040c3940970b4fd0adc331d1', url = 'https://github.com/FuelLabs/tree-sitter-sway.git', }, maintainers = { '@ribru17' }, @@ -2241,7 +2241,7 @@ return { }, systemverilog = { install_info = { - revision = '3bd2c5d2f60ed7b07c2177b34e2976ad9a87c659', + revision = '999e88565e199abec12d6fb7470419b5ae217386', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, From 939556333f7d160161e7d590736850aca554d59b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 7 Sep 2025 11:27:17 +0200 Subject: [PATCH 204/434] feat(parsers): update arduino, desktop, hurl, mlir, query, slint, snakemake, xresources --- lua/nvim-treesitter/parsers.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b8e2493f5..822421bfe 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -36,7 +36,7 @@ return { }, arduino = { install_info = { - revision = '2f0c1223c50aa4b754136db544204c6fc99ffc77', + revision = '53eb391da4c6c5857f8defa2c583c46c2594f565', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'cbf82f2b3f75c4f2367d11ef85d34fbad89a974d', + revision = 'ea5cff078ebd8abb42598e006e549e5cb75d4752', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -1003,7 +1003,7 @@ return { }, hurl = { install_info = { - revision = 'ff07a42d9ec95443b5c1b57ed793414bf7b79be5', + revision = '1124058cd192e80d80914652a5850a5b1887cc10', url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = '09666cead2c001cbbfc82b395007f6d8158113a5', + revision = '1f3bc2fd4d4e28361d1ff75cf5763e1d0c2b6348', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1805,7 +1805,7 @@ return { }, query = { install_info = { - revision = '2668cc53024953224a40b1e6546d7b8ec5a11150', + revision = '60e253d3c9d6b1131a0f75c85e4bdcc9a48d5b42', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -2043,7 +2043,7 @@ return { }, slint = { install_info = { - revision = '96bc969d20ff347030519184ea2467f4046a524d', + revision = 'ecd60078bbd546eeb4c7fbbe02226752517b847f', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2067,7 +2067,7 @@ return { }, snakemake = { install_info = { - revision = 'f36c1587624d6d84376c82a357c20fc319cbf02c', + revision = '7731408e5e8095fe242fdd423c3d3ae886fbf9fd', url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, @@ -2615,7 +2615,7 @@ return { }, xresources = { install_info = { - revision = 'f40778ff42f2119aebacd46d4b6d785a4181a9ba', + revision = '423597c9ee0cd9fd98691a9f9881ff4e6f7b047a', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From fee71c102c54146f90b14c89711ddbb8f95a1484 Mon Sep 17 00:00:00 2001 From: osthomas <8322329+osthomas@users.noreply.github.com> Date: Sun, 7 Sep 2025 13:58:28 +0200 Subject: [PATCH 205/434] feat(snakemake): update queries (#8106) also add indent tests --- runtime/queries/snakemake/highlights.scm | 8 +-- runtime/queries/snakemake/indents.scm | 40 +++++++++------ runtime/queries/snakemake/locals.scm | 36 ++++++++++++++ tests/indent/snakemake/blocks.smk | 22 +++++++++ .../indent/snakemake/directive_parameters.smk | 36 ++++++++++++++ tests/indent/snakemake_spec.lua | 49 +++++++++++++++++++ 6 files changed, 171 insertions(+), 20 deletions(-) create mode 100644 tests/indent/snakemake/blocks.smk create mode 100644 tests/indent/snakemake/directive_parameters.smk create mode 100644 tests/indent/snakemake_spec.lua diff --git a/runtime/queries/snakemake/highlights.scm b/runtime/queries/snakemake/highlights.scm index 8781b405c..59a180c44 100644 --- a/runtime/queries/snakemake/highlights.scm +++ b/runtime/queries/snakemake/highlights.scm @@ -63,20 +63,20 @@ body: (_ ; directive labels in wildcard context ((wildcard (identifier) @label) - (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards")) + (#any-of? @label "input" "jobid" "log" "output" "params" "resources" "rule" "threads" "wildcards")) ((wildcard (attribute object: (identifier) @label)) - (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards")) + (#any-of? @label "input" "jobid" "log" "output" "params" "resources" "rule" "threads" "wildcards")) ((wildcard (subscript value: (identifier) @label)) - (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards")) + (#any-of? @label "input" "jobid" "log" "output" "params" "resources" "rule" "threads" "wildcards")) ; directive labels in block context (eg. within 'run:') ((identifier) @label - (#any-of? @label "input" "log" "output" "params" "resources" "threads" "wildcards") + (#any-of? @label "input" "jobid" "log" "output" "params" "resources" "rule" "threads" "wildcards") (#has-ancestor? @label "directive") (#has-ancestor? @label "block")) diff --git a/runtime/queries/snakemake/indents.scm b/runtime/queries/snakemake/indents.scm index 140b7fb3c..d4ed63992 100644 --- a/runtime/queries/snakemake/indents.scm +++ b/runtime/queries/snakemake/indents.scm @@ -1,12 +1,12 @@ ; inherits: python -((rule_definition) @indent.begin - (#set! indent.immediate 1)) - -((checkpoint_definition) @indent.begin - (#set! indent.immediate 1)) - -((rule_inheritance) @indent.begin +([ + (rule_definition) + (checkpoint_definition) + (rule_inheritance) + (module_definition) + (directive) +] @indent.begin (#set! indent.immediate 1)) ((rule_import @@ -14,12 +14,20 @@ ":") @indent.begin (#set! indent.immediate 1)) -((module_definition) @indent.begin - (#set! indent.immediate 1)) - -((directive) @indent.begin - (#set! indent.immediate 1)) - -; end indentation after last parameter node (no following ',') -(directive_parameters - (_) @indent.end .) +; ; end indentation after last parameter node (no following ',') +; ; accommodate different levels of nesting +; ; see also queries/python/indents.scm: return_statement +(directive + (directive_parameters + [ + (_) @indent.dedent + (_ + [ + (_) + ")" + "}" + "]" + ] .) @indent.dedent + ] + . ; anchor at end: no subsequent ',' + )) diff --git a/runtime/queries/snakemake/locals.scm b/runtime/queries/snakemake/locals.scm index 219f23347..8b5e7c0b4 100644 --- a/runtime/queries/snakemake/locals.scm +++ b/runtime/queries/snakemake/locals.scm @@ -2,3 +2,39 @@ (rule_definition name: (identifier) @local.definition.type) @local.scope + +(rule_inheritance + alias: (as_pattern_target) @local.definition.type) @local.scope + +(checkpoint_definition + name: (identifier) @local.definition.type) @local.scope + +(module_definition + name: (identifier) @local.definition.type) @local.scope + +; use rule A from X +(rule_import + (rule_import_list + (identifier) @local.definition.import) + . + module_name: (identifier) .) @local.scope + +; use rule A from X as A_fromX +; use rule A from X as *_fromX +; use rule * from X as *_fromX +(rule_import + alias: (as_pattern_target) @local.definition.import .) @local.scope + +; use rule A from X with: +(rule_import + (rule_import_list + (identifier) @local.definition.type) + . + module_name: (identifier) + . + "with") @local.scope + +; use rule A from X as Y with: +(rule_import + alias: (as_pattern_target) @local.definition.type + "with") @local.scope diff --git a/tests/indent/snakemake/blocks.smk b/tests/indent/snakemake/blocks.smk new file mode 100644 index 000000000..fc10e7ae3 --- /dev/null +++ b/tests/indent/snakemake/blocks.smk @@ -0,0 +1,22 @@ +rule A: + """doc""" + +if True: + rule B: + """doc""" + +use rule other from somewhere + +use rule other2 from somewhere as other_alias + +use rule other3 from somewhere with: + input: 2 + +use rule other4 from somewhere as other_alias2 with: + input: 2 + +checkpoint C: + input: "1" + +module A: + snakefile: "x.smk" diff --git a/tests/indent/snakemake/directive_parameters.smk b/tests/indent/snakemake/directive_parameters.smk new file mode 100644 index 000000000..fa311bfb7 --- /dev/null +++ b/tests/indent/snakemake/directive_parameters.smk @@ -0,0 +1,36 @@ +rule A: + input: a + output: b + params: + a = 1, + b = 2, + c = 3 + shell: + """ + touch {output} + """ + +rule B: + input: a, + output: a, + b + params: + +rule C: + # test dedent after variably nested nodes + params: + 1 + params: + "1" + params: + a = 1 + params: + a = "1" + params: + a = call(1) + params: + a = call("1") + params: + a = config["a"] + params: + b = call(config["a"]) diff --git a/tests/indent/snakemake_spec.lua b/tests/indent/snakemake_spec.lua new file mode 100644 index 000000000..111d01113 --- /dev/null +++ b/tests/indent/snakemake_spec.lua @@ -0,0 +1,49 @@ +local Runner = require('tests.indent.common').Runner +local XFAIL = require('tests.indent.common').XFAIL + +local run = Runner:new(it, 'tests/indent/snakemake', { + tabstop = 4, + shiftwidth = 4, + softtabstop = 0, + expandtab = true, +}) + +describe('indent Snakemake:', function() + describe('whole file:', function() + run:whole_file('.', { + expected_failures = {}, + }) + end) + + describe('new line:', function() + run:new_line('blocks.smk', { on_line = 1, text = 'input: 1', indent = 4 }) + run:new_line('blocks.smk', { on_line = 2, text = 'input: 1', indent = 4 }) + run:new_line('blocks.smk', { on_line = 5, text = 'input: 1', indent = 8 }) + run:new_line('blocks.smk', { on_line = 6, text = 'input: 1', indent = 8 }) + run:new_line('blocks.smk', { on_line = 8, text = 'pass', indent = 0 }) + run:new_line('blocks.smk', { on_line = 10, text = 'pass', indent = 0 }) + run:new_line('blocks.smk', { on_line = 12, text = 'pass', indent = 4 }) + run:new_line('blocks.smk', { on_line = 15, text = 'pass', indent = 4 }) + run:new_line('directive_parameters.smk', { on_line = 4, text = 'before_a = 0,', indent = 8 }) + run:new_line('directive_parameters.smk', { on_line = 5, text = 'after_a = 1.1,', indent = 8 }) + run:new_line( + 'directive_parameters.smk', + { on_line = 7, text = '"""dedent_after_last_param"""', indent = 4 } + ) + run:new_line( + 'directive_parameters.smk', + { on_line = 14, text = 'b = "indent_after_param_with_comma"', indent = 8 } + ) + run:new_line( + 'directive_parameters.smk', + { on_line = 15, text = 'b = "indent_after_param_with_comma"', indent = 8 } + ) + run:new_line( + 'directive_parameters.smk', + { on_line = 17, text = 'b = "indent_after_opening"', indent = 8 } + ) + for _, line in ipairs({ 22, 24, 26, 28, 30, 32, 34, 36 }) do + run:new_line('directive_parameters.smk', { on_line = line, text = '"doc"', indent = 4 }) + end + end) +end) From 7f8dd2e48bc47227d8138a5b5b1fb5a6d6e42237 Mon Sep 17 00:00:00 2001 From: altermo <107814000+altermo@users.noreply.github.com> Date: Wed, 10 Sep 2025 09:29:48 +0200 Subject: [PATCH 206/434] fix(filetypes): correct glimmer_* mappings (#8110) --- plugin/filetypes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index a7bb3bcc0..5e23adffd 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -24,7 +24,7 @@ local filetypes = { ini = { 'confini', 'dosini' }, janet_simple = { 'janet' }, javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' }, - javascript_glimmer = { 'javascript.glimmer' }, + glimmer_javascript = { 'javascript.glimmer' }, latex = { 'tex' }, linkerscript = { 'ld' }, m68k = { 'asm68k' }, @@ -53,7 +53,7 @@ local filetypes = { tlaplus = { 'tla' }, tsx = { 'typescriptreact', 'typescript.tsx' }, typescript = { 'ts' }, - typescript_glimmer = { 'typescript.glimmer' }, + glimmer_typescript = { 'typescript.glimmer' }, typst = { 'typ' }, udev = { 'udevrules' }, uxntal = { 'tal', 'uxn' }, From f42378a959ffeaaf181b0b4793ee3cdb733324be Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 13 Sep 2025 04:24:44 -0400 Subject: [PATCH 207/434] feat(glimmer_*): add `glimmer_template` folds (#8115) --- runtime/queries/glimmer_javascript/folds.scm | 2 ++ runtime/queries/glimmer_typescript/folds.scm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/runtime/queries/glimmer_javascript/folds.scm b/runtime/queries/glimmer_javascript/folds.scm index 04328f099..95accfece 100644 --- a/runtime/queries/glimmer_javascript/folds.scm +++ b/runtime/queries/glimmer_javascript/folds.scm @@ -1 +1,3 @@ ; inherits: ecma + +(glimmer_template) @fold diff --git a/runtime/queries/glimmer_typescript/folds.scm b/runtime/queries/glimmer_typescript/folds.scm index 1b61e36da..62d0b9e0c 100644 --- a/runtime/queries/glimmer_typescript/folds.scm +++ b/runtime/queries/glimmer_typescript/folds.scm @@ -1 +1,3 @@ ; inherits: typescript + +(glimmer_template) @fold From f6adaede57e68eadd20c15cd1511ad4eea042cb0 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 13 Sep 2025 10:23:18 +0200 Subject: [PATCH 208/434] feat(parsers): update authzed, bash, cpp, cylc, editorconfig, foam, gdscript, go, html, hurl, idl, java, javadoc, javascript, jsdoc, json, mlir, php, php_only, powershell, regex, rust, supercollider, zig --- lua/nvim-treesitter/parsers.lua | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 822421bfe..c3804a45e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -62,7 +62,7 @@ return { }, authzed = { install_info = { - revision = '1dec7e1af96c56924e3322cd85fdce15d0a31d00', + revision = '83e5c26a8687eb4688fe91d690c735cc3d21ad81', url = 'https://github.com/mleonidas/tree-sitter-authzed', }, maintainers = { '@mattpolzin' }, @@ -77,7 +77,7 @@ return { }, bash = { install_info = { - revision = 'b930fed16910a74c230e09ea5b97f671448d2116', + revision = 'cef0974919c6fc7647a24ed1d89b291264b5abca', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = '077f14ffd2de226ac95808596989c705f6dee289', + revision = 'e89fbaf0a4d294526c58259c40d5b3c16401f4e9', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -322,7 +322,7 @@ return { }, cylc = { install_info = { - revision = '5517ecade85b1de85ed8e0cb742b81decc64183a', + revision = '6d1d81137112299324b526477ce1db989ab58fb8', url = 'https://github.com/elliotfontaine/tree-sitter-cylc', }, maintainers = { '@elliotfontaine' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '17be0e84ac012b6731626baf6920ff24e1865a03', + revision = 'de41a82984170f3c1c4ff20f2e8b906e5a860e1d', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -576,7 +576,7 @@ return { }, foam = { install_info = { - revision = 'f08bb76892b93e5b23c45ac3bd6b1eea5df323cc', + revision = '472c24f11a547820327fb1be565bcfff98ea96a4', url = 'https://github.com/FoamScience/tree-sitter-foam', }, maintainers = { '@FoamScience' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = '8d30b8dbb84a5f786b93726dca158ae8ea3c413f', + revision = 'd28f24a9cc482a5274d77d41918b052e72cc18f4', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -770,7 +770,7 @@ return { }, go = { install_info = { - revision = '1547678a9da59885853f5f5cc8a99cc203fa2e2c', + revision = '9d780544a2226ccd1a2a57299903d51d0d8c8951', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -973,7 +973,7 @@ return { }, html = { install_info = { - revision = '9fc04b9ef21a92e3ea9258f5690e4461394d7811', + revision = '281738071a38865c9c52b41cd3f42a626407ffa1', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -1003,7 +1003,7 @@ return { }, hurl = { install_info = { - revision = '1124058cd192e80d80914652a5850a5b1887cc10', + revision = '597efbd7ce9a814bb058f48eabd055b1d1e12145', url = 'https://github.com/pfeiferj/tree-sitter-hurl', }, maintainers = { '@pfeiferj' }, @@ -1019,7 +1019,7 @@ return { }, idl = { install_info = { - revision = '6ab5582bd47b86df75afe90cdd8dc55d2d480ce1', + revision = '914f1f9bea4458427351f20c25bf263288aaeb66', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1067,7 +1067,7 @@ return { }, java = { install_info = { - revision = '968afb3c9be2d4dba4cd36f3580ee0b1a9c1c537', + revision = '12c4848bc6cf2660d80b435f8d8de1a9d4676d04', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = 'fea74f50f5a6dcef575687703b82a96f9e6d1312', + revision = 'a1917ed4cbf5c9438abbeb0a9d02b2d87bfebf7c', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1083,7 +1083,7 @@ return { }, javascript = { install_info = { - revision = '44c892e0be055ac465d5eeddae6d3e194424e7de', + revision = '22da14e17db59c35aae2b9da2728337c301ce741', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1121,7 +1121,7 @@ return { }, jsdoc = { install_info = { - revision = 'a417db5dbdd869fccb6a8b75ec04459e1d4ccd2c', + revision = '658d18dcdddb75c760363faa4963427a7c6b52db', url = 'https://github.com/tree-sitter/tree-sitter-jsdoc', }, maintainers = { '@steelsojka' }, @@ -1129,7 +1129,7 @@ return { }, json = { install_info = { - revision = 'fd38547e2fe5738e5b173e5f40a27df261224bba', + revision = '532a34b9e5a64fdcd5a8748a917fd489aa06d6fb', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = '1f3bc2fd4d4e28361d1ff75cf5763e1d0c2b6348', + revision = 'ef7a2efed65814aa394875e2b578ff6aeb272b41', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1574,7 +1574,7 @@ return { php = { install_info = { location = 'php', - revision = '5b5627faaa290d89eb3d01b9bf47c3bb9e797dea', + revision = '9d7d6f649297ee01639e759795793cc57698031b', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1585,7 +1585,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '5b5627faaa290d89eb3d01b9bf47c3bb9e797dea', + revision = '9d7d6f649297ee01639e759795793cc57698031b', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1653,7 +1653,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '96ab1da05cfb55b52ee7000b4be8a4b6fad232f5', + revision = 'f272e5ac9bc48d0f6df2429cab914d216e9413cd', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1877,7 +1877,7 @@ return { }, regex = { install_info = { - revision = 'b638d29335ef41215b86732dd51be34c701ef683', + revision = 'b2ac15e27fce703d2f37a79ccd94a5c0cbe9720b', url = 'https://github.com/tree-sitter/tree-sitter-regex', }, maintainers = { '@theHamsta' }, @@ -1974,7 +1974,7 @@ return { }, rust = { install_info = { - revision = '3bfef41a01ab49a25ffdecf998823b4b82fcaf69', + revision = '2a58b00ed44829eebcbe6f932604093b9396a43b', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2174,7 +2174,7 @@ return { }, supercollider = { install_info = { - revision = 'c6145cad24e19485f6ceb86e0a1be479d6537fb0', + revision = '613bac2ddc30bff4f0a1d88b1aa7e5ec8ca37028', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, @@ -2655,7 +2655,7 @@ return { }, zig = { install_info = { - revision = 'b71affffdb4222ff2d2dea6e164f76603b0be6bc', + revision = '6479aa13f32f701c383083d8b28360ebd682fb7d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-zig', }, maintainers = { '@amaanq' }, From 682d083292f01636622362cf9eb0e4b2f9de2b13 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 13 Sep 2025 10:31:02 +0200 Subject: [PATCH 209/434] feat(python)!: update parser and queries Breaking change: anonymous node `"expect*"` was removed by the refactor. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/python/highlights.scm | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index c3804a45e..f9f9620e4 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1772,7 +1772,7 @@ return { }, python = { install_info = { - revision = '710796b8b877a970297106e5bbc8e2afa47f86ec', + revision = '293fdc02038ee2bf0e2e206711b69c90ac0d413f', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 00250de1b..e5b9ac3aa 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -223,7 +223,6 @@ [ "try" "except" - "except*" "raise" "finally" ] @keyword.exception From 7aa24acae3a288e442e06928171f360bbdf75ba4 Mon Sep 17 00:00:00 2001 From: purarue <7804791+purarue@users.noreply.github.com> Date: Sun, 14 Sep 2025 08:53:21 +0000 Subject: [PATCH 210/434] feat(rifleconf): add parser and queries --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++++++ runtime/queries/rifleconf/highlights.scm | 31 ++++++++++++++++++++++++ runtime/queries/rifleconf/injections.scm | 16 ++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 runtime/queries/rifleconf/highlights.scm create mode 100644 runtime/queries/rifleconf/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 25c5e1137..361585ab2 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -244,6 +244,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [rego](https://github.com/FallenAngel97/tree-sitter-rego) | unstable | `H  J ` | | @FallenAngel97 [requirements](https://github.com/tree-sitter-grammars/tree-sitter-requirements) | unstable | `H  J ` | | @ObserverOfTime [rescript](https://github.com/rescript-lang/tree-sitter-rescript) | unstable | `HFIJL` | | @ribru17 +[rifleconf](https://github.com/purarue/tree-sitter-rifleconf) | unstable | `H  J ` | | @purarue [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | unstable | `HF J ` | | @bamonroe [robot](https://github.com/Hubro/tree-sitter-robot) | unstable | `HFIJ ` | | @Hubro [robots](https://github.com/opa-oz/tree-sitter-robots-txt) | unstable | `H  J ` | | @opa-oz diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index f9f9620e4..096d93599 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1908,6 +1908,14 @@ return { maintainers = { '@ribru17' }, tier = 2, }, + rifleconf = { + install_info = { + url = 'https://github.com/purarue/tree-sitter-rifleconf', + revision = 'b215640ba72a9a8cac6f5d95dbc3d320cb546e13', + }, + maintainers = { '@purarue' }, + tier = 2, + }, rnoweb = { install_info = { revision = '1a74dc0ed731ad07db39f063e2c5a6fe528cae7f', diff --git a/runtime/queries/rifleconf/highlights.scm b/runtime/queries/rifleconf/highlights.scm new file mode 100644 index 000000000..2ac837a3e --- /dev/null +++ b/runtime/queries/rifleconf/highlights.scm @@ -0,0 +1,31 @@ +(comment) @comment @spell + +[ + "," + ";" +] @punctuation.delimiter + +[ + "=" + (condition_negation) +] @operator + +; mark the string values for items interpreted as regex as string.regexp +(binary_condition_expression + (binary_condition_identifier) @_keyword + (identifier) @string.regexp + (#any-of? @_keyword "match" "ext" "mime" "name" "path")) + +(binary_condition_identifier) @keyword + +(unary_condition_identifier) @keyword + +(condition_expression + (binary_condition_expression + (binary_condition_identifier) @keyword + (identifier) @number) + (#eq? @keyword "number")) + +(ask) @function.builtin + +(string) @string diff --git a/runtime/queries/rifleconf/injections.scm b/runtime/queries/rifleconf/injections.scm new file mode 100644 index 000000000..e0463982f --- /dev/null +++ b/runtime/queries/rifleconf/injections.scm @@ -0,0 +1,16 @@ +; These are all interpreted as regex when evaluated +; https://github.com/ranger/ranger/blob/38bb8901004b75a407ffee4b9e176bc0a436cb15/ranger/ext/rifle.py#L273-L282 +(binary_condition_expression + (binary_condition_identifier) @_keyword + (identifier) @injection.content + (#any-of? @_keyword "match" "ext" "mime" "name" "path") + (#set! injection.language "regex")) + +; highlight any commands using the bash tree-sitter parser +(command_list + (command) @injection.content + (#set! injection.include-children) + (#set! injection.language "bash")) + +((comment) @injection.content + (#set! injection.language "comment")) From 030e979b23a65a22f1c0a43396e6c7cf676c8735 Mon Sep 17 00:00:00 2001 From: "Sergio A. Vargas" Date: Wed, 17 Sep 2025 10:53:25 -0500 Subject: [PATCH 211/434] docs(README): clarify that `tree-sitter-cli` is required (#8124) Seems like most distros have split out the CLI package under this name and reserve `tree-sitter` for the library (and crates) only. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 921b11002..bdb9c1ddc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For details on these and how to help improving them, see [CONTRIBUTING.md](./CON - Neovim 0.11.0 or later (nightly) - `tar` and `curl` in your path -- [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) CLI (0.25.0 or later) +- [`tree-sitter-cli`](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md) (0.25.0 or later) - a C compiler in your path (see ) - `Node` (23.0.0 or later) for some parsers (see the [list of supported languages](SUPPORTED_LANGUAGES.md)) From f4d22b96c58c799939b014e03eb4db1b5e5c82c9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 17 Sep 2025 17:56:17 +0200 Subject: [PATCH 212/434] docs(health): consistent use of `tree-sitter-cli` --- lua/nvim-treesitter/health.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 856e2183e..3da7f5415 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -54,14 +54,14 @@ local function install_health() 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)) + health.ok(string.format('tree-sitter-cli %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)) + string.format('tree-sitter-cli v%d.%d.%d is required', unpack(TREE_SITTER_MIN_VER)) ) end else - health.error('tree-sitter CLI not found') + health.error('tree-sitter-cli not found') end end From 1c760c1888f5e7474d1ae222f0638cb3b731629b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 17 Sep 2025 18:08:02 +0200 Subject: [PATCH 213/434] feat(parsers): update bash, c, cpp, desktop, djot, dtd, editorconfig, gdscript, go, html, idl, java, javadoc, javascript, json, markdown, markdown_inline, mlir, php, php_only, python, r, rust, scheme, ssh_config, supercollider, superhtml, systemverilog, templ, xml, xresources --- lua/nvim-treesitter/parsers.lua | 64 +++++++++++++-------------- runtime/queries/python/highlights.scm | 12 +++-- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 096d93599..ff27ab5d9 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -77,7 +77,7 @@ return { }, bash = { install_info = { - revision = 'cef0974919c6fc7647a24ed1d89b291264b5abca', + revision = '20f55fb9663568f16ebceaac7673d2aa530add46', url = 'https://github.com/tree-sitter/tree-sitter-bash', }, maintainers = { '@TravonteD' }, @@ -158,7 +158,7 @@ return { }, c = { install_info = { - revision = 'd8d0503aa0152119149ecad76685f37682c0d03f', + revision = 'ae19b676b13bdcc13b7665397e6d9b14975473dd', url = 'https://github.com/tree-sitter/tree-sitter-c', }, maintainers = { '@amaanq' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = 'e89fbaf0a4d294526c58259c40d5b3c16401f4e9', + revision = '2a682d312b09eb737a08b4900ec786415574b6bf', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'ea5cff078ebd8abb42598e006e549e5cb75d4752', + revision = '4a0a5eec8644a7f3357f852d7a16d2550bb2cbc2', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -386,7 +386,7 @@ return { }, djot = { install_info = { - revision = 'eb31845d59b9ee8c1b2098e78e9ca72004bd1579', + revision = '74fac1f53c6d52aeac104b6874e5506be6d0cfe6', url = 'https://github.com/treeman/tree-sitter-djot', }, maintainers = { '@NoahTheDuke' }, @@ -419,7 +419,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '87be254e12169240a0e0214dbee5e208df96fa75', + revision = '863dbc381f44f6c136a399e684383b977bb2beaa', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = 'de41a82984170f3c1c4ff20f2e8b906e5a860e1d', + revision = '947228fb880f838c6d71e8f11dbc0bfb82cd4c78', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = 'd28f24a9cc482a5274d77d41918b052e72cc18f4', + revision = 'e8f2cb84bfd61d025cbc39e95346ebc6b866daf1', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -770,7 +770,7 @@ return { }, go = { install_info = { - revision = '9d780544a2226ccd1a2a57299903d51d0d8c8951', + revision = '2346a3ab1bb3857b48b29d779a1ef9799a248cd7', url = 'https://github.com/tree-sitter/tree-sitter-go', }, maintainers = { '@theHamsta', '@WinWisely268' }, @@ -973,7 +973,7 @@ return { }, html = { install_info = { - revision = '281738071a38865c9c52b41cd3f42a626407ffa1', + revision = '73a3947324f6efddf9e17c0ea58d454843590cc0', url = 'https://github.com/tree-sitter/tree-sitter-html', }, maintainers = { '@TravonteD' }, @@ -1019,7 +1019,7 @@ return { }, idl = { install_info = { - revision = '914f1f9bea4458427351f20c25bf263288aaeb66', + revision = '3632e926ef4ba924b05993683111480af0d5c9e3', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1067,7 +1067,7 @@ return { }, java = { install_info = { - revision = '12c4848bc6cf2660d80b435f8d8de1a9d4676d04', + revision = 'e10607b45ff745f5f876bfa3e94fbcc6b44bdc11', url = 'https://github.com/tree-sitter/tree-sitter-java', }, maintainers = { '@p00f' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = 'a1917ed4cbf5c9438abbeb0a9d02b2d87bfebf7c', + revision = '85acd4655cbfaef414de6e3f87436e63ef5cb0da', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1083,7 +1083,7 @@ return { }, javascript = { install_info = { - revision = '22da14e17db59c35aae2b9da2728337c301ce741', + revision = '58404d8cf191d69f2674a8fd507bd5776f46cb11', url = 'https://github.com/tree-sitter/tree-sitter-javascript', }, maintainers = { '@steelsojka' }, @@ -1129,7 +1129,7 @@ return { }, json = { install_info = { - revision = '532a34b9e5a64fdcd5a8748a917fd489aa06d6fb', + revision = '001c28d7a29832b06b0e831ec77845553c89b56d', url = 'https://github.com/tree-sitter/tree-sitter-json', }, maintainers = { '@steelsojka' }, @@ -1347,7 +1347,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '7462bb66ac7e90312082269007fac2772fe5efd1', + revision = '2dfd57f547f06ca5631a80f601e129d73fc8e9f0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1358,7 +1358,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '7462bb66ac7e90312082269007fac2772fe5efd1', + revision = '2dfd57f547f06ca5631a80f601e129d73fc8e9f0', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = 'ef7a2efed65814aa394875e2b578ff6aeb272b41', + revision = 'fc6f378f2ce6ceee11ea31fbfc8d72955d9bbe27', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1574,7 +1574,7 @@ return { php = { install_info = { location = 'php', - revision = '9d7d6f649297ee01639e759795793cc57698031b', + revision = '9a85df21c63bdaf1695b7ac1430e29354cb5904f', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1585,7 +1585,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '9d7d6f649297ee01639e759795793cc57698031b', + revision = '9a85df21c63bdaf1695b7ac1430e29354cb5904f', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1772,7 +1772,7 @@ return { }, python = { install_info = { - revision = '293fdc02038ee2bf0e2e206711b69c90ac0d413f', + revision = '26855eabccb19c6abf499fbc5b8dc7cc9ab8bc64', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, @@ -1814,7 +1814,7 @@ return { }, r = { install_info = { - revision = '7b4eb04dfcc86e6705cade825f8c1edbd46584b2', + revision = '0e6ef7741712c09dc3ee6e81c42e919820cc65ef', url = 'https://github.com/r-lib/tree-sitter-r', }, maintainers = { '@ribru17' }, @@ -1910,8 +1910,8 @@ return { }, rifleconf = { install_info = { - url = 'https://github.com/purarue/tree-sitter-rifleconf', revision = 'b215640ba72a9a8cac6f5d95dbc3d320cb546e13', + url = 'https://github.com/purarue/tree-sitter-rifleconf', }, maintainers = { '@purarue' }, tier = 2, @@ -1982,7 +1982,7 @@ return { }, rust = { install_info = { - revision = '2a58b00ed44829eebcbe6f932604093b9396a43b', + revision = '00d7cbc95f0b8ea2703129550fbd1853a13e0e29', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2008,7 +2008,7 @@ return { }, scheme = { install_info = { - revision = 'e35b41a183164f4a12e10da3d0c430e837c3d75a', + revision = '67b5c8d6ce19fd5265f13204fec0a3efa9e095d9', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 2, @@ -2150,7 +2150,7 @@ return { }, ssh_config = { install_info = { - revision = '2d620d0ad636705800cf0ddb92c30afe703cd84f', + revision = '71d2693deadaca8cdc09e38ba41d2f6042da1616', url = 'https://github.com/tree-sitter-grammars/tree-sitter-ssh-config', }, maintainers = { '@ObserverOfTime' }, @@ -2182,7 +2182,7 @@ return { }, supercollider = { install_info = { - revision = '613bac2ddc30bff4f0a1d88b1aa7e5ec8ca37028', + revision = '18be2f121ea0a722dfdffcc4439687fc1d10a9ce', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, @@ -2191,7 +2191,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '8cb16babb0c66b6512d6aeb4cbc37ed90641d980', + revision = '521458b2a61e607d07b794d85b5dcfcd10518745', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2249,7 +2249,7 @@ return { }, systemverilog = { install_info = { - revision = '999e88565e199abec12d6fb7470419b5ae217386', + revision = '9e06a0dddbef4e80a2091fd0a772cc93a55019f7', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2298,7 +2298,7 @@ return { }, templ = { install_info = { - revision = '47594c5cbef941e6a3ccf4ddb934a68cf4c68075', + revision = '27a1fc62c8dd4c49669e03629491f66449c6c435', url = 'https://github.com/vrischmann/tree-sitter-templ', }, maintainers = { '@vrischmann' }, @@ -2614,7 +2614,7 @@ return { xml = { install_info = { location = 'xml', - revision = '87be254e12169240a0e0214dbee5e208df96fa75', + revision = '863dbc381f44f6c136a399e684383b977bb2beaa', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2623,7 +2623,7 @@ return { }, xresources = { install_info = { - revision = '423597c9ee0cd9fd98691a9f9881ff4e6f7b047a', + revision = '64a07d24c34a8e7915360e6ab367e9b0ff991307', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index e5b9ac3aa..0cdc957d0 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -358,17 +358,15 @@ ((class_definition body: (block - (expression_statement - (assignment - left: (identifier) @variable.member)))) + (assignment + left: (identifier) @variable.member))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition body: (block - (expression_statement - (assignment - left: (_ - (identifier) @variable.member))))) + (assignment + left: (_ + (identifier) @variable.member)))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition From 8ab64a37ea56762dc0d1a6da2bba2d4af88e3594 Mon Sep 17 00:00:00 2001 From: sharpchen Date: Wed, 17 Sep 2025 22:48:13 +0800 Subject: [PATCH 214/434] fix(c_sharp): missing query for delegate name --- runtime/queries/c_sharp/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm index ce9911151..d8cf08388 100644 --- a/runtime/queries/c_sharp/highlights.scm +++ b/runtime/queries/c_sharp/highlights.scm @@ -190,6 +190,9 @@ (enum_declaration name: (identifier) @type) +(delegate_declaration + name: (identifier) @type) + (enum_member_declaration name: (identifier) @variable.member) From 317a77affcd887441d67c5f7f1d5beff5243989b Mon Sep 17 00:00:00 2001 From: sharpchen Date: Thu, 18 Sep 2025 23:02:03 +0800 Subject: [PATCH 215/434] fix(c_sharp): missing highlight for parameter modifier --- runtime/queries/c_sharp/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm index d8cf08388..0c9489506 100644 --- a/runtime/queries/c_sharp/highlights.scm +++ b/runtime/queries/c_sharp/highlights.scm @@ -90,6 +90,9 @@ (parameter name: (identifier) @variable.parameter) +(parameter + (modifier) @keyword.modifier) + (parameter_list name: (identifier) @variable.parameter) From 1b8622a830da30c348998f26fab6934ca0133392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20de=20Vill=C3=A8le?= <25150288+Thibaulltt@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:46:07 +0200 Subject: [PATCH 216/434] feat(latex)!: update parser and queries Breaking change: `(curly_group_label)` replaced by `(curly_group_text)` see latex-lsp/tree-sitter-latex#213 --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/latex/highlights.scm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ff27ab5d9..8ea842356 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1240,7 +1240,7 @@ return { latex = { install_info = { generate = true, - revision = '9410012b3eba659da5de5a655b4041593b493cb7', + revision = '7af2bf3addcab5ada8843cf08b857daf1799dbd4', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm index ec39afcf5..30602c907 100644 --- a/runtime/queries/latex/highlights.scm +++ b/runtime/queries/latex/highlights.scm @@ -92,9 +92,9 @@ (label_reference_range command: _ @function.macro - from: (curly_group_text + from: (curly_group_label (_) @markup.link) - to: (curly_group_text + to: (curly_group_label (_) @markup.link)) (label_reference @@ -104,7 +104,7 @@ (label_number command: _ @function.macro - name: (curly_group_text + name: (curly_group_label (_) @markup.link) number: (_) @markup.link) From c41b3b9841588e956663345cf01842a232d5eece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20de=20Vill=C3=A8le?= <25150288+Thibaulltt@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:12:12 +0200 Subject: [PATCH 217/434] feat(latex): add counter nodes' highlight rules --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/latex/highlights.scm | 59 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8ea842356..16d575512 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1240,7 +1240,7 @@ return { latex = { install_info = { generate = true, - revision = '7af2bf3addcab5ada8843cf08b857daf1799dbd4', + revision = '7e0ecdc02926c7b9b2e0c76003d4fe7b0944f957', url = 'https://github.com/latex-lsp/tree-sitter-latex', }, maintainers = { '@theHamsta', '@clason' }, diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm index 30602c907..3f195a13e 100644 --- a/runtime/queries/latex/highlights.scm +++ b/runtime/queries/latex/highlights.scm @@ -23,6 +23,9 @@ (curly_group_spec (text) @variable.parameter) +(curly_group_value + (value_literal) @constant) + (brack_group_argc) @variable.parameter [ @@ -85,6 +88,54 @@ declaration: (curly_group_command_name (_) @function)) +(counter_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (brack_group_word + (word) @variable)?) + +(counter_within_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (curly_group_word + (word) @variable)) + +(counter_without_declaration + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable) + supercounter: (curly_group_word + (word) @variable)) + +(counter_value + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +; The 'value' fields for the two following highlights +; are handled by counter_value and curly_group_value. +(counter_definition + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_addition + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_increment + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + +(counter_typesetting + command: _ @function.macro @nospell + counter: (curly_group_word + (word) @variable)) + (label_definition command: _ @function.macro name: (curly_group_label @@ -298,6 +349,14 @@ ; Turn spelling off for whole nodes [ + (counter_declaration) + (counter_within_declaration) + (counter_without_declaration) + (counter_value) + (counter_definition) + (counter_addition) + (counter_increment) + (counter_typesetting) (label_reference) (label_reference_range) (label_number) From 20fc6b1270dddff7e16220e0a51d17614d41fd43 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 19 Sep 2025 13:35:29 +0200 Subject: [PATCH 218/434] feat(python): revert breaking change This reverts the update in https://github.com/nvim-treesitter/nvim-treesitter/pull/8128 which turned out to have further breaking consequences. Pin the parser to the last release (tier 1) to avoid pulling in more breaking changes. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/python/highlights.scm | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 361585ab2..61371d0e0 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -227,7 +227,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [puppet](https://github.com/tree-sitter-grammars/tree-sitter-puppet) | unstable | `HFIJL` | | @amaanq [purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | | @postsolar [pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | | @ObserverOfTime -[python](https://github.com/tree-sitter/tree-sitter-python) | unstable | `HFIJL` | | @stsewd, @theHamsta +[python](https://github.com/tree-sitter/tree-sitter-python) | stable | `HFIJL` | | @stsewd, @theHamsta [ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | | @pwntester [qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | | @amaanq [qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | | @Decodetalkers diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 16d575512..79fe3a6b6 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1772,11 +1772,11 @@ return { }, python = { install_info = { - revision = '26855eabccb19c6abf499fbc5b8dc7cc9ab8bc64', + revision = 'v0.25.0', url = 'https://github.com/tree-sitter/tree-sitter-python', }, maintainers = { '@stsewd', '@theHamsta' }, - tier = 2, + tier = 1, }, ql = { install_info = { diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 0cdc957d0..e5b9ac3aa 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -358,15 +358,17 @@ ((class_definition body: (block - (assignment - left: (identifier) @variable.member))) + (expression_statement + (assignment + left: (identifier) @variable.member)))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition body: (block - (assignment - left: (_ - (identifier) @variable.member)))) + (expression_statement + (assignment + left: (_ + (identifier) @variable.member))))) (#lua-match? @variable.member "^[%l_].*$")) ((class_definition From a1d3efbdf587a4c220d08249b1a4d8870c828d38 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 21 Sep 2025 10:32:52 +0200 Subject: [PATCH 219/434] feat(parsers): update ada, cuda, desktop, gdscript, json5, mlir, nu, slint, snakemake, supercollider, superhtml, vhdl, wgsl_bevy, xresources --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 79fe3a6b6..9e3a32e2e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,7 @@ return { ada = { install_info = { - revision = '0a4c27dc1308a9d2742de22e5fcfc0c137b3d3f3', + revision = '364d3f4aa8b382113bdd5d3ca6d82dc9c74ac738', url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, @@ -305,7 +305,7 @@ return { }, cuda = { install_info = { - revision = '014628ae8d2df391b88ddb9fa0260fd97f770829', + revision = '48b066f334f4cf2174e05a50218ce2ed98b6fd01', url = 'https://github.com/tree-sitter-grammars/tree-sitter-cuda', }, maintainers = { '@theHamsta' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '4a0a5eec8644a7f3357f852d7a16d2550bb2cbc2', + revision = 'b77dad972dcc96f9a7123fb08d8eb46308e31d9a', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -652,7 +652,7 @@ return { }, gdscript = { install_info = { - revision = 'e8f2cb84bfd61d025cbc39e95346ebc6b866daf1', + revision = '9686853b696db07118ad110e440d6de0ca6498b4', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, maintainers = { '@PrestonKnopp' }, @@ -1137,7 +1137,7 @@ return { }, json5 = { install_info = { - revision = '5ebe24e210f0fbcd6180fd673ed184ed81f3bcc6', + revision = '8cb4114a4d7e5bab75d74466422e032de31d83df', url = 'https://github.com/Joakker/tree-sitter-json5', }, maintainers = { '@Joakker' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = 'fc6f378f2ce6ceee11ea31fbfc8d72955d9bbe27', + revision = '8f86b34b5e3dfe561e1e913df4a3d719ea1dcc5c', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1479,7 +1479,7 @@ return { }, nu = { install_info = { - revision = 'cc4624fbc6ec3563d98fbe8f215a8b8e10b16f32', + revision = '0e6c59c46db3c246eaf86ce5b325da1247e971a5', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -2051,7 +2051,7 @@ return { }, slint = { install_info = { - revision = 'ecd60078bbd546eeb4c7fbbe02226752517b847f', + revision = '152ec7f6a2aa29fe222f741d91bec70153c487da', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2075,7 +2075,7 @@ return { }, snakemake = { install_info = { - revision = '7731408e5e8095fe242fdd423c3d3ae886fbf9fd', + revision = '68010430c3e51c0e84c1ce21c6551df0e2469f51', url = 'https://github.com/osthomas/tree-sitter-snakemake', }, maintainers = { '@osthomas' }, @@ -2182,7 +2182,7 @@ return { }, supercollider = { install_info = { - revision = '18be2f121ea0a722dfdffcc4439687fc1d10a9ce', + revision = '76b3cab1773f08bb7d3a185420b0a44c6da8c294', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, maintainers = { '@madskjeldgaard' }, @@ -2191,7 +2191,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '521458b2a61e607d07b794d85b5dcfcd10518745', + revision = '574a7a000c6e6a8a922c11afa9da60dca84e5e1f', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2515,7 +2515,7 @@ return { }, vhdl = { install_info = { - revision = '02523d7fb0321344c19c1f3f4ec6b83424c7d6c8', + revision = '0c25aa064dc489ec5291e4879fa7ed41cf5fe680', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2573,7 +2573,7 @@ return { }, wgsl_bevy = { install_info = { - revision = '47c1818d245a6156a488c4c4d06e9336714bae9b', + revision = 'd9306a798ede627001a8e5752f775858c8edd7e4', url = 'https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy', }, maintainers = { '@theHamsta' }, @@ -2623,7 +2623,7 @@ return { }, xresources = { install_info = { - revision = '64a07d24c34a8e7915360e6ab367e9b0ff991307', + revision = '2259ae28ad0e139b726dab286f7fa9626a1c2256', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From bd99d6bd2bdd346c5da090db5e3956de0e0a2f3f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 21 Sep 2025 10:38:22 +0200 Subject: [PATCH 220/434] feat(koto)!: update parser and queries Breaking changes: `call`, `index`, `lookup` fields removed --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/koto/highlights.scm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 9e3a32e2e..0ddc29cd4 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1215,7 +1215,7 @@ return { }, koto = { install_info = { - revision = '2ffc77c14f0ac1674384ff629bfc207b9c57ed89', + revision = '633744bca404ae4edb961a3c2d7bc947a987afa4', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, diff --git a/runtime/queries/koto/highlights.scm b/runtime/queries/koto/highlights.scm index bd6ce8d0e..396d9bdc6 100644 --- a/runtime/queries/koto/highlights.scm +++ b/runtime/queries/koto/highlights.scm @@ -90,7 +90,8 @@ (identifier) @module) (chain - lookup: (identifier) @variable.member) + (lookup + (identifier)) @variable.member) (chain start: (identifier) @function.call) From 6ac9f2e51270cd6f57c4783a36c60cd03e4cfb94 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 21 Sep 2025 16:59:47 -0700 Subject: [PATCH 221/434] fix: align line continuation highlights (#8146) These should be `@punctuation.special`. Added the highlight for python, cylc, and make. Corrected it for earthfile and matlab. --- runtime/queries/cylc/highlights.scm | 2 ++ runtime/queries/earthfile/highlights.scm | 2 +- runtime/queries/make/highlights.scm | 2 ++ runtime/queries/matlab/highlights.scm | 7 +++---- runtime/queries/python/highlights.scm | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/runtime/queries/cylc/highlights.scm b/runtime/queries/cylc/highlights.scm index a744caa52..086caf788 100644 --- a/runtime/queries/cylc/highlights.scm +++ b/runtime/queries/cylc/highlights.scm @@ -32,6 +32,8 @@ (graph_parenthesis) ] @punctuation.bracket +(line_continuation) @punctuation.special + [ "\"" "\"\"\"" diff --git a/runtime/queries/earthfile/highlights.scm b/runtime/queries/earthfile/highlights.scm index cc7dce298..ee0e300b5 100644 --- a/runtime/queries/earthfile/highlights.scm +++ b/runtime/queries/earthfile/highlights.scm @@ -126,4 +126,4 @@ "=" @operator -(line_continuation) @operator +(line_continuation) @punctuation.special diff --git a/runtime/queries/make/highlights.scm b/runtime/queries/make/highlights.scm index afdfbe336..8d182c026 100644 --- a/runtime/queries/make/highlights.scm +++ b/runtime/queries/make/highlights.scm @@ -168,3 +168,5 @@ "file" "value" ] @function.builtin) + +"\\" @punctuation.special diff --git a/runtime/queries/matlab/highlights.scm b/runtime/queries/matlab/highlights.scm index 66ec69465..05713e05a 100644 --- a/runtime/queries/matlab/highlights.scm +++ b/runtime/queries/matlab/highlights.scm @@ -211,10 +211,9 @@ (#eq? @boolean "false")) ; Comments -[ - (comment) - (line_continuation) -] @comment @spell +(comment) @comment @spell + +(line_continuation) @punctuation.special ((comment) @keyword.directive (#lua-match? @keyword.directive "^%%%% ")) diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index e5b9ac3aa..3e777d08b 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -247,6 +247,8 @@ "{" @punctuation.special "}" @punctuation.special) +(line_continuation) @punctuation.special + (type_conversion) @function.macro [ From 53819acac287632ee2b62e0f7b63057904984906 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Thu, 11 Sep 2025 15:27:19 +0200 Subject: [PATCH 222/434] feat(snl): add parser and queries --- SUPPORTED_LANGUAGES.md | 2 + lua/nvim-treesitter/parsers.lua | 9 ++ runtime/queries/snl/folds.scm | 21 +++ runtime/queries/snl/highlights.scm | 245 +++++++++++++++++++++++++++++ runtime/queries/snl/indents.scm | 61 +++++++ runtime/queries/snl/injections.scm | 117 ++++++++++++++ runtime/queries/snl/locals.scm | 65 ++++++++ 7 files changed, 520 insertions(+) create mode 100644 runtime/queries/snl/folds.scm create mode 100644 runtime/queries/snl/highlights.scm create mode 100644 runtime/queries/snl/indents.scm create mode 100644 runtime/queries/snl/injections.scm create mode 100644 runtime/queries/snl/locals.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 61371d0e0..2cc4bd6a9 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -265,6 +265,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | unstable | `HFIJL` | | @amaanq [smithy](https://github.com/indoorvivants/tree-sitter-smithy) | unstable | `H  J ` | | @amaanq, @keynmol [snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJL` | | @osthomas +[snl](https://github.com/minijackson/tree-sitter-snl)[^snl] | unstable | `HFIJL` | | @minijackson [solidity](https://github.com/JoranHonig/tree-sitter-solidity) | unstable | `HF J ` | | @amaanq [soql](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | | @aheber, @xixiafinland [sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | | @aheber, @xixiafinland @@ -359,4 +360,5 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [^query]: Tree-sitter query language [^sflog]: Salesforce debug log [^slang]: Shader Slang +[^snl]: EPICS Sequencer's SNL files diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 0ddc29cd4..6a64739fa 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2081,6 +2081,15 @@ return { maintainers = { '@osthomas' }, tier = 2, }, + snl = { + install_info = { + url = 'https://github.com/minijackson/tree-sitter-snl', + revision = '846e2d6809ac5863a15b5494f20fd267c21221c8', + }, + maintainers = { '@minijackson' }, + readme_note = "EPICS Sequencer's SNL files", + tier = 2, + }, solidity = { install_info = { revision = '4e938a46c7030dd001bc99e1ac0f0c750ac98254', diff --git a/runtime/queries/snl/folds.scm b/runtime/queries/snl/folds.scm new file mode 100644 index 000000000..65e50c62f --- /dev/null +++ b/runtime/queries/snl/folds.scm @@ -0,0 +1,21 @@ +[ + (for_statement) + (if_statement) + (while_statement) + (funcdef) + (structdef) + (comment) + (preproc_if) + (preproc_elif) + (preproc_else) + (preproc_ifdef) + (preproc_function_def) + (init_expr) + (entry) + (state_set) + (state) + (exit) +] @fold + +(initial_defn + (preproc_include))+ @fold diff --git a/runtime/queries/snl/highlights.scm b/runtime/queries/snl/highlights.scm new file mode 100644 index 000000000..423a7deb7 --- /dev/null +++ b/runtime/queries/snl/highlights.scm @@ -0,0 +1,245 @@ +(identifier) @variable + +[ + "enum" + "struct" + "union" +] @keyword.type + +[ + "assign" + "const" + "entry" + "exit" + "foreign" + "monitor" + "option" + "program" + "ss" + "state" + "sync" + "syncq" + "to" + "typename" +] @keyword + +"sizeof" @keyword.operator + +"return" @keyword.return + +[ + "while" + "for" + "continue" + "break" +] @keyword.repeat + +[ + "if" + "else" + "when" +] @keyword.conditional + +[ + "#elif" + "#else" + "#endif" + "#if" + "#ifdef" + "#ifndef" + (preproc_directive) + (line_marker) +] @keyword.directive + +"#define" @keyword.directive.define + +"#include" @keyword.import + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "." + "," + ";" +] @punctuation.delimiter + +[ + "%%" + "%{" + "}%" + "..." +] @punctuation.special + +[ + "+" + "-" + "*" + "&" + "!" + "~" + "++" + "--" + "=" + ">>" + "<<" + "/" + ">" + ">=" + "<" + "<=" + "==" + "!=" + "^" + "|" + "||" + "&&" + "%" + "*=" + "/=" + "%=" + "+=" + "-=" + "<<=" + ">>=" + "&=" + "^=" + "|=" +] @operator + +(comma_expr + "," @operator) + +[ + (true) + (false) +] @boolean + +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +[ + (string_literal) + (system_lib_string) +] @string + +(parameter_expansion + [ + "{" + "}" + ] @string.special) + +(parameter_expansion + (identifier) @constant) + +(escape_sequence) @string.escape + +(null) @constant.builtin + +[ + (number_literal) + (char_literal) +] @number + +((preproc_arg) @function.macro + (#set! "priority" 90)) + +(preproc_defined) @function.macro + +(call_expression + function: (identifier) @function.call) + +(call_expression + function: (field_expression + field: (identifier) @function.call)) + +(function_declarator + declarator: (identifier) @function) + +(preproc_function_def + name: (identifier) @function.macro) + +(field_expression + field: (identifier) @property) + +(type_qualifier) @keyword.modifier + +(structdef + name: (identifier) @type.definition) + +[ + (basetype) + (type_expr) +] @type + +(prim_type) @type.builtin + +(program + name: (identifier) @constant) + +(state_set + name: (identifier) @function) + +(state + name: (identifier) @function) + +(transition + name: (identifier) @function) + +(option + name: (identifier) @constant) + +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z%d_]*$")) + +(preproc_def + name: (_) @constant.macro) + +(preproc_call + directive: (preproc_directive) @_u + argument: (_) @constant.macro + (#eq? @_u "#undef")) + +(comment) @comment @spell + +(param_decl + (declarator + (identifier) @variable.parameter)) + +((identifier) @variable.parameter + (#has-ancestor? @variable.parameter param_decl)) + +(param_decl + (declarator + (pointer_declarator) @variable.parameter)) + +(preproc_params + (identifier) @variable.parameter) + +((call_expression + function: (_) @function.builtin) + (#any-of? @function.builtin + "delay" "pvPut" "pvPutComplete" "pvArrayPutComplete" "pvPutCancel" "pvArrayPutCancel" "pvGet" + "pvGetComplete" "pvArrayGetComplete" "pvGetCancel" "pvArrayGetCancel" "pvGetQ" "pvFreeQ" + "pvFlushQ" "pvAssign" "pvAssignSubst" "pvMonitor" "pvArrayMonitor" "pvStopMonitor" + "pvArrayStopMonitor" "pvSync" "pvArraySync" "pvCount" "pvStatus" "pvSeverity" "pvMessage" + "pvTimeStamp" "pvAssigned" "pvConnected" "pvArrayConnected" "pvIndex" "pvFlush" "pvChannelCount" + "pvAssignCount" "pvConnectCount" "efSet" "efClear" "efTest" "efTestAndClear" "macValueGet" + "optGet")) + +((identifier) @constant.builtin + (#any-of? @constant.builtin + "pvStatOK" "pvStatERROR" "pvStatDISCONN" "pvStatREAD" "pvStatWRITE" "pvStatHIHI" "pvStatHIGH" + "pvStatLOLO" "pvStatLOW" "pvStatSTATE" "pvStatCOS" "pvStatCOMM" "pvStatTIMEOUT" "pvStatHW_LIMIT" + "pvStatCALC" "pvStatSCAN" "pvStatLINK" "pvStatSOFT" "pvStatBAD_SUB" "pvStatUDF" "pvStatDISABLE" + "pvStatSIMM" "pvStatREAD_ACCESS" "pvStatWRITE_ACCESS" "pvSevrOK" "pvSevrERROR" "pvSevrNONE" + "pvSevrMINOR" "pvSevrMAJOR" "pvSevrINVALID" "DEFAULT" "ASYNC" "SYNC" "NOEVFLAG")) diff --git a/runtime/queries/snl/indents.scm b/runtime/queries/snl/indents.scm new file mode 100644 index 000000000..0d6523615 --- /dev/null +++ b/runtime/queries/snl/indents.scm @@ -0,0 +1,61 @@ +[ + (field_declaration_list) + (state_set) + (state) + (block) + (member_decl) +] @indent.begin + +(block + "}" @indent.end) + +[ + "else" + "}" +] @indent.branch + +(call_expression) @indent.begin + +(call_expression + ")" @indent.end) + +(if_statement + condition: (_) @indent.begin) + +(if_statement + consequence: (_) @_consequence + (#not-kind-eq? @_consequence block)) @indent.begin + +(else_statement + consequence: (_) @_consequence + (#not-kind-eq? @_consequence block)) @indent.begin + +(while_statement + body: (statement + (_) @_body) + (#not-kind-eq? @_body block)) @indent.begin + +(for_statement + body: (statement + (_) @_body) + (#not-kind-eq? @_body block)) @indent.begin + +(init_declarator) @indent.begin + +(transition + condition: (_) @indent.begin) + +[ + "#define" + "#ifdef" + "#if" + "#else" + "#endif" +] @indent.zero + +[ + (preproc_arg) + (string_literal) +] @indent.ignore + +(comment) @indent.auto diff --git a/runtime/queries/snl/injections.scm b/runtime/queries/snl/injections.scm new file mode 100644 index 000000000..b595d8033 --- /dev/null +++ b/runtime/queries/snl/injections.scm @@ -0,0 +1,117 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((c_code) @injection.content + (#set! injection.language "c")) + +((preproc_arg) @injection.content + (#set! injection.self)) + +((call_expression + function: (identifier) @_function + (args + . + [ + (string_literal + (string_content) @injection.content) + (concatenated_string + (string_literal + (string_content) @injection.content)) + ])) + ; format-ignore + (#any-of? @_function + "printf" "printf_s" + "vprintf" "vprintf_s" + "scanf" "scanf_s" + "vscanf" "vscanf_s" + "wprintf" "wprintf_s" + "vwprintf" "vwprintf_s" + "wscanf" "wscanf_s" + "vwscanf" "vwscanf_s" + "cscanf" "_cscanf" + "printw" + "scanw") + (#set! injection.language "printf")) + +((call_expression + function: (identifier) @_function + (args + (_) + . + [ + (string_literal + (string_content) @injection.content) + (concatenated_string + (string_literal + (string_content) @injection.content)) + ])) + ; format-ignore + (#any-of? @_function + "fprintf" "fprintf_s" + "sprintf" + "dprintf" + "fscanf" "fscanf_s" + "sscanf" "sscanf_s" + "vsscanf" "vsscanf_s" + "vfprintf" "vfprintf_s" + "vsprintf" + "vdprintf" + "fwprintf" "fwprintf_s" + "vfwprintf" "vfwprintf_s" + "fwscanf" "fwscanf_s" + "swscanf" "swscanf_s" + "vswscanf" "vswscanf_s" + "vfscanf" "vfscanf_s" + "vfwscanf" "vfwscanf_s" + "wprintw" + "vw_printw" "vwprintw" + "wscanw" + "vw_scanw" "vwscanw") + (#set! injection.language "printf")) + +((call_expression + function: (identifier) @_function + (args + (_) + . + (_) + . + [ + (string_literal + (string_content) @injection.content) + (concatenated_string + (string_literal + (string_content) @injection.content)) + ])) + ; format-ignore + (#any-of? @_function + "sprintf_s" + "snprintf" "snprintf_s" + "vsprintf_s" + "vsnprintf" "vsnprintf_s" + "swprintf" "swprintf_s" + "snwprintf_s" + "vswprintf" "vswprintf_s" + "vsnwprintf_s" + "mvprintw" + "mvscanw") + (#set! injection.language "printf")) + +((call_expression + function: (identifier) @_function + (args + (_) + . + (_) + . + (_) + . + [ + (string_literal + (string_content) @injection.content) + (concatenated_string + (string_literal + (string_content) @injection.content)) + ])) + (#any-of? @_function "mvwprintw" "mvwscanw") + (#set! injection.language "printf")) diff --git a/runtime/queries/snl/locals.scm b/runtime/queries/snl/locals.scm new file mode 100644 index 000000000..35c8da5c9 --- /dev/null +++ b/runtime/queries/snl/locals.scm @@ -0,0 +1,65 @@ +; Functions definitions +(function_declarator + declarator: (identifier) @local.definition.function) + +(preproc_function_def + name: (identifier) @local.definition.macro) @local.scope + +(preproc_def + name: (identifier) @local.definition.macro) + +((identifier) @local.definition.parameter + (#has-ancestor? @local.definition.parameter param_decl)) + +(init_declarator + (declarator + (identifier)) @local.definition.var) + +(array_declarator + (identifier) @local.definition.var) + +; Struct +(member_decl + (declarator + (identifier)) @local.definition.field) + +(structdef + name: (identifier) @local.definition.type) + +; References +((field_expression + field: (identifier) @local.reference) + (#set! reference.kind "field")) + +((call_expression + function: (identifier) @local.reference) + (#set! reference.kind "call")) + +((basetype + (identifier) @local.reference) + (#set! reference.kind "type")) + +; SNL specific +(state_set + name: (identifier) @local.definition) + +(state + name: (identifier) @local.definition) + +(state_statement + name: (identifier) @local.reference) + +(transition + name: (identifier) @local.reference) + +(identifier) @local.reference + +[ + (for_statement) + (if_statement) + (while_statement) + (source_file) + (block) + (state_set) + (state_block) +] @local.scope From 5a70b1eb8cbdf6c7f0a59dfb7356ad198421b620 Mon Sep 17 00:00:00 2001 From: Omar Valdez Date: Mon, 22 Sep 2025 08:14:00 -0700 Subject: [PATCH 223/434] feat(hyprlang): highlight more exec keywords --- runtime/queries/hyprlang/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/hyprlang/highlights.scm b/runtime/queries/hyprlang/highlights.scm index 5e3514125..340237fcc 100644 --- a/runtime/queries/hyprlang/highlights.scm +++ b/runtime/queries/hyprlang/highlights.scm @@ -3,7 +3,10 @@ [ "source" "exec" + "execr" "exec-once" + "execr-once" + "exec-shutdown" ] @keyword (keyword From 1df23c59d8c3142fc9fc130575fbc761d10e30e4 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 28 Sep 2025 11:55:09 +0200 Subject: [PATCH 224/434] feat(parsers): update ada, cpp, desktop, erlang, godot_resource, ini, javadoc, mlir, powershell, rifleconf, slint, sql, superhtml, t32, xresources --- lua/nvim-treesitter/parsers.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6a64739fa..ce96a62a6 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,7 @@ return { ada = { install_info = { - revision = '364d3f4aa8b382113bdd5d3ca6d82dc9c74ac738', + revision = '9821c989184447f7f088f1096601eb23be35afc5', url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, @@ -278,7 +278,7 @@ return { }, cpp = { install_info = { - revision = '2a682d312b09eb737a08b4900ec786415574b6bf', + revision = '12bd6f7e96080d2e70ec51d4068f2f66120dde35', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = 'b77dad972dcc96f9a7123fb08d8eb46308e31d9a', + revision = '73c3f1ec366061aa9b1f61d76fc3d37b86b5a9af', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -520,7 +520,7 @@ return { }, erlang = { install_info = { - revision = '07dad1469ecb7df80f2b6d5178f79564d19d67e0', + revision = 'df268da05d8ed4837dd2a8e2af1906619c2f0aa0', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -786,7 +786,7 @@ return { }, godot_resource = { install_info = { - revision = '9bbb540e8a2734101c6857bd437f04baa974e03d', + revision = '302c1895f54bf74d53a08572f7b26a6614209adc', url = 'https://github.com/PrestonKnopp/tree-sitter-godot-resource', }, maintainers = { '@pierpo' }, @@ -1034,7 +1034,7 @@ return { }, ini = { install_info = { - revision = '31899dfa3b91622ea39e5c0bcddc88f45a9a3cfe', + revision = '0eaed8040513e62ee2e9e8db9f086cf630a524eb', url = 'https://github.com/justinmk/tree-sitter-ini', }, maintainers = { '@theHamsta' }, @@ -1075,7 +1075,7 @@ return { }, javadoc = { install_info = { - revision = '85acd4655cbfaef414de6e3f87436e63ef5cb0da', + revision = 'c39005f7da0218cc3ac2734bef049a8fa9ee0e72', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1399,7 +1399,7 @@ return { mlir = { install_info = { generate = true, - revision = '8f86b34b5e3dfe561e1e913df4a3d719ea1dcc5c', + revision = '14152c1e580043865131bca80bcd8e8cb9132df7', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1653,7 +1653,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = 'f272e5ac9bc48d0f6df2429cab914d216e9413cd', + revision = '497fe9ac43bdf090efbfe28fba65b7c0c7c6a7b3', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1910,7 +1910,7 @@ return { }, rifleconf = { install_info = { - revision = 'b215640ba72a9a8cac6f5d95dbc3d320cb546e13', + revision = 'fe10eab6cacff239ec61f4456e793bed15703aaf', url = 'https://github.com/purarue/tree-sitter-rifleconf', }, maintainers = { '@purarue' }, @@ -2051,7 +2051,7 @@ return { }, slint = { install_info = { - revision = '152ec7f6a2aa29fe222f741d91bec70153c487da', + revision = '927f3e2f0213d0eea7f12c978c81067c3dc4289d', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2083,8 +2083,8 @@ return { }, snl = { install_info = { - url = 'https://github.com/minijackson/tree-sitter-snl', revision = '846e2d6809ac5863a15b5494f20fd267c21221c8', + url = 'https://github.com/minijackson/tree-sitter-snl', }, maintainers = { '@minijackson' }, readme_note = "EPICS Sequencer's SNL files", @@ -2143,7 +2143,7 @@ return { sql = { install_info = { branch = 'gh-pages', - revision = 'b1ec2aa5091624e4729f0a771a6d631afebf1ed4', + revision = '0a997b07c777b6504792d04357a0f655897f15a8', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2200,7 +2200,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '574a7a000c6e6a8a922c11afa9da60dca84e5e1f', + revision = '4b60dd98f5d3e158967c9feb839ae71321a625b9', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2266,7 +2266,7 @@ return { }, t32 = { install_info = { - revision = '335e5533de72a4ac8c6763958df1befbdc855a30', + revision = '5f20682355725d840611b07b2ce9681034cff3a6', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2632,7 +2632,7 @@ return { }, xresources = { install_info = { - revision = '2259ae28ad0e139b726dab286f7fa9626a1c2256', + revision = 'c6f240ab53c75edc0b122bc26c994ceb410d5b27', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 9176343647ad99583becbcec7b17fc7fd5bd4782 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 28 Sep 2025 12:01:45 +0200 Subject: [PATCH 225/434] feat(inko)!: update parser and queries Breaking change: `(array_pattern)` rule and node was removed again. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/inko/indents.scm | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index ce96a62a6..67a492baa 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1042,7 +1042,7 @@ return { }, inko = { install_info = { - revision = '74cbd0f69053b4a9ad4fed8831dee983ec7e4990', + revision = '1fcbf8ca64b1a088525235662ad80aa803d97413', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, diff --git a/runtime/queries/inko/indents.scm b/runtime/queries/inko/indents.scm index 260249343..d2d9a5724 100644 --- a/runtime/queries/inko/indents.scm +++ b/runtime/queries/inko/indents.scm @@ -27,7 +27,6 @@ (trait) (tuple) (tuple_pattern) - (array_pattern) (type_arguments) ] @indent.begin From db50897909bfd77d816ef3958e392a2f7fccd057 Mon Sep 17 00:00:00 2001 From: Mouinul Hossain <122956967+OXY2DEV@users.noreply.github.com> Date: Mon, 29 Sep 2025 07:04:09 +0600 Subject: [PATCH 226/434] feat(parsers): add kitty (#8129) --- SUPPORTED_LANGUAGES.md | 1 + lua/nvim-treesitter/parsers.lua | 8 ++ runtime/queries/kitty/highlights.scm | 175 +++++++++++++++++++++++++++ runtime/queries/kitty/injections.scm | 31 +++++ 4 files changed, 215 insertions(+) create mode 100644 runtime/queries/kitty/highlights.scm create mode 100644 runtime/queries/kitty/injections.scm diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 2cc4bd6a9..3386e6bf2 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -160,6 +160,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [kcl](https://github.com/kcl-lang/tree-sitter-kcl) | unstable | `HF J ` | | @bertbaron [kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | unstable | `HFIJL` | | @amaanq [kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | unstable | `HFIJL` | | @amaanq +[kitty](https://github.com/OXY2DEV/tree-sitter-kitty) | unstable | `H  J ` | | @OXY2DEV [kotlin](https://github.com/fwcd/tree-sitter-kotlin) | unstable | `HF JL` | | @SalBakraa [koto](https://github.com/koto-lang/tree-sitter-koto) | unstable | `HF JL` | | @irh [kusto](https://github.com/Willem-J-an/tree-sitter-kusto) | unstable | `H  J ` | | @Willem-J-an diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 67a492baa..34a5aa04e 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1205,6 +1205,14 @@ return { maintainers = { '@amaanq' }, tier = 2, }, + kitty = { + install_info = { + revision = '49f877cff80ab613808b34bde170ea477ec182fe', + url = 'https://github.com/OXY2DEV/tree-sitter-kitty', + }, + maintainers = { '@OXY2DEV' }, + tier = 2, + }, kotlin = { install_info = { revision = '57fb4560ba8641865bc0baa6b3f413b236112c4c', diff --git a/runtime/queries/kitty/highlights.scm b/runtime/queries/kitty/highlights.scm new file mode 100644 index 000000000..c6b5a5dfd --- /dev/null +++ b/runtime/queries/kitty/highlights.scm @@ -0,0 +1,175 @@ +(line_continuation) @comment + +(comment + (comment_content) @spell) @comment + +[ + (pixel) + (percentage) + (number) +] @number + +[ + "steps" + "cubic-bezier" +] @function.call + +(boolean) @boolean + +(color) @constant + +(string) @string + +[ + (ctrl) + (alt) + (shift) + (function) + (super) + (mouse_button) + (up) + (left) + (right) + (middle) + (down) +] @constant.builtin + +[ + "+" + ">" + ":" + "-" + (separator) + "=" + "," + "'" + ":" +] @punctuation.delimiter + +[ + "(" + ")" +] @punctuation.bracket + +(special) @variable.builtin + +(key) @character + +(path) @string.special.path + +(label) @label + +(constant) @constant + +(direction) @constant + +(pattern) @string.regexp + +(flag) @constant + +((string) @constant + (#lua-match? @constant "^-")) + +(generic_action) @function.call + +(action_name) @function.call + +[ + "pt" + "px" + "%" + "ratio" + (signal_name) + (clear_target) + (ligature_target) + (window_location) + (stdin_source) + (marker_type) + (window_state) + (logo_position) + (mouse_selection_type) + (window_layout) + (os_window) + "ignore-shell" + (detach_into) + "@selection" + (kitty_shell_open_as) + (mouse_event) + (font_modification_type) + (ease_step_position) + "c" + (filter_element_type) + "all" + (ligature_disabled) + (clipboard_action) + (shell_feature) + (source_strategy) + (notification_time) + (paste_action) + (pointer) + (layout) + (launch_type_value) + (os_window_class) + (layout_type) + (time_suffix) + (cursor) + (spacing_type) + (remote_action) + (font_feature) +] @type + +(kitten + target: (string) @type) + +[ + (color_option_name) + "map" + "mouse_map" + (option_name) +] @keyword + +(open_url + value: (string) @string.special.url) + +(handle_click_actions + _ @type) + +(title) @string.special + +(font_change_amount + sign: (font_change_sign) @operator) + +(aliased_action + name: (string) @function.call) + +(set_colors + "set_colors" @function.call) + +(include + environment_variable: (string) @variable.builtin) + +(key_focus_on + condition: (string) @string.special) + +(mouse_mode + [ + "grabbed" + "ungrabbed" + ] @variable.parameter) + +(font_property + name: (string) @variable.parameter) + +(url_excluded_characters + value: (string) @character) + +(transparent_color + "@" @punctuation.special + (alpha) @number) + +(env + variable: (string) @variable.builtin) + +(boolean_operator) @keyword.operator + +(notification_action) @function.call diff --git a/runtime/queries/kitty/injections.scm b/runtime/queries/kitty/injections.scm new file mode 100644 index 000000000..74fde7b76 --- /dev/null +++ b/runtime/queries/kitty/injections.scm @@ -0,0 +1,31 @@ +(launch_source_window + value: (string) @injection.content + (#set! injection.language "regex")) + +(launch_next_to + value: (string) @injection.content + (#set! injection.language "regex")) + +(marker_entry + (pattern) @injection.content + (#set! injection.language "regex")) + +(color_match + (pattern) @injection.content + (#set! injection.language "regex")) + +(color_match_tab + (pattern) @injection.content + (#set! injection.language "regex")) + +(include + glob: (pattern) @injection.content + (#set! injection.language "regex")) + +(filter_element + (pattern) @injection.content + (#set! injection.language "regex")) + +(comment + (comment_content) @injection.content + (#set! injection.language "comment")) From 77362027f7aa850c87419fd571151e76b0b342a6 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 28 Sep 2025 18:39:09 -0700 Subject: [PATCH 227/434] fix: remove redundant alternants (#8159) --- runtime/queries/bitbake/highlights.scm | 1 - runtime/queries/circom/highlights.scm | 2 -- runtime/queries/d/highlights.scm | 1 - runtime/queries/enforce/highlights.scm | 1 - runtime/queries/fennel/locals.scm | 1 - runtime/queries/fsharp/highlights.scm | 1 - runtime/queries/gdscript/highlights.scm | 1 - runtime/queries/gleam/indents.scm | 2 -- runtime/queries/go/highlights.scm | 1 - runtime/queries/groovy/highlights.scm | 3 --- runtime/queries/hack/highlights.scm | 14 -------------- runtime/queries/inko/highlights.scm | 2 -- runtime/queries/jinja_inline/highlights.scm | 1 - runtime/queries/kitty/highlights.scm | 1 - runtime/queries/luadoc/highlights.scm | 1 - runtime/queries/matlab/highlights.scm | 1 - runtime/queries/mermaid/highlights.scm | 1 - runtime/queries/nu/highlights.scm | 2 -- runtime/queries/ocaml/highlights.scm | 1 - runtime/queries/ocaml_interface/highlights.scm | 1 - runtime/queries/pascal/folds.scm | 1 - runtime/queries/pascal/highlights.scm | 1 - runtime/queries/pony/highlights.scm | 1 - runtime/queries/prql/highlights.scm | 1 - runtime/queries/re2c/highlights.scm | 1 - runtime/queries/roc/indents.scm | 1 - runtime/queries/scala/highlights.scm | 1 - runtime/queries/solidity/highlights.scm | 3 --- runtime/queries/sway/highlights.scm | 2 -- runtime/queries/t32/highlights.scm | 5 ----- runtime/queries/vhdl/folds.scm | 1 - runtime/queries/zig/highlights.scm | 2 -- 32 files changed, 59 deletions(-) diff --git a/runtime/queries/bitbake/highlights.scm b/runtime/queries/bitbake/highlights.scm index c7316de6e..e10ae705b 100644 --- a/runtime/queries/bitbake/highlights.scm +++ b/runtime/queries/bitbake/highlights.scm @@ -281,7 +281,6 @@ "=." "-" "-=" - ":=" "!=" "*" "**" diff --git a/runtime/queries/circom/highlights.scm b/runtime/queries/circom/highlights.scm index c61925e7a..983df8703 100644 --- a/runtime/queries/circom/highlights.scm +++ b/runtime/queries/circom/highlights.scm @@ -119,8 +119,6 @@ ">" "!" "~" - "-" - "+" "++" "--" "<==" diff --git a/runtime/queries/d/highlights.scm b/runtime/queries/d/highlights.scm index 50428d20c..e08b83b45 100644 --- a/runtime/queries/d/highlights.scm +++ b/runtime/queries/d/highlights.scm @@ -263,7 +263,6 @@ (idouble) (ifloat) (creal) - (double) (cfloat) (string) (dstring) diff --git a/runtime/queries/enforce/highlights.scm b/runtime/queries/enforce/highlights.scm index aa8fb9b3e..35226202d 100644 --- a/runtime/queries/enforce/highlights.scm +++ b/runtime/queries/enforce/highlights.scm @@ -80,7 +80,6 @@ "<<" "&" "|" - "^" "~" ] @operator diff --git a/runtime/queries/fennel/locals.scm b/runtime/queries/fennel/locals.scm index be63e728f..320c93bb9 100644 --- a/runtime/queries/fennel/locals.scm +++ b/runtime/queries/fennel/locals.scm @@ -11,7 +11,6 @@ (collect_form) (icollect_form) (accumulate_form) - (for_form) (fcollect_form) (faccumulate_form) (case_form) diff --git a/runtime/queries/fsharp/highlights.scm b/runtime/queries/fsharp/highlights.scm index 72168528a..16b969fb6 100644 --- a/runtime/queries/fsharp/highlights.scm +++ b/runtime/queries/fsharp/highlights.scm @@ -246,7 +246,6 @@ "<-" "&" "&&" - "|" "||" ":>" ":?>" diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm index f3fd3b62f..3885d0068 100644 --- a/runtime/queries/gdscript/highlights.scm +++ b/runtime/queries/gdscript/highlights.scm @@ -176,7 +176,6 @@ "/" "%" "+" - "-" "<<" ">>" "&" diff --git a/runtime/queries/gleam/indents.scm b/runtime/queries/gleam/indents.scm index 3a44ea4c0..a8fa961d5 100644 --- a/runtime/queries/gleam/indents.scm +++ b/runtime/queries/gleam/indents.scm @@ -9,8 +9,6 @@ (function) (let) (list) - (constant) - (function) (type_definition) (type_alias) (todo) diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm index 7675cb790..91a9d4d76 100644 --- a/runtime/queries/go/highlights.scm +++ b/runtime/queries/go/highlights.scm @@ -61,7 +61,6 @@ "!=" "..." "*" - "*" "*=" "/" "/=" diff --git a/runtime/queries/groovy/highlights.scm b/runtime/queries/groovy/highlights.scm index 4504e16e2..69fcb6e1d 100644 --- a/runtime/queries/groovy/highlights.scm +++ b/runtime/queries/groovy/highlights.scm @@ -135,13 +135,10 @@ "&&" "||" "?:" - "+" - "*" ".&" ".@" "?." "*." - "*" "*:" "++" "--" diff --git a/runtime/queries/hack/highlights.scm b/runtime/queries/hack/highlights.scm index bb9d2a55c..f74233e23 100644 --- a/runtime/queries/hack/highlights.scm +++ b/runtime/queries/hack/highlights.scm @@ -169,20 +169,6 @@ "--" "!" "?:" - "=" - "??=" - ".=" - "|=" - "^=" - "&=" - "<<=" - ">>=" - "+=" - "-=" - "*=" - "/=" - "%=" - "**=" "=>" ; type modifiers "@" diff --git a/runtime/queries/inko/highlights.scm b/runtime/queries/inko/highlights.scm index 989bdb9e8..3b8ede262 100644 --- a/runtime/queries/inko/highlights.scm +++ b/runtime/queries/inko/highlights.scm @@ -35,11 +35,9 @@ "<<" "<<=" "<=" - "<=" "==" ">" ">=" - ">=" ">>" ">>=" ">>>" diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index b66d7fb2e..fd2030fa8 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -56,7 +56,6 @@ "endmacro" "endcall" "endset" - "endtrans" "endautoescape" ] @keyword diff --git a/runtime/queries/kitty/highlights.scm b/runtime/queries/kitty/highlights.scm index c6b5a5dfd..93e5d31a4 100644 --- a/runtime/queries/kitty/highlights.scm +++ b/runtime/queries/kitty/highlights.scm @@ -43,7 +43,6 @@ "=" "," "'" - ":" ] @punctuation.delimiter [ diff --git a/runtime/queries/luadoc/highlights.scm b/runtime/queries/luadoc/highlights.scm index 1649e5d9b..f1680d7b2 100644 --- a/runtime/queries/luadoc/highlights.scm +++ b/runtime/queries/luadoc/highlights.scm @@ -20,7 +20,6 @@ "@version" "@operator" "@nodiscard" - "@cast" "@overload" "@enum" "@language" diff --git a/runtime/queries/matlab/highlights.scm b/runtime/queries/matlab/highlights.scm index 05713e05a..7c7fd9a5f 100644 --- a/runtime/queries/matlab/highlights.scm +++ b/runtime/queries/matlab/highlights.scm @@ -170,7 +170,6 @@ "-" ".*" "*" - ".*" "/" "./" "\\" diff --git a/runtime/queries/mermaid/highlights.scm b/runtime/queries/mermaid/highlights.scm index 2b7b56374..8fa11dfef 100644 --- a/runtime/queries/mermaid/highlights.scm +++ b/runtime/queries/mermaid/highlights.scm @@ -42,7 +42,6 @@ "includes" "excludes" "todaymarker" - "title" "section" "direction" "subgraph" diff --git a/runtime/queries/nu/highlights.scm b/runtime/queries/nu/highlights.scm index fc73d3483..38ffbaa2e 100644 --- a/runtime/queries/nu/highlights.scm +++ b/runtime/queries/nu/highlights.scm @@ -123,12 +123,10 @@ file_path: (val_string) @variable.parameter "*=" "/=" "++=" - "-" ".." "..=" "..<" "=>" - "=" "|" "o>" "out>" diff --git a/runtime/queries/ocaml/highlights.scm b/runtime/queries/ocaml/highlights.scm index 891ff7bd5..82a74b7fb 100644 --- a/runtime/queries/ocaml/highlights.scm +++ b/runtime/queries/ocaml/highlights.scm @@ -294,7 +294,6 @@ (hash_operator) (indexing_operator) (let_operator) - (and_operator) (match_operator) ] @operator diff --git a/runtime/queries/ocaml_interface/highlights.scm b/runtime/queries/ocaml_interface/highlights.scm index b623e432b..2f7cdba85 100644 --- a/runtime/queries/ocaml_interface/highlights.scm +++ b/runtime/queries/ocaml_interface/highlights.scm @@ -294,7 +294,6 @@ (hash_operator) (indexing_operator) (let_operator) - (and_operator) (match_operator) ] @operator diff --git a/runtime/queries/pascal/folds.scm b/runtime/queries/pascal/folds.scm index 8fcde3ac0..ac527fbf0 100644 --- a/runtime/queries/pascal/folds.scm +++ b/runtime/queries/pascal/folds.scm @@ -19,7 +19,6 @@ (declEnum) (declProcRef) (declExports) - (declProcRef) (declType) (defProc) (declField) diff --git a/runtime/queries/pascal/highlights.scm b/runtime/queries/pascal/highlights.scm index d6014ee1d..b81c0c599 100644 --- a/runtime/queries/pascal/highlights.scm +++ b/runtime/queries/pascal/highlights.scm @@ -41,7 +41,6 @@ (kDestructor) (kOperator) (kReference) - (kInterface) (kImplementation) (kInitialization) (kFinalization) diff --git a/runtime/queries/pony/highlights.scm b/runtime/queries/pony/highlights.scm index f3d4b5dca..6ccb3d7ae 100644 --- a/runtime/queries/pony/highlights.scm +++ b/runtime/queries/pony/highlights.scm @@ -206,7 +206,6 @@ "<=" "<" "+~" - "-~" "*~" "/~" "%~" diff --git a/runtime/queries/prql/highlights.scm b/runtime/queries/prql/highlights.scm index d24777dc0..f49c887c8 100644 --- a/runtime/queries/prql/highlights.scm +++ b/runtime/queries/prql/highlights.scm @@ -85,7 +85,6 @@ alias: (identifier) @variable.member (keyword_avg) (keyword_sum) (keyword_stddev) - (keyword_count) (keyword_rank) ] @function diff --git a/runtime/queries/re2c/highlights.scm b/runtime/queries/re2c/highlights.scm index c89c30745..e15f97f82 100644 --- a/runtime/queries/re2c/highlights.scm +++ b/runtime/queries/re2c/highlights.scm @@ -1,6 +1,5 @@ ; Namespaces [ - "re2c" "re2c" "local" "rules" diff --git a/runtime/queries/roc/indents.scm b/runtime/queries/roc/indents.scm index 9a08f2074..b2cea9b77 100644 --- a/runtime/queries/roc/indents.scm +++ b/runtime/queries/roc/indents.scm @@ -22,7 +22,6 @@ ;types (record_type) (tags_type) - (record_expr) (implements_implementation) "{" "(" diff --git a/runtime/queries/scala/highlights.scm b/runtime/queries/scala/highlights.scm index f85c502a4..7e623aebc 100644 --- a/runtime/queries/scala/highlights.scm +++ b/runtime/queries/scala/highlights.scm @@ -186,7 +186,6 @@ "end" "implicit" "extension" - "with" ] @keyword [ diff --git a/runtime/queries/solidity/highlights.scm b/runtime/queries/solidity/highlights.scm index ca6988edb..ca1f65dd9 100644 --- a/runtime/queries/solidity/highlights.scm +++ b/runtime/queries/solidity/highlights.scm @@ -151,7 +151,6 @@ "modifier" "var" "let" - "emit" "error" "fallback" "receive" @@ -287,8 +286,6 @@ ">" "!" "~" - "-" - "+" "++" "--" ":=" diff --git a/runtime/queries/sway/highlights.scm b/runtime/queries/sway/highlights.scm index e408464fe..e1f72eb46 100644 --- a/runtime/queries/sway/highlights.scm +++ b/runtime/queries/sway/highlights.scm @@ -68,7 +68,6 @@ "||" "^" "^=" - "*" "*=" "-" "-=" @@ -86,7 +85,6 @@ "@" ".." "..=" - "'" "?" ] @operator diff --git a/runtime/queries/t32/highlights.scm b/runtime/queries/t32/highlights.scm index 9211a49d2..83e8e19dd 100644 --- a/runtime/queries/t32/highlights.scm +++ b/runtime/queries/t32/highlights.scm @@ -22,13 +22,10 @@ ".." "--" "++" - "+" - "-" "~" "!" "&" "->" - "*" "-=" "+=" "*=" @@ -39,8 +36,6 @@ "^=" ">>=" "<<=" - "--" - "++" ] @operator [ diff --git a/runtime/queries/vhdl/folds.scm b/runtime/queries/vhdl/folds.scm index 9fc6deafe..42a58c25f 100644 --- a/runtime/queries/vhdl/folds.scm +++ b/runtime/queries/vhdl/folds.scm @@ -27,7 +27,6 @@ (subprogram_definition) (subprogram_head) (procedure_specification) - (sequential_block) (loop_statement) (if_statement_block) (if_statement) diff --git a/runtime/queries/zig/highlights.scm b/runtime/queries/zig/highlights.scm index 1f9006781..a1dce6930 100644 --- a/runtime/queries/zig/highlights.scm +++ b/runtime/queries/zig/highlights.scm @@ -212,7 +212,6 @@ ">=" "<=" "<" - "&" "^" "|" "<<" @@ -221,7 +220,6 @@ "+" "++" "+%" - "-%" "+|" "-|" "*" From 99bd52ba56a4b7c9a8cc50a6140180755e76fac6 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Wed, 1 Oct 2025 20:33:49 -0700 Subject: [PATCH 228/434] feat(java): highlight wildcards (#8165) --- runtime/queries/java/highlights.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/java/highlights.scm b/runtime/queries/java/highlights.scm index df9ca14d4..641f1e3fd 100644 --- a/runtime/queries/java/highlights.scm +++ b/runtime/queries/java/highlights.scm @@ -235,6 +235,9 @@ ":" ] @keyword.conditional.ternary) +(wildcard + "?" @character.special) + ; Loops [ "for" From 4709d4276c9cef5e353790071aec046d9b089719 Mon Sep 17 00:00:00 2001 From: Omar Valdez Date: Fri, 3 Oct 2025 00:17:57 -0700 Subject: [PATCH 229/434] feat(python): highlight special brackets in `format_expression` --- runtime/queries/python/highlights.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 3e777d08b..70f6d9acc 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -247,6 +247,10 @@ "{" @punctuation.special "}" @punctuation.special) +(format_expression + "{" @punctuation.special + "}" @punctuation.special) + (line_continuation) @punctuation.special (type_conversion) @function.macro From b684696315a11e1b08564398bda778788eac92a9 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 3 Oct 2025 15:13:45 +0200 Subject: [PATCH 230/434] feat(inko): update parser and highlights This commit includes syntax support for a few new syntax elements, and updates the highlights queries to highlight two new expression keywords. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/inko/highlights.scm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 34a5aa04e..af6814160 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1042,7 +1042,7 @@ return { }, inko = { install_info = { - revision = '1fcbf8ca64b1a088525235662ad80aa803d97413', + revision = '080e957d94b330e3867f063b148a8050b0888f4e', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, diff --git a/runtime/queries/inko/highlights.scm b/runtime/queries/inko/highlights.scm index 3b8ede262..4bb9631f8 100644 --- a/runtime/queries/inko/highlights.scm +++ b/runtime/queries/inko/highlights.scm @@ -64,6 +64,11 @@ "uni" ] @keyword +[ + "async" + "await" +] @keyword.coroutine + "fn" @keyword.function "import" @keyword.import From b4888ed9e8c3af52320ba3b52a88eccc1c18d498 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 4 Oct 2025 10:51:48 +0200 Subject: [PATCH 231/434] chore(gdscript): mark as unmaintained Significant upstream breaking changes are not adapted to. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 3386e6bf2..989187984 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -92,7 +92,7 @@ ecma (queries only)[^ecma] | unstable | `HFIJL` | | @steelsojka [fusion](https://gitlab.com/jirgn/tree-sitter-fusion) | unstable | `HFIJL` | | @jirgn [gap](https://github.com/gap-system/tree-sitter-gap)[^gap] | unstable | `HF JL` | | @reiniscirpons [gaptst](https://github.com/gap-system/tree-sitter-gaptst)[^gaptst] | unstable | `HF J ` | | @reiniscirpons -[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | unstable | `HFIJL` | | @PrestonKnopp +[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | unmaintained | `HFIJL` | | [gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) | unstable | `H  J ` | | @godofavacyn [git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | unstable | `HF J ` | | @amaanq [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | unstable | `H  J ` | | @gbprod diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index af6814160..0ee85320a 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -655,9 +655,8 @@ return { revision = '9686853b696db07118ad110e440d6de0ca6498b4', url = 'https://github.com/PrestonKnopp/tree-sitter-gdscript', }, - maintainers = { '@PrestonKnopp' }, readme_note = 'Godot', - tier = 2, + tier = 3, }, gdshader = { install_info = { From c579a8c0cfc2d8d448aa72e8ba4f84e6a68f4533 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 4 Oct 2025 11:02:11 +0200 Subject: [PATCH 232/434] feat(parsers): update ada, c_sharp, css, dart, editorconfig, enforce, javadoc, koto, prisma, rust, sql, superhtml, t32 --- lua/nvim-treesitter/parsers.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 0ee85320a..c1e83d01f 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,7 @@ return { ada = { install_info = { - revision = '9821c989184447f7f088f1096601eb23be35afc5', + revision = 'b23672d313b4c994ab96fd54f1b7ff15eac68a55', url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, @@ -174,7 +174,7 @@ return { }, c_sharp = { install_info = { - revision = '3431444351c871dffb32654f1299a00019280f2f', + revision = '6563c3af3f03ec948d08f9325e4bbd072e4c6b99', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -287,7 +287,7 @@ return { }, css = { install_info = { - revision = '6e327db434fec0ee90f006697782e43ec855adf5', + revision = 'dda5cfc5722c429eaba1c910ca32c2c0c5bb1a3f', url = 'https://github.com/tree-sitter/tree-sitter-css', }, maintainers = { '@TravonteD' }, @@ -338,7 +338,7 @@ return { }, dart = { install_info = { - revision = '80e23c07b64494f7e21090bb3450223ef0b192f4', + revision = 'c1222f5a65aba7e0175cc0cc6f88d198d9fe2b02', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -449,7 +449,7 @@ return { }, editorconfig = { install_info = { - revision = '947228fb880f838c6d71e8f11dbc0bfb82cd4c78', + revision = '911d7017566116b15c4b2c339e1dbe11fcf03f63', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, @@ -512,7 +512,7 @@ return { }, enforce = { install_info = { - revision = 'a194046e64bdec2c9e2e1a7caa35326387f78b95', + revision = 'b695854665e749acdd16ce4a2a2e2f38f9ea9ca3', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -1074,7 +1074,7 @@ return { }, javadoc = { install_info = { - revision = 'c39005f7da0218cc3ac2734bef049a8fa9ee0e72', + revision = '7d92cf188e4a3ed1b5068dd99af129f083c47e70', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1222,7 +1222,7 @@ return { }, koto = { install_info = { - revision = '633744bca404ae4edb961a3c2d7bc947a987afa4', + revision = '7cba915fad6121f776f59e0d1787a3e36e4cfc4e', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1676,7 +1676,7 @@ return { }, prisma = { install_info = { - revision = '73f39a6d5401cfdcd143951e499336cf5ab2ffaa', + revision = '3556b2c1f20ec9ac91e92d32c43d9d2a0ca3cc49', url = 'https://github.com/victorhqc/tree-sitter-prisma', }, maintainers = { '@elianiva' }, @@ -1989,7 +1989,7 @@ return { }, rust = { install_info = { - revision = '00d7cbc95f0b8ea2703129550fbd1853a13e0e29', + revision = '946595d164e77b705fa28385654f9420f59262ef', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2150,7 +2150,7 @@ return { sql = { install_info = { branch = 'gh-pages', - revision = '0a997b07c777b6504792d04357a0f655897f15a8', + revision = '4afe285bb142542cee0aa7b689fec00a71df4741', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2207,7 +2207,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = '4b60dd98f5d3e158967c9feb839ae71321a625b9', + revision = 'c52790b328b73237bcd924f3d65c5a17e794e8b1', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2273,7 +2273,7 @@ return { }, t32 = { install_info = { - revision = '5f20682355725d840611b07b2ce9681034cff3a6', + revision = 'd4e26ab7a730cfbe0cf84dba6ea3647989064839', url = 'https://gitlab.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, From 01ced7499fb07f6c94abd316414ef198bd6e7058 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 4 Oct 2025 11:08:09 +0200 Subject: [PATCH 233/434] feat(angular)!: update parser and queries Breaking change: node `(static_member_expression)` was removed --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/angular/highlights.scm | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index c1e83d01f..8245bf553 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = 'd1f24a8890462cb740909ff62a3a079cded288bc', + revision = '15590fdaf2edbd33e5883b22c844eef545320fc5', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, diff --git a/runtime/queries/angular/highlights.scm b/runtime/queries/angular/highlights.scm index 271e352e5..4793745b4 100644 --- a/runtime/queries/angular/highlights.scm +++ b/runtime/queries/angular/highlights.scm @@ -4,10 +4,7 @@ (pipe_operator) @operator -[ - (string) - (static_member_expression) -] @string +(string) @string (number) @number From 0594d1ba65ddd6fc73411afb78f09ffc912f37b3 Mon Sep 17 00:00:00 2001 From: blindfs Date: Mon, 6 Oct 2025 21:24:58 +0800 Subject: [PATCH 234/434] feat(nu)!: update parser and queries --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/nu/highlights.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8245bf553..72d607836 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1486,7 +1486,7 @@ return { }, nu = { install_info = { - revision = '0e6c59c46db3c246eaf86ce5b325da1247e971a5', + revision = 'e1509fc9f9aa6579430a65f167528617df56b107', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, diff --git a/runtime/queries/nu/highlights.scm b/runtime/queries/nu/highlights.scm index 38ffbaa2e..e23a30fae 100644 --- a/runtime/queries/nu/highlights.scm +++ b/runtime/queries/nu/highlights.scm @@ -203,7 +203,7 @@ file_path: (val_string) @variable.parameter (param_value "=" @punctuation.delimiter) -(param_cmd +(param_completer "@" @punctuation.delimiter) (param_opt @@ -240,7 +240,7 @@ key: (identifier) @property (parameter param_name: (_) @variable.parameter) -(param_cmd +(param_completer (cmd_identifier) @string) (attribute From 3ab4f2d2d20be55874e2eb575145c6928d7d7d0e Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 7 Oct 2025 02:25:25 +0200 Subject: [PATCH 235/434] feat(inko): update parser for let pattern matching Commit 9d7ed4 of the Inko tree-sitter grammar introduces support for pattern matching in `let` expressions. This requires some corresponding changes to the "local" queries to correctly define local variables. This is done by simply defining locals for all "identifier_pattern" nodes, instead of only doing this for "define_variable" nodes. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/inko/locals.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 72d607836..26f8ca2af 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1041,7 +1041,7 @@ return { }, inko = { install_info = { - revision = '080e957d94b330e3867f063b148a8050b0888f4e', + revision = '9d7ed4f6c0ea2a8f846f3bb00e33ab21ec9ca379', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, diff --git a/runtime/queries/inko/locals.scm b/runtime/queries/inko/locals.scm index b69681cd1..2d61c2c5d 100644 --- a/runtime/queries/inko/locals.scm +++ b/runtime/queries/inko/locals.scm @@ -13,7 +13,7 @@ (argument name: _ @local.definition.parameter) -(define_variable +(identifier_pattern name: _ @local.definition.var) (define_constant From de003000a287c501a6650a1ddd3be80ee34278d4 Mon Sep 17 00:00:00 2001 From: Steven Xu Date: Fri, 10 Oct 2025 20:47:09 +1100 Subject: [PATCH 236/434] feat(tmux)!: update parser and highlights Breaking changes: - Node `(variable)` was renamed to `(expr_double_quotes)`. - Node `(variable_raw)` was renamed to `(expr_single_quotes)`. - Node `(string)` was renamed to `(str_double_quotes)`. - Node `(raw_string)` was renamed to `(str_single_quotes)`. - Node `(raw_string_quote)` was removed. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/tmux/highlights.scm | 26 ++++++++++++++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 989187984..90df4eb87 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -300,7 +300,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | unstable | `HFIJL` | | @amaanq, @duskmoon314 [tiger](https://github.com/ambroisie/tree-sitter-tiger) | unstable | `HFIJL` | | @ambroisie [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | unstable | `HF JL` | | @ahelwer, @susliko -[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | unstable | `H  J ` | | @Freed-Wu +[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | unstable | `H  J ` | | @Freed-Wu, @stevenxxiu [todotxt](https://github.com/arnarg/tree-sitter-todotxt) | unstable | `H    ` | | @arnarg [toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | unstable | `HFIJL` | | @tk-shirasaka [tsv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 26f8ca2af..aba7016a1 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2372,10 +2372,10 @@ return { }, tmux = { install_info = { - revision = '0252ecd080016e45e6305ef1a943388f5ae2f4b4', + revision = 'a2936cb2579f7723b5744563c45bcefabc42fe47', url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, - maintainers = { '@Freed-Wu' }, + maintainers = { '@Freed-Wu', '@stevenxxiu' }, tier = 2, }, todotxt = { diff --git a/runtime/queries/tmux/highlights.scm b/runtime/queries/tmux/highlights.scm index 50da7d7d8..ea98dff06 100644 --- a/runtime/queries/tmux/highlights.scm +++ b/runtime/queries/tmux/highlights.scm @@ -1,19 +1,21 @@ -; Comments (comment) @comment @spell -; General [ - (string) - (raw_string) + "'" + (str_single_quotes) + (str_double_quotes) ] @string -(int) @number +(backslash_escape) @string.escape (path) @string.special.path +(int) @number + [ (option) (variable_name) + (variable_name_short) ] @variable (command_line_option) @variable.builtin @@ -21,7 +23,17 @@ ((option) @variable.builtin (#not-lua-match? @variable.builtin "^@")) -(command) @keyword +[ + (if_keyword) + (elif_keyword) + (else_keyword) + (endif_keyword) +] @keyword.conditional + +[ + (hidden_keyword) + (command) +] @keyword (source_file_directive (command) @keyword.import) @@ -33,6 +45,8 @@ "=" @operator [ + ";" + "';'" "," ":" ] @punctuation.delimiter From cbafde992598b8ee05b5b80e165905655578fb75 Mon Sep 17 00:00:00 2001 From: Steven Xu Date: Sat, 11 Oct 2025 17:23:17 +1100 Subject: [PATCH 237/434] feat(tmux)!: update parser and highlights Breaking changes: - Nodes `(variable_name)`, `(expr_variable_name)`, `(variable_name_short)`, are exposed as `(name)`. --- lua/nvim-treesitter/parsers.lua | 2 +- runtime/queries/tmux/highlights.scm | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index aba7016a1..936dc9592 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2372,7 +2372,7 @@ return { }, tmux = { install_info = { - revision = 'a2936cb2579f7723b5744563c45bcefabc42fe47', + revision = '72b42cd0307bdfe471fd151a0282d0d38e889944', url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, maintainers = { '@Freed-Wu', '@stevenxxiu' }, diff --git a/runtime/queries/tmux/highlights.scm b/runtime/queries/tmux/highlights.scm index ea98dff06..33509d76e 100644 --- a/runtime/queries/tmux/highlights.scm +++ b/runtime/queries/tmux/highlights.scm @@ -14,8 +14,7 @@ [ (option) - (variable_name) - (variable_name_short) + (name) ] @variable (command_line_option) @variable.builtin From 763f1e650b91aa951495e709d61597d1222dba65 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 11 Oct 2025 11:12:06 +0200 Subject: [PATCH 238/434] feat(parsers): update angular, comment, dart, desktop, enforce, erlang, gleam, gotmpl, hare, helm, javadoc, kitty, koto, mlir, racket, rust, scheme, superhtml, systemverilog, wit, xresources, yaml --- lua/nvim-treesitter/parsers.lua | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 936dc9592..238f66f67 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = '15590fdaf2edbd33e5883b22c844eef545320fc5', + revision = 'c884ad6cce47da111584aee4b147cdf7dd3383e1', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -238,7 +238,7 @@ return { }, comment = { install_info = { - revision = '689be73775bd2dd57b938b8e12bf50fec35a6ca3', + revision = 'db922d7809637900089709e07e31b88c42354ec2', url = 'https://github.com/stsewd/tree-sitter-comment', }, maintainers = { '@stsewd' }, @@ -338,7 +338,7 @@ return { }, dart = { install_info = { - revision = 'c1222f5a65aba7e0175cc0cc6f88d198d9fe2b02', + revision = 'd4d8f3e337d8be23be27ffc35a0aef972343cd54', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '73c3f1ec366061aa9b1f61d76fc3d37b86b5a9af', + revision = '73b9f3ac30ac8d01267a16b1c4f0880aecdb56b2', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -512,7 +512,7 @@ return { }, enforce = { install_info = { - revision = 'b695854665e749acdd16ce4a2a2e2f38f9ea9ca3', + revision = 'eb2796871d966264cdb041b797416ef1757c8b4f', url = 'https://github.com/simonvic/tree-sitter-enforce', }, maintainers = { '@simonvic' }, @@ -520,7 +520,7 @@ return { }, erlang = { install_info = { - revision = 'df268da05d8ed4837dd2a8e2af1906619c2f0aa0', + revision = 'a260cb65eaa6e055289a34434f98c3aae6137ed5', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -708,7 +708,7 @@ return { }, gleam = { install_info = { - revision = 'dae1551a9911b24f41d876c23f2ab05ece0a9d4c', + revision = 'ec3c27c5eef20f48b17ee28152f521697df10312', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -810,7 +810,7 @@ return { }, gotmpl = { install_info = { - revision = '65f4f86c3aaa9dabab36e3482584e8a111cf7db1', + revision = 'ca26229bafcd3f37698a2496c2a5efa2f07e86bc', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -881,7 +881,7 @@ return { }, hare = { install_info = { - revision = '4af5d82cf9ec39f67cb1db5b7a9269d337406592', + revision = 'eed7ddf6a66b596906aa8ca3d40521b8278adc6f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hare', }, maintainers = { '@amaanq' }, @@ -922,7 +922,7 @@ return { helm = { install_info = { location = 'dialects/helm', - revision = '65f4f86c3aaa9dabab36e3482584e8a111cf7db1', + revision = 'ca26229bafcd3f37698a2496c2a5efa2f07e86bc', url = 'https://github.com/ngalaiko/tree-sitter-go-template', }, maintainers = { '@qvalentin' }, @@ -1074,7 +1074,7 @@ return { }, javadoc = { install_info = { - revision = '7d92cf188e4a3ed1b5068dd99af129f083c47e70', + revision = '92f9d7115598c1b012f5931a84ee5d50d46c0eb7', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1206,7 +1206,7 @@ return { }, kitty = { install_info = { - revision = '49f877cff80ab613808b34bde170ea477ec182fe', + revision = '064d1b4d8ae1b93244de0ff6bc9f0ee0cffee3b5', url = 'https://github.com/OXY2DEV/tree-sitter-kitty', }, maintainers = { '@OXY2DEV' }, @@ -1222,7 +1222,7 @@ return { }, koto = { install_info = { - revision = '7cba915fad6121f776f59e0d1787a3e36e4cfc4e', + revision = '172050b74825a38e29ecc94c85a4dcd10d733738', url = 'https://github.com/koto-lang/tree-sitter-koto', }, maintainers = { '@irh' }, @@ -1406,7 +1406,7 @@ return { mlir = { install_info = { generate = true, - revision = '14152c1e580043865131bca80bcd8e8cb9132df7', + revision = '7eadef0de98de1170cdffb68c0931e375fc1b046', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1829,7 +1829,7 @@ return { }, racket = { install_info = { - revision = '6d63a202602eb350e726b5e7814127ba22ed25fc', + revision = '130e76536bd3a45df7b7fd71cfa3d0df25fcfe8e', url = 'https://github.com/6cdh/tree-sitter-racket', }, tier = 2, @@ -1989,7 +1989,7 @@ return { }, rust = { install_info = { - revision = '946595d164e77b705fa28385654f9420f59262ef', + revision = '261b20226c04ef601adbdf185a800512a5f66291', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -2015,7 +2015,7 @@ return { }, scheme = { install_info = { - revision = '67b5c8d6ce19fd5265f13204fec0a3efa9e095d9', + revision = '591893b9a8b9ec85f5cef86e0cc1028012ad9f0e', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 2, @@ -2207,7 +2207,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'c52790b328b73237bcd924f3d65c5a17e794e8b1', + revision = 'aeaa0c7d9ef983453952a2ee4983476fef0168f3', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2265,7 +2265,7 @@ return { }, systemverilog = { install_info = { - revision = '9e06a0dddbef4e80a2091fd0a772cc93a55019f7', + revision = 'e88937e66adc3ee7be0bfe40b7e937eafe4212bb', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2605,7 +2605,7 @@ return { }, wit = { install_info = { - revision = '8fd7cfd90be29b363922b2e09bf6a7db50de04a8', + revision = '230984dfaf803a0ff8f77da5034361a62c326577', url = 'https://github.com/bytecodealliance/tree-sitter-wit', }, maintainers = { '@mkatychev' }, @@ -2639,7 +2639,7 @@ return { }, xresources = { install_info = { - revision = 'c6f240ab53c75edc0b122bc26c994ceb410d5b27', + revision = 'fd546d43fe0a179b59dfdfb296082c584870e11b', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, @@ -2647,7 +2647,7 @@ return { }, yaml = { install_info = { - revision = '3431ec21da1dde751bab55520963cf3a4f1121f3', + revision = '7708026449bed86239b1cd5bce6e3c34dbca6415', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, From 09d50fd1576feeda21e85af56bcbfbdf8fccef76 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 11 Oct 2025 08:45:31 -0700 Subject: [PATCH 239/434] fix(kitty): align line continuation highlights Changes them from `@comment` to `@punctuation.special`, which is how they are in other languages. --- runtime/queries/kitty/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/kitty/highlights.scm b/runtime/queries/kitty/highlights.scm index 93e5d31a4..7fe0f214a 100644 --- a/runtime/queries/kitty/highlights.scm +++ b/runtime/queries/kitty/highlights.scm @@ -1,4 +1,4 @@ -(line_continuation) @comment +(line_continuation) @punctuation.special (comment (comment_content) @spell) @comment From 4b74045bbe6de587c36b1e96956fa22769b4cdf7 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 11 Oct 2025 09:02:49 -0700 Subject: [PATCH 240/434] chore: ask for file extension in new language PR template This will really help me to search on github for diverse code samples. --- .github/PULL_REQUEST_TEMPLATE/new_language.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE/new_language.md b/.github/PULL_REQUEST_TEMPLATE/new_language.md index 0f814f0f0..b35e84b3b 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_language.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_language.md @@ -8,6 +8,8 @@ https://... +Language file extension, if applicable: (e.g. `.zu`) +
Representative code sample ``` From 0606c7a9dcaa5c5beee0b0f09043e9fdd1ba0a68 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 11 Oct 2025 15:34:39 -0700 Subject: [PATCH 241/434] feat(vue): delimiter highlight touch-ups --- runtime/queries/vue/highlights.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/queries/vue/highlights.scm b/runtime/queries/vue/highlights.scm index 66b7ea61e..173908b5a 100644 --- a/runtime/queries/vue/highlights.scm +++ b/runtime/queries/vue/highlights.scm @@ -5,7 +5,15 @@ "]" ] @punctuation.bracket -(interpolation) @punctuation.special +[ + ":" + "." +] @punctuation.delimiter + +[ + (interpolation) + "@" +] @punctuation.special (interpolation (raw_text) @none) From 4968877bb2dceac45948e24ee14298b1006b4cbf Mon Sep 17 00:00:00 2001 From: Christoph Sax Date: Wed, 15 Oct 2025 21:16:29 +0200 Subject: [PATCH 242/434] fix(t32): update repo url Switches the grammar repository from GitLab to GitHub. --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 90df4eb87..59dcb4b41 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -288,7 +288,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | | @RaafatTurki [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | | @ok-ryoko [systemverilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | unstable | `HF J ` | | @zhangwwpeng -[t32](https://gitlab.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | | @xasc +[t32](https://github.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | | @xasc [tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | unstable | `HFIJL` | | @amaanq [tact](https://github.com/tact-lang/tree-sitter-tact) | unstable | `HFIJL` | | @novusnota [tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | unstable | `HFIJ ` | | @lewis6991 diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 238f66f67..762717cd3 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2274,7 +2274,7 @@ return { t32 = { install_info = { revision = 'd4e26ab7a730cfbe0cf84dba6ea3647989064839', - url = 'https://gitlab.com/xasc/tree-sitter-t32', + url = 'https://github.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, tier = 2, From 63fac0a576bc78a4790cbcce24646cca860bc8c1 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Wed, 15 Oct 2025 23:17:41 -0700 Subject: [PATCH 243/434] fix(vue): `@character.special` highlights for `:`, `.` (#8200) --- runtime/queries/vue/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/vue/highlights.scm b/runtime/queries/vue/highlights.scm index 173908b5a..70e4f405e 100644 --- a/runtime/queries/vue/highlights.scm +++ b/runtime/queries/vue/highlights.scm @@ -8,7 +8,7 @@ [ ":" "." -] @punctuation.delimiter +] @character.special [ (interpolation) From cdb5d5ef233cd5d3c558b4a48dc367943bd5c016 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 17 Oct 2025 14:19:37 +0200 Subject: [PATCH 244/434] docs(readme): remove wiki link --- README.md | 2 -- doc/nvim-treesitter.txt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index bdb9c1ddc..71cf69e33 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,6 @@ For `nvim-treesitter` to support a specific feature for a specific language requ A list of the currently supported languages can be found [on this page](SUPPORTED_LANGUAGES.md). If you wish to add a new language or improve the queries for an existing one, please see our [contributing guide](CONTRIBUTING.md). -For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information). - # Supported features `nvim-treesitter` provides queries for the following features. **These are not automatically enabled.** diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt index f77cb061b..3bb3f9356 100644 --- a/doc/nvim-treesitter.txt +++ b/doc/nvim-treesitter.txt @@ -57,7 +57,7 @@ COMMANDS *nvim-treesitter-commands* Install one or more treesitter parsers. {language} can be one or multiple parsers or tiers (`stable`, `unstable`, or `all` (not recommended)). This is a -no-op of the parser(s) are already installed. Installation is performed +no-op if the parser(s) are already installed. Installation is performed asynchronously. Use *:TSInstall!* to force installation even if a parser is already installed. From 846d51137b8cbc030ab94edf9dc33968ddcdb195 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 17 Oct 2025 15:54:28 +0200 Subject: [PATCH 245/434] feat(julia): update builtin functions and types (#8203) Update to Julia 1.12 (sync with upstream) --- runtime/queries/julia/highlights.scm | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/runtime/queries/julia/highlights.scm b/runtime/queries/julia/highlights.scm index 9a82c5d41..de32c67ed 100644 --- a/runtime/queries/julia/highlights.scm +++ b/runtime/queries/julia/highlights.scm @@ -45,12 +45,13 @@ (identifier) @function.macro))) ; Built-in functions -; filter(name -> Base.eval(Core, name) isa Core.Builtin, names(Core)) +; print.("\"", filter(name -> getglobal(Core, name) isa Core.Builtin, names(Core)), "\" ") ((identifier) @function.builtin (#any-of? @function.builtin - "applicable" "fieldtype" "getfield" "getglobal" "invoke" "isa" "isdefined" "modifyfield!" - "modifyglobal!" "nfields" "replacefield!" "replaceglobal!" "setfield!" "setfieldonce!" - "setglobal!" "setglobalonce!" "swapfield!" "swapglobal!" "throw" "tuple" "typeassert" "typeof")) + "applicable" "fieldtype" "getfield" "getglobal" "invoke" "isa" "isdefined" "isdefinedglobal" + "modifyfield!" "modifyglobal!" "nfields" "replacefield!" "replaceglobal!" "setfield!" + "setfieldonce!" "setglobal!" "setglobalonce!" "swapfield!" "swapglobal!" "throw" "tuple" + "typeassert" "typeof")) ; Type definitions (type_head @@ -91,19 +92,21 @@ (#any-of? @operator "<:" ">:")) ; Built-in types -; filter(name -> typeof(Base.eval(Core, name)) in [DataType, UnionAll], names(Core)) +; print.("\"", filter(name -> typeof(Base.eval(Core, name)) in [DataType, UnionAll], names(Core)), "\" ") ((identifier) @type.builtin (#any-of? @type.builtin "AbstractArray" "AbstractChar" "AbstractFloat" "AbstractString" "Any" "ArgumentError" "Array" - "AssertionError" "Bool" "BoundsError" "Char" "ConcurrencyViolationError" "Cvoid" "DataType" - "DenseArray" "DivideError" "DomainError" "ErrorException" "Exception" "Expr" "Float16" "Float32" - "Float64" "Function" "GlobalRef" "IO" "InexactError" "InitError" "Int" "Int128" "Int16" "Int32" - "Int64" "Int8" "Integer" "InterruptException" "LineNumberNode" "LoadError" "Method" - "MethodError" "Module" "NTuple" "NamedTuple" "Nothing" "Number" "OutOfMemoryError" - "OverflowError" "Pair" "Ptr" "QuoteNode" "ReadOnlyMemoryError" "Real" "Ref" "SegmentationFault" - "Signed" "StackOverflowError" "String" "Symbol" "Task" "Tuple" "Type" "TypeError" "TypeVar" - "UInt" "UInt128" "UInt16" "UInt32" "UInt64" "UInt8" "UndefInitializer" "UndefKeywordError" - "UndefRefError" "UndefVarError" "Union" "UnionAll" "Unsigned" "VecElement" "WeakRef")) + "AssertionError" "AtomicMemory" "AtomicMemoryRef" "Bool" "BoundsError" "Char" + "ConcurrencyViolationError" "Cvoid" "DataType" "DenseArray" "DivideError" "DomainError" + "ErrorException" "Exception" "Expr" "FieldError" "Float16" "Float32" "Float64" "Function" + "GenericMemory" "GenericMemoryRef" "GlobalRef" "IO" "InexactError" "InitError" "Int" "Int128" + "Int16" "Int32" "Int64" "Int8" "Integer" "InterruptException" "LineNumberNode" "LoadError" + "Memory" "MemoryRef" "Method" "MethodError" "Module" "NTuple" "NamedTuple" "Nothing" "Number" + "OutOfMemoryError" "OverflowError" "Pair" "Ptr" "QuoteNode" "ReadOnlyMemoryError" "Real" "Ref" + "SegmentationFault" "Signed" "StackOverflowError" "String" "Symbol" "Task" "Tuple" "Type" + "TypeError" "TypeVar" "UInt" "UInt128" "UInt16" "UInt32" "UInt64" "UInt8" "UndefInitializer" + "UndefKeywordError" "UndefRefError" "UndefVarError" "Union" "UnionAll" "Unsigned" "VecElement" + "WeakRef")) ; Keywords [ From 71bf1665f804d46f7e4b24ad7ffc11f6ea5b271a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 19 Oct 2025 11:29:49 +0200 Subject: [PATCH 246/434] feat(parsers): update ada, cmake, desktop, dot, mlir, nu, qmljs, sparql, sql, superhtml, systemverilog, t32, tmux, xresources --- lua/nvim-treesitter/parsers.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 762717cd3..5cdbf3e43 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2,7 +2,7 @@ return { ada = { install_info = { - revision = 'b23672d313b4c994ab96fd54f1b7ff15eac68a55', + revision = '6c26c4413965dc7bacbccfa66503bf6b8228e254', url = 'https://github.com/briot/tree-sitter-ada', }, maintainers = { '@briot' }, @@ -230,7 +230,7 @@ return { }, cmake = { install_info = { - revision = 'cf9799600b2ba5e6620fdabddec3b2db8306bc46', + revision = 'c7b2a71e7f8ecb167fad4c97227c838439280175', url = 'https://github.com/uyha/tree-sitter-cmake', }, maintainers = { '@uyha' }, @@ -346,7 +346,7 @@ return { }, desktop = { install_info = { - revision = '73b9f3ac30ac8d01267a16b1c4f0880aecdb56b2', + revision = 'de6482e226443a210f27627e0240c12aa25c2925', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, @@ -402,7 +402,7 @@ return { }, dot = { install_info = { - revision = '9ab85550c896d8b294d9b9ca1e30698736f08cea', + revision = '71e2c5241eef9de920a4efedfefd1d527dd9a118', url = 'https://github.com/rydesun/tree-sitter-dot', }, maintainers = { '@rydesun' }, @@ -1406,7 +1406,7 @@ return { mlir = { install_info = { generate = true, - revision = '7eadef0de98de1170cdffb68c0931e375fc1b046', + revision = '47c3f2cf3b10016503f2577c2d99c15bb2053402', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1486,7 +1486,7 @@ return { }, nu = { install_info = { - revision = 'e1509fc9f9aa6579430a65f167528617df56b107', + revision = '4f4ac8667c1e7f80d0d9f9534845e63026210aaf', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1803,7 +1803,7 @@ return { }, qmljs = { install_info = { - revision = '0889da4632bba3ec6f39ef4102625654890c15c1', + revision = '0bec4359a7eb2f6c9220cd57372d87d236f66d59', url = 'https://github.com/yuja/tree-sitter-qmljs', }, maintainers = { '@Decodetalkers' }, @@ -2133,7 +2133,7 @@ return { }, sparql = { install_info = { - revision = 'd853661ca680d8ff7f8d800182d5782b61d0dd58', + revision = '1ef52d35a73a2a5f2e433ecfd1c751c1360a923b', url = 'https://github.com/GordianDziwis/tree-sitter-sparql', }, maintainers = { '@GordianDziwis' }, @@ -2150,7 +2150,7 @@ return { sql = { install_info = { branch = 'gh-pages', - revision = '4afe285bb142542cee0aa7b689fec00a71df4741', + revision = 'd71f2bd7f0e3dba84df7025fc9314738d180e71e', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2207,7 +2207,7 @@ return { superhtml = { install_info = { location = 'tree-sitter-superhtml', - revision = 'aeaa0c7d9ef983453952a2ee4983476fef0168f3', + revision = '8b5bb272b269afdd38cdf641c4a707dd92fbe902', url = 'https://github.com/kristoff-it/superhtml', }, maintainers = { '@rockorager' }, @@ -2265,7 +2265,7 @@ return { }, systemverilog = { install_info = { - revision = 'e88937e66adc3ee7be0bfe40b7e937eafe4212bb', + revision = '7c4b01b7df2f6e7fa1f698c9d30ac8f93af18ed2', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2273,7 +2273,7 @@ return { }, t32 = { install_info = { - revision = 'd4e26ab7a730cfbe0cf84dba6ea3647989064839', + revision = '2f604ad17a15c09d99648199da7f173eed8250dc', url = 'https://github.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2372,7 +2372,7 @@ return { }, tmux = { install_info = { - revision = '72b42cd0307bdfe471fd151a0282d0d38e889944', + revision = '815f8fa5ac7aeb6246c14896d16082fecdf98b2b', url = 'https://github.com/Freed-Wu/tree-sitter-tmux', }, maintainers = { '@Freed-Wu', '@stevenxxiu' }, @@ -2639,7 +2639,7 @@ return { }, xresources = { install_info = { - revision = 'fd546d43fe0a179b59dfdfb296082c584870e11b', + revision = '321231f99e3704f1555de14cda5dca93ee14a95b', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, From 30c466ad571b8b99fd06e3df8b2336e3ae63a53a Mon Sep 17 00:00:00 2001 From: zc he Date: Tue, 21 Oct 2025 15:10:18 +0800 Subject: [PATCH 247/434] fix(nu): separate patterns for `collection_type` --- runtime/queries/nu/highlights.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/runtime/queries/nu/highlights.scm b/runtime/queries/nu/highlights.scm index e23a30fae..e008352d4 100644 --- a/runtime/queries/nu/highlights.scm +++ b/runtime/queries/nu/highlights.scm @@ -344,14 +344,19 @@ key: (identifier) @property [ "record" "table" - ] @type.builtin - "<" @punctuation.bracket - key: (_) @variable.parameter + ] @type.builtin) + +(collection_type + key: (_) @variable.parameter) + +(collection_type [ - "," - ":" - ] @punctuation.delimiter - ">" @punctuation.bracket) + "<" + ">" + ] @punctuation.bracket) + +(collection_type + ":" @punctuation.special) (shebang) @keyword.directive From 8fecb462580ec0794a803b1d6ff9e2c4896c3e6f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 20 Oct 2025 19:19:17 +0200 Subject: [PATCH 248/434] feat(julia)!: switch to maintained fork breaking change: ABI 15, drop support for emoji identifiers --- SUPPORTED_LANGUAGES.md | 2 +- lua/nvim-treesitter/parsers.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 59dcb4b41..f931a3590 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -155,7 +155,7 @@ html_tags (queries only)[^html_tags] | unstable | `H IJ ` | | @TravonteD [jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc) | unstable | `HFIJL` | | @WhyNotHugo [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | unstable | `HF JL` | | @nawordar jsx (queries only)[^jsx] | unstable | `HFIJ ` | | @steelsojka -[julia](https://github.com/tree-sitter/tree-sitter-julia) | unstable | `HFIJL` | | @fredrikekre +[julia](https://github.com/tree-sitter-grammars/tree-sitter-julia) | unstable | `HFIJL` | | @clason [just](https://github.com/IndianBoy42/tree-sitter-just) | unstable | `HFIJL` | | @Hubro [kcl](https://github.com/kcl-lang/tree-sitter-kcl) | unstable | `HF J ` | | @bertbaron [kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | unstable | `HFIJL` | | @amaanq diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 5cdbf3e43..62217fc33 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1166,10 +1166,10 @@ return { }, julia = { install_info = { - revision = '73d1539a51b8a202d6d2471cc594cf4d7c5e673f', - url = 'https://github.com/tree-sitter/tree-sitter-julia', + revision = '8d11bcffb6eebcb08049436bd01bd98afa058dc4', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-julia', }, - maintainers = { '@fredrikekre' }, + maintainers = { '@clason' }, tier = 2, }, just = { From eea5725822098255cc22233b053ba9d56aaf53b9 Mon Sep 17 00:00:00 2001 From: Isla Waters Date: Fri, 17 Oct 2025 10:06:14 -0400 Subject: [PATCH 249/434] feat(perl): Add language injection based on heredoc delimiter --- runtime/queries/perl/injections.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/queries/perl/injections.scm b/runtime/queries/perl/injections.scm index ec11e9013..a1327bd4b 100644 --- a/runtime/queries/perl/injections.scm +++ b/runtime/queries/perl/injections.scm @@ -13,3 +13,7 @@ (#not-lua-match? @_modifiers "e.*e") (#set! injection.language "perl") (#set! injection.include-children)) + +(heredoc_content + (heredoc_end) @injection.language) @injection.content + (#set! injection.include-children) From 4a9f57971ae455f07922800973f2d0eccc818e3a Mon Sep 17 00:00:00 2001 From: Isla Waters Date: Fri, 17 Oct 2025 10:35:00 -0400 Subject: [PATCH 250/434] Remove empty capture based on ts_query_ls output --- runtime/queries/perl/injections.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/queries/perl/injections.scm b/runtime/queries/perl/injections.scm index a1327bd4b..56e9b14fa 100644 --- a/runtime/queries/perl/injections.scm +++ b/runtime/queries/perl/injections.scm @@ -16,4 +16,3 @@ (heredoc_content (heredoc_end) @injection.language) @injection.content - (#set! injection.include-children) From f2204e58dbb2031cb6783caa4541c4483edbb426 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Fri, 24 Oct 2025 18:47:39 -0700 Subject: [PATCH 251/434] fix: use proper `; inherits` syntax in queries (#8226) Some queries don't add a colon after the `inherits` keyword, which nvim could handle but `ts_query_ls` could not, causing it to give incomplete diagnostics. --- runtime/queries/html/injections.scm | 3 ++- runtime/queries/starlark/injections.scm | 2 +- runtime/queries/vue/injections.scm | 3 ++- runtime/queries/wgsl_bevy/folds.scm | 3 ++- runtime/queries/wgsl_bevy/highlights.scm | 3 ++- runtime/queries/wgsl_bevy/indents.scm | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/runtime/queries/html/injections.scm b/runtime/queries/html/injections.scm index adb067d15..6a9d3e89e 100644 --- a/runtime/queries/html/injections.scm +++ b/runtime/queries/html/injections.scm @@ -1,4 +1,5 @@ -; inherits html_tags +; inherits: html_tags + (element (start_tag (tag_name) @_py_script) diff --git a/runtime/queries/starlark/injections.scm b/runtime/queries/starlark/injections.scm index 2b60646e2..0b920cbf9 100644 --- a/runtime/queries/starlark/injections.scm +++ b/runtime/queries/starlark/injections.scm @@ -1 +1 @@ -; inherits python +; inherits: python diff --git a/runtime/queries/vue/injections.scm b/runtime/queries/vue/injections.scm index 586964011..d17bbb55f 100644 --- a/runtime/queries/vue/injections.scm +++ b/runtime/queries/vue/injections.scm @@ -1,4 +1,5 @@ -; inherits html_tags +; inherits: html_tags + ;