From 74c93c6c6ab12eb5c76673c160cd029e8169b437 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 11 Mar 2024 21:08:24 +0800 Subject: [PATCH] chore(treesitter): update nvim-treesitter to 0.9.1 for Nvim-0.8.x --- autoload/SpaceVim/layers/treesitter.vim | 7 +- bundle/nvim-treesitter-0.9.1/.editorconfig | 20 + .../nvim-treesitter-0.9.1/.github/CODEOWNERS | 7 + .../nvim-treesitter-0.9.1/.github/FUNDING.yml | 2 + .../.github/ISSUE_TEMPLATE/bug_report.yml | 58 + .../.github/ISSUE_TEMPLATE/feature_request.md | 19 + .../ISSUE_TEMPLATE/highlighting_issue.yml | 98 + .../nvim-treesitter-0.9.1/.github/mergify.yml | 37 + .../.github/workflows/lint.yml | 33 + .../.github/workflows/release.yml | 17 + .../.github/workflows/test-queries.yml | 87 + .../.github/workflows/tests.yml | 65 + .../.github/workflows/update-lockfile.yml | 56 + .../.github/workflows/update-readme.yml | 42 + bundle/nvim-treesitter-0.9.1/.gitignore | 4 + bundle/nvim-treesitter-0.9.1/.luacheckrc | 21 + bundle/nvim-treesitter-0.9.1/.luarc.json | 25 + bundle/nvim-treesitter-0.9.1/.stylua.toml | 6 + bundle/nvim-treesitter-0.9.1/.styluaignore | 1 + bundle/nvim-treesitter-0.9.1/CONTRIBUTING.md | 347 +++ bundle/nvim-treesitter-0.9.1/LICENSE | 201 ++ bundle/nvim-treesitter-0.9.1/Makefile | 7 + bundle/nvim-treesitter-0.9.1/README.md | 721 +++++++ bundle/nvim-treesitter-0.9.1/assets/logo.png | Bin 0 -> 26664 bytes .../autoload/nvim_treesitter.vim | 27 + .../doc/nvim-treesitter.txt | 590 ++++++ bundle/nvim-treesitter-0.9.1/lockfile.json | 608 ++++++ .../lua/nvim-treesitter.lua | 22 + .../lua/nvim-treesitter/caching.lua | 71 + .../lua/nvim-treesitter/compat.lua | 27 + .../lua/nvim-treesitter/configs.lua | 616 ++++++ .../lua/nvim-treesitter/fold.lua | 123 ++ .../lua/nvim-treesitter/health.lua | 176 ++ .../lua/nvim-treesitter/highlight.lua | 49 + .../nvim-treesitter/incremental_selection.lua | 176 ++ .../lua/nvim-treesitter/indent.lua | 359 ++++ .../lua/nvim-treesitter/info.lua | 190 ++ .../lua/nvim-treesitter/install.lua | 773 +++++++ .../lua/nvim-treesitter/locals.lua | 364 ++++ .../lua/nvim-treesitter/parsers.lua | 1870 +++++++++++++++++ .../lua/nvim-treesitter/query.lua | 453 ++++ .../lua/nvim-treesitter/query_predicates.lua | 281 +++ .../shell_command_selectors.lua | 335 +++ .../lua/nvim-treesitter/statusline.lua | 53 + .../lua/nvim-treesitter/ts_utils.lua | 467 ++++ .../lua/nvim-treesitter/tsrange.lua | 154 ++ .../lua/nvim-treesitter/utils.lua | 237 +++ .../nvim-treesitter-scm-1.rockspec | 36 + .../parser-info/.gitignore | 2 + .../nvim-treesitter-0.9.1/parser/.gitignore | 2 + .../plugin/nvim-treesitter.lua | 34 + .../queries/ada/folds.scm | 14 + .../queries/ada/highlights.scm | 196 ++ .../queries/ada/locals.scm | 33 + .../queries/agda/folds.scm | 4 + .../queries/agda/highlights.scm | 82 + .../queries/arduino/folds.scm | 1 + .../queries/arduino/highlights.scm | 111 + .../queries/arduino/indents.scm | 1 + .../queries/arduino/injections.scm | 6 + .../queries/arduino/locals.scm | 1 + .../queries/astro/folds.scm | 1 + .../queries/astro/highlights.scm | 5 + .../queries/astro/indents.scm | 1 + .../queries/astro/injections.scm | 19 + .../queries/astro/locals.scm | 1 + .../queries/awk/highlights.scm | 195 ++ .../queries/awk/injections.scm | 2 + .../queries/bash/folds.scm | 8 + .../queries/bash/highlights.scm | 148 ++ .../queries/bash/injections.scm | 3 + .../queries/bash/locals.scm | 13 + .../queries/bass/folds.scm | 5 + .../queries/bass/highlights.scm | 109 + .../queries/bass/indents.scm | 22 + .../queries/bass/injections.scm | 1 + .../queries/bass/locals.scm | 25 + .../queries/beancount/folds.scm | 4 + .../queries/beancount/highlights.scm | 24 + .../queries/bibtex/folds.scm | 3 + .../queries/bibtex/highlights.scm | 49 + .../queries/bibtex/indents.scm | 10 + .../queries/bicep/folds.scm | 25 + .../queries/bicep/highlights.scm | 230 ++ .../queries/bicep/indents.scm | 18 + .../queries/bicep/injections.scm | 4 + .../queries/bicep/locals.scm | 74 + .../queries/blueprint/highlights.scm | 57 + .../nvim-treesitter-0.9.1/queries/c/folds.scm | 20 + .../queries/c/highlights.scm | 263 +++ .../queries/c/indents.scm | 90 + .../queries/c/injections.scm | 10 + .../queries/c/locals.scm | 53 + .../queries/c_sharp/folds.scm | 15 + .../queries/c_sharp/highlights.scm | 412 ++++ .../queries/c_sharp/injections.scm | 1 + .../queries/c_sharp/locals.scm | 41 + .../queries/cairo/folds.scm | 31 + .../queries/cairo/highlights.scm | 338 +++ .../queries/cairo/indents.scm | 45 + .../queries/cairo/injections.scm | 3 + .../queries/cairo/locals.scm | 68 + .../queries/capnp/folds.scm | 14 + .../queries/capnp/highlights.scm | 154 ++ .../queries/capnp/indents.scm | 38 + .../queries/capnp/injections.scm | 1 + .../queries/capnp/locals.scm | 90 + .../queries/chatito/folds.scm | 5 + .../queries/chatito/highlights.scm | 54 + .../queries/chatito/indents.scm | 7 + .../queries/chatito/injections.scm | 1 + .../queries/chatito/locals.scm | 10 + .../queries/clojure/folds.scm | 1 + .../queries/clojure/highlights.scm | 376 ++++ .../queries/clojure/injections.scm | 1 + .../queries/clojure/locals.scm | 1 + .../queries/cmake/folds.scm | 8 + .../queries/cmake/highlights.scm | 217 ++ .../queries/cmake/indents.scm | 25 + .../queries/comment/highlights.scm | 43 + .../queries/commonlisp/folds.scm | 1 + .../queries/commonlisp/highlights.scm | 145 ++ .../queries/commonlisp/locals.scm | 72 + .../queries/cooklang/highlights.scm | 22 + .../queries/corn/folds.scm | 5 + .../queries/corn/highlights.scm | 22 + .../queries/corn/indents.scm | 14 + .../queries/corn/locals.scm | 16 + .../queries/cpon/folds.scm | 5 + .../queries/cpon/highlights.scm | 50 + .../queries/cpon/indents.scm | 17 + .../queries/cpon/injections.scm | 1 + .../queries/cpon/locals.scm | 7 + .../queries/cpp/folds.scm | 14 + .../queries/cpp/highlights.scm | 240 +++ .../queries/cpp/indents.scm | 11 + .../queries/cpp/injections.scm | 10 + .../queries/cpp/locals.scm | 75 + .../queries/css/folds.scm | 3 + .../queries/css/highlights.scm | 91 + .../queries/css/indents.scm | 9 + .../queries/css/injections.scm | 1 + .../queries/cuda/folds.scm | 1 + .../queries/cuda/highlights.scm | 13 + .../queries/cuda/indents.scm | 1 + .../queries/cuda/injections.scm | 6 + .../queries/cuda/locals.scm | 1 + .../queries/cue/folds.scm | 5 + .../queries/cue/highlights.scm | 164 ++ .../queries/cue/indents.scm | 21 + .../queries/cue/injections.scm | 1 + .../queries/cue/locals.scm | 34 + .../nvim-treesitter-0.9.1/queries/d/folds.scm | 1 + .../queries/d/highlights.scm | 288 +++ .../queries/d/indents.scm | 17 + .../queries/d/injections.scm | 7 + .../queries/dart/folds.scm | 15 + .../queries/dart/highlights.scm | 272 +++ .../queries/dart/indents.scm | 45 + .../queries/dart/injections.scm | 1 + .../queries/dart/locals.scm | 34 + .../queries/devicetree/folds.scm | 1 + .../queries/devicetree/highlights.scm | 35 + .../queries/devicetree/indents.scm | 14 + .../queries/devicetree/injections.scm | 1 + .../queries/devicetree/locals.scm | 4 + .../queries/dhall/folds.scm | 14 + .../queries/dhall/highlights.scm | 171 ++ .../queries/dhall/injections.scm | 4 + .../queries/diff/highlights.scm | 6 + .../queries/dockerfile/highlights.scm | 57 + .../queries/dockerfile/injections.scm | 3 + .../queries/dot/highlights.scm | 55 + .../queries/dot/injections.scm | 2 + .../queries/ebnf/highlights.scm | 43 + .../queries/ecma/folds.scm | 22 + .../queries/ecma/highlights.scm | 357 ++++ .../queries/ecma/indents.scm | 57 + .../queries/ecma/injections.scm | 103 + .../queries/ecma/locals.scm | 37 + .../queries/eex/highlights.scm | 15 + .../queries/eex/injections.scm | 5 + .../queries/elixir/folds.scm | 9 + .../queries/elixir/highlights.scm | 226 ++ .../queries/elixir/indents.scm | 23 + .../queries/elixir/injections.scm | 48 + .../queries/elixir/locals.scm | 164 ++ .../queries/elm/highlights.scm | 205 ++ .../queries/elm/injections.scm | 3 + .../queries/elsa/folds.scm | 1 + .../queries/elsa/highlights.scm | 41 + .../queries/elsa/indents.scm | 6 + .../queries/elsa/injections.scm | 1 + .../queries/elsa/locals.scm | 12 + .../queries/elvish/highlights.scm | 70 + .../queries/elvish/injections.scm | 1 + .../queries/embedded_template/highlights.scm | 12 + .../queries/embedded_template/injections.scm | 2 + .../queries/erlang/folds.scm | 9 + .../queries/erlang/highlights.scm | 129 ++ .../queries/fennel/folds.scm | 1 + .../queries/fennel/highlights.scm | 121 ++ .../queries/fennel/injections.scm | 1 + .../queries/fennel/locals.scm | 26 + .../queries/firrtl/folds.scm | 6 + .../queries/firrtl/highlights.scm | 189 ++ .../queries/firrtl/indents.scm | 12 + .../queries/firrtl/injections.scm | 1 + .../queries/firrtl/locals.scm | 38 + .../queries/fish/folds.scm | 8 + .../queries/fish/highlights.scm | 168 ++ .../queries/fish/indents.scm | 18 + .../queries/fish/injections.scm | 1 + .../queries/fish/locals.scm | 18 + .../queries/foam/folds.scm | 7 + .../queries/foam/highlights.scm | 61 + .../queries/foam/indents.scm | 11 + .../queries/foam/injections.scm | 12 + .../queries/foam/locals.scm | 6 + .../queries/fortran/folds.scm | 11 + .../queries/fortran/highlights.scm | 332 +++ .../queries/fortran/indents.scm | 27 + .../queries/fsh/highlights.scm | 91 + .../queries/func/highlights.scm | 175 ++ .../queries/fusion/folds.scm | 6 + .../queries/fusion/highlights.scm | 120 ++ .../queries/fusion/indents.scm | 19 + .../queries/fusion/locals.scm | 21 + .../queries/gdscript/folds.scm | 25 + .../queries/gdscript/highlights.scm | 344 +++ .../queries/gdscript/indents.scm | 78 + .../queries/gdscript/injections.scm | 1 + .../queries/gdscript/locals.scm | 92 + .../queries/git_config/folds.scm | 0 .../queries/git_config/highlights.scm | 49 + .../queries/git_rebase/highlights.scm | 8 + .../queries/git_rebase/injections.scm | 5 + .../queries/gitattributes/highlights.scm | 53 + .../queries/gitattributes/injections.scm | 1 + .../queries/gitcommit/highlights.scm | 33 + .../queries/gitcommit/injections.scm | 2 + .../queries/gitignore/highlights.scm | 31 + .../queries/gleam/folds.scm | 7 + .../queries/gleam/highlights.scm | 172 ++ .../queries/gleam/indents.scm | 28 + .../queries/gleam/injections.scm | 6 + .../queries/gleam/locals.scm | 24 + .../queries/glimmer/folds.scm | 4 + .../queries/glimmer/highlights.scm | 88 + .../queries/glimmer/indents.scm | 22 + .../queries/glimmer/locals.scm | 7 + .../queries/glsl/folds.scm | 1 + .../queries/glsl/highlights.scm | 37 + .../queries/glsl/indents.scm | 1 + .../queries/glsl/injections.scm | 6 + .../queries/glsl/locals.scm | 1 + .../queries/go/folds.scm | 20 + .../queries/go/highlights.scm | 255 +++ .../queries/go/indents.scm | 33 + .../queries/go/injections.scm | 13 + .../queries/go/locals.scm | 79 + .../queries/godot_resource/folds.scm | 3 + .../queries/godot_resource/highlights.scm | 28 + .../queries/godot_resource/locals.scm | 3 + .../queries/gomod/highlights.scm | 18 + .../queries/gomod/injections.scm | 1 + .../queries/gosum/highlights.scm | 31 + .../queries/gowork/highlights.scm | 14 + .../queries/gowork/injections.scm | 1 + .../queries/graphql/highlights.scm | 165 ++ .../queries/graphql/indents.scm | 9 + .../queries/graphql/injections.scm | 1 + .../queries/groovy/highlights.scm | 95 + .../queries/groovy/injections.scm | 4 + .../queries/hack/highlights.scm | 317 +++ .../queries/hare/folds.scm | 21 + .../queries/hare/highlights.scm | 255 +++ .../queries/hare/indents.scm | 36 + .../queries/hare/injections.scm | 8 + .../queries/hare/locals.scm | 47 + .../queries/haskell/folds.scm | 5 + .../queries/haskell/highlights.scm | 160 ++ .../queries/haskell/injections.scm | 85 + .../queries/haskell_persistent/folds.scm | 3 + .../queries/haskell_persistent/highlights.scm | 38 + .../queries/hcl/folds.scm | 6 + .../queries/hcl/highlights.scm | 99 + .../queries/hcl/indents.scm | 15 + .../queries/hcl/injections.scm | 7 + .../queries/heex/folds.scm | 6 + .../queries/heex/highlights.scm | 56 + .../queries/heex/indents.scm | 20 + .../queries/heex/injections.scm | 11 + .../queries/heex/locals.scm | 13 + .../queries/hjson/folds.scm | 1 + .../queries/hjson/highlights.scm | 16 + .../queries/hjson/indents.scm | 3 + .../queries/hjson/injections.scm | 1 + .../queries/hjson/locals.scm | 1 + .../queries/hlsl/folds.scm | 1 + .../queries/hlsl/highlights.scm | 35 + .../queries/hlsl/indents.scm | 1 + .../queries/hlsl/injections.scm | 6 + .../queries/hlsl/locals.scm | 1 + .../queries/hocon/highlights.scm | 37 + .../queries/hocon/injections.scm | 1 + .../queries/hoon/folds.scm | 6 + .../queries/hoon/highlights.scm | 33 + .../queries/hoon/locals.scm | 4 + .../queries/html/folds.scm | 5 + .../queries/html/highlights.scm | 5 + .../queries/html/indents.scm | 1 + .../queries/html/injections.scm | 24 + .../queries/html/locals.scm | 1 + .../queries/html_tags/highlights.scm | 60 + .../queries/html_tags/indents.scm | 34 + .../queries/html_tags/injections.scm | 74 + .../queries/htmldjango/folds.scm | 4 + .../queries/htmldjango/highlights.scm | 35 + .../queries/htmldjango/indents.scm | 3 + .../queries/htmldjango/injections.scm | 1 + .../queries/http/highlights.scm | 60 + .../queries/http/injections.scm | 7 + .../queries/hurl/folds.scm | 20 + .../queries/hurl/highlights.scm | 133 ++ .../queries/hurl/indents.scm | 14 + .../queries/hurl/injections.scm | 7 + .../queries/ini/folds.scm | 1 + .../queries/ini/highlights.scm | 16 + .../queries/ispc/folds.scm | 8 + .../queries/ispc/highlights.scm | 225 ++ .../queries/ispc/indents.scm | 7 + .../queries/ispc/injections.scm | 1 + .../queries/ispc/locals.scm | 17 + .../queries/janet_simple/folds.scm | 1 + .../queries/janet_simple/highlights.scm | 300 +++ .../queries/janet_simple/injections.scm | 1 + .../queries/janet_simple/locals.scm | 1 + .../queries/java/folds.scm | 7 + .../queries/java/highlights.scm | 296 +++ .../queries/java/indents.scm | 37 + .../queries/java/injections.scm | 4 + .../queries/java/locals.scm | 89 + .../queries/javascript/folds.scm | 1 + .../queries/javascript/highlights.scm | 55 + .../queries/javascript/indents.scm | 1 + .../queries/javascript/injections.scm | 1 + .../queries/javascript/locals.scm | 63 + .../queries/jq/highlights.scm | 330 +++ .../queries/jq/injections.scm | 31 + .../queries/jsdoc/highlights.scm | 2 + .../queries/json/folds.scm | 5 + .../queries/json/highlights.scm | 30 + .../queries/json/indents.scm | 9 + .../queries/json/locals.scm | 4 + .../queries/json5/highlights.scm | 17 + .../queries/json5/injections.scm | 1 + .../queries/jsonc/folds.scm | 1 + .../queries/jsonc/highlights.scm | 3 + .../queries/jsonc/indents.scm | 3 + .../queries/jsonc/injections.scm | 1 + .../queries/jsonc/locals.scm | 1 + .../queries/jsonnet/highlights.scm | 96 + .../queries/jsx/folds.scm | 1 + .../queries/jsx/highlights.scm | 35 + .../queries/jsx/indents.scm | 16 + .../queries/jsx/injections.scm | 8 + .../queries/julia/folds.scm | 17 + .../queries/julia/highlights.scm | 300 +++ .../queries/julia/indents.scm | 43 + .../queries/julia/injections.scm | 23 + .../queries/julia/locals.scm | 79 + .../queries/kdl/folds.scm | 8 + .../queries/kdl/highlights.scm | 58 + .../queries/kdl/indents.scm | 7 + .../queries/kdl/injections.scm | 4 + .../queries/kdl/locals.scm | 10 + .../queries/kotlin/folds.scm | 17 + .../queries/kotlin/highlights.scm | 422 ++++ .../queries/kotlin/injections.scm | 35 + .../queries/kotlin/locals.scm | 84 + .../queries/lalrpop/highlights.scm | 60 + .../queries/lalrpop/injections.scm | 9 + .../queries/lalrpop/locals.scm | 5 + .../queries/latex/folds.scm | 14 + .../queries/latex/highlights.scm | 249 +++ .../queries/latex/injections.scm | 22 + .../queries/ledger/folds.scm | 3 + .../queries/ledger/highlights.scm | 54 + .../queries/ledger/indents.scm | 3 + .../queries/ledger/injections.scm | 2 + .../queries/llvm/highlights.scm | 166 ++ .../queries/lua/folds.scm | 10 + .../queries/lua/highlights.scm | 247 +++ .../queries/lua/indents.scm | 43 + .../queries/lua/injections.scm | 59 + .../queries/lua/locals.scm | 51 + .../queries/luadoc/highlights.scm | 152 ++ .../queries/luap/highlights.scm | 35 + .../queries/luau/folds.scm | 5 + .../queries/luau/highlights.scm | 252 +++ .../queries/luau/indents.scm | 5 + .../queries/luau/injections.scm | 39 + .../queries/luau/locals.scm | 51 + .../queries/m68k/folds.scm | 1 + .../queries/m68k/highlights.scm | 71 + .../queries/m68k/injections.scm | 1 + .../queries/m68k/locals.scm | 22 + .../queries/make/folds.scm | 7 + .../queries/make/highlights.scm | 131 ++ .../queries/make/injections.scm | 4 + .../queries/markdown/folds.scm | 9 + .../queries/markdown/highlights.scm | 63 + .../queries/markdown/indents.scm | 3 + .../queries/markdown/injections.scm | 17 + .../queries/markdown_inline/highlights.scm | 94 + .../queries/markdown_inline/injections.scm | 2 + .../queries/matlab/folds.scm | 11 + .../queries/matlab/highlights.scm | 154 ++ .../queries/matlab/indents.scm | 35 + .../queries/matlab/injections.scm | 1 + .../queries/matlab/locals.scm | 20 + .../queries/menhir/highlights.scm | 29 + .../queries/menhir/injections.scm | 1 + .../queries/mermaid/highlights.scm | 177 ++ .../queries/meson/folds.scm | 9 + .../queries/meson/highlights.scm | 76 + .../queries/meson/injections.scm | 1 + .../queries/mlir/highlights.scm | 335 +++ .../queries/mlir/locals.scm | 7 + .../queries/nickel/highlights.scm | 61 + .../queries/nickel/indents.scm | 13 + .../queries/ninja/folds.scm | 1 + .../queries/ninja/highlights.scm | 98 + .../queries/ninja/indents.scm | 6 + .../queries/nix/folds.scm | 11 + .../queries/nix/highlights.scm | 133 ++ .../queries/nix/injections.scm | 108 + .../queries/nix/locals.scm | 15 + .../queries/objc/folds.scm | 20 + .../queries/objc/highlights.scm | 216 ++ .../queries/objc/indents.scm | 1 + .../queries/objc/injections.scm | 10 + .../queries/objc/locals.scm | 1 + .../queries/ocaml/folds.scm | 30 + .../queries/ocaml/highlights.scm | 177 ++ .../queries/ocaml/indents.scm | 69 + .../queries/ocaml/injections.scm | 1 + .../queries/ocaml/locals.scm | 77 + .../queries/ocaml_interface/folds.scm | 1 + .../queries/ocaml_interface/highlights.scm | 1 + .../queries/ocaml_interface/indents.scm | 1 + .../queries/ocaml_interface/injections.scm | 1 + .../queries/ocaml_interface/locals.scm | 1 + .../queries/ocamllex/highlights.scm | 41 + .../queries/ocamllex/injections.scm | 3 + .../queries/odin/folds.scm | 7 + .../queries/odin/highlights.scm | 293 +++ .../queries/odin/indents.scm | 27 + .../queries/odin/injections.scm | 1 + .../queries/odin/locals.scm | 39 + .../queries/pascal/folds.scm | 33 + .../queries/pascal/highlights.scm | 424 ++++ .../queries/pascal/indents.scm | 32 + .../queries/pascal/injections.scm | 4 + .../queries/pascal/locals.scm | 25 + .../queries/passwd/highlights.scm | 16 + .../queries/pem/folds.scm | 1 + .../queries/pem/highlights.scm | 11 + .../queries/pem/injections.scm | 1 + .../queries/perl/folds.scm | 11 + .../queries/perl/highlights.scm | 198 ++ .../queries/perl/injections.scm | 1 + .../queries/php/folds.scm | 16 + .../queries/php/highlights.scm | 314 +++ .../queries/php/indents.scm | 28 + .../queries/php/injections.scm | 20 + .../queries/php/locals.scm | 87 + .../queries/phpdoc/highlights.scm | 45 + .../queries/pioasm/highlights.scm | 34 + .../queries/pioasm/injections.scm | 10 + .../queries/po/folds.scm | 9 + .../queries/po/highlights.scm | 33 + .../queries/po/injections.scm | 1 + .../queries/poe_filter/folds.scm | 1 + .../queries/poe_filter/highlights.scm | 38 + .../queries/poe_filter/indents.scm | 5 + .../queries/poe_filter/injections.scm | 1 + .../queries/pony/folds.scm | 39 + .../queries/pony/highlights.scm | 292 +++ .../queries/pony/indents.scm | 60 + .../queries/pony/injections.scm | 4 + .../queries/pony/locals.scm | 91 + .../queries/prisma/highlights.scm | 39 + .../queries/promql/highlights.scm | 42 + .../queries/promql/injections.scm | 1 + .../queries/proto/folds.scm | 5 + .../queries/proto/highlights.scm | 82 + .../queries/prql/highlights.scm | 151 ++ .../queries/prql/injections.scm | 13 + .../queries/pug/highlights.scm | 80 + .../queries/pug/injections.scm | 7 + .../queries/puppet/folds.scm | 13 + .../queries/puppet/highlights.scm | 195 ++ .../queries/puppet/indents.scm | 24 + .../queries/puppet/injections.scm | 4 + .../queries/puppet/locals.scm | 46 + .../queries/python/folds.scm | 28 + .../queries/python/highlights.scm | 345 +++ .../queries/python/indents.scm | 132 ++ .../queries/python/injections.scm | 8 + .../queries/python/locals.scm | 115 + .../queries/ql/folds.scm | 7 + .../queries/ql/highlights.scm | 135 ++ .../queries/ql/indents.scm | 23 + .../queries/ql/injections.scm | 5 + .../queries/ql/locals.scm | 30 + .../queries/qmldir/highlights.scm | 24 + .../queries/qmldir/injections.scm | 1 + .../queries/qmljs/folds.scm | 8 + .../queries/qmljs/highlights.scm | 153 ++ .../queries/query/folds.scm | 6 + .../queries/query/highlights.scm | 34 + .../queries/query/indents.scm | 12 + .../queries/query/injections.scm | 13 + .../queries/query/locals.scm | 15 + .../queries/r/highlights.scm | 144 ++ .../queries/r/indents.scm | 33 + .../queries/r/injections.scm | 1 + .../queries/r/locals.scm | 11 + .../queries/racket/folds.scm | 1 + .../queries/racket/highlights.scm | 141 ++ .../queries/racket/injections.scm | 2 + .../queries/rasi/folds.scm | 5 + .../queries/rasi/highlights.scm | 82 + .../queries/rasi/indents.scm | 5 + .../queries/rasi/locals.scm | 5 + .../queries/regex/highlights.scm | 34 + .../queries/rego/highlights.scm | 64 + .../queries/rego/injections.scm | 1 + .../queries/requirements/highlights.scm | 47 + .../queries/requirements/injections.scm | 1 + .../queries/rnoweb/folds.scm | 3 + .../queries/rnoweb/highlights.scm | 2 + .../queries/rnoweb/injections.scm | 7 + .../queries/robot/highlights.scm | 21 + .../queries/ron/folds.scm | 7 + .../queries/ron/highlights.scm | 53 + .../queries/ron/indents.scm | 12 + .../queries/ron/injections.scm | 4 + .../queries/ron/locals.scm | 12 + .../queries/rst/highlights.scm | 171 ++ .../queries/rst/injections.scm | 71 + .../queries/rst/locals.scm | 40 + .../queries/ruby/folds.scm | 12 + .../queries/ruby/highlights.scm | 259 +++ .../queries/ruby/indents.scm | 43 + .../queries/ruby/injections.scm | 9 + .../queries/ruby/locals.scm | 55 + .../queries/rust/folds.scm | 25 + .../queries/rust/highlights.scm | 384 ++++ .../queries/rust/indents.scm | 60 + .../queries/rust/injections.scm | 34 + .../queries/rust/locals.scm | 103 + .../queries/scala/folds.scm | 15 + .../queries/scala/highlights.scm | 264 +++ .../queries/scala/injections.scm | 4 + .../queries/scala/locals.scm | 42 + .../queries/scfg/highlights.scm | 8 + .../queries/scfg/injections.scm | 1 + .../queries/scheme/folds.scm | 1 + .../queries/scheme/highlights.scm | 182 ++ .../queries/scheme/injections.scm | 1 + .../queries/scss/folds.scm | 1 + .../queries/scss/highlights.scm | 65 + .../queries/scss/indents.scm | 7 + .../queries/slint/highlights.scm | 154 ++ .../queries/slint/indents.scm | 14 + .../queries/smali/folds.scm | 12 + .../queries/smali/highlights.scm | 218 ++ .../queries/smali/indents.scm | 32 + .../queries/smali/injections.scm | 1 + .../queries/smali/locals.scm | 42 + .../queries/smithy/highlights.scm | 113 + .../queries/solidity/highlights.scm | 263 +++ .../queries/sparql/folds.scm | 26 + .../queries/sparql/highlights.scm | 211 ++ .../queries/sparql/indents.scm | 17 + .../queries/sparql/injections.scm | 1 + .../queries/sparql/locals.scm | 8 + .../queries/sql/highlights.scm | 379 ++++ .../queries/sql/indents.scm | 27 + .../queries/sql/injections.scm | 3 + .../queries/squirrel/folds.scm | 27 + .../queries/squirrel/highlights.scm | 307 +++ .../queries/squirrel/indents.scm | 58 + .../queries/squirrel/injections.scm | 9 + .../queries/squirrel/locals.scm | 67 + .../queries/starlark/folds.scm | 22 + .../queries/starlark/highlights.scm | 302 +++ .../queries/starlark/indents.scm | 53 + .../queries/starlark/injections.scm | 1 + .../queries/starlark/locals.scm | 91 + .../queries/supercollider/folds.scm | 7 + .../queries/supercollider/highlights.scm | 97 + .../queries/supercollider/indents.scm | 31 + .../queries/supercollider/injections.scm | 4 + .../queries/supercollider/locals.scm | 27 + .../queries/surface/folds.scm | 6 + .../queries/surface/highlights.scm | 44 + .../queries/surface/indents.scm | 14 + .../queries/surface/injections.scm | 8 + .../queries/svelte/folds.scm | 9 + .../queries/svelte/highlights.scm | 30 + .../queries/svelte/indents.scm | 20 + .../queries/svelte/injections.scm | 40 + .../queries/swift/highlights.scm | 181 ++ .../queries/swift/indents.scm | 92 + .../queries/swift/locals.scm | 18 + .../queries/sxhkdrc/folds.scm | 3 + .../queries/sxhkdrc/highlights.scm | 10 + .../queries/sxhkdrc/injections.scm | 1 + .../queries/systemtap/folds.scm | 18 + .../queries/systemtap/highlights.scm | 153 ++ .../queries/systemtap/injections.scm | 2 + .../queries/systemtap/locals.scm | 35 + .../queries/t32/folds.scm | 1 + .../queries/t32/highlights.scm | 232 ++ .../queries/t32/indents.scm | 34 + .../queries/t32/injections.scm | 1 + .../queries/t32/locals.scm | 38 + .../queries/tablegen/folds.scm | 13 + .../queries/tablegen/highlights.scm | 156 ++ .../queries/tablegen/indents.scm | 27 + .../queries/tablegen/injections.scm | 7 + .../queries/tablegen/locals.scm | 51 + .../queries/teal/folds.scm | 13 + .../queries/teal/highlights.scm | 135 ++ .../queries/teal/indents.scm | 18 + .../queries/teal/injections.scm | 27 + .../queries/teal/locals.scm | 23 + .../queries/terraform/folds.scm | 1 + .../queries/terraform/highlights.scm | 21 + .../queries/terraform/indents.scm | 1 + .../queries/terraform/injections.scm | 1 + .../queries/thrift/folds.scm | 12 + .../queries/thrift/highlights.scm | 230 ++ .../queries/thrift/indents.scm | 16 + .../queries/thrift/injections.scm | 1 + .../queries/thrift/locals.scm | 51 + .../queries/tiger/folds.scm | 19 + .../queries/tiger/highlights.scm | 121 ++ .../queries/tiger/indents.scm | 70 + .../queries/tiger/injections.scm | 3 + .../queries/tiger/locals.scm | 39 + .../queries/tlaplus/folds.scm | 5 + .../queries/tlaplus/highlights.scm | 270 +++ .../queries/tlaplus/injections.scm | 4 + .../queries/tlaplus/locals.scm | 89 + .../queries/todotxt/highlights.scm | 6 + .../queries/toml/folds.scm | 5 + .../queries/toml/highlights.scm | 36 + .../queries/toml/indents.scm | 11 + .../queries/toml/injections.scm | 1 + .../queries/toml/locals.scm | 4 + .../queries/tsx/folds.scm | 1 + .../queries/tsx/highlights.scm | 1 + .../queries/tsx/indents.scm | 1 + .../queries/tsx/injections.scm | 1 + .../queries/tsx/locals.scm | 1 + .../queries/turtle/folds.scm | 4 + .../queries/turtle/highlights.scm | 58 + .../queries/turtle/indents.scm | 10 + .../queries/turtle/injections.scm | 1 + .../queries/turtle/locals.scm | 12 + .../queries/twig/highlights.scm | 55 + .../queries/twig/injections.scm | 2 + .../queries/typescript/folds.scm | 7 + .../queries/typescript/highlights.scm | 157 ++ .../queries/typescript/indents.scm | 7 + .../queries/typescript/injections.scm | 1 + .../queries/typescript/locals.scm | 27 + .../queries/ungrammar/folds.scm | 1 + .../queries/ungrammar/highlights.scm | 30 + .../queries/ungrammar/indents.scm | 6 + .../queries/ungrammar/injections.scm | 2 + .../queries/ungrammar/locals.scm | 7 + .../queries/usd/folds.scm | 3 + .../queries/usd/highlights.scm | 181 ++ .../queries/usd/indents.scm | 26 + .../queries/usd/locals.scm | 4 + .../queries/uxntal/folds.scm | 7 + .../queries/uxntal/highlights.scm | 84 + .../queries/uxntal/indents.scm | 17 + .../queries/uxntal/injections.scm | 1 + .../queries/uxntal/locals.scm | 22 + .../nvim-treesitter-0.9.1/queries/v/folds.scm | 6 + .../queries/v/highlights.scm | 467 ++++ .../queries/v/indents.scm | 16 + .../queries/v/injections.scm | 13 + .../queries/v/locals.scm | 28 + .../queries/vala/folds.scm | 12 + .../queries/vala/highlights.scm | 250 +++ .../queries/verilog/folds.scm | 6 + .../queries/verilog/highlights.scm | 315 +++ .../queries/verilog/injections.scm | 1 + .../queries/verilog/locals.scm | 61 + .../queries/vhs/highlights.scm | 38 + .../queries/vim/folds.scm | 4 + .../queries/vim/highlights.scm | 290 +++ .../queries/vim/injections.scm | 27 + .../queries/vim/locals.scm | 10 + .../queries/vimdoc/highlights.scm | 25 + .../queries/vimdoc/injections.scm | 3 + .../queries/vue/folds.scm | 6 + .../queries/vue/highlights.scm | 23 + .../queries/vue/indents.scm | 7 + .../queries/vue/injections.scm | 66 + .../queries/wgsl/folds.scm | 10 + .../queries/wgsl/highlights.scm | 106 + .../queries/wgsl/indents.scm | 19 + .../queries/wgsl_bevy/folds.scm | 5 + .../queries/wgsl_bevy/highlights.scm | 36 + .../queries/wgsl_bevy/indents.scm | 7 + .../queries/wing/folds.scm | 18 + .../queries/wing/highlights.scm | 86 + .../queries/wing/locals.scm | 5 + .../queries/yaml/folds.scm | 4 + .../queries/yaml/highlights.scm | 53 + .../queries/yaml/indents.scm | 6 + .../queries/yaml/injections.scm | 53 + .../queries/yaml/locals.scm | 8 + .../queries/yang/folds.scm | 3 + .../queries/yang/highlights.scm | 43 + .../queries/yang/indents.scm | 11 + .../queries/yang/injections.scm | 6 + .../queries/yuck/folds.scm | 9 + .../queries/yuck/highlights.scm | 150 ++ .../queries/yuck/indents.scm | 26 + .../queries/yuck/injections.scm | 1 + .../queries/yuck/locals.scm | 21 + .../queries/zig/folds.scm | 16 + .../queries/zig/highlights.scm | 232 ++ .../queries/zig/indents.scm | 24 + .../queries/zig/injections.scm | 5 + .../queries/zig/locals.scm | 0 .../scripts/check-queries.lua | 136 ++ .../scripts/ci-install-macos-latest.sh | 6 + .../scripts/ci-install-ubuntu-latest.sh | 6 + .../scripts/ci-install-windows-2022.sh | 5 + .../scripts/compile_parsers.makefile | 52 + .../scripts/minimal_init.lua | 25 + bundle/nvim-treesitter-0.9.1/scripts/pre-push | 10 + .../scripts/run_tests.sh | 16 + .../scripts/update-lockfile.sh | 20 + .../scripts/update-readme.lua | 59 + .../scripts/write-lockfile.lua | 15 + .../tests/indent/algorithm/trailing.py | 6 + .../indent/algorithm/trailing_whitespace.html | 11 + .../tests/indent/algorithm_spec.lua | 18 + .../tests/indent/c/aligned_indent.c | 7 + .../tests/indent/c/array.c | 14 + .../tests/indent/c/comment.c | 8 + .../tests/indent/c/compound_lit.c | 10 + .../tests/indent/c/cond.c | 10 + .../tests/indent/c/enum.c | 5 + .../tests/indent/c/expr.c | 12 + .../tests/indent/c/func.c | 33 + .../tests/indent/c/if_else.c | 59 + .../tests/indent/c/issue-1568.c | 6 + .../tests/indent/c/issue-2086.c | 3 + .../tests/indent/c/issue-4079.c | 7 + .../tests/indent/c/issue-4117.c | 6 + .../tests/indent/c/issue-4525.c | 23 + .../tests/indent/c/label.c | 7 + .../tests/indent/c/loop.c | 16 + .../tests/indent/c/no_braces.c | 13 + .../tests/indent/c/preproc_cond.c | 10 + .../tests/indent/c/preproc_func.c | 9 + .../tests/indent/c/string.c | 5 + .../tests/indent/c/struct.c | 11 + .../tests/indent/c/switch.c | 16 + .../tests/indent/c/ternary.c | 6 + .../tests/indent/c/unfinished_comment.c | 2 + .../tests/indent/c_spec.lua | 93 + .../tests/indent/capnp/test.capnp | 1057 ++++++++++ .../tests/indent/capnp_spec.lua | 30 + .../tests/indent/common.lua | 202 ++ .../tests/indent/cpp/access.cpp | 6 + .../tests/indent/cpp/class.cpp | 7 + .../tests/indent/cpp/initializer_list.cpp | 17 + .../tests/indent/cpp/stream.cpp | 7 + .../tests/indent/cpp_spec.lua | 51 + .../tests/indent/css/next_rule.css | 3 + .../tests/indent/css/open_block.css | 1 + .../tests/indent/css_spec.lua | 22 + .../tests/indent/dart/class.dart | 8 + .../indent/dart/class_function_argument.dart | 13 + .../tests/indent/dart/multiple_arguments.dart | 13 + .../tests/indent/dart/switch.dart | 30 + .../tests/indent/dart/try.dart | 13 + .../tests/indent/dart_spec.lua | 46 + .../tests/indent/ecma/array-issue3382.js | 2 + .../tests/indent/ecma/binary_expression.js | 4 + .../tests/indent/ecma/callback.js | 6 + .../tests/indent/ecma/class.js | 20 + .../tests/indent/ecma/func.js | 51 + .../tests/indent/ecma/if_else.js | 13 + .../tests/indent/ecma/issue-2515.js | 16 + .../tests/indent/ecma/new-line-after-class.js | 2 + .../tests/indent/ecma/object.js | 5 + .../tests/indent/ecma/switch.js | 8 + .../tests/indent/ecma/ternary.js | 6 + .../tests/indent/ecma/try_catch.js | 8 + .../tests/indent/ecma/variable.js | 6 + .../tests/indent/gdscript/basic_blocks.gd | 16 + .../tests/indent/gdscript_spec.lua | 20 + .../indent/gleam/anonymous_function.gleam | 7 + .../tests/indent/gleam/assert.gleam | 4 + .../indent/gleam/binary_expression.gleam | 4 + .../tests/indent/gleam/case.gleam | 10 + .../tests/indent/gleam/constant.gleam | 2 + .../tests/indent/gleam/function.gleam | 15 + .../tests/indent/gleam/import.gleam | 4 + .../tests/indent/gleam/let.gleam | 4 + .../tests/indent/gleam/list.gleam | 11 + .../tests/indent/gleam/pipe.gleam | 4 + .../tests/indent/gleam/todo.gleam | 5 + .../tests/indent/gleam/tuple.gleam | 11 + .../tests/indent/gleam/type.gleam | 18 + .../tests/indent/gleam_spec.lua | 127 ++ .../tests/indent/go/const_declaration.go | 7 + .../tests/indent/go/issue-2369-newline.go | 8 + .../tests/indent/go/issue-2369.go | 19 + .../tests/indent/go/issue-3288.go | 22 + .../tests/indent/go/multiple-vars.go | 19 + .../tests/indent/go/select.go | 16 + .../tests/indent/go/switch.go | 20 + .../tests/indent/go_spec.lua | 24 + .../tests/indent/graphql/issue-1981.graphql | 6 + .../tests/indent/graphql_spec.lua | 19 + .../tests/indent/html/issue-3986.html | 4 + .../tests/indent/html/script_style.html | 12 + .../tests/indent/html/self_closing_tag.html | 14 + .../tests/indent/html/start_tag.html | 8 + .../tests/indent/html_spec.lua | 28 + .../tests/indent/java/annotation.java | 3 + .../tests/indent/java/annotation_2.java | 8 + .../indent/java/class_with_annotation.java | 3 + ...ctor_with_arguments_on_multiple_lines.java | 6 + .../tests/indent/java/enum.java | 4 + .../indent/java/enum_with_annotation.java | 3 + .../tests/indent/java/interface.java | 2 + .../tests/indent/java/issue_2571.java | 6 + .../tests/indent/java/issue_2583.java | 6 + .../tests/indent/java/javadoc.java | 5 + .../tests/indent/java/method.java | 2 + .../tests/indent/java/method_chaining.java | 6 + ...thod_with_arguments_on_multiple_lines.java | 6 + .../tests/indent/java_spec.lua | 39 + .../tests/indent/javascript_spec.lua | 123 ++ .../tests/indent/jsx/element_attributes.jsx | 18 + .../tests/indent/jsx/issue-3986.jsx | 10 + .../tests/indent/jsx/jsx_expression.jsx | 16 + .../tests/indent/jsx_spec.lua | 43 + .../tests/indent/lua/comment.lua | 7 + .../tests/indent/lua/cond.lua | 14 + .../tests/indent/lua/func.lua | 9 + .../tests/indent/lua/loop.lua | 14 + .../tests/indent/lua/method_index_expr.lua | 3 + .../tests/indent/lua/nested-table.lua | 7 + .../lua/no-indent-after-paren-pairs.lua | 6 + .../tests/indent/lua/string.lua | 5 + .../tests/indent/lua/table.lua | 10 + .../tests/indent/lua_spec.lua | 47 + .../tests/indent/nickel/indent-newline.ncl | 14 + .../tests/indent/nickel_spec.lua | 25 + .../tests/indent/php/enum-indent.php | 4 + .../tests/indent/php/example.php | 12 + .../tests/indent/php/example2.php | 6 + .../tests/indent/php/issue-2497.php | 14 + .../tests/indent/php/issue-3591.php | 5 + .../tests/indent/php/unfinished-call.php | 6 + .../tests/indent/php_spec.lua | 28 + .../tests/indent/python/aligned_indent.py | 14 + .../tests/indent/python/aligned_indent_2.py | 12 + .../tests/indent/python/basic_blocks.py | 14 + .../tests/indent/python/basic_collections.py | 23 + .../tests/indent/python/branches.py | 31 + .../tests/indent/python/break_continue.py | 9 + .../tests/indent/python/comprehensions.py | 25 + .../tests/indent/python/control_flow.py | 28 + .../tests/indent/python/error_state_def.py | 6 + .../tests/indent/python/error_state_dict.py | 6 + .../indent/python/error_state_funcall.py | 5 + .../tests/indent/python/error_state_list.py | 5 + .../tests/indent/python/error_state_set.py | 5 + .../tests/indent/python/error_state_tuple.py | 7 + .../indent/python/error_state_tuple_align.py | 7 + .../tests/indent/python/hanging_indent.py | 6 + .../tests/indent/python/if_else.py | 3 + .../tests/indent/python/join_lines.py | 8 + .../tests/indent/python/line_after_indent.py | 65 + .../tests/indent/python/match_case.py | 15 + .../tests/indent/python/nested_collections.py | 41 + .../tests/indent/python/return_dedent.py | 39 + .../tests/indent/python/strings.py | 17 + .../tests/indent/python_spec.lua | 100 + .../tests/indent/ql/module.ql | 3 + .../tests/indent/ql_spec.lua | 24 + .../tests/indent/r/aligned_indent.R | 4 + .../tests/indent/r/comment.R | 2 + .../tests/indent/r/cond.R | 12 + .../tests/indent/r/func.R | 18 + .../tests/indent/r/loop.R | 17 + .../tests/indent/r/pipe.R | 10 + .../tests/indent/r_spec.lua | 42 + .../tests/indent/ruby/indent-assignment.rb | 2 + .../tests/indent/ruby/indent-brackets.rb | 5 + .../tests/indent/ruby/indent-ensure.rb | 2 + .../tests/indent/ruby/indent-parens.rb | 5 + .../ruby/indent-parenthesized-statements.rb | 2 + .../tests/indent/ruby/indent-rescue.rb | 2 + .../indent/ruby/indent-square-brackets.rb | 5 + .../tests/indent/ruby/indent-unless.rb | 2 + .../tests/indent/ruby/period-issue-3364.rb | 7 + .../tests/indent/ruby_spec.lua | 22 + .../tests/indent/rust/array.rs | 11 + .../tests/indent/rust/comment.rs | 13 + .../tests/indent/rust/cond.rs | 17 + .../tests/indent/rust/enum.rs | 11 + .../tests/indent/rust/func.rs | 10 + .../tests/indent/rust/if_let_cond.rs | 7 + .../tests/indent/rust/impl.rs | 7 + .../tests/indent/rust/loop.rs | 19 + .../tests/indent/rust/macro.rs | 13 + .../tests/indent/rust/match.rs | 11 + .../tests/indent/rust/mod.rs | 8 + .../tests/indent/rust/string.rs | 12 + .../tests/indent/rust/struct.rs | 4 + .../tests/indent/rust/trait.rs | 11 + .../tests/indent/rust/where.rs | 21 + .../tests/indent/rust_spec.lua | 66 + .../tests/indent/smali/array_and_switch.smali | 58 + .../tests/indent/smali/field.smali | 12 + .../tests/indent/smali/method.smali | 8 + .../tests/indent/smali/parameter.smali | 55 + .../tests/indent/smali_spec.lua | 25 + .../tests/indent/sql/case.sql | 8 + .../tests/indent/sql/compound.sql | 3 + .../tests/indent/sql/create.sql | 4 + .../tests/indent/sql/cte.sql | 7 + .../tests/indent/sql/insert.sql | 5 + .../tests/indent/sql/select.sql | 4 + .../tests/indent/sql/subquery.sql | 9 + .../tests/indent/sql_spec.lua | 19 + .../tests/indent/swift/declarations.swift | 51 + .../tests/indent/swift/expressions.swift | 17 + .../tests/indent/swift/statements.swift | 34 + .../tests/indent/swift_spec.lua | 21 + .../tests/indent/t32/if_block.cmm | 49 + .../tests/indent/t32/repeat_block.cmm | 27 + .../tests/indent/t32/subroutine_block.cmm | 23 + .../tests/indent/t32/while_block.cmm | 14 + .../tests/indent/t32_spec.lua | 123 ++ .../tests/indent/terraform/function_call.tf | 6 + .../terraform/indent-in-multiline-objects.tf | 6 + .../terraform/indent-in-multiline-tuples.tf | 6 + .../indent/terraform/multiline-comments.tf | 7 + .../indent/terraform/multiple-attributes.tf | 4 + .../tests/indent/terraform/multiple-blocks.tf | 6 + .../tests/indent/terraform/nested_blocks.tf | 5 + .../indent/terraform/no-indent-after-brace.tf | 4 + .../tests/indent/terraform_spec.lua | 35 + .../tests/indent/tiger/classes.tig | 14 + .../tests/indent/tiger/control-flow.tig | 22 + .../tests/indent/tiger/functions.tig | 14 + .../tests/indent/tiger/groupings.tig | 10 + .../indent/tiger/values-and-expressions.tig | 30 + .../tests/indent/tiger_spec.lua | 113 + .../tests/indent/usd/prim.usd | 6 + .../tests/indent/usd_spec.lua | 21 + .../tests/indent/vue/template_indent.vue | 3 + .../tests/indent/vue_spec.lua | 24 + .../tests/indent/wgsl/basic.wgsl | 43 + .../tests/indent/wgsl_spec.lua | 19 + .../indent/yaml/autoindent-mapping-pair.yaml | 2 + .../indent/yaml/indent-sequence-items.yaml | 2 + .../tests/indent/yaml_spec.lua | 20 + .../tests/indent/yang/module.yang | 58 + .../tests/indent/yang_spec.lua | 23 + .../tests/indent/zig/pr-3269.zig | 10 + .../tests/indent/zig_spec.lua | 22 + .../query/highlights/bash/double-parens.sh | 6 + .../query/highlights/c/enums-as-constants.c | 21 + .../tests/query/highlights/capnp/test.capnp | 633 ++++++ .../tests/query/highlights/cpp/concepts.cpp | 22 + .../highlights/cpp/enums-as-constants.cpp | 25 + .../cpp/static-namespace-functions.cpp | 14 + .../tests/query/highlights/cpp/test.cpp | 19 + .../tests/query/highlights/ecma/const.js | 13 + .../tests/query/highlights/ecma/test.ts | 32 + .../tests/query/highlights/fusion/afx.fusion | 17 + .../query/highlights/fusion/basic.fusion | 60 + .../highlights/fusion/expressions.fusion | 82 + .../gitattributes/test.gitattributes | 37 + .../tests/query/highlights/gleam/assert.gleam | 13 + .../query/highlights/gleam/function.gleam | 127 ++ .../tests/query/highlights/gleam/import.gleam | 22 + .../tests/query/highlights/gleam/pipe.gleam | 18 + .../tests/query/highlights/gleam/todo.gleam | 7 + .../tests/query/highlights/gleam/type.gleam | 84 + .../query/highlights/hack/as-foreach.hack | 6 + .../highlights/hack/async-functions.hack | 8 + .../query/highlights/hack/attribute-type.hack | 15 + .../tests/query/highlights/hack/generics.hack | 24 + .../query/highlights/hack/heredoc-dollar.hack | 4 + .../tests/query/highlights/hack/shapes.hack | 12 + .../tests/query/highlights/hack/use.hack | 28 + .../tests/query/highlights/hack/using.hack | 3 + .../tests/query/highlights/hack/xhp.hack | 10 + .../tests/query/highlights/hocon/test.conf | 59 + .../tests/query/highlights/julia/test.jl | 26 + .../tests/query/highlights/lua/test.lua | 13 + .../tests/query/highlights/markdown/test.md | 28 + .../tests/query/highlights/pascal/test.pas | 39 + .../tests/query/highlights/prisma/test.prisma | 63 + .../tests/query/highlights/python/fields.py | 12 + .../query/highlights/python/future_import.py | 4 + .../highlights/python/pattern_matching.py | 51 + .../query/highlights/python/raise_from.py | 6 + .../query/highlights/python/yield_from.py | 7 + .../tests/query/highlights/r/test.r | 47 + .../tests/query/highlights/rust/for.rs | 15 + .../highlights/rust/super-crate-imports.rs | 12 + .../smali/baksmali_test_class.smali | 261 +++ .../tests/query/highlights/solidity/test.sol | 186 ++ .../tests/query/highlights/t32/comments.cmm | 10 + .../tests/query/highlights/t32/keywords.cmm | 123 ++ .../tests/query/highlights/t32/literals.cmm | 39 + .../tests/query/highlights/t32/var.cmm | 75 + .../query/highlights/tiger/built-ins.tig | 44 + .../tests/query/highlights/tiger/comment.tig | 6 + .../query/highlights/tiger/functions.tig | 9 + .../query/highlights/tiger/identifiers.tig | 30 + .../tests/query/highlights/tiger/imports.tig | 4 + .../tests/query/highlights/tiger/keywords.tig | 42 + .../tests/query/highlights/tiger/literals.tig | 9 + .../query/highlights/tiger/meta-variables.tig | 14 + .../highlights/tiger/object-oriented.tig | 29 + .../query/highlights/tiger/operators.tig | 49 + .../tests/query/highlights/typescript/as.ts | 8 + .../tests/query/highlights/usd/prims.usda | 118 ++ .../query/highlights/usd/properties.usda | 21 + .../tests/query/highlights/usd/subLayers.usda | 9 + .../tests/query/highlights/wing/class.w | 19 + .../query/highlights/wing/nested_method.w | 4 + .../tests/query/highlights/xhp-intro.hack | 46 + .../tests/query/highlights_spec.lua | 122 ++ .../tests/query/injection_spec.lua | 86 + .../injections/cuda/macro-self-injection.cu | 2 + .../injections/ecma/ecma-test-injections.js | 9 + .../injections/html/test-html-injections.html | 55 + .../svelte/test-svelte-injections.svelte | 24 + .../injections/vue/negative-assertions.vue | 4 + .../injections/vue/test-vue-injections.vue | 38 + .../yaml/bash-on-github-actions.yml | 32 + .../yaml/promql-on-prometheus-rules.yaml | 12 + .../tests/unit/ts_utils_spec.lua | 114 + 1069 files changed, 53624 insertions(+), 1 deletion(-) create mode 100644 bundle/nvim-treesitter-0.9.1/.editorconfig create mode 100644 bundle/nvim-treesitter-0.9.1/.github/CODEOWNERS create mode 100644 bundle/nvim-treesitter-0.9.1/.github/FUNDING.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/highlighting_issue.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/mergify.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/lint.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/release.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/test-queries.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/tests.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/update-lockfile.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.github/workflows/update-readme.yml create mode 100644 bundle/nvim-treesitter-0.9.1/.gitignore create mode 100644 bundle/nvim-treesitter-0.9.1/.luacheckrc create mode 100644 bundle/nvim-treesitter-0.9.1/.luarc.json create mode 100644 bundle/nvim-treesitter-0.9.1/.stylua.toml create mode 100644 bundle/nvim-treesitter-0.9.1/.styluaignore create mode 100644 bundle/nvim-treesitter-0.9.1/CONTRIBUTING.md create mode 100644 bundle/nvim-treesitter-0.9.1/LICENSE create mode 100644 bundle/nvim-treesitter-0.9.1/Makefile create mode 100644 bundle/nvim-treesitter-0.9.1/README.md create mode 100644 bundle/nvim-treesitter-0.9.1/assets/logo.png create mode 100644 bundle/nvim-treesitter-0.9.1/autoload/nvim_treesitter.vim create mode 100644 bundle/nvim-treesitter-0.9.1/doc/nvim-treesitter.txt create mode 100644 bundle/nvim-treesitter-0.9.1/lockfile.json create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/caching.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/compat.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/configs.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/fold.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/health.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/highlight.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/incremental_selection.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/indent.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/info.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/install.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/locals.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/parsers.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query_predicates.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/shell_command_selectors.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/statusline.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/ts_utils.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/tsrange.lua create mode 100644 bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/utils.lua create mode 100644 bundle/nvim-treesitter-0.9.1/nvim-treesitter-scm-1.rockspec create mode 100644 bundle/nvim-treesitter-0.9.1/parser-info/.gitignore create mode 100644 bundle/nvim-treesitter-0.9.1/parser/.gitignore create mode 100644 bundle/nvim-treesitter-0.9.1/plugin/nvim-treesitter.lua create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ada/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ada/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ada/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/agda/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/agda/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/arduino/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/arduino/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/arduino/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/arduino/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/arduino/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/astro/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/astro/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/astro/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/astro/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/astro/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/awk/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/awk/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bash/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bash/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bash/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bash/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bass/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bass/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bass/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bass/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bass/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/beancount/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/beancount/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bibtex/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bibtex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bibtex/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bicep/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bicep/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bicep/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bicep/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/bicep/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/blueprint/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c_sharp/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c_sharp/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c_sharp/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/c_sharp/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cairo/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cairo/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cairo/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cairo/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cairo/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/capnp/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/capnp/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/capnp/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/capnp/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/capnp/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/chatito/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/chatito/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/chatito/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/chatito/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/chatito/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/clojure/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/clojure/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/clojure/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/clojure/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cmake/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cmake/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cmake/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/comment/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/commonlisp/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/commonlisp/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/commonlisp/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cooklang/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/corn/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/corn/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/corn/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/corn/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpon/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpon/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpon/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpon/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpon/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpp/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpp/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpp/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpp/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cpp/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/css/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/css/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/css/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/css/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cuda/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cuda/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cuda/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cuda/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cuda/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cue/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cue/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cue/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cue/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/cue/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/d/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/d/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/d/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/d/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dart/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dart/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dart/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dart/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dart/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/devicetree/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/devicetree/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/devicetree/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/devicetree/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/devicetree/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dhall/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dhall/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dhall/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/diff/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dockerfile/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dockerfile/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dot/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/dot/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ebnf/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ecma/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ecma/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ecma/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ecma/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ecma/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/eex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/eex/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elixir/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elixir/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elixir/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elixir/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elixir/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elm/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elm/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elsa/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elsa/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elsa/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elsa/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elsa/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elvish/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/elvish/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/embedded_template/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/embedded_template/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/erlang/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/erlang/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fennel/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fennel/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fennel/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fennel/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/firrtl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/firrtl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/firrtl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/firrtl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/firrtl/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fish/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fish/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fish/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fish/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fish/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/foam/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/foam/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/foam/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/foam/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/foam/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fortran/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fortran/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fortran/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fsh/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/func/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fusion/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fusion/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fusion/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/fusion/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gdscript/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gdscript/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gdscript/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gdscript/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gdscript/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/git_config/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/git_config/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/git_rebase/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/git_rebase/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gitattributes/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gitattributes/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gitcommit/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gitcommit/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gitignore/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gleam/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gleam/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gleam/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gleam/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gleam/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glimmer/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glimmer/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glimmer/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glimmer/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glsl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glsl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glsl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glsl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/glsl/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/go/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/go/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/go/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/go/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/go/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/godot_resource/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/godot_resource/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/godot_resource/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gomod/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gomod/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gosum/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gowork/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/gowork/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/graphql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/graphql/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/graphql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/groovy/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/groovy/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hack/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hare/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hare/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hare/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hare/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hare/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/haskell/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/haskell/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/haskell/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hcl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hcl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hcl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hcl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/heex/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/heex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/heex/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/heex/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/heex/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hjson/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hjson/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hjson/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hjson/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hjson/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hlsl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hlsl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hlsl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hlsl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hlsl/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hocon/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hocon/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hoon/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hoon/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hoon/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html_tags/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html_tags/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/html_tags/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/htmldjango/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/htmldjango/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/htmldjango/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/htmldjango/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/http/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/http/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hurl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hurl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hurl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/hurl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ini/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ini/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ispc/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ispc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ispc/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ispc/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ispc/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/janet_simple/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/janet_simple/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/janet_simple/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/janet_simple/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/java/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/java/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/java/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/java/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/java/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/javascript/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/javascript/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/javascript/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/javascript/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/javascript/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jq/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jq/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsdoc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json5/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/json5/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonc/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonc/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonc/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonc/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsonnet/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsx/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsx/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsx/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/jsx/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/julia/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/julia/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/julia/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/julia/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/julia/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kdl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kdl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kdl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kdl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kdl/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kotlin/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kotlin/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kotlin/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/kotlin/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lalrpop/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lalrpop/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lalrpop/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/latex/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/latex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/latex/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ledger/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ledger/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ledger/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ledger/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/llvm/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lua/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lua/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lua/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lua/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/lua/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luadoc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luap/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luau/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luau/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luau/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luau/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/luau/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/m68k/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/m68k/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/m68k/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/m68k/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/make/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/make/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/make/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown_inline/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/markdown_inline/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/matlab/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/matlab/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/matlab/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/matlab/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/matlab/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/menhir/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/menhir/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/mermaid/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/meson/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/meson/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/meson/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/mlir/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/mlir/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nickel/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nickel/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ninja/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ninja/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ninja/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nix/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nix/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nix/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/nix/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/objc/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/objc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/objc/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/objc/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/objc/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml_interface/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml_interface/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml_interface/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml_interface/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocaml_interface/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocamllex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ocamllex/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/odin/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/odin/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/odin/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/odin/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/odin/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pascal/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pascal/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pascal/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pascal/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pascal/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/passwd/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pem/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pem/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pem/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/perl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/perl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/perl/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/php/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/php/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/php/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/php/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/php/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/phpdoc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pioasm/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pioasm/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/po/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/po/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/po/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/poe_filter/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/poe_filter/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/poe_filter/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/poe_filter/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pony/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pony/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pony/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pony/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pony/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/prisma/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/promql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/promql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/proto/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/proto/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/prql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/prql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pug/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/pug/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/puppet/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/puppet/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/puppet/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/puppet/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/puppet/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/python/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/python/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/python/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/python/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/python/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ql/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ql/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ql/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/qmldir/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/qmldir/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/qmljs/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/qmljs/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/query/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/query/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/query/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/query/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/query/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/r/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/r/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/r/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/r/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/racket/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/racket/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/racket/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rasi/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rasi/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rasi/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rasi/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/regex/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rego/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rego/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/requirements/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/requirements/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rnoweb/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rnoweb/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rnoweb/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/robot/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ron/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ron/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ron/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ron/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ron/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rst/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rst/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rst/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ruby/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ruby/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ruby/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ruby/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ruby/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rust/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rust/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rust/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rust/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/rust/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scala/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scala/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scala/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scala/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scfg/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scfg/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scheme/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scheme/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scheme/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scss/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scss/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/scss/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/slint/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/slint/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smali/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smali/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smali/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smali/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smali/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/smithy/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/solidity/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sparql/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sparql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sparql/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sparql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sparql/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sql/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sql/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sql/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/squirrel/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/squirrel/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/squirrel/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/squirrel/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/squirrel/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/starlark/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/starlark/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/starlark/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/starlark/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/starlark/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/supercollider/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/supercollider/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/supercollider/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/supercollider/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/supercollider/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/surface/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/surface/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/surface/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/surface/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/svelte/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/svelte/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/svelte/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/svelte/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/swift/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/swift/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/swift/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sxhkdrc/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sxhkdrc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/sxhkdrc/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/systemtap/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/systemtap/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/systemtap/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/systemtap/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/t32/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/t32/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/t32/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/t32/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/t32/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tablegen/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tablegen/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tablegen/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tablegen/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tablegen/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/teal/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/teal/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/teal/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/teal/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/teal/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/terraform/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/terraform/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/terraform/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/terraform/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/thrift/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/thrift/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/thrift/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/thrift/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/thrift/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tiger/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tiger/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tiger/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tiger/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tiger/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tlaplus/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tlaplus/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tlaplus/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tlaplus/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/todotxt/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/toml/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/toml/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/toml/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/toml/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/toml/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tsx/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tsx/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tsx/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tsx/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/tsx/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/turtle/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/turtle/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/turtle/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/turtle/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/turtle/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/twig/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/twig/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/typescript/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/typescript/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/typescript/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/typescript/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/typescript/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ungrammar/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ungrammar/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ungrammar/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ungrammar/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/ungrammar/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/usd/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/usd/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/usd/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/usd/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/uxntal/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/uxntal/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/uxntal/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/uxntal/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/uxntal/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/v/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/v/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/v/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/v/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/v/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vala/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vala/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/verilog/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/verilog/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/verilog/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/verilog/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vhs/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vim/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vim/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vim/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vim/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vimdoc/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vimdoc/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vue/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vue/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vue/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/vue/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl_bevy/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl_bevy/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wgsl_bevy/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wing/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wing/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/wing/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yaml/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yaml/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yaml/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yaml/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yaml/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yang/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yang/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yang/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yang/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yuck/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yuck/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yuck/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yuck/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/yuck/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/zig/folds.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/zig/highlights.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/zig/indents.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/zig/injections.scm create mode 100644 bundle/nvim-treesitter-0.9.1/queries/zig/locals.scm create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/check-queries.lua create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/ci-install-macos-latest.sh create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/ci-install-ubuntu-latest.sh create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/ci-install-windows-2022.sh create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/compile_parsers.makefile create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/minimal_init.lua create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/pre-push create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/run_tests.sh create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/update-lockfile.sh create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/update-readme.lua create mode 100644 bundle/nvim-treesitter-0.9.1/scripts/write-lockfile.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/algorithm/trailing.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/algorithm/trailing_whitespace.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/algorithm_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/aligned_indent.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/array.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/comment.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/compound_lit.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/cond.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/enum.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/expr.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/func.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/if_else.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/issue-1568.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/issue-2086.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/issue-4079.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/issue-4117.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/issue-4525.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/label.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/loop.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/no_braces.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/preproc_cond.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/preproc_func.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/string.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/struct.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/switch.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/ternary.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c/unfinished_comment.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/c_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/capnp/test.capnp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/capnp_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/common.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/cpp/access.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/cpp/class.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/cpp/initializer_list.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/cpp/stream.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/cpp_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/css/next_rule.css create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/css/open_block.css create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/css_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart/class.dart create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart/class_function_argument.dart create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart/multiple_arguments.dart create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart/switch.dart create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart/try.dart create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/dart_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/array-issue3382.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/binary_expression.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/callback.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/class.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/func.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/if_else.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/issue-2515.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/new-line-after-class.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/object.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/switch.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/ternary.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/try_catch.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ecma/variable.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gdscript/basic_blocks.gd create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gdscript_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/anonymous_function.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/assert.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/binary_expression.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/case.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/constant.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/function.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/import.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/let.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/list.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/pipe.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/todo.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/tuple.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam/type.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/gleam_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/const_declaration.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/issue-2369-newline.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/issue-2369.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/issue-3288.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/multiple-vars.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/select.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go/switch.go create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/go_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/graphql/issue-1981.graphql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/graphql_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/html/issue-3986.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/html/script_style.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/html/self_closing_tag.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/html/start_tag.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/html_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/annotation.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/annotation_2.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/class_with_annotation.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/constructor_with_arguments_on_multiple_lines.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/enum.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/enum_with_annotation.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/interface.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/issue_2571.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/issue_2583.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/javadoc.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/method.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/method_chaining.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java/method_with_arguments_on_multiple_lines.java create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/java_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/javascript_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/jsx/element_attributes.jsx create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/jsx/issue-3986.jsx create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/jsx/jsx_expression.jsx create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/jsx_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/comment.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/cond.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/func.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/loop.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/method_index_expr.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/nested-table.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/no-indent-after-paren-pairs.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/string.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua/table.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/lua_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/nickel/indent-newline.ncl create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/nickel_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/enum-indent.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/example.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/example2.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/issue-2497.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/issue-3591.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php/unfinished-call.php create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/php_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/aligned_indent.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/aligned_indent_2.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/basic_blocks.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/basic_collections.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/branches.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/break_continue.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/comprehensions.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/control_flow.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_def.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_dict.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_funcall.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_list.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_set.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_tuple.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/error_state_tuple_align.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/hanging_indent.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/if_else.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/join_lines.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/line_after_indent.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/match_case.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/nested_collections.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/return_dedent.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python/strings.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/python_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ql/module.ql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ql_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/aligned_indent.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/comment.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/cond.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/func.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/loop.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r/pipe.R create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/r_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-assignment.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-brackets.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-ensure.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-parens.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-parenthesized-statements.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-rescue.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-square-brackets.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/indent-unless.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby/period-issue-3364.rb create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/ruby_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/array.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/comment.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/cond.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/enum.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/func.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/if_let_cond.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/impl.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/loop.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/macro.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/match.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/mod.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/string.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/struct.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/trait.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust/where.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/rust_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/smali/array_and_switch.smali create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/smali/field.smali create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/smali/method.smali create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/smali/parameter.smali create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/smali_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/case.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/compound.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/create.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/cte.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/insert.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/select.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql/subquery.sql create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/sql_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/swift/declarations.swift create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/swift/expressions.swift create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/swift/statements.swift create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/swift_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/t32/if_block.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/t32/repeat_block.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/t32/subroutine_block.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/t32/while_block.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/t32_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/function_call.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/indent-in-multiline-objects.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/indent-in-multiline-tuples.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/multiline-comments.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/multiple-attributes.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/multiple-blocks.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/nested_blocks.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform/no-indent-after-brace.tf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/terraform_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger/classes.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger/control-flow.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger/functions.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger/groupings.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger/values-and-expressions.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/tiger_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/usd/prim.usd create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/usd_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/vue/template_indent.vue create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/vue_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/wgsl/basic.wgsl create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/wgsl_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/yaml/autoindent-mapping-pair.yaml create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/yaml/indent-sequence-items.yaml create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/yaml_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/yang/module.yang create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/yang_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/zig/pr-3269.zig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/indent/zig_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/bash/double-parens.sh create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/c/enums-as-constants.c create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/capnp/test.capnp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/cpp/concepts.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/cpp/enums-as-constants.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/cpp/static-namespace-functions.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/cpp/test.cpp create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/ecma/const.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/ecma/test.ts create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/fusion/afx.fusion create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/fusion/basic.fusion create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/fusion/expressions.fusion create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gitattributes/test.gitattributes create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/assert.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/function.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/import.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/pipe.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/todo.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/gleam/type.gleam create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/as-foreach.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/async-functions.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/attribute-type.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/generics.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/heredoc-dollar.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/shapes.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/use.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/using.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hack/xhp.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/hocon/test.conf create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/julia/test.jl create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/lua/test.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/markdown/test.md create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/pascal/test.pas create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/prisma/test.prisma create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/python/fields.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/python/future_import.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/python/pattern_matching.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/python/raise_from.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/python/yield_from.py create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/r/test.r create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/rust/for.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/rust/super-crate-imports.rs create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/smali/baksmali_test_class.smali create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/solidity/test.sol create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/t32/comments.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/t32/keywords.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/t32/literals.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/t32/var.cmm create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/built-ins.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/comment.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/functions.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/identifiers.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/imports.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/keywords.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/literals.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/meta-variables.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/object-oriented.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/tiger/operators.tig create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/typescript/as.ts create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/usd/prims.usda create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/usd/properties.usda create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/usd/subLayers.usda create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/wing/class.w create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/wing/nested_method.w create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights/xhp-intro.hack create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/highlights_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injection_spec.lua create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/cuda/macro-self-injection.cu create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/ecma/ecma-test-injections.js create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/html/test-html-injections.html create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/svelte/test-svelte-injections.svelte create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/negative-assertions.vue create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/test-vue-injections.vue create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/bash-on-github-actions.yml create mode 100644 bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/promql-on-prometheus-rules.yaml create mode 100644 bundle/nvim-treesitter-0.9.1/tests/unit/ts_utils_spec.lua diff --git a/autoload/SpaceVim/layers/treesitter.vim b/autoload/SpaceVim/layers/treesitter.vim index caeff68c1..694940ddd 100644 --- a/autoload/SpaceVim/layers/treesitter.vim +++ b/autoload/SpaceVim/layers/treesitter.vim @@ -13,7 +13,12 @@ function! SpaceVim#layers#treesitter#plugins() abort let plugins = [] - call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-treesitter', + if has('nvim-0.8.0') + let l:version = '-0.9.1' + else + let l:version = '' + endif + call add(plugins, [g:_spacevim_root_dir . 'bundle/nvim-treesitter' . l:version, \ { \ 'merged' : 0, \ 'loadconf' : 1 , diff --git a/bundle/nvim-treesitter-0.9.1/.editorconfig b/bundle/nvim-treesitter-0.9.1/.editorconfig new file mode 100644 index 000000000..00ea231bb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 8 +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.lua] +tab_width = 2 + +[*.py] +indent_size = 4 +tab_width = 4 + +[{Makefile,**/Makefile,runtime/doc/*.txt}] +indent_style = tab +indent_size = 8 diff --git a/bundle/nvim-treesitter-0.9.1/.github/CODEOWNERS b/bundle/nvim-treesitter-0.9.1/.github/CODEOWNERS new file mode 100644 index 000000000..8fcb7cd9e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/CODEOWNERS @@ -0,0 +1,7 @@ +/lua/nvim-treesitter/textobjects/ @theHamsta +/lua/nvim-treesitter/incremental_selection.lua @theHamsta + +/lua/nvim-treesitter/fold.lua @vigoux +/lua/nvim-treesitter/highlight.lua @vigoux + +/lua/nvim-treesitter/refactor/ @steelsojka diff --git a/bundle/nvim-treesitter-0.9.1/.github/FUNDING.yml b/bundle/nvim-treesitter-0.9.1/.github/FUNDING.yml new file mode 100644 index 000000000..b2844b214 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/FUNDING.yml @@ -0,0 +1,2 @@ +open_collective: "nvim-treesitter" +github: "nvim-treesitter" diff --git a/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/bug_report.yml b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..f68dd2486 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,58 @@ +name: Bug report +description: Create a report to help us improve +labels: [bug] + +body: + - type: markdown + attributes: + value: | + # Before reporting + Please do the following steps before reporting an issue. + + - I have updated my neovim version to latest _master_ + - I have updated my plugin to the latest version + - I have run `:TSUpdate` + - I have read the [troubleshooting section](https://github.com/nvim-treesitter/nvim-treesitter#troubleshooting) + + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior. + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + + - type: textarea + attributes: + label: Output of `:checkhealth nvim-treesitter` + render: markdown + validations: + required: true + + - type: textarea + attributes: + label: Output of `nvim --version` + render: text + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Add any context about the problem here. diff --git a/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/feature_request.md b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..d883b8f2d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "" +labels: enhancement +assignees: "" +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/highlighting_issue.yml b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/highlighting_issue.yml new file mode 100644 index 000000000..2713df8a1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/ISSUE_TEMPLATE/highlighting_issue.yml @@ -0,0 +1,98 @@ +name: Highlighting issue +description: Missing or incorrect highlights or you want to change the way something is highlighted +labels: [highlights] + +body: + - type: markdown + attributes: + value: | + # Before reporting + Please perform the following steps before reporting an issue. + - I have updated my neovim version to latest _master_. + - I have updated my plugin to the latest version. + - I have run `:TSUpdate`. + - I have inspected the syntax tree using https://github.com/nvim-treesitter/playground and made sure + that no `ERROR` nodes are in the syntax tree. nvim-treesitter can not guarantee correct highlighting in the + presence of `ERROR`s -- in this case, please report the bug directly at corresponding parser's repository. (You can find all repository URLs in [README.md](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages).) + - I have used `:TSHighlightCapturesUnderCursor` from https://github.com/nvim-treesitter/playground to inspect which highlight groups Neovim is using and that legacy syntax highlighting is not interfering (i.e., what you are observing is actual tree-sitter highlighting). + + - type: textarea + attributes: + label: Describe the highlighting problem + description: A clear and concise description of what should be highlighted in a different way. + validations: + required: true + + - type: textarea + attributes: + label: Example snippet that causes the problem + description: Please provide an example snippet in plain text that causes the problem. + validations: + required: true + + - type: textarea + attributes: + label: Tree-sitter parsing result + description: | + Please provide the output of `:TSPlaygroundToggle` from https://github.com/nvim-treesitter/playground + (screenshot or plain text) with the following options enabled (pressing the key): + - `I` (name of the parsed language) + - `t` (toggle injected languages) + - `a` (show anonymous nodes) + placeholder: | + This should look somehow like this: + ``` + preproc_ifdef [0, 0] - [4, 6] cpp + "#ifdef" [0, 0] - [0, 6] cpp + name: identifier [0, 7] - [0, 17] cpp + preproc_def [1, 0] - [2, 0] cpp + "#define" [1, 0] - [1, 7] cpp + name: identifier [1, 8] - [1, 16] cpp + value: preproc_arg [1, 16] - [1, 27] cpp + "\n" [1, 27] - [2, 0] cpp + alternative: preproc_else [2, 0] - [4, 0] cpp + "#else" [2, 0] - [2, 5] cpp + preproc_def [3, 0] - [4, 0] cpp + "#define" [3, 0] - [3, 7] cpp + name: identifier [3, 8] - [3, 16] cpp + value: preproc_arg [3, 16] - [3, 29] cpp + ``` + validations: + required: true + + - type: textarea + attributes: + label: Example screenshot + description: | + Please provide a screenshot of the current highlighting. Please also tell us the `:h colorscheme` you are using + and how to install it. If applicable, you can also upload a screenshot with the contents of + `:TSHighlightCapturesUnderCursor`. + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: | + A clear and concise description of what you expect to be changed. You can provide screenshot of + other editors or traditional Vim highlighting that don't show this problem or show a screenshot how + nvim-treesitter highlighting would look like when a problematic query would be removed/altered. + + - type: textarea + attributes: + label: Output of `:checkhealth nvim-treesitter` + render: markdown + validations: + required: true + + - type: textarea + attributes: + label: Output of `nvim --version` + render: text + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Add any context about the problem here. diff --git a/bundle/nvim-treesitter-0.9.1/.github/mergify.yml b/bundle/nvim-treesitter-0.9.1/.github/mergify.yml new file mode 100644 index 000000000..b95a074a5 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/mergify.yml @@ -0,0 +1,37 @@ +pull_request_rules: + - name: Merge lockfile updates + conditions: + - "title=Update lockfile.json" + actions: + review: + type: APPROVE + message: Automatically approving lockfile updates + merge: + method: merge + + - name: Prepare for merge + conditions: + - and: + - "-draft" + - "#approved-reviews-by=1" + - "#review-requested=0" + actions: + comment: + message: | + This PR is ready to be merged, and will be in 1 day if nothing happens before. + If you want other people to review your PR, request their reviews. + If you don't want this PR to be merged now, mark it as a Draft. + + - name: Merge on approval + conditions: + - and: + - or: + - "#approved-reviews-by>=2" + - and: + - "#approved-reviews-by=1" + - "updated-at>=1 day ago" + - "-draft" + - "#review-requested=0" + actions: + merge: + method: rebase diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/lint.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/lint.yml new file mode 100644 index 000000000..121526c60 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Linting and style checking + +on: + push: + pull_request: + +jobs: + luacheck: + name: Luacheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Prepare + run: | + sudo apt-get update + sudo apt-get install luarocks -y + sudo luarocks install luacheck + + - name: Run Luacheck + run: luacheck . + + stylua: + name: StyLua + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Lint with stylua + uses: JohnnyMorganz/stylua-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/release.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/release.yml new file mode 100644 index 000000000..03b4d4e35 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: "release" +on: + push: + tags: + - '*' +jobs: + luarocks-upload: + runs-on: ubuntu-latest + steps: + - uses: nvim-neorocks/luarocks-tag-release@v2.2.0 + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} + with: + 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. + build_type: "make" diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/test-queries.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/test-queries.yml new file mode 100644 index 000000000..5c67d503a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/test-queries.yml @@ -0,0 +1,87 @@ +name: Test queries + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + +# 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 + +jobs: + check_compilation: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-2022, macos-latest] + cc: [gcc, clang] + nvim_tag: [stable] + exclude: + - os: ubuntu-latest + cc: clang + nvim_tag: stable + + - os: macos-latest + cc: gcc + nvim_tag: stable + + - os: windows-2022 + cc: clang + nvim_tag: stable + + include: + - os: windows-2022 + cc: cl + nvim_tag: stable + + - os: ubuntu-latest + cc: gcc + nvim_tag: nightly + + name: Parser compilation + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + NVIM: ${{ matrix.os == 'windows-2022' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }} + ALLOWED_INSTALLATION_FAILURES: ${{ matrix.os == 'windows-2022' && 'rnoweb' }} + steps: + - uses: actions/checkout@v3 + - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/setup-node@v3 + + - name: Install tree-sitter CLI + run: npm i -g tree-sitter-cli + + - name: Install and prepare Neovim + env: + NVIM_TAG: ${{ matrix.nvim_tag }} + run: | + bash ./scripts/ci-install-${{ matrix.os }}.sh + + - name: Setup Parsers Cache + id: parsers-cache + uses: actions/cache@v3 + with: + path: | + ./parser/ + ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/ + key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.nvim_tag }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './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: matrix.os == 'windows-2022' + run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser + + - name: Check query files + run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q" diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/tests.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/tests.yml new file mode 100644 index 000000000..2393a78dc --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/tests.yml @@ -0,0 +1,65 @@ +name: Tests + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + +# 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 + +jobs: + check_compilation: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + cc: [gcc] + + name: Run tests + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + + - name: Install tree-sitter CLI + run: npm i -g tree-sitter-cli + + - name: Test Dependencies + run: | + mkdir -p ~/.local/share/nvim/site/pack/plenary.nvim/start + cd ~/.local/share/nvim/site/pack/plenary.nvim/start + git clone https://github.com/nvim-lua/plenary.nvim + curl -L https://github.com/theHamsta/highlight-assertions/releases/download/v0.1.6/highlight-assertions_v0.1.6_x86_64-unknown-linux-gnu.tar.gz | tar -xz + cp highlight-assertions /usr/local/bin + + - name: Install and prepare Neovim + env: + NVIM_TAG: stable + TREE_SITTER_CLI_TAG: v0.20.8 + run: | + bash ./scripts/ci-install-${{ matrix.os }}.sh + + - name: Setup Parsers Cache + id: parsers-cache + uses: actions/cache@v3 + with: + path: | + ./parser/ + ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/ + key: ${{ matrix.os }}-${{ matrix.cc }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_selectors.lua') }} + + - name: Compile parsers Unix like + if: ${{ matrix.os != 'windows-latest' && steps.parsers-cache.outputs.cache-hit != 'true' }} + run: | + nvim --headless -c "TSInstallSync all" -c "q" + + - name: Tests + run: PATH=/usr/local/bin:$PATH ./scripts/run_tests.sh diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/update-lockfile.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/update-lockfile.yml new file mode 100644 index 000000000..a1b910e3b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/update-lockfile.yml @@ -0,0 +1,56 @@ +name: Update lockfile + +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + +jobs: + update-lockfile: + name: Update lockfile + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: master + + - name: Prepare + env: + NVIM_TAG: stable + run: | + wget https://github.com/josephburnett/jd/releases/download/v1.6.1/jd-amd64-linux + mv ./jd-amd64-linux /tmp/jd + chmod +x /tmp/jd + sudo apt install libfuse2 + wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage + chmod u+x nvim.appimage + mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start + ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start + + - name: Update parsers + env: + SKIP_LOCKFILE_UPDATE_FOR_LANGS: "" + run: | + cp lockfile.json /tmp/old_lockfile.json + ./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q" + # Pretty print + cp lockfile.json /tmp/lockfile.json + cat /tmp/lockfile.json | jq --sort-keys > lockfile.json + + - name: Commit changes + run: | + git config user.name "GitHub" + git config user.email "noreply@github.com" + git add lockfile.json + UPDATED_PARSERS=$(/tmp/jd -f merge /tmp/old_lockfile.json lockfile.json | jq -r 'keys | join(", ")') + echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV + git commit -m "Update parsers: $UPDATED_PARSERS" || echo 'No commit necessary!' + git clean -xf + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}" + branch: update-lockfile-pr + base: ${{ github.head_ref }} + draft: true diff --git a/bundle/nvim-treesitter-0.9.1/.github/workflows/update-readme.yml b/bundle/nvim-treesitter-0.9.1/.github/workflows/update-readme.yml new file mode 100644 index 000000000..c8673a6a0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.github/workflows/update-readme.yml @@ -0,0 +1,42 @@ +name: Update README + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + update-readme: + name: Update README + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Prepare + env: + NVIM_TAG: stable + run: | + sudo apt install libfuse2 + wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage + chmod u+x nvim.appimage + mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start + ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start + + - name: Check README + run: | + git config user.email "actions@github" + git config user.name "Github Actions" + ./nvim.appimage --headless -c "luafile ./scripts/update-readme.lua" -c "q" || echo "Needs update" + git add README.md + git commit -m "Update README" || echo 'No commit necessary!' + git clean -xf + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Update README + title: Update README + branch: update-readme-pr + base: ${{ github.head_ref }} + draft: true diff --git a/bundle/nvim-treesitter-0.9.1/.gitignore b/bundle/nvim-treesitter-0.9.1/.gitignore new file mode 100644 index 000000000..6e01dc63c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.gitignore @@ -0,0 +1,4 @@ +doc/tags +.luacheckcache +/tags +nvim.appimage diff --git a/bundle/nvim-treesitter-0.9.1/.luacheckrc b/bundle/nvim-treesitter-0.9.1/.luacheckrc new file mode 100644 index 000000000..b0ee19d8a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.luacheckrc @@ -0,0 +1,21 @@ +-- Rerun tests only if their modification time changed. +cache = true +codes = true + +exclude_files = { + "tests/indent/lua/" +} + +-- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html +ignore = { + "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. + "411", -- Redefining a local variable. + "412", -- Redefining an argument. + "422", -- Shadowing an argument + "122" -- Indirectly setting a readonly global +} + +-- Global objects defined by the C code +read_globals = { + "vim", +} diff --git a/bundle/nvim-treesitter-0.9.1/.luarc.json b/bundle/nvim-treesitter-0.9.1/.luarc.json new file mode 100644 index 000000000..8dc060501 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.luarc.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", + "runtime": { + "version": "LuaJIT" + }, + "workspace": { + "library": [ + "lua", + "$VIMRUNTIME", + "${3rd}/luv/library" + ], + "checkThirdParty": false + }, + "diagnostics": { + "groupFileStatus": { + "strict": "Opened", + "strong": "Opened" + }, + "groupSeverity": { + "strong": "Warning", + "strict": "Warning" + }, + "unusedLocalExclude": [ "_*" ] + } +} diff --git a/bundle/nvim-treesitter-0.9.1/.stylua.toml b/bundle/nvim-treesitter-0.9.1/.stylua.toml new file mode 100644 index 000000000..ecb6dca5a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +call_parentheses = "None" diff --git a/bundle/nvim-treesitter-0.9.1/.styluaignore b/bundle/nvim-treesitter-0.9.1/.styluaignore new file mode 100644 index 000000000..2b6c4c6ab --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/.styluaignore @@ -0,0 +1 @@ +tests/indent/lua/ diff --git a/bundle/nvim-treesitter-0.9.1/CONTRIBUTING.md b/bundle/nvim-treesitter-0.9.1/CONTRIBUTING.md new file mode 100644 index 000000000..2d06c3525 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/CONTRIBUTING.md @@ -0,0 +1,347 @@ +# Contributing to `nvim-treesitter` + +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 + +Depending on which part of the plugin you want to contribute to, please read the appropriate section. + +## Style Checks and Tests + +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: + +```bash +luarocks install luacheck +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`. +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). + +Each query has an appropriate name, which is then used by modules to extract data from the syntax tree. +For now these are the types of queries used by `nvim-treesitter`: + +- `highlights.scm`: used for syntax highlighting, using the `highlight` module. +- `locals.scm`: used to extract keyword definitions, scopes, references, etc, using the `locals` module. +- `textobjects.scm`: used to define text objects. +- `folds.scm`: used to define folds. +- `injections.scm`: used to define injections. + +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/) +- Matches in the bottom will override queries that are above of them. + +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_. + +```query +; inherits: lang1,(optionallang) +``` + +If you want to inherit a language, but don't want the languages inheriting from yours to inherit it, +you can mark the language as optional (by putting it between parenthesis). + +### Highlights + +As languages differ quite a lot, here is a set of captures available to you when building a `highlights.scm` query. Note that your colorscheme needs to define (or link) these captures as highlight groups. + +#### Misc + +```scheme +@comment ; line and block comments +@comment.documentation ; comments documenting code +@error ; syntax/parser errors +@none ; completely disable the highlight +@preproc ; various preprocessor directives & shebangs +@define ; preprocessor definition directives +@operator ; symbolic operators (e.g. `+` / `*`) +``` + +#### Punctuation + +```scheme +@punctuation.delimiter ; delimiters (e.g. `;` / `.` / `,`) +@punctuation.bracket ; brackets (e.g. `()` / `{}` / `[]`) +@punctuation.special ; special symbols (e.g. `{}` in string interpolation) +``` + +#### Literals + +```scheme +@string ; string literals +@string.documentation ; string documenting code (e.g. Python docstrings) +@string.regex ; regular expressions +@string.escape ; escape sequences +@string.special ; other special strings (e.g. dates) + +@character ; character literals +@character.special ; special characters (e.g. wildcards) + +@boolean ; boolean literals +@number ; numeric literals +@float ; floating-point number literals +``` + +#### Functions + +```scheme +@function ; function definitions +@function.builtin ; built-in functions +@function.call ; function calls +@function.macro ; preprocessor macros + +@method ; method definitions +@method.call ; method calls + +@constructor ; constructor calls and definitions +@parameter ; parameters of a function +``` + +#### Keywords + +```scheme +@keyword ; various keywords +@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.return ; keywords like `return` and `yield` + +@conditional ; keywords related to conditionals (e.g. `if` / `else`) +@conditional.ternary ; ternary operator (e.g. `?` / `:`) + +@repeat ; keywords related to loops (e.g. `for` / `while`) +@debug ; keywords related to debugging +@label ; GOTO and other labels (e.g. `label:` in C) +@include ; keywords for including modules (e.g. `import` / `from` in Python) +@exception ; keywords related to exceptions (e.g. `throw` / `catch`) +``` + +#### Types + +```scheme +@type ; type or class definitions and annotations +@type.builtin ; built-in types +@type.definition ; type definitions (e.g. `typedef` in C) +@type.qualifier ; type qualifiers (e.g. `const`) + +@storageclass ; modifiers that affect storage in memory or life-time +@attribute ; attribute annotations (e.g. Python decorators) +@field ; object and struct fields +@property ; similar to `@field` +``` + +#### Identifiers + +```scheme +@variable ; various variable names +@variable.builtin ; built-in variable names (e.g. `this`) + +@constant ; constant identifiers +@constant.builtin ; built-in constant values +@constant.macro ; constants defined by the preprocessor + +@namespace ; modules or namespaces +@symbol ; symbols or atoms +``` + +#### Text + +Mainly for markup languages. + +```scheme +@text ; non-structured text +@text.strong ; bold text +@text.emphasis ; text with emphasis +@text.underline ; underlined text +@text.strike ; strikethrough text +@text.title ; text that is part of a title +@text.quote ; text quotations +@text.uri ; URIs (e.g. hyperlinks) +@text.math ; math environments (e.g. `$ ... $` in LaTeX) +@text.environment ; text environments of markup languages +@text.environment.name ; text indicating the type of an environment +@text.reference ; text references, footnotes, citations, etc. + +@text.literal ; literal or verbatim text (e.g., inline code) +@text.literal.block ; literal or verbatim text as a stand-alone block + ; (use priority 90 for blocks with injections) + +@text.todo ; todo notes +@text.note ; info notes +@text.warning ; warning notes +@text.danger ; danger/error notes + +@text.diff.add ; added text (for diff files) +@text.diff.delete ; deleted text (for diff files) +``` + +#### Tags + +Used for XML-like tags. + +```scheme +@tag ; XML tag names +@tag.attribute ; XML tag attributes +@tag.delimiter ; XML tag delimiters +``` + +#### Conceal + +```scheme +@conceal ; for captures that are only used for concealing +``` + +`@conceal` must be followed by `(#set! conceal "")`. + +#### Spell + +```scheme +@spell ; for defining regions to be spellchecked +@nospell ; for defining regions that should NOT be spellchecked +``` + +The main types of nodes which are spell checked are: +- Comments +- Strings; where it makes sense. Strings that have interpolation or are typically used for non text purposes are not spell checked (e.g. bash). + +#### Priority + +Captures can be assigned a priority to control precedence of highlights via the +`#set! "priority" ` directive (see `:h treesitter-highlight-priority`). +The default priority for treesitter highlights is `100`; queries should only +set priorities between `90` and `120`, to avoid conflict with other sources of +highlighting (such as diagnostics or LSP semantic tokens). + +### Locals + +Note: pay specific attention to the captures here as they are a bit different to +those listed in the upstream [Local Variables +docs](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables). +Some of these docs didn't exist when `nvim-treesitter` was created and the +upstream captures are more limiting than what we have here. + +```scheme +@definition ; various definitions +@definition.constant ; constants +@definition.function ; functions +@definition.method ; methods +@definition.var ; variables +@definition.parameter ; parameters +@definition.macro ; preprocessor macros +@definition.type ; types or classes +@definition.field ; fields or properties +@definition.enum ; enumerations +@definition.namespace ; modules or namespaces +@definition.import ; imported names +@definition.associated ; the associated type of a variable + +@scope ; scope block +@reference ; identifier reference +``` + +#### Definition Scope + +You can set the scope of a definition by setting the `scope` property on the definition. + +For example, a JavaScript function declaration creates a scope. The function name is captured as the definition. +This means that the function definition would only be available WITHIN the scope of the function, which is not the case. +The definition can be used in the scope the function was defined in. + +```javascript +function doSomething() {} + +doSomething(); // Should point to the declaration as the definition +``` + +```query +(function_declaration + ((identifier) @definition.var) + (#set! "definition.var.scope" "parent")) +``` + +Possible scope values are: + +- `parent`: The definition is valid in the containing scope and one more scope above that scope +- `global`: The definition is valid in the root scope +- `local`: The definition is valid in the containing scope. This is the default behavior + +### Folds + +You can define folds for a given language by adding a `folds.scm` query : + +```scheme +@fold ; fold this node +``` + +If the `folds.scm` query is not present, this will fall back to the `@scope` captures in the `locals` +query. + +### Injections + +Some captures are related to language injection (like markdown code blocks). They are used in `injections.scm`. +You can directly use the name of the language that you want to inject (e.g. `@html` to inject html). + +If you want to dynamically detect the language (e.g. for Markdown blocks) use the `@language` to capture +the node describing the language and `@content` to describe the injection region. + +```scheme +@{lang} ; e.g. @html to describe a html region + +@language ; dynamic detection of the injection language (i.e. the text of the captured node describes the language) +@content ; region for the dynamically detected language +@combined ; combine all matches of a pattern as one single block of content +``` + +### Indents + +```scheme +@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 diff --git a/bundle/nvim-treesitter-0.9.1/LICENSE b/bundle/nvim-treesitter-0.9.1/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bundle/nvim-treesitter-0.9.1/Makefile b/bundle/nvim-treesitter-0.9.1/Makefile new file mode 100644 index 000000000..139e6cb99 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/Makefile @@ -0,0 +1,7 @@ +# 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 autoload plugin queries lua $(INST_LUADIR) diff --git a/bundle/nvim-treesitter-0.9.1/README.md b/bundle/nvim-treesitter-0.9.1/README.md new file mode 100644 index 000000000..fdc643170 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/README.md @@ -0,0 +1,721 @@ +
+

nvim-treesitter

+

+ + Matrix Chat + + + Linting and Style + + + Syntax files + +

+
+ +
+

+ Logo +

+

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

+

+ + Logo by @steelsojka + +

+
+ +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: + +![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/projects/1). +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) + +--- + +# Quickstart + +## Requirements + +- [Latest](https://github.com/neovim/neovim/releases/tag/stable) Neovim release ([nightly](https://github.com/neovim/neovim#install-from-source) recommended) +- `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)). + +## 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 + +```lua +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + 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, + + -- List of parsers to ignore installing (for "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, + }, +} +``` + +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. + +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/AusCyberman/tree-sitter-agda) (maintained by @Decodetalkers) +- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime) +- [x] [astro](https://github.com/virchau13/tree-sitter-astro) (maintained by @virchau13) +- [ ] [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/amaanq/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] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus) +- [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 @Luxed) +- [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] [clojure](https://github.com/sogaiu/tree-sitter-clojure) (maintained by @sogaiu) +- [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] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta) +- [x] [cue](https://github.com/eonpatapon/tree-sitter-cue) (maintained by @amaanq) +- [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar) +- [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @akinsho) +- [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] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek) +- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun) +- [x] [ebnf](https://github.com/RubixDev/ebnf) (experimental, maintained by @RubixDev) +- [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] [erlang](https://github.com/WhatsApp/tree-sitter-erlang) (maintained by @filmor) +- [x] [fennel](https://github.com/travonted/tree-sitter-fennel) (maintained by @TravonteD) +- [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] [fortran](https://github.com/stadelmanma/tree-sitter-fortran) (maintained by @amaanq) +- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna) +- [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] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp) +- [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/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli) +- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta) +- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268) +- [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] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc) +- [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley) +- [x] [groovy](https://github.com/Decodetalkers/tree-sitter-groovy) (maintained by @Decodetalkers) +- [ ] [hack](https://github.com/slackhq/tree-sitter-hack) +- [x] [hare](https://github.com/amaanq/tree-sitter-hare) (maintained by @amaanq) +- [ ] [haskell](https://github.com/tree-sitter/tree-sitter-haskell) +- [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] [hjson](https://github.com/winston0410/tree-sitter-hjson) (maintained by @winston0410) +- [x] [hlsl](https://github.com/theHamsta/tree-sitter-hlsl) (maintained by @theHamsta) +- [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) +- [x] [hurl](https://github.com/pfeiferj/tree-sitter-hurl) (maintained by @pfeiferj) +- [x] [ini](https://github.com/justinmk/tree-sitter-ini) (experimental, maintained by @theHamsta) +- [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] [javascript](https://github.com/tree-sitter/tree-sitter-javascript) (maintained by @steelsojka) +- [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 @theHamsta) +- [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] [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] [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) +- [ ] [nickel](https://github.com/nickel-lang/tree-sitter-nickel) +- [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] [objc](https://github.com/amaanq/tree-sitter-objc) (maintained by @amaanq) +- [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) +- [ ] [org](https://github.com/milisims/tree-sitter-org) +- [x] [pascal](https://github.com/Isopod/tree-sitter-pascal.git) (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/ganezdragon/tree-sitter-perl) (maintained by @lcrownover) +- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka) +- [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] [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] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva) +- [x] [promql](https://github.com/MichaHoffmann/tree-sitter-promql) (maintained by @MichaHoffmann) +- [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] [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] [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 @echasnovski) +- [ ] [racket](https://github.com/6cdh/tree-sitter-racket) +- [x] [rasi](https://github.com/Fymyte/tree-sitter-rasi) (maintained by @Fymyte) +- [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] [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) (maintained by @bamonroe) +- [x] [robot](https://github.com/Hubro/tree-sitter-robot) (experimental, maintained by @ema2159) +- [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] [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://git.sr.ht/~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] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton) +- [x] [smali](https://git.sr.ht/~yotam/tree-sitter-smali) (maintained by @amaanq) +- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol) +- [x] [solidity](https://github.com/JoranHonig/tree-sitter-solidity) (maintained by @amaanq) +- [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis) +- [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] [starlark](https://github.com/amaanq/tree-sitter-starlark) (maintained by @amaanq) +- [x] [supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) (maintained by @madskjeldgaard) +- [x] [surface](https://github.com/connorlay/tree-sitter-surface) (maintained by @connorlay) +- [x] [svelte](https://github.com/Himujjal/tree-sitter-svelte) (maintained by @elianiva) +- [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] [teal](https://github.com/euclidianAce/tree-sitter-teal) (maintained by @euclidianAce) +- [x] [terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann) +- [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] [todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) (experimental, maintained by @arnarg) +- [x] [toml](https://github.com/ikatyang/tree-sitter-toml) (maintained by @tk-shirasaka) +- [x] [tsx](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka) +- [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @BonaBeavis) +- [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] [ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) (maintained by @Philipp-M, @amaanq) +- [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/v-analyzer/v-analyzer) (maintained by @kkharji, @amaanq) +- [x] [vala](https://github.com/vala-lang/tree-sitter-vala) (maintained by @Prince781) +- [x] [verilog](https://github.com/tree-sitter/tree-sitter-verilog) (maintained by @zegervdv) +- [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] [vue](https://github.com/ikatyang/tree-sitter-vue) (maintained by @WhyNotHugo) +- [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/wing) (experimental, maintained by @gshpychka) +- [x] [yaml](https://github.com/ikatyang/tree-sitter-yaml) (maintained by @stsewd) +- [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] [zig](https://github.com/maxxnino/tree-sitter-zig) (maintained by @maxxnino) + + +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 + +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). + +#### Highlight + +Consistent syntax highlighting. + +```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, + }, +} +``` + +To customize the syntax highlighting of a capture, simply define or link a highlight group of the same name: + +```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. _(Technically not a module because it's per windows and not per buffer.)_ + +```vim +set foldmethod=expr +set foldexpr=nvim_treesitter#foldexpr() +set nofoldenable " Disable folding at startup. +``` + +This will respect your `foldminlines` and `foldnestmax` settings. + +# 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 added to the +`runtimepath`. For example: + +```lua + vim.opt.runtimepath:append("/some/path/to/store/parsers") + + require'nvim-treesitter.configs'.setup { + parser_install_dir = "/some/path/to/store/parsers", + + ... + + } +``` + +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. + +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`) + +The default paths are: + +1. first the package folder. Where `nvim-treesitter` is installed. +2. second the site directory. This is the "site" subdirectory of `stdpath("data")`. + +## Adding parsers + +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`: + +```lua +local parser_config = require "nvim-treesitter.parsers".get_parser_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 + 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 wish to set a specific parser for a filetype, you should use `vim.treesitter.language.register()`: + +```lua +vim.treesitter.language.register('python', 'someft') -- the someft filetype will use the python parser and queries. +``` + +Note this requires Nvim v0.9. + +4. 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). + +All queries found in the runtime directories will be combined. +By convention, if you want to write a query, use the `queries/` directory, +but if you want to extend a query use the `after/queries/` directory. + +If you want to completely override a query, you can use `:h set_query()`. +For example, to override the `injections` queries from `c` with your own: + +```lua +require("vim.treesitter.query").set_query("c", "injections", "(comment) @comment") +``` + +Note: when using `set_query`, 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}`... + +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. + +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). + +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. + +#### 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 `:echo nvim_get_runtime_file('parser', v: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: + +```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: + +```lua +for _, config in pairs(require("nvim-treesitter.parsers").get_parser_configs()) do + config.install_info.url = config.install_info.url:gsub("https://github.com/", "something else") +end + +require'nvim-treesitter.configs'.setup { + -- + -- +} +``` diff --git a/bundle/nvim-treesitter-0.9.1/assets/logo.png b/bundle/nvim-treesitter-0.9.1/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a60e536bcaf45d9612175d50ce817678bb23fb6a GIT binary patch literal 26664 zcmV)$K#sqOP)Mz2EPgbE~>%wOUQ;FbijYwbP;MR&~`q z_vHVvp~=a;?5bBqUUS{+te(E^@%O*=UAmCZwSDGC4*-Dm0*96XzypAi*>V7o^>#m< z&;I*A+^kL>&DQBB{6bJ?Z+vaM#Z4dCKK4YTuVp@|X&J;`f6?mHpZ~)b?6sR-AuQ&F z`1QZHv%LH1$DQ>TT{_)yRIvau5)I!w>o0=*_y7Gf>g3Ux<$d%K_7>mS~G ze5S{r%VbBb^i3bx{NH!{_13HVw~uda^!3aa$wptmnJ9Ag8-KO^^LIb%oOjVH^u!qW zLnr8Sd(DQ|+3PR5>TJhq-<$eDAqUzkpT66S7Y6r=UwcK{ZFfK0^1*+(x8ti14|M!! z_s;0+-}=92I?lOFPQ+?|^M|+mq;F%(MUB3e`J$#{km&1w z>;qjcfo$u(*jc^dYWy5G?fVeC4mLG1IOV-awtyNRo%&fkH8Tc@#62|g1-f||&HE_=uPk)4ay&E&dbuYc>iWJ~Ar zGks^T-uQ;r|MR6sWlwM4OvXGHNo(Hhh}C)1hd1BVx3OhoqpxYMG_MRIA~6xY_AS?U zetYY~vFqOX2Qxahr9GMc>(6`*+(-hKXs!Hk$(QLC0IvihmY52IWGx<&K%U|>R&kuf5>B)_?lJ4h$c0H8!L^V2_htfDr#QBbD_K*Undna9XH^tV(3tu)wut5;6&ly`JQY5A9p1#d3AN|6YW_<(C37UFy+^Foi>DJBv)wi)_eWR~zwlrr3 zv6ijvYx(pKznA`tPu``Kf05PRL!aBdtJgBH#=f2y7AV{_w;ROS=;DKoDI#1 zL83Rj^EcZ+f7g!4g_penEDOAS+rm48t9|TEZ~vf(#9nZm}uDb3i5BuV0}fBMg&r9C~D`+BaC6S0=ucO!f_w*lpo{gJJmpoUNKwMz>`OUJZq5NFHf@32>%7gzZ# z$hNNVbCnq-X%=2Xb^@&SZa!Be)|zAAZ5`3G44L-_4$%v8+Xkdm zWfJ;6O?s3@sPp?L`_1@mpeDyb8^%Jz-XA^%;D$~x8k1Iev_lNpi+VSSmiDu|dL0*H z*Z#)uqFN?|1etE*%fbafNDyv>BnO^5_>QkZfv~I6;x&nz;Z|@r+7i%niY}De&u(cZ%qHlz9asL zqeo~AQjd5%T(Q;oDClyT^n5bHGovi2ObkSJE~4`Z5TM3J=r5{a$Xwxd71%(RsdhI0 zCo(vxE$70Qyy|Sf)n0ee>+I$0RzV=tg7GFNKqgzjJG_ss&D-6Wv*a`XX-Tqgn zkGKBiJult-#--D;$J5J_TH2r27%4w_|3hSFl#8KzSH_b7ei<~a*g&7Dp%Wma z0IOpW_ydROug+%ZJCrIYB}A%~y<1i8U%Ec>z-kcDDCo>6s&<#3?YG9>@SE>L!(11# z;13S)`EwH>5=qd08PxbN**5mt3&L}uG%G#yC)Zy!U|C zkVEDu?|f>??*&wU#z(;FS_*1noLsT8a|w7SkJ9(Dy$9UOUj3J{r+4w0#@1sa$9y!r zg(OA@$3@jCmjzIo-=i&opT?4)izQKTGczg;jN#% z?6FJVxa{2k+V#pxfE42K?;if*TprZ9NN&VhcHIXz-`lsbd0oKMSFwuuT=Bji-GM5V z8XF>GG*n{>Ia-x*wU_N(AQvy=$(+v`F$3Uix-{Wl{y#o?rlI|lN4Dw7aaL1;V}dAn zG7Ty-LK2C|eBRm){>VvySe#TFJcn#;r+5XpE-?*7&V>Li#gs8|AKB6d@f-i}=IFJ* z@j1Duj~9{bttkJ*W zOf;jUy~17J{<^dI^0x_`fMbJTwRO{k*0`d!b`qlqyM;{#DM2Pupt6%>PoTaYyY@GJ zqx{&t|Lh;#|77*J>O}uuouBkTgRRGh0D4!kYGv8v2~(#ANQHvHOC%)NeQTh+<8iQ8 zo)7-XqhNI}1(9q8kj}E zWCn{z=KHedLNj8J(gSzit^VM{J9Iv`L7h5I4B{W&1J?3&6ro0)JtQXrvbz`jqx(QE zUr!7p((O*J8K9@Q-`PcC1a%;av( zb2MGVSp|~GG)h{+1_@ zaY3??g@jVZo`u@>vquXctFc&hlbj6mx`C}K~cgJ5f7n9654pO}9 zJ6|DBPBvrG%{8s`I-i>wVaCN%3bIEiR*-5VkCOZ1SG~-B(JQYzeO#3pEm7P;zE$b0XL@xg3|%L2xES6QmMF zU-~~jA<}J~Q+6#C${N*{Xq;5GU_y~ZNVTzAjs zt_Kb7Ad*gF7CHLvAKF7+GhzlQ*~xJ7D99ztLFXn&I!(RCBKZCL`Ss*D#bzR-2i5x2 zt}*~bKp=zIB4h?582|)DK$X(ql@%yogYxjN0@$%s+FxPeVAhfJiy z2sx@gC?T9JFIyV9@_&A+dR*bgj_b?_1^R+0b$AT%ngS?sG@KYC&o%(sA|%Zy9>Q6@ zv`;)m3=@)4#sL5jG!OhiTbh~V-u9*OhDY3Im5Wul>$_j16+4!siG?Z?SM$OfqU^QZn7_U$^Q%owd6R(LC^?yqa;Pxw<;-0Pwv)4OXV(7GNT!P z$;z;55E)gVq``Bc?csUMJmhsV2DeF>7payo>P`$5PqJfx)GIdRk=gxy+t}W*9rlWO z9vSP=;-FgJez0V2WZsQRRG7>UA{OyLh@$OCW(td$BK#If$=px=b=TXz_u;2*E}SUk z=lDF&8A^9WSG?&%7u}QUiZrwkZB`88?|b%#Ix}*_KXr@@WQtbXHV66&Ib#f0xoXLf z&eAGOY3sQR*y}HZ=xeV3H?e31$3`@OfBY~-jFH^*wB!Cbk#ZU!Q!zXxul1j#Qnj8<$MVC=5aQ+q={8~}DuRw;u&yp>m zbCV$3yJ^4mJx7at5O{Ssx=8)<>HWF?gMJVX28#Pp9J;WTs0p`f1C z-3uz81AFa-s3N^I_Upg4QgO_E~$T1tD?yc3X&pGRYMhvG6R%P5=3?`0@<~gJXY3{6(rH@WvjvJ=;m|g zCg6PdX(4cG+fhpeuTkg-p{3S3s(hVRO1ElFTUu)!dFYOPfBD0|d-g-~`xu*qY9T@@ z>ei|oKYH=c>dho`swnjK@3@`wpNb%)4c6ji;G0@_8OaWeJlL5+F!CSoae5ZEr2?UDyA zmgN1*B>*~x)jpYS=b|gkk#T|wLdNb`#8r!}o$N{uYEWW{@H}|!Eyo`8x?-a~iwB`e zz2euLnlDJxi=k;^5FqhBBS)4lziHL~x#44%+_q?K`n>sjjLktc=CL(89ENuvbB_Z1yzMyC{;GKJRM$uq6qSo%z>oshzpLKF=yus*}Bvo~G6P_0FX+0vcSwKsm`;(Jn^k(w_qb7qk8Ge7@^e`Mb{8n=paqPW-z-=htJ z@16CVNu@#K7*}K}uCgrh{^0jkPcMCs5+f*pvX-qOi6q-u@8?O*#aR^FFc?=*=D!k+ z>ud&OlwHASW03pSGmIr|fMkm)_)T@P-x$G$ig~gdJX3G(Y`BD0 zY9OQ8c&MT=cC(V(Rk4(rWc3UuI=P2C7x8)MTs%HA14rxqarRz`WNTQ%t|rIXT{||+ zd0eP|xe?B#3Zm&aSp#4Q$u4Ayi=b*oc1Tsw(~W>Xbez<&mF0&*>0#M|)wt(*i1=N= zBzQjMQ;wQGlV_`Qd2-|bx@GeZUiZEWJ|1gvk~4iSji-9Eh=z1m)>ab-vQKpP|xv_0B;IC&5a^7AjI za#*xW)Yu4EtzBVk0-1xV0&^3j7U5^!-e*}tXhseR;}_DdR5cpIo${v2WflPABOHyN z80B<#rNHj#Gs%bM{-OYx_Br-)DSZ?zQBN`qexhqN|bz2rCF^_451ef96He^0tQ+BxIr(@3g6k3hOJa{dh; z*@BW}Q7wMbj2Xl~w*OhYGJDyYm$&@C?>v(F|ksVbh$v2z+Q6! z_=k3xlyT1Rb^Co}AIGVWAWFz#NQ+{QIasp}Dj6BWjl zOBH~WT&OwPok+8KWl3TLRJlmP_@#=W{as<6xWDi$732NYA zH9E+yS}8$| zoMd;j6y$+hl7FNW#5<%TG)QqKFu~_+AcPJs2^R_5wNUzySJ-kSST=9?x#iN1<%hn0 z@GlVTb3^LuZ!a4tvUn4u9 zT%s&rof+lCLnms06S$}e?E{%?r4`&-vWk%tC&$S?3G5H6XBovnM6zw_$&G5FjNQR+ zjCvv~a|GYil9M`CE}MNK>|IlekEMF}64*;uaRO!{&8hr*o(6l_dPpC- z$LmaH{2<(6IZ{`JK3;GmSFo6>ks(u@PMK4Mz2E%66R*4P3wysX(`VCYn$~Jj!!6Yr zz3{quW|EoPAjN#yJ8|TxU|F|XIw^up1yR`y8Rxo?rQ}6=Z`)vXF99`pjO~nM8vNsj zxXz=cjco;-Jw% zMbk}^BCAzpO4Uaj0k4bdKTL#O#uHp;?|TLe;uQ3Dj+CZg&bo5O4^Rqm2J@V$T<}MJ zcKe?9f9`i5c;&&zhZkaprl!czPj^Nyy6)C3KTdT<=A~!LtlYe%$9{TeFh6B$2dPjr zxiTZ{b;9q;CGd|OWY3V&U@ct*-l5(6y1SPW|Inz%8-$uY6BUH z%wi1eAWa=VC;LG|2+xD+5|8B=70M(knqw#n*+?s0EP~a!nBydl13_+?Z0iEq(hkmw z^C$^(S=;dns+|BWEirR#SQU(Jc>GDYwt_rrFJBMd{%s&yI(Z&A5m4hpT$+kf1R0=^ z1FLs6_=k5>4LeR=|HwYDSDwenAqHwxMiXpQqnd+E5wCbWsh&h@6F)JZ1t}=;6f;Oz ziBUGWTTsauRJ_PhP%zcT7*_)ai3yN_k)dTvC)azRw6gg2#4p&QI&+_`c(0u26$CFx zLJG0(=R-f*e)qt4`=1@XKXa-uKI_4ni~JXK>D7@^UC}LXx^>Hced|M8UpYBcoSf}A zvyvd?XMg_FDGQ^tz*&0{Ve{f7L&Ka5X*UY~u|wo0rIZa+g`#mPuCf*_r-VXkZ_s8` zMpU&7s=FFKK@x-lg~55ymcae03$l`}l;%=>J!t65u(*o#8;XbrtrMgTG7_iYpa6CY z%hoQ#*u&tHI#?v;E}H@sL!&;QpwiF zL7I=6M#ZY8bXW9}H{G)3Ka!o1X?GQ?rdg+&c>A~Cf2Pmv-qqms?<3e80yc;xIpC*! zu-9*a^3Er~UU8nWPb@+(ArDuvKrU8dEU(1nuWp1J>VzltKuwO39YbCxRGDyMqn%@- z?80$Cw0Cnv+^9&Xf^ocrJzN1i5Jl>dDGcC*y>t~v+Dpu2YTzK*AwAyqkU{XYLD}qF z=)6}fx^cs`i_hAzcOj7u6Nj2_OLawG{H9wr-;?T$w9WK)&H70fAG_zyiV9PuZn-gv zZ%|#g^1(m26Ev>IhxSkeol@Tq?gH7lm|7LcSc>s@O|3VW1Vka7FeRNn!`p9ji7ZJK zX&W40P3jRD^k!eHr_TUNBu&#C)0PcbjUx$%yJp6!;wW66i?)e(WG^`j?2VT~JW^7v z(X3AjgaU0@GDxYK^LEWUH~wQR?YwY@p@l(y!#Uxs>Q?O1H+^XHoyo4~jM749FG03F z@-(S5zR#d;gvq8Clz%m&_{Z5cCu()S_T3x)X133u$*3vZyl10SSM0K1zh(11 z(Ujdf-D76WAZl>nXyM@>KSTLZl(4738#x6Y+83!-kjvJA@=BD$M7dX!8JeQy{=Jl9 zP769t%*+Tts)Z)8%1wYmbtji$d@N~!D&$#>awDM7PKm?`BbNjh+7HN_z(rJw8rlG8 zlr;Dk_aoaxfGQQ)0ftN!m?s2@8lmbzH95*~shx{xTx8tRvkyae{8YJmF_Mm)*Trr9 zD;C|f@`{ctXZswQi2S(%$JOIsYe(d=RA+SBU9RS&Oc(C??)M1=q*wr9N634mi$%6M zP}Nzy(gf`?4C+?M5r7+&-*zrxsGwvk*%q|YI}vupD(-P8Q*E5S9vIu1QFi?%c>y3( znKFb0sZ?t4IC-9^_I+%KJKmal^Puj$x^)_VCO8hG!%z7doCwv&cc(_Z>KRS;$2^Pw z*Ztvze;;dE@Tyi*t5{RE8PJ>Fjdyqtfx%VZH3rAl+!)7p!9TKxjQnJz5PD~%C1!Ygr$_Ntx9`>OJny}=7`u+t zv_|?I_+ySGxBYv6qD~zvk~A1ONk+38Iu8D^17tXRhjtO@0T}NQ1oh$NvZ-UYsNoK| zhdqDl)rZAQRaJwglWg!yg=y*;c)Umwne=&y%x3D|gU#w&LoQwsjnOp*Y4{K{;3=0V z!h2{lIQB9XNFu0_Q(&*z1m*3IP92MKscgpKwGAe&8)J}Y z&tzYC{0yjHNN|`NCF35?Me0-lSxT{(iq?YCMW7Tb6sWlm;dl+6m~siaRAO~YFho&D zA~RLJl2X@lX}k7)7kpv?t6EJLD4Y)wGWU|(olpF?&P~z;C4AcvZjENGxqxcU30cH( zO)D3e(RS%9M<1$JCyiw$j@7$XKV=Ynf3fJ$g5NUf#dm^eC@LoB+O* z(M784g|M+Fw?VKLuLxVU@pa@GbRwPvogD}N=zeHR<)`FD32Ux*>+BS7iL8FbZ>@b# zZO>9O@*6$xYrr3KXAp1KlXv>3`q^dcm&qpZPaFYf)dq0ZT?FNAkAOOHn0I#BW2AEv zU@cuu=_i4GLGcMLxdRAbM+;f5Vv6FQIO@ zqo=0a5>?2t8fTh$A`@DRmov)Adseh@4d-X~U=qbFrF2#R5uyzvus> zSi`AftoH{7d9gq(5oAjzN33yTyK%NDj60Vb=9D>YJ)5E9MY0OT9qkI+Wn8WCVGyld z1OaNV+C<;mYc3>k2AOOnH!r~m+3u7ZLXAO9Z963_dOm0DraOY_CvNrZM7hxpH3yAC zGEoZE25HyMKtFv;_r%s+_0IKwIv>xbj`T|v>v`|Yp`AYxtsR8)9-x5)tFpb$OyIUo zmI?vvj_q*tTUZPzw`du6mWn5tK?H;X(j^i4Ybkvfc*j*a47k)bu1|8z!xfSJZ~*uXU;kZN8@O-MyPy&#&uA z=Rlfo+Brw_!XV{sKmUXP2)kno2)3yeG#&q}xq*sSMi@%hr;;6ExZkT*<;9ziTrNsZpMhAOReySEiVX z&Sf|w*gz6dvSdCBQ7f;cRw18J45YrxoOR8gZTjQ_QneONpl}9aWL_8qN(Ha{^n>^6 zu^~zTq&Cr|BCpQLR#R!Xgfn;1AkK{P$=kXanH?uGs%8e+K$-6ePgmNkewoRN6IpgG zW!x<{Mk(`FH@A-v5za%?re-~8!KSm51QkS3qv;L?t471!iG++q@I-iCRQYm~kcfFx zR0d(yPsIwhmPPT4UUK8A-=CLfRAVYllztf~JnIeG{_t(&<{cXXXTzmbcaD+-Cmk^h z+7D>_DxZRRgu;lEF*{Cn1J#ck<6OoP1O`ER7Owt_87?=$)SrJAnKuUU4(z(eJGy_!>RSutXC5R>-tz7zsh%Q8g$-37WQ>V1Qky85 zu~cLv5z|u;RVmuh97DNYr20$}00XsMqZD>UDxENhB-$XjTWww74;%kyzWX;1hNgwPd$MCn%bzK)xH&3iWelN~wTHP?jH=y_iQ5i)NK z0u!Uf^3xA|87Hxbr=j%hBNU7)?|PE*uV~dq{a>0!mr9#7^)jg8<7__!;8BjtK|7Q< zrgtD2{-(1m1QB#0L&-uB_mWYm(8ehgxQ5;I6AVxk{o#|uwD?|S##l0i zN8pOzy_CDe+Ad2F-(zo8xm3BkgaALxsEBTqyUv<+38?<~$B$58F);E~ZW7A-ICGdJ zk@=je0xiq5P&h(CNjfe!NkK%}(#fE3is6OS$$nxqJdPk!$A`dyf(kLMETNI98@avc z*H`>y&zkh|`Fvi#q!*@nWe_zqaKhX7?0@+K2f@AYaza?7wgCieJVt5^VML*x=<#Q0%BYq%4$n(}RSL2;1Ci(X|W?kP?~LDedrVlamo_a#T$gW?g$D5+LXVMm*S>N;#z zlW5=)zbDaQ8tM2RxEH>ZT(&Y6=k{x)VtEFqYnTe4)a1AUuJ%JDM!R4evxS28Kk`H@gG8|c+xw#lUKfFYdQU- zXBoMB$>WqW*t%$(#}eE--Pjh=jgd>1VR~YmLltnnHW`CPktDkYRW_7JRcY{q?<)i+ zK(_TTgTzholoO@;c2u)S1sgoha6g3{Mb;^sw^Se;i0~%Ws19T{blHuo-rwGvXlU>7 zUnH7$27z*^P~N@u^Jq}}$M%!jWA&~9|Hy7O(ukBscSP)?UbkQqefsOVwa; zQ9Y)DGEF*H&C?X8x1p-_+V@=Wf9L(V%>y-Bby^TA7E<}?`~O*IGul70hrCbz;4zMZ zCsN@`PpXW?kUg9_ViQ<`3P9i@G4^tqq9#fvq&94BSm;FfS7fYDgnbc%NWKVSDy$6E87nAy18b{GsDiOHXj46j;o&(T~!r>i38_0>#yW zF1umXt?j*ux-_!fqli#?0Lsbcl zcHF;Q=9UR2O3vvaytvzaYZ(M0KS`B~6l0N+1CS^YN(GLn7xUyL1Jf-R92e}x%c-i7 zV1o!AsKh-&`uA~;Se0f2sHinwyPC4u5v%pp?`tl|phl}s3r58Pt`phe_3!%{p^Ffl z=m^C$f_4VfD6^|K^z)-#K!_y~!vOesG{*emdz|qbVCx!KQ*zT57*-V3Gn68fxf?9_ z)H%1rF5E%J2DVx|DR7C5CgKSwAK1>pM)HzbVetpYKuiXJtV0pVEVkZNZC7u4?b6rR z>KXo$YRDi!=!^e-3pfq|AfR19bs?oZ$VDqSa*dKD#*-e6b1JV56AUxq<&ohY^hig> z>RxILZC1T-63dQ7tWu#0mYWF21yi^co<|!DVH~|{DHUL$grN#UwyJ(20oIkdACv*CO>YtNxz)J@Wcwn5 z8nt@Ya;(O7&Tv0P2VAWu~!##y;b zR)wxy@;nvTRZHF{RF#6FCu-WM*xgIbG^6I%2?B#46!**sR~b^9wG>#LOF3e1N_vA? zga*HivuZ~Gb>?#!PmxVRsqYN)z@D|KcW`D)P6KGgC7r*z>9xJrH2ONuMXEW2sH6LS z3_`Ge6cjE6jcxpLIRDrc+ro^5jDdCw8rGJ>$SA%~D?9;H7xNT-_XiGuKX8y#I5l{b zR4>8;PPQ=f3BkyYru{*14ay+FQwFeK=BU0&d7&)fDiX~rJf>_{ylwqQqG@N^n6tH@ zM&E;(Y}2KhGl(u^$JNBx(}W=6d0ZbNBq*GmM&$XKQDz?BKz^b)Y#ME_z2n; zu_SnhcXJwuYf?*aU(;!drf57x-YW0VF6upk6CBkn|5QH*86$D>j#W3x(N%c7)GsmU zj2pCt!+TXOGDt)`$pu&xlW|BrliX&q%Gd)L|f$GB`hju>zL9r69 z$fW`!9VSvVA*o)Sn&kwb2|mXwf?9KwKBI%waTX`PjK&G#luCIMEg-vlIYOQp=6DNE zew0cUGn#1a3M1vTQ2OX6EQ|CQD{he#$%;?GTdd@6J2mAtS}|G)fd~+Np^y}RlT?P><*O9BP8!Ki?cu7X|^X_Mv)3(Qs6Os1-t%0)%8}_wS*mHbjBDmYV5Q zO=?q?OFh_4MWMB51x3V>5hU6UnGqA?5T>CIoxE~f5Jp863?-OBNTKnNA;VaUj}oNe z&vCZf>X-K1wCW|@jR3+v=g<}FBSD5wjEhuT7L9L8A;F1BEz>k-_?8Ofy&~Jd*dD^f zHUi}VB?oz^Vkwd^UjN>yYLk?#s-ex|MmW}I#+R+#?CCP~=`z_uebU3W(!n_b50>wN zfU<7<3Rn1`4un9fsr8ys ztE9#KKB#My;z>O=$PxHhoS8={P-yu3Tz5{4=9r)%+8H=TZh~7QluL$zxQ`-%HBik+ zF+86zZegQhHU3G?VT+~RWv}{!^Z%+|&zGK|77Ih{&VcI1AmDogYJA9myXg?&1SN-P z>E!m#T7_A(luAN|bdC|@jWKU^_i_(*lsNfG&ce-Q$gUBI7KRi>h7gibQqbUbqf`uq z=ZB!*dNI!uqr?Dr5EN#aK%p_x8~!ZkvaNsRlHXo^Y5T?Xdc-xu^*wIriP9r8%&`uX0s(Aj(M)z~&o&0a zb*U(dJ|~y4Da=BnI}+vQq4^9aOrq^W*TpCZq?-99Q>6%S-zOis*)OSl!=L6Hw{%x* z`73^B-Mj1ZjHxAY6F9qH&>22`svm>cZokgw$YAC)bkq0-C4{sM`nzRREo2avCO_FK zf>BLmnhTpqMVibo<`o+A2HYB)s41+<1Na74*JEUN*|C@;3PA$lcqU1bYTA9@G~JQh z6jTFb4i6uG=Fa|qsK}RvyKQ()?>qapwAUO6TkC~^@IDi&pNe&K?;x%GabCG8`c1%Y zrZs`EI9?I1=n)2Y8yh02fhrPCay>cDXzUYXrnW?cebH%5>UcXDo`=TvJ+Rt(_(HUa zu!nA7POYbeMRFLB6-55tr~c#cKaC#CKGx{EkGXHcdDS0m_^cg~wawoCr42HB64Ce| zt!Ku2L=ZmF7^yTQ1-uetV3~?R5lc|qL|EMaki1Os1gOF!ceKq{6)8`|+SgUL}I z7Pl?{v^ykwrO2h5XS*iI!Qx>ph7FPq=Ya)fhWKp7m z9H<{5G6;^D9XD=TRmo3RKE1bBUuY!7RAQS$Q)gXbimLdFf3iPYz3-!6-T#@1Q~76V zcXR4S?$z(!^iQ^18>sqUs#tR%q2Vy8JY)oOqM&r6>^(9}Ld8tlOxhs2jcN~0;0U*F zqkiUv9F@+}s!wC)SOTGqgGM(YwzFDA-Z9O~nNVIEH1jT@$UYNjI&>(J(jpT>;8T5Y;C}g-WlH(`jJm z*sdqOb>JTx)B<5%w@co*^4*=QQfub<5z`vf=(#_gEfSypw6C9vMXHls=BrdZfzeh@ zb%4UjPw0xKKHaaRc~A<8VG_c?%1v@=iS2SHE0hXCf^6$yrpZlmewT3#(>OuPHxpc> z&q6mdk44Q#H5e&!=5^-D?;QN}#9)4BJ?~jQ~gAjyiUuK2WncU>6- zq;(8f4ur@ewBlzcD2g8T2Ps$CDbi+ULZdn}#;GY$6Xc_$Mwj<7bs)H()wzVfF6Jq6 zP8Ear7ta&8ca5WfqW6^MuER0I65-RxD=Po)Pj0(egDy7#G}fH9*1p7xF1TUY@6PM< z)eA$#Qd&1BgZL*84^t{RMX~v6)yPSXsH0j$9i}v+i&QI&CV^0wa_sgkX8AjZgNbOf zSe=U){wI-QNns-FpgdBaB&u2XI*7cZ)S{GMMN#?? z+?exr@inXdyme`O-q0B}EDRNECiA|o45CX#P^bDC{V-5*49pIBt_*TJ)n)`LR?xf9 zjfAdS88L>p$=DT^ODSgEQb~6Qj&2_Y}ldb%{ zS0a^3jSaGm5sh1{Z-4-c+cD)@50FD#i=me-&Ai2qEO}G zSBksVR=Hz|G_T@8RxPPKE=w0Goy|>F_LUCzIB)HqG6Wj&+z-*XZc()==GfcSxtKqr zp6Z(FKL~g(*q7bR(^3^4yJO$SCkFEeXK^2zikyg*c=exb`uJSO85wHcmJ!v2rs{O} zt*@I`$ea#>f+5NYy<@DZqRGn=g3{m#N7q32&|eedAdeU4cX4#xHTxLP7}+hpH}%+3 zkccC%#Ff7aGmC0Qf_xvE)t%>awVDJ}o#+Ke5|&ma zNz#z-S6!L_|M;PxqH#t6w8!t*_jeP6`NNH$;&a=ah!ub3A8-2D%pU53q~??$>QsLb zsu%!m3aS^Um4B*xmo}vcpqgHT=|5-+s!%1PC_DA^5TV)?980Yh;Pfe=ro0dOs)z5< z=(i}%#hS_QLRIVMckF#%6NEPAye-+-_L}pqUiyaFJl{sEPSbZ{HLC=HDmYN!RCIEy z66|PIW^X{$lFi^?IqsBHd1}0a#(W`9>F-ogSS2A)tzs8)g>?C}_@An3{;4%soxOw- z&!vqsqXYM!eDL7IC%@i!IWYI_^50(n!DMH&ZKn5N0a0^G5F(uDwnM$l{fUt>~kCg1F{$G~TQJ1<3AGKEtt4+64blqSzL_R=G@g4FGyp z_vQY7-TATHc&Wb$@)75>$%xhYsy{scTvoN3RDuMNYB$QbxC9FlQe zx!`mYI#!vuhUJ(TNFd)&TMdC#wlHcBmBhtxGtqgNs@^%X`FVwj^7uoy@BZMt+^Yst z&!*06*SuoUYi4pxqgAJKL&b7q2ArY9015mlRSSmXMyvKWuPJVlWp7k&f@?T{qvLRz zfv!xa+@J`my7Sa?DDaL2C?~wrtYLBvJb2>nLyw&NUZd5d`Pg3aTkHQ%q{m6k_FgnG zHLHrH366)r8E|3;MM|jlD6it8#eV@ZyK7vxl#?Yn(GhKvGRILuY^$LAEpEYg(Rk=G zCU-L097g)EXsH|@jK}<;=Y%8m@E7-dC_i2tZhX$}+_p%{>3aG9KJS)!d;HBq%_~7j zO~T1+R(u^y{(SbdE3pU-8CW}y|A^<207(yl9}vu~prdiq<_N{~vmpmC>~_RIE}cC1Jl zFfLj`KPhvp1PyAX7(LN=wa!Q=8K|3;X)TRodS^(r(z?1{{tOp1GurXvV|N{WYUl@z zR+Hvqd-*%g|9B+jBX(clM9O(omeZ{zyDRLilt)jvxmsK~CC^A&zL`Uz8 zBk5l<>#%XTNDnZb`7^mnpVd=&aQ{-Ow zS_eRG8laS;zl>yJ8{-Y$Rp`F~@%^=>?GG{_!V>=f8>ODWoEdL?6WSH z7#vP=|MW0RSDgWwry6jsx_&*Z9|?vw5q4^mz`;Xu|DuXkE`s*T&kd@~1Ks!OZSNJn zpKJIGpW~M7jIDq1Ti5;Z>A$ZDE^WG7lS&ZHl0uIUv(9hQ+##qO)Klv}batFOOHGau zFav8x#$q&uPUI3cpAqwr4Wmr{Rh3KGuSDvrad;twD%I4ihisHWwkG#wd?0uH@oygd za4p8JH=TEN@9!?Tu>FE5A2z|vpVrpAHi$_abWHC+U3DQ{y*x=LGps&=2$0q}if(eX zC|QvvIUDt1o>i4(;9lny2}3ztUO5D@CY8%_Ik<@S34T}PUWKxKam8U!1A6v94t;It zK<42lm?m@GBA33Eyjs<&)xQVET z$%qE!Jy;6BfIB>gsu={;E#C`qd}&xWV!GodO)gduL~A!o75uz?am{q>`~PX%dxY;V z_?{!JOOqQezJB%Zh4=ZFz;SaYk!oWUk}@~o3{%nR$^}amk_3VqbVg$Qp423hTH^Z# zzUO)FK#(FIY{5Cgn2F|n6emUou@nNv4syGMSX8TfFg}nw_V_ms{(a-8%G|e&*DU+J zj+H5H@3ugoN1Iy3qP`x+)k>4UT$&0sYS|U{uU4G1Wjsx~ILXIQ9}qd^S5r3d^W71j zTTC;0d=;{M@O|Jq29w>(=Wea#eb{m5k=sX)Ww$oEIBL$DfauHLwee%NOK$mv(p@5C8h5F=k0$48p@5IFLT>kmLx8|==#;~S|}=3(*_EK z<%VerMr3m>T7Vpeasun!72A zq88GY&2HQ3VN1n|iiMLssQUonN+gch%}PoK7eA zOzhivXa8p#KgH*`Y0z%cIo*HKd|T5p2xwQ04*_kXC)iahq-kKost>t-DgE4BT9~h; zD{1OM6upoGHFBcTkkjl-3~~l23xXUnY4mt3scPCJGg4`89@O|C8}Q1nnVa`awDp_& zKQT6t-PLH|xVdbEM=1ojDYxM~aCZKfKGi$b#DOAL1QPD9L0Jq}f8|pEktQe_;gkwe zK`SBmtQ4H5g_Ap%;n+r%M4_a^>PDPZ0YmbFQDKzLp01!w*X&Oq59Bx?1AbP}KeHuN zwI2V{o|_l6R}1*>0#dbJkm@Z#Y-9kLY9&cQP&Zvz3I^X0dB$x{4ve9&4B7HK?J3<3mYdOPj=HM1UxRY6|pq`2+QSYcMwHKm56Kw z$@^*uvu{OJT1;d>ke^vhFiYl_Q?ik&TG=n+OEUn`Hs5vlgdKB#)- zC(U~W5RG%Dt})D2sleY66p%Rv)jRwfi7|Foxd0H0H%y5>{_Myz2kt-duZ^xjpT%bC z%_^IlbemJvnkF@jy+u$`i|UPUQqjGsMNpNTDd2qrV;(1aX4Fh>#~`vBa-t!MyCyp$ z#x{saO$q8v$fgOTQV>-)U2t`|3^Lx@5EUz+M{nQx$wH=dq>X^lqhvc?3su?3G8iaSp<-Y1@ zb12Vb>uRz!bbf-`K?g`H#AsB=;7)AVj5I+H)e{{Btdin8e|Gyv3KOMcjlPb#5=wg~RoBqcyiomX(t|uG z%AqpSf;vYTXwfPutxbP(dLP&hxd~2DK}qA4d2$Eo>Oqc{sOk%XOc+gaHKDF5o+7|F z?iGS+8+E}o_3A=OkX?Oq?i)TIM5@+pyZ&lwK2FopS+CKF+F-d0OVz4>`vWq(HA@b! z#4g!bx>8A?eClZqK_+f+9I96o6ERf>C>79dh{UJ?Xs}P^8EO7p`NUAc z57Qe2jq_?)9+VmZ-mX$rNr%RuccY+7S?X&}6JFYtR1>3Rg^|c0t5jh%sfnWp&-}&+|}evYdJ9E4$7KAZ#aQgLIl^?KvyeUBwbc#_8(1 za$*ow@f6}J@0EBp7Xtjj{t82&-9f>?2~x5AlLyJ*rmnX^?YcI_Rj5AMoT*FaLWA9j z^4KPmnCzHXl3Otles7f3FLw1dB%1zwwC~=NcMUu<{N09of#zY0q}{+2tiOsi1FAn8 zhdEG+y4Z%sdDydqad@Yowkt18O9`@Z0VlB(G_mDr2qzTxK#4->?7)ydmQ4~x#uA`1 zLktcPH0bfm)E15~2XKh&7*`;+FX^oN{doa;Q^)w zN+e>&Xp&+u!j4b}UWOo2eRa7jGoaFBdGx8T?7W3?)tYRZDY5=00CB z7ISQPhp`Ti`kj+1grpUFmyEi^fD6oEs%X;LgTg4v^-`SKTPlPlwUiWD%rS%TD4gh9vqlS!IS3G*utI>7u6qIJw5Yxek{R|Y zK|$tam7f6F(gjvmU*(n=wTSEmU|{J08;kl9DvqENvlz9B(@Mkdh+Qc}vV}{Tq;Y2L8zMl7IHuS_7cYV++c#{qH+s<*bEJ2c_*~CcwjZj_H zpCb~Z`f!?zZZ()X+Z#dRB7w!3XgO!t}28}%p@;j+hgw?Anz;Zz%A_W2y?CPcBsv$b3L>tC78N$_f z%XULVcvSzWkD}#*Om{ZD1Oe)#d-Pj_dq(eVyd0S0q!j|(CR4TQjm>+ERUY!BGD2TF?v97}sTVdOrd?;iHD=LX8r#>1=eK%^C zjHRiOr;Nr?;zUHMV?{mh(QN6dJNEvyU-Bm#35`X-SaaMg+p4{)H3OwiV;WUxG(0&MefRyu<;GnS)bY_@cw5XclacF>Zp%Vi&7{i^UgA<`r+VJK~ ziQEIopyXDY8k7Pkm-)K^}I*3rLn`4$9DZ>|Htd4!q;+h5>8E3t(j1LRV>>j z5G-vvO9?kI)h}Hxv2>6&xnk9@NnUkhVV!wMe%VwAI;=`jCN5|0hH3G@Al5RHVCbJJ z;!@s#1RLwYF(^?C1d;6Qy}TB;q87C02LoRlIh1*`x?!LXpb9`vQ~)2$qz?`EaDWODJdsx>iAF~! z+SpK+7FaziUsQuzQ4{h@ND>2-q=1= zb5bVgpuoHgYSbxi5>L{32*{yxQA5#9W=dm+ClBrauS1`1f;m3tjnEn8{Ht0sq58%_ zlsd>!a$PBMB5d7CRxheaR%;KtS%Y*E-{*)rN(D6FBMDQ>F2h=Lw$qJ7s7_oAVMqC= zs>xBRCqb1>COg92$iwBEeIp5utrYVhW9^#=Y<2= zIZ!y5p|V!$=izYfRM68L7_L&7h&omLfh0*nn7zmXsCpT21!5RsR4Eh!2F8?L7pvN_ znUr@C)TvL7nl{np&^;XP2kbzQi8fH#v7l~5%C?>h>v^B%N~mf*^R>M4Rf_7+O?^56NmJ=;Rnb(~xHHG`5X$VGH0|0nmE1DwiQ@bz zN_#gyo+9hqm^17uW&UzLSLH@&17k|#B6CuQDT}YocB$4xCfgSjgCGs>9Y3_^?)`sX zPee9tYSrd@a}w^nt6I~g`o=+8J0oDK_C$!23w+6>770)kAhg0Bgk*nI6&nQo(s2?K z8VP{uhHFpph=nQf1S_h;F!@&1`+m3idh7zP*p^mf_u>fxnwDTSmGikVMoFw zL@P*Br+7t-5!^iwgk>V>riB_FBU^g-btK77i)UH7e&dKn_6I zznkiLpXQ5D)!O={UGLR1#oKH`vR#|Nu;(I)N|WV*C;xr-t8+tzebYT}y<4y)a8;&G zPNuI1$z`-9Oy?&*m*Kfv%5%~o83mI6y3vX}N2b9^Z&{$c5`Cs7$13|Nk6#O8ygSh; z=&YLTcOO)NbGWoow-l;Y5tE{Vsv25CZHq6e>wTI>8s0m;ci)3YKHcaXlzCCLlCDAj zpE>2niiaP&ZReE}$8$Spa$J2GBodE=D|e7EsLe`kAVWj%6{Vvm&!|9>1S;n_H3bCy&0IYu=hQVU?S>gqT#*cyY@ZMe{QH+Xs}OX=9aSMfvsQOef3P$ zs%omQk)G;UM-s#<1EB7YQY6ZGRAehqOykUVMFx@ZT!trm(MX6YR7OfiG0||g$|~bg zd_}QKIKbngYQ+2`CoAGUkp#&sRm_2iwJ>mqoI45+`o~SIbVU@y(pP-6Cm+(LTqG^3EA4ywDsxJB~rCM zzw-k%)PU+ncGL#>JgQc4vOMs_?K3yX&qVcQkoHB(Nma63?){M+qt7{tEv7`k!_H8; zst`(>NI0dr$G{)z4XP}6Hs5EvqEracPpDNJF(`x)d17F`T9DBs z1t4`{0<69bzXHu&qCPDe+&=Qyq5B3tPoBeh-s)X|;-(!qy^9MMI?DCXGpiVTA46sbaX#gk#|j$ma66EVkqWjt-F6uFi} zNC#9fhRcwnI4(8gG0P2}m)yXn;}u2a$#B=?(V}DRD9FyfMOMqwtLt^YYDwF^vG*T~ znbN_gL2a1jCZ!C~;$bRt?4PfDRX+x4>0BeCN!II89YP}*S8}pHxK)~rr&#^L)!Zvp zBISn2=#HmBPmYl7LeeDcIcU_TpwQ?p{*i} zgMjQK9-LgyvS-Ds>vg|sNvLW)`S~3mn(uKNVX&jBB^*g=)ze?0AmF?)2h@{6q?_18 z6O&pqbN_5Iu#IOaNHiqLQOHuRmM#^itQcG%<%0Iv1spH~BeailM4UWRW-Mykri}_! z1exmOD#fb)>Y6~Z?GTR(&&v=&MLvf?Ly?JAa8_>l&3fIhTGQZ;kw^L;IsWB3FZwmv zB561O%pJS0nmC@@HQ)ECeiEd$s~g-n=*$qgVX1|I798QuXH60z2k%hL(z$U670kc| zj0_QgQUidq`VyMJYJ8A^=g)Gu98djpN*p>1J1 z+yViO^J3O`#tb%AwM<5)LkVKs!;I>#LAp^=w`43y(umryxluYdk=9^!uK=rS)eZH! zXSJr%WI6Zb7k2zvqpxEQlz;YXyRSd;!13?Z>IC)lVhKGl%t?e)Uh9CK90$95CHMTW zBV=RfA~*UE(cSY|v)c19!~mrNO9@nilI^4xp@C0mB<)Kp{njZeZ=&W#>hK#?DYQbV zRxYw<%Rmaz1yBN{iJt(3Aa&M~bqhLRcsiZfI`r_slc&DbctJ4Ztx#*`fVwhBBp#!5 zl31DxoxBpEhLGf-^4UDAPNh8Pv6GZ=7!avO(lY3ZCaR7TR@z(@sC*Eq4u%hnr%j5x zGOpgKwdujRL-0Dwsno9rpHV+V#)?JN&mSM;al8^(9eppY+dZojJ@eJwAM=aesd<{a z^`OGGukC*Gkq3_dsMaT{8-rNwOJ7CMpOGlXI7SA5Y!WoEP4t^U6EuTNTWyQ^werH0 zk}xXn#!RrVU{Kk!WPk_bgq?IFaR$ex9wQDLuhE$#`=eFLyW1#?HqvW`$){-Njx-f`HwyzS2mR_pv7-eNhh8fy6e=op&!<< z0C6_|kU6gFf8h9k)a$;~g+XMhV~sHRPUN9NNnwBy{J|rYejY~Om#vE`0$VaD9I9Yw zxFe&G3YD9nR1iW&!SB&_K?X8Ho~sB=4SSG2Z@{T3=L#7ouuHV*A5tn(Z$rYx%1@B= zkkJ&#wjNLu!_36e2CHx5uh!$f)tk0{Vdn?^qCeK?>v$e2Z2Q`toBHdZR#j7d7^J0} z68&(}Q7nW~(+i+Z9R$G7qDi(ROuaeSZdg+us9dB5CEM8jTg(!Zaak_6lGeE~F4;BX zv8$J(@S1SADxId-2C>OoMaTOd_iHC4N6is^!tWa5h`;Z1O9pBUR|0$K`q$UvzSWyh z)!OmRy&syB1yY;d3WaTV?0IuNB}YK@VUW&cFQPPZ(?*TjoJC^%8Yev3Bz_5G!o)(H zDD6YIR0RDaXwnM?K#dMm3Z#J5DzsO0VS+o==En_&7I&@Egxbi!a6nP?1V!Y@ zUa?(Lp-4(3T0u4?O-q4L@Eo_kSiS~2$Jez>dv`H-!c=LBj=o=k_g8`rlNu= z&tnD)stl!FX~rXLwmp#9a4fCDnssnuEJ1Qyd(PdefQqV!32|&`k*bH|B12M(XsSt( z0B$@clI<(&aqk*IJHNgER=?;^H2OMlDckn-J#XoMu)bEilO0S0cxe^gowrC1e zsR&m45)jJ3oN89Ph$#siE?22J>FlLg3NeiG*#RIVA75QFV!L21UUNZK@`Tova0403nPIbv zC%N$^s!$Q`cP?8NF?=Y_`SDYrC)gQ-->b2cJVv?55pmz603)T{ldIQaH?TtHTS}fa zygsg8^i2(XiEGrUbXS4B?1C$6eeW7gJHNf}gMP`Mm~MTB76bw_*E$bmjyLx|c>ITr z{{2u71`#bC%c+P76bJOWSAuL?#L%7qmEPy^l<9#U2~*gi(yyE*In{QcbU^8Y>R7ym z4RZ3H_@)p_8Fi_TVTC3~$ky;ta%D%^u(!B3w`^Ym8V&PkvXbkClFoKPj}Nj}Y+@MH z$T6^5dQAK33`s)Sy<(L}_O7Y*{c9v;PvlPSyYtZBPIuYoCOUJ9!56lFeb1YlL2?9C zdkGR>`eHJ&P2f+aJHbD`pAk(=RxPz=HqfEuxx#&^Zo|}}qrEXPOpHYhb|yzCjzSH1 z@I9(gIF<<%azvf;tthpHNN`kra+H%HCx#(tlR(}p%L)66SnW$eQ8qDmt0Gt-&!~ca zi6xTOU@u$sJGH)ljiv)XKJuNh!xN88YmVzV!Gj`mG~DJmoode@EvZd7q1EUKnq=Og zr)lL!JA#aI)2A>r&XuB!UMtlZN)rG0Ua|?Ozq#^2p$g_iIiV0$ADra4;-g_6OVflW zhrq}&mJG;r@iZ|bNr&77r^VxU$|GsPF_;S3eH;05hL6%;@8~Yh)$%+p-Bmu=E4G|7 znZ0MDXTG@OeSXP5Gf2P`Ivtv3+Em!_4U!y9p;lE>Z5br;|Fd`Pv2C4I{M`FpJ9g|i zc5KIK*R)9+vR3Wds+~Hz4s~oihANGR#0F&uO&gOyO#Hzg2q6I)V$!BcNGl-NG>O8X zw51ZXAk?uHuI{<# z_dAc@X?07!&}!M143#7Tjjk=8|cQ^;W9kLKpZa1)0&?sm~P zr* zm4u_AzLo>z;EGDdi)Lq0Z%$gj+%opkG z{iyWCBNiv?nHiun6L!&31`=M`lx-(h+r?v-_b-g+25+3oVz)aoTN>i9YM?%y1O5*X zOTxAh{^obJioqvNuo)F8U9k6hC=QW%D!YhL0$R*q=PxJLa(I=1SZzU|nP~xwiXwem z*5Q=`U1A7|I|p{~YRFZnW^W^-6eJwEb>pBFs>!=r#d1~r-V})f{+(pY3t0w8JW7F( z5W@4hJop!{L*h_u!}F52qv@I#uVo+ZANdI|b_1v--44VuhYpN>?aDy?!K!MjIS1hm zP}ar82*M#uc}HP+{-UxPP5hg3QjGKBCIBbdN()$-1n3{U35>tFomE;^9zT$K)&c42 z6A&qzLWe?0AAVfUM>w2wc|r1b3HT-}Vn~bgAbUI)kHw=)VFBbw9|~b(L!~{Ei)m%O zB<4;yOfwB3WlEF|=hj^Z8*K~Komh4<7mFR6_{9xl!mWf3V5Q*$qhFe;B*I$QUuT$IC`S`m_ygo6+Vw#8!$x-D`o`#MEr zL9qr)^l>>{0^;!q#GMV-J4Zx+6|O`OYABqH)7&gZ8B{-M3kpJ?ONq031NfJ8t_BiX z339jxKo@%yWl!Ki$L7zyRMUG|CwAfJrPuS*g)`T#6y934YUse|ll2}s%2rbck-dRF zTx26jV8+gf2U)9<2IWK1QX=kKCYpHdHFmR8#y7zSrcr1Zx@lo)IsTc zK(wi}v;qlri_dLhs@&86J+gAc?pof@da-l+hJSh;sC6@lr4An)+dVaqXb9(knmdRu zyc6d?bX7=;R*Hl6X|XD8XP0c15wMlmId9>-#7bU7GK~a1upE^B?bu_5&c>sdgPf`rNHv0&uZl+^P?A!O}uuS|IK!e`iE83rquG_vNy0nY_PRg4j3B9 zku`$w@`ucxB(xG2fGq15FpI;U);4^wNw`P6<@v+zXaQwezu*C)$+2jR3>=}E#5;5$ z`93RUqpX-!qm#fX~wd0JLfTKUcjlU>t)##Sfw0Zha6f} zsj*=HM2iRLd>rKVFc|0l`JxpXi70Efecj5l%1;O zywi-?AmR?xevl0R<(fLwj9#v!zaG49^LZ=YvSBNni@aL zvZ**LWpyw$%Cf1X6(4!m9Q*fg$g=(}(z$vo)>`;OZqJ+JgO9sK3ZgJsNDtD5nX|Gl zbT1A|<>o}{IdMS@V#!26DoJA6=|j)yXO8YMV}nPGb8o!@u2$XAyQNQd`+OKph@;)n zw{53!{+%~)V`-Bbqs+=q<KeAxJTg5LgIwzOX>Cq%5yjuzz70S4ZwEnG6+hKju&UZ> zrp`fDtbf+I@zbx--0W$VpF3d0&g|!J_wx60c-8$aJ9ZD2iMg_B6B1-={t9YavFr@C zcgXFXn6|YhKQ#37Z$E8DPyXRfu19kFe9rqHe?|^=f6;mGj!*EL@%INie<9hU)W0I?_j}vRzAHfJ>#z#R} z-j9P-*3>X}G=8kO`u3~eHinKbN|=^>VUO(gg{}F?@v?y2wT$#^-NY8A<1`&lEyj79 z)jHM%Hf{OVrv0{qECT>DdT8v4Mvfe1s~rb1^}@{{1}*3lO3%8l@+cv>y`np}kQT#J zsR>|eeqMj?$g}FPUp`G!6N{(4suc}ZNN2>b)b)*Jrjty~6&LNiO=_iCHA!5=(cbIZ z0SuJrp|LN=PcbtXo-`b7&#db*< z+ofNJH->hNzj^tUc!R^LYFknV0br6u6ioBdOcKdBC{D1ZM=oh6|G1N>xu#B)Hj`0< zs)KvZK5i6@TWE`K99!D{A+0z=I(t6L)O + Thomas Vigouroux + Stephan Seitz + Steven Sojka + Santos Gallegos + https://github.com/nvim-treesitter/nvim-treesitter/graphs/contributors + + Type |gO| to see the table of contents. + +============================================================================== +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. + +============================================================================== +QUICK START *nvim-treesitter-quickstart* + +Install the parser for your language + +> + :TSInstall {language} +< + +To get a list of supported languages + +> + :TSInstallInfo +< + +By default, everything is disabled. +To enable supported features, put this in your `init.lua` file: + +> + 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", + + -- A list of parser names, or "all" + ensure_installed = { "c", "lua", "rust" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + auto_install = false, + + -- List of parsers to ignore installing (for "all") + 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. + +============================================================================== +MODULES *nvim-treesitter-modules* + +|nvim-treesitter| provides several functionalities via modules (and submodules), +each module makes use of the query files defined for each 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. + +> + require'nvim-treesitter.configs'.setup { + -- Modules and its options go here + highlight = { enable = true }, + incremental_selection = { enable = true }, + textobjects = { enable = true }, + } +< + +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. + +> + require'nvim-treesitter.configs'.setup { + highlight = { + enable = true, + disable = { "cpp", "lua" }, + }, + } +< + +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: + +> + 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, + }, + } +< + +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. + +External plugins can provide their own modules with their own options, +those can also be configured using the `nvim-treesitter.configs.setup` +function. + +------------------------------------------------------------------------------ +HIGHLIGHT *nvim-treesitter-highlight-mod* + +Consistent syntax highlighting. + +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 based on treesitter for the |=| operator. +NOTE: this is an experimental feature. + +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`, +`@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. + +`@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. + +> + ( + (if_statement) + (ERROR "else") @indent.begin + ) +< +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. + +eg for python: +> + ((if_statement) @indent.begin + (#set! indent.immediate 1)) +< + +Will allow: +> + 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. +> + ((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: + +> + if (a > b and + c < d): + pass + +Is not correct, whereas +> + if (a > b and + c < d): + pass + +Would be correctly indented. This behavior may be chosen using +`indent.avoid_last_matching_next`. Eg. + +> + (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. + +============================================================================== +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/bundle/nvim-treesitter-0.9.1/lockfile.json b/bundle/nvim-treesitter-0.9.1/lockfile.json new file mode 100644 index 000000000..4501e7956 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lockfile.json @@ -0,0 +1,608 @@ +{ + "ada": { + "revision": "ba7951a8f3fb08f9ea923625153e7670c89f30b4" + }, + "agda": { + "revision": "80ea622cf952a0059e168e5c92a798b2f1925652" + }, + "arduino": { + "revision": "d988e6a803203cc2bbfd2a8a84edffc73d2922b4" + }, + "astro": { + "revision": "e122a8fcd07e808a7b873bfadc2667834067daf1" + }, + "awk": { + "revision": "244426241376b08d9531616290d657106ec8f7ff" + }, + "bash": { + "revision": "1b0321ee85701d5036c334a6f04761cdc672e64c" + }, + "bass": { + "revision": "27f110dfe79620993f5493ffa0d0f2fe12d250ed" + }, + "beancount": { + "revision": "358e5ecbb87109eef7fd596ea518a4ff74cb9b31" + }, + "bibtex": { + "revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" + }, + "bicep": { + "revision": "3604d8c961ab129d2bfc6dfca56419c236ccdb83" + }, + "blueprint": { + "revision": "7f1a5df44861291d6951b6b2146a9fef4c226e14" + }, + "c": { + "revision": "93ef1785bbf854cf964e6e53d6e1e6885a4d8ebc" + }, + "c_sharp": { + "revision": "1648e21b4f087963abf0101ee5221bb413107b07" + }, + "cairo": { + "revision": "6216c6ee5e9fc0649c4bd7b1aedd884a55bdd9ef" + }, + "capnp": { + "revision": "dc28c9f4212809eab74d10996086297853eb34e5" + }, + "chatito": { + "revision": "c80c219da2086696202cec8fc2501c02f4819a3f" + }, + "clojure": { + "revision": "6e41628e9d18b19caea1cb1d72aae4ccff5bdfe9" + }, + "cmake": { + "revision": "3dfc596025431b21e839d392c171f6f97c2a4258" + }, + "comment": { + "revision": "c9a7e2df7cac2dfb730f766a4f343308f84ff346" + }, + "commonlisp": { + "revision": "338db38330f0d25cba8e2c6428240ebc5e020264" + }, + "cooklang": { + "revision": "5e113412aadb78955c27010daa4dbe1d202013cf" + }, + "corn": { + "revision": "604d73c38d4c28ca68e9e441ffd405d68cb63051" + }, + "cpon": { + "revision": "f4b3cbc8b0bd4e13035d39940fef09f1392e8739" + }, + "cpp": { + "revision": "77cecd88d28032bf4f54fd4ee68efb53a6c8c9a5" + }, + "css": { + "revision": "5f2c94b897601b4029fedcce7db4c6d76ce8a128" + }, + "cuda": { + "revision": "d4285d0396a409c91bcd5a7fd362cf13cc6f8600" + }, + "cue": { + "revision": "0deecf48944aa54bb73e5383ba8acfbf9f2c44b4" + }, + "d": { + "revision": "c2fbf21bd3aa45495fe13247e040ad5815250032" + }, + "dart": { + "revision": "e398400a0b785af3cf571f5a57eccab242f0cdf9" + }, + "devicetree": { + "revision": "d2cc332aeb814ea40e1e34ed6b9446324b32612a" + }, + "dhall": { + "revision": "affb6ee38d629c9296749767ab832d69bb0d9ea8" + }, + "diff": { + "revision": "c165725c28e69b36c5799ff0e458713a844f1aaf" + }, + "dockerfile": { + "revision": "c0a9d694d9bf8ab79a919f5f9c7bc9c169caf321" + }, + "dot": { + "revision": "9ab85550c896d8b294d9b9ca1e30698736f08cea" + }, + "ebnf": { + "revision": "8e635b0b723c620774dfb8abf382a7f531894b40" + }, + "eex": { + "revision": "f742f2fe327463335e8671a87c0b9b396905d1d1" + }, + "elixir": { + "revision": "a2861e88a730287a60c11ea9299c033c7d076e30" + }, + "elm": { + "revision": "b075803c445191af3cf7dbfdc84efef5f5bbc0f5" + }, + "elsa": { + "revision": "0a66b2b3f3c1915e67ad2ef9f7dbd2a84820d9d7" + }, + "elvish": { + "revision": "5e7210d945425b77f82cbaebc5af4dd3e1ad40f5" + }, + "embedded_template": { + "revision": "203f7bd3c1bbfbd98fc19add4b8fcb213c059205" + }, + "erlang": { + "revision": "7aa24fe8616072fc1a659f72d5b60bd8c01fb5cc" + }, + "fennel": { + "revision": "517195970428aacca60891b050aa53eabf4ba78d" + }, + "firrtl": { + "revision": "2b5adae629c8cba528c7b1e4aa67a8ae28934ea5" + }, + "fish": { + "revision": "f9176908c9eb2e11eb684d79e1d00f3b29bd65c9" + }, + "foam": { + "revision": "09e03445f49290450589c5d293610ab39434e3e4" + }, + "fortran": { + "revision": "6828cf3629addb1706bdbbd33491e95f12b7042c" + }, + "fsh": { + "revision": "fa3347712f7a59ed02ccf508284554689c6cde28" + }, + "func": { + "revision": "0834e35ecf8b23fbf9ad15b088af6a897e19d4a8" + }, + "fusion": { + "revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6" + }, + "gdscript": { + "revision": "03f20b94707a21bed90bb95101684bc4036139ce" + }, + "git_config": { + "revision": "a01b498b25003d97a5f93b0da0e6f28307454347" + }, + "git_rebase": { + "revision": "d8a4207ebbc47bd78bacdf48f883db58283f9fd8" + }, + "gitattributes": { + "revision": "2339ffe87a88d0b7838c015592c8269eb0063140" + }, + "gitcommit": { + "revision": "6856a5fd0ffeff17d83325a8ce4e57811010eff1" + }, + "gitignore": { + "revision": "f4685bf11ac466dd278449bcfe5fd014e94aa504" + }, + "gleam": { + "revision": "8302c98ed78128b22f946fadefaf4af5ba5d5850" + }, + "glimmer": { + "revision": "d3031a8294bf331600d5046b1d14e690a0d8ba0c" + }, + "glsl": { + "revision": "00ffe2099374613d2f313ace4a9dda44370b458b" + }, + "go": { + "revision": "bbaa67a180cfe0c943e50c55130918be8efb20bd" + }, + "godot_resource": { + "revision": "b6ef0768711086a86b3297056f9ffb5cc1d77b4a" + }, + "gomod": { + "revision": "f41a27386f1cfa1271122db5f0ff59b910520007" + }, + "gosum": { + "revision": "e2ac513b2240c7ff1069ae33b2df29ce90777c11" + }, + "gowork": { + "revision": "949a8a470559543857a62102c84700d291fc984c" + }, + "graphql": { + "revision": "5e66e961eee421786bdda8495ed1db045e06b5fe" + }, + "groovy": { + "revision": "76e02db5866dd2b096512103ed4d8f630cc32980" + }, + "hack": { + "revision": "2887d3927c5fadebfd71c604922d0c59748e9901" + }, + "hare": { + "revision": "3d4af179414525a35dd069ba0208c9b71093d8b3" + }, + "haskell": { + "revision": "99706824b92f162d4e0f47c7e930bbccb367276e" + }, + "haskell_persistent": { + "revision": "58a6ccfd56d9f1de8fb9f77e6c42151f8f0d0f3d" + }, + "hcl": { + "revision": "b5539065432c08e4118eb3ee7c94902fdda85708" + }, + "heex": { + "revision": "9bf4ae444a8779839ecbca3b6b896dee426b10ae" + }, + "hjson": { + "revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0" + }, + "hlsl": { + "revision": "95361dde7ad4025fbec5dc4e5cdde0ea8ed64172" + }, + "hocon": { + "revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc" + }, + "hoon": { + "revision": "900a272271cc2fb78f24aa7b5a1e21ed36bb1d39" + }, + "html": { + "revision": "e5d7d7decbbdec5a4c90bbc69436b3828f5646e7" + }, + "htmldjango": { + "revision": "717e83aefd328735beeeb671f3f95b2624e70c57" + }, + "http": { + "revision": "6824a247d1326079aab4fa9f9164e9319678081d" + }, + "hurl": { + "revision": "0eca909c8338364992e04c4862ac6afc5342cbb8" + }, + "ini": { + "revision": "7f11a02fb8891482068e0fe419965d7bade81a68" + }, + "ispc": { + "revision": "cc57a931eb782474324910e19ca253aa0d5fe38a" + }, + "janet_simple": { + "revision": "bd9cbaf1ea8b942dfd58e68df10c9a378ab3d2b6" + }, + "java": { + "revision": "e8d1bc4043c1d2326f7ce3aa7b8833c7b18d0560" + }, + "javascript": { + "revision": "f772967f7b7bc7c28f845be2420a38472b16a8ee" + }, + "jq": { + "revision": "13990f530e8e6709b7978503da9bc8701d366791" + }, + "jsdoc": { + "revision": "189a6a4829beb9cdbe837260653b4a3dfb0cc3db" + }, + "json": { + "revision": "ca3f8919800e3c1ad4508de3bfd7b0b860ce434f" + }, + "json5": { + "revision": "5dd5cdc418d9659682556b6adca2dd9ace0ac6d2" + }, + "jsonc": { + "revision": "02b01653c8a1c198ae7287d566efa86a135b30d5" + }, + "jsonnet": { + "revision": "26d9699842a429731844c93cbcb485519bb2c526" + }, + "julia": { + "revision": "ab0f70c0a919d38b41822305a8ca80e527c94e4f" + }, + "kdl": { + "revision": "e180e05132c4cb229a8ba679b298790ef1eca77c" + }, + "kotlin": { + "revision": "06a2f6e71c7fcac34addcbf2a4667adad1b9c5a7" + }, + "lalrpop": { + "revision": "b7431e4b64183a5d0d094895a4cd5daf51ed3103" + }, + "latex": { + "revision": "2ae2021d7b224fb6aa57b760e0d146059f943bb8" + }, + "ledger": { + "revision": "8a841fb20ce683bfbb3469e6ba67f2851cfdf94a" + }, + "llvm": { + "revision": "d47c95d78ef0e7495a74d214dd6fcddf6e402dfc" + }, + "lua": { + "revision": "7268c1cea5df56ac0c779cd37d6631d4e6f41d4f" + }, + "luadoc": { + "revision": "8981072676ec8bd74def6134be4f883655f7c082" + }, + "luap": { + "revision": "31461ae9bd0866cb5117cfe5de71189854fd0f3e" + }, + "luau": { + "revision": "6953cd4fa5967c9aa3c769b4e4c7e69c904b9fa9" + }, + "m68k": { + "revision": "d097b123f19c6eaba2bf181c05420d88b9fc489d" + }, + "make": { + "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" + }, + "markdown": { + "revision": "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee" + }, + "markdown_inline": { + "revision": "aaf76797aa8ecd9a5e78e0ec3681941de6c945ee" + }, + "matlab": { + "revision": "c8723b33970deda54257e640779714fb181d4d5f" + }, + "menhir": { + "revision": "be8866a6bcc2b563ab0de895af69daeffa88fe70" + }, + "mermaid": { + "revision": "e26a5f8898a8174f02b4cc9a9050eb3ccfb799f3" + }, + "meson": { + "revision": "3d6dfbdb2432603bc84ca7dc009bb39ed9a8a7b1" + }, + "mlir": { + "revision": "e2053f7c8856d91bc36c87604f697784845cee69" + }, + "nickel": { + "revision": "e1d9337864d209898a08c26b8cd4c2dd14c15148" + }, + "ninja": { + "revision": "0a95cfdc0745b6ae82f60d3a339b37f19b7b9267" + }, + "nix": { + "revision": "66e3e9ce9180ae08fc57372061006ef83f0abde7" + }, + "norg": { + "revision": "1a305093569632de50f9a316ff843dcda25b4ef5" + }, + "objc": { + "revision": "97e022ec4a908108283bad23d42eee39ad204db6" + }, + "ocaml": { + "revision": "694c57718fd85d514f8b81176038e7a4cfabcaaf" + }, + "ocaml_interface": { + "revision": "694c57718fd85d514f8b81176038e7a4cfabcaaf" + }, + "ocamllex": { + "revision": "4b9898ccbf198602bb0dec9cd67cc1d2c0a4fad2" + }, + "odin": { + "revision": "d165dbee27617dab2653e38737d96ede1030d14f" + }, + "org": { + "revision": "64cfbc213f5a83da17632c95382a5a0a2f3357c1" + }, + "pascal": { + "revision": "9e995404ddff8319631d72d4b46552e737206912" + }, + "passwd": { + "revision": "20239395eacdc2e0923a7e5683ad3605aee7b716" + }, + "pem": { + "revision": "e01767921df18142055d97407595329d7629e643" + }, + "perl": { + "revision": "79e88f64681660f3961939bf764d8f3b4bbb0d27" + }, + "php": { + "revision": "d76de26b8218df208949f46b31e0c422020eda3a" + }, + "phpdoc": { + "revision": "915a527d5aafa81b31acf67fab31b0ac6b6319c0" + }, + "pioasm": { + "revision": "924aadaf5dea2a6074d72027b064f939acf32e20" + }, + "po": { + "revision": "d6aed225290bc71a15ab6f06305cb11419360c56" + }, + "poe_filter": { + "revision": "d7b43b51f92fb19efe8af45c2246087c611c8f63" + }, + "pony": { + "revision": "16f930b250433cfcd4fb4144df92bb98ad344c20" + }, + "prisma": { + "revision": "eca2596a355b1a9952b4f80f8f9caed300a272b5" + }, + "promql": { + "revision": "ed9a12f6ae4e75d4622adef8fb1b1e4d0ac0a759" + }, + "proto": { + "revision": "e9f6b43f6844bd2189b50a422d4e2094313f6aa3" + }, + "prql": { + "revision": "09e158cd3650581c0af4c49c2e5b10c4834c8646" + }, + "pug": { + "revision": "a7ff31a38908df9b9f34828d21d6ca5e12413e18" + }, + "puppet": { + "revision": "9ce9a5f7d64528572aaa8d59459ba869e634086b" + }, + "python": { + "revision": "5af00f64af6bbf822f208243cce5cf75396fb6f5" + }, + "ql": { + "revision": "bd087020f0d8c183080ca615d38de0ec827aeeaf" + }, + "qmldir": { + "revision": "6b2b5e41734bd6f07ea4c36ac20fb6f14061c841" + }, + "qmljs": { + "revision": "35ead5b9955cdb29bcf709d622fa960ff33992b6" + }, + "query": { + "revision": "3a9808b22742d5bd906ef5d1a562f2f1ae57406d" + }, + "r": { + "revision": "c55f8b4dfaa32c80ddef6c0ac0e79b05cb0cbf57" + }, + "racket": { + "revision": "7dc4fb60390218b09bc351062eeede7dcdbb4d9f" + }, + "rasi": { + "revision": "371dac6bcce0df5566c1cfebde69d90ecbeefd2d" + }, + "regex": { + "revision": "2354482d7e2e8f8ff33c1ef6c8aa5690410fbc96" + }, + "rego": { + "revision": "b2667c975f07b33be3ceb83bea5cfbad88095866" + }, + "requirements": { + "revision": "56ddb4dad2ea0761d20c0995a0de2990caa350b5" + }, + "rnoweb": { + "revision": "502c1126dc6777f09af5bef16e72a42f75bd081e" + }, + "robot": { + "revision": "5e50f2517580290cd1b9689664815e3b09d986b8" + }, + "ron": { + "revision": "ce6086b2c9e8e71065b8129d6c2289c5f66d1879" + }, + "rst": { + "revision": "2ca8c123c82ca41f41b66b5d13d403cff0204b78" + }, + "ruby": { + "revision": "f257f3f57833d584050336921773738a3fd8ca22" + }, + "rust": { + "revision": "0a70e15da977489d954c219af9b50b8a722630ee" + }, + "scala": { + "revision": "f14629b4d53f72356ce8f6d4ac8c54d21b4e74dd" + }, + "scfg": { + "revision": "6deae0cbb458c849a4d1e2985093e9c9c32d7fd0" + }, + "scheme": { + "revision": "af3af6c9356b936f8a515a1e449c32e804c2b1a8" + }, + "scss": { + "revision": "c478c6868648eff49eb04a4df90d703dc45b312a" + }, + "slint": { + "revision": "00c8a2d3645766f68c0d0460086c0a994e5b0d85" + }, + "smali": { + "revision": "72e334b2630f5852825ba5ff9dfd872447175eb5" + }, + "smithy": { + "revision": "cf8c7eb9faf7c7049839585eac19c94af231e6a0" + }, + "solidity": { + "revision": "168020304759ad5d8b4a88a541a699134e3730c5" + }, + "sparql": { + "revision": "05f949d3c1c15e3261473a244d3ce87777374dec" + }, + "sql": { + "revision": "3dfa1b1fafac51e3ffc39064eafb26b5111861a2" + }, + "squirrel": { + "revision": "e8b5835296f931bcaa1477d3c5a68a0c5c2ba034" + }, + "starlark": { + "revision": "504ddd75ecc78fbbce22aa6facd70375d3f8854a" + }, + "supercollider": { + "revision": "3b35bd0fded4423c8fb30e9585c7bacbcd0e8095" + }, + "surface": { + "revision": "f4586b35ac8548667a9aaa4eae44456c1f43d032" + }, + "svelte": { + "revision": "697bb515471871e85ff799ea57a76298a71a9cca" + }, + "swift": { + "revision": "29541ac9bbe2090de75d0b1e70360b85bbda1fef" + }, + "sxhkdrc": { + "revision": "440d5f913d9465c9c776a1bd92334d32febcf065" + }, + "systemtap": { + "revision": "1af543a96d060b1f808982037bfc54cc02218edd" + }, + "t32": { + "revision": "6da5e3cbabd376b566d04282005e52ffe67ef74a" + }, + "tablegen": { + "revision": "300f6a490e71f895e644ed2deec6920860a2e107" + }, + "teal": { + "revision": "33482c92a0dfa694491d34e167a1d2f52b0dccb1" + }, + "terraform": { + "revision": "b5539065432c08e4118eb3ee7c94902fdda85708" + }, + "thrift": { + "revision": "d4deb1bd9e848f2dbe81103a151d99e8546de480" + }, + "tiger": { + "revision": "4a099243ed68a4fc72fdad8ea3ce57ec411ebfe3" + }, + "tlaplus": { + "revision": "7ba226cf85280c7917d082940022006e6a3b7b6f" + }, + "todotxt": { + "revision": "0207f6a4ab6aeafc4b091914d31d8235049a2578" + }, + "toml": { + "revision": "8bd2056818b21860e3d756b5a58c4f6e05fb744e" + }, + "tsx": { + "revision": "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf" + }, + "turtle": { + "revision": "085437f5cb117703b7f520dd92161140a684f092" + }, + "twig": { + "revision": "779ee5ab1e065dcef7f51f253030dc875445b25f" + }, + "typescript": { + "revision": "b1bf4825d9eaa0f3bdeb1e52f099533328acfbdf" + }, + "ungrammar": { + "revision": "debd26fed283d80456ebafa33a06957b0c52e451" + }, + "usd": { + "revision": "718a6b3e939904e0b4fe7cff6742e96af4781f4b" + }, + "uxntal": { + "revision": "4c5ecd6326ebd61f6f9a22a370cbd100e0d601da" + }, + "v": { + "revision": "e14fdf6e661b10edccc744102e4ccf0b187aa8ad" + }, + "vala": { + "revision": "8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b" + }, + "verilog": { + "revision": "902031343056bc0b11f3e47b33f036a9cf59f58d" + }, + "vhs": { + "revision": "fec6e981b7795b68262ddf229d73d2aa03a89b9a" + }, + "vim": { + "revision": "77e9e96c2ae5cff7343ce3dced263483acf95793" + }, + "vimdoc": { + "revision": "c0f85802485afe4d15e65bbf995ae864bb8ed7c4" + }, + "vue": { + "revision": "91fe2754796cd8fba5f229505a23fa08f3546c06" + }, + "wgsl": { + "revision": "40259f3c77ea856841a4e0c4c807705f3e4a2b65" + }, + "wgsl_bevy": { + "revision": "a041228ae64632f59b9bd37346a0dbcb7817f36b" + }, + "wing": { + "revision": "9399564d1e32864c6af2d49c0dcd1f76d54443f2" + }, + "yaml": { + "revision": "0e36bed171768908f331ff7dff9d956bae016efb" + }, + "yang": { + "revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502" + }, + "yuck": { + "revision": "c348825d3f86dec71dee0e1223c6bd73114e3579" + }, + "zig": { + "revision": "0d08703e4c3f426ec61695d7617415fff97029bd" + } +} diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter.lua new file mode 100644 index 000000000..963fe7309 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter.lua @@ -0,0 +1,22 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/caching.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/caching.lua new file mode 100644 index 000000000..7733202ed --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/caching.lua @@ -0,0 +1,71 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/compat.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/compat.lua new file mode 100644 index 000000000..c56e12b18 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/compat.lua @@ -0,0 +1,27 @@ +-- 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 + +return M diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/configs.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/configs.lua new file mode 100644 index 000000000..a3ec30fb2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/configs.lua @@ -0,0 +1,616 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/fold.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/fold.lua new file mode 100644 index 000000000..759599876 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/fold.lua @@ -0,0 +1,123 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/health.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/health.lua new file mode 100644 index 000000000..0edab2a55 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/health.lua @@ -0,0 +1,176 @@ +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 M = {} + +local NVIM_TREESITTER_MINIMUM_ABI = 13 + +local function install_health() + _start "Installation" + + if fn.has "nvim-0.8.3" ~= 1 then + _error "Nvim-treesitter requires Neovim 0.8.3+" + 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" + handle:close() + local version = vim.split(result, "\n")[1] + _ok("`node` found " .. version .. " (only needed for :TSInstallFromGrammar)") + 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.", + }) + else + _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.inspect(install.compilers) + .. " 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( + "`" + .. cc + .. "` executable found. Selected from " + .. vim.inspect(install.compilers) + .. (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.treesitter.language_version + .. " (required >=" + .. NVIM_TREESITTER_MINIMUM_ABI + .. "). Parsers must be compatible with runtime ABI." + ) + else + _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" + .. " 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())) +end + +local function query_status(lang, query_group) + local ok, err = pcall(queries.get_query, lang, query_group) + if not ok then + return "x", err + elseif not err then + return "." + else + return "✓" + end +end + +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 + end + table.insert(parser_installation, vim.fn.trim(out, " ", 2)) + end + 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}]] + table.insert(parser_installation, legend) + -- Finally call the report function + _start(table.concat(parser_installation, "\n")) + if #error_collection > 0 then + _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) + 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(ts.parse_query, lang, fd:read "*a") + if ok then + table.insert(lines, '| [OK]:"' .. file .. '"') + else + table.insert(lines, '| [ERROR]:"' .. file .. '", failed to load: ' .. file_err) + end + fd:close() + end + end + end + _error(table.concat(lines, "\n")) + end + end +end + +return M diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/highlight.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/highlight.lua new file mode 100644 index 000000000..5a3cc2e86 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/highlight.lua @@ -0,0 +1,49 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/incremental_selection.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/incremental_selection.lua new file mode 100644 index 000000000..b0fd7b65f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/incremental_selection.lua @@ -0,0 +1,176 @@ +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 M = {} + +---@type table> +local selections = {} + +function M.init_selection() + local buf = api.nvim_get_current_buf() + 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 "'<") ---@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 root = parsers.get_parser():parse()[1]:root() + local node = root:named_descendant_for_range(csrow - 1, cscol - 1, cerow - 1, cecol) + 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 main tree + -- TODO: we should search on the parent tree of the current node. + local root = parsers.get_parser():parse()[1]:root() + parent = root:named_descendant_for_range(csrow - 1, cscol - 1, cerow - 1, cecol) + if not parent or root == node or parent == node then + ts_utils.update_selection(buf, node) + return + end + 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 + ---@type string, string|function + local mode, rhs + if funcname == "init_selection" then + mode = "n" + ---@type function + rhs = M[funcname] + else + mode = "x" + -- We need to move to command mode to access marks '< (visual area start) and '> (visual area end) which are not + -- properly accessible in visual mode. + rhs = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()", funcname) + end + vim.keymap.set( + mode, + mapping, + rhs, + { buffer = bufnr, silent = true, noremap = true, desc = FUNCTION_DESCRIPTIONS[funcname] } + ) + 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 + if f == "init_selection" then + vim.keymap.del("n", mapping, { buffer = bufnr }) + else + vim.keymap.del("x", mapping, { buffer = bufnr }) + end + end + end +end + +return M diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/indent.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/indent.lua new file mode 100644 index 000000000..40c0cda46 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/indent.lua @@ -0,0 +1,359 @@ +local ts = vim.treesitter +local parsers = require "nvim-treesitter.parsers" + +local M = {} + +M.avoid_force_reparsing = { + yaml = true, +} + +M.comment_parsers = { + comment = true, + jsdoc = true, + phpdoc = true, +} + +local function getline(lnum) + return vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1] or "" +end + +---@param root TSNode +---@param lnum integer +---@param col? integer +---@return TSNode +local function get_first_node_at_line(root, lnum, col) + col = col or vim.fn.indent(lnum) + return root:descendant_for_range(lnum - 1, col, lnum - 1, col) +end + +---@param root TSNode +---@param lnum integer +---@param col? integer +---@return TSNode +local function get_last_node_at_line(root, lnum, col) + col = col or (#getline(lnum) - 1) + return root:descendant_for_range(lnum - 1, col, lnum - 1, col) +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 +---@return TSNode|nil child +---@return boolean|nil is_end +local function find_delimiter(bufnr, node, delimiter) + for child, _ in node:iter_children() do + if child:type() == delimiter then + local linenr = child:start() + 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 .. "]*", "") + return child, #trimmed_after_delim == 0 + 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 + +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"] = {}, + } + + --TODO(clason): remove when dropping Nvim 0.8 compat + local query = (ts.query.get or ts.get_query)(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 + map[query.captures[id]][node:id()] = metadata or {} + end + end + + return map +end, function(bufnr, root, lang) + return tostring(bufnr) .. root:id() .. "_" .. lang +end) + +---@param lnum number (1-indexed) +function M.get_indent(lnum) + local bufnr = vim.api.nvim_get_current_buf() + local parser = parsers.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) + + -- 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() + end + + -- Get language tree with smallest range around node that's not a comment parser + local root, lang_tree ---@type TSNode, LanguageTree + parser:for_each_tree(function(tstree, tree) + if not tstree or M.comment_parsers[tree:lang()] then + return + 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 + root = local_root + lang_tree = tree + end + end + end) + + -- Not likely, but just in case... + if not root then + return 0 + 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 + local prevlnum = vim.fn.prevnonblank(lnum) + local indent = vim.fn.indent(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, indent + #prevline - 1) + 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, indent) + local _, scol, _, _ = node:range() + if first_node:id() ~= node:id() then + -- In case the last captured node is a trailing comment node, re-trim the string + prevline = vim.trim(prevline:sub(1, scol - indent)) + -- Add back indent as indent of prevline was trimmed away + local col = indent + #prevline - 1 + node = get_last_node_at_line(root, prevlnum, col) + end + end + if q["indent.end"][node:id()] then + node = get_first_node_at_line(root, lnum) + end + else + node = get_first_node_at_line(root, lnum) + end + + local indent_size = vim.fn.shiftwidth() + local indent = 0 + local _, _, root_start = root:start() + if root_start ~= 0 then + -- injected tree + indent = vim.fn.indent(root:start() + 1) + end + + -- tracks to ensure multiple indent levels are not applied for same line + local is_processed_by_row = {} + + 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()] + and node:start() < lnum - 1 + and lnum - 1 <= node:end_() + then + return -1 + end + + -- Do not indent if we are inside an @ignore block. + -- 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()] + and node:start() < lnum - 1 + and lnum - 1 <= node:end_() + then + return 0 + end + + local srow, _, erow = node:range() + + local is_processed = false + + 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)) + then + indent = indent - indent_size + is_processed = true + end + + -- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum) + local should_process = not is_processed_by_row[srow] + local is_in_err = false + if should_process then + local parent = node:parent() + is_in_err = parent and parent:has_error() + end + 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"]) + ) + then + indent = indent + indent_size + is_processed = true + end + + 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! "delimeter" "AB")) + -- matching for all X, instead set do + -- (ERROR "X" @aligned_indent (#set! "delimeter" "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()] + 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()] + 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"]) + 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"]) + else + c_delim_node = node + end + + if o_delim_node then + local o_srow, o_scol = o_delim_node:start() + local c_srow = nil + if c_delim_node then + c_srow, _ = c_delim_node:start() + end + if o_is_last_in_line then + -- hanging indent (previous line ended with starting delimiter) + -- should be processed like indent + if should_process then + indent = indent + indent_size * 1 + if c_is_last_in_line then + -- If current line is outside the range of a node marked with `@aligned_indent` + -- Then its indent level shouldn't be affected by `@aligned_indent` node + if c_srow and c_srow < lnum - 1 then + indent = math.max(indent - indent_size, 0) + end + end + end + else + -- aligned indent + if c_is_last_in_line and c_srow and o_srow ~= c_srow and c_srow < lnum - 1 then + -- If current line is outside the range of a node marked with `@aligned_indent` + -- 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_is_absolute = true + end + end + -- deal with the final line + local avoid_last_matching_next = false + if c_srow and c_srow ~= o_srow and c_srow == lnum - 1 then + -- delims end on current line, and are not open and closed same line. + -- 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 + end + if avoid_last_matching_next then + -- last line must be indented more in cases where + -- it would be same indent as next line (we determine this as one + -- width more than the open indent to avoid confusing with any + -- hanging indents) + if indent <= vim.fn.indent(o_srow + 1) + indent_size then + indent = indent + indent_size * 1 + else + indent = indent + end + end + is_processed = true + if indent_is_absolute then + -- don't allow further indenting by parent nodes, this is an absolute position + return indent + end + end + end + + is_processed_by_row[srow] = is_processed_by_row[srow] or is_processed + + node = node:parent() + end + + 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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/info.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/info.lua new file mode 100644 index 000000000..6e94b357d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/info.lua @@ -0,0 +1,190 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/install.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/install.lua new file mode 100644 index 000000000..82d233e20 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/install.lua @@ -0,0 +1,773 @@ +local api = vim.api +local fn = vim.fn +local luv = 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 M = {} + +---@class LockfileInfo +---@field revision string + +---@type table +local lockfile = {} + +M.compilers = { vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" } +M.prefer_git = fn.has "win32" == 1 +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 function reset_progress_counter() + if started_commands ~= finished_commands then + return + end + started_commands = 0 + finished_commands = 0 + failed_commands = 0 + complete_std_output = {} + complete_error_output = {} +end + +local function get_job_status() + return "[nvim-treesitter] [" + .. finished_commands + .. "/" + .. started_commands + .. (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(vim.treesitter.language.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 + end + end + end +end + +---@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] + + if not parser_config then + 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 +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() + 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 +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 +end + +---@param lang string +---@return boolean +local function needs_update(lang) + local revision = get_revision(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 + +---@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 + 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) + 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 = 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)) + 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 + 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 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 path_sep = utils.get_path_sep() + + local project_name = "tree-sitter-" .. lang + local maybe_local_path = vim.fn.expand(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 = utils.join_path(compile_location, repo.location) + end + else + local repo_location = project_name + if repo.location then + repo_location = repo_location .. "/" .. repo.location + end + repo_location = repo_location:gsub("/", path_sep) + compile_location = utils.join_path(cache_folder, repo_location) + end + local parser_lib_name = utils.join_path(install_folder, 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 `" + .. lang + .. "` is marked that it needs " + .. "to be generated from the grammar definitions to be compatible with nvim!" + ) + 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", "--abi", vim.treesitter.language_version } + else + M.ts_generate_args = { "generate" } + end + 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 + end + + local revision = repo.revision + if not revision then + revision = get_revision(lang) + end + + ---@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, { shell.select_install_rm_cmd(cache_folder, project_name) }) + vim.list_extend( + command_list, + shell.select_download_commands(repo, project_name, cache_folder, 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), + 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")) + end, + }, + { -- auto-attach modules after installation + cmd = reattach_if_possible_fn(lang, true), + }, + }) + if not from_local_path then + vim.list_extend(command_list, { shell.select_install_rm_cmd(cache_folder, project_name) }) + end + + if with_sync then + if iter_cmd_sync(command_list) == true then + print("Treesitter parser for " .. lang .. " has been installed") + end + else + M.iter_cmd(command_list, 1, lang, "Treesitter 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 generate_from_grammar boolean +---@field exclude_configured_parsers boolean + +-- Install a parser +---@param options? InstallOptions +---@return function +local function install(options) + options = options or {} + local with_sync = options.with_sync + local ask_reinstall = options.ask_reinstall + local generate_from_grammar = options.generate_from_grammar + local exclude_configured_parsers = options.exclude_configured_parsers + + return function(...) + if fn.executable "git" == 0 then + return api.nvim_err_writeln "Git is required on your system to run this command" + end + + local cache_folder, err = utils.get_cache_dir() + if err then + return api.nvim_err_writeln(err) + end + assert(cache_folder) + + local install_folder + install_folder, err = configs.get_parser_install_dir() + if err then + return api.nvim_err_writeln(err) + end + assert(install_folder) + + local languages ---@type string[] + local ask ---@type boolean|string + if ... == "all" then + languages = parsers.available_parsers() + ask = false + else + languages = vim.tbl_flatten { ... } + ask = ask_reinstall + end + + if exclude_configured_parsers then + languages = utils.difference(languages, configs.get_ignored_parser_installs()) + end + + 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 + end +end + +function M.setup_auto_install() + vim.api.nvim_create_autocmd("FileType", { + pattern = { "*" }, + callback = function() + 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, + }) +end + +function M.update(options) + options = options or {} + return function(...) + M.lockfile = {} + reset_progress_counter() + if ... and ... ~= "all" then + ---@type string[] + local languages = vim.tbl_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 + 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 + 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 = vim.tbl_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 + + 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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/locals.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/locals.lua new file mode 100644 index 000000000..cc69d5621 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/locals.lua @@ -0,0 +1,364 @@ +-- Functions to handle locals +-- Locals are a generalization of definition and scopes +-- its 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 api = vim.api + +local M = {} + +function M.collect_locals(bufnr) + return queries.collect_group_results(bufnr, "locals") +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) +end + +---@param bufnr integer +---@return any +function M.get_locals(bufnr) + return queries.get_matches(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 +---@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() }, "_") +end + +function M.get_definitions(bufnr) + local locals = M.get_locals(bufnr) + + local defs = {} + + for _, loc in ipairs(locals) do + if loc.definition then + table.insert(defs, loc.definition) + end + end + + return defs +end + +function M.get_scopes(bufnr) + local locals = M.get_locals(bufnr) + + local scopes = {} + + for _, loc in ipairs(locals) do + if loc.scope and loc.scope.node then + table.insert(scopes, loc.scope.node) + end + end + + return scopes +end + +function M.get_references(bufnr) + local locals = M.get_locals(bufnr) + + local refs = {} + + for _, loc in ipairs(locals) do + if loc.reference and loc.reference.node then + table.insert(refs, loc.reference.node) + end + end + + return refs +end + +-- Gets a table with all the scopes containing a node +-- The order is from most specific to least (bottom up) +---@param node TSNode +---@param bufnr integer +---@return TSNode[] +function M.get_scope_tree(node, bufnr) + local scopes = {} ---@type TSNode[] + + for scope in M.iter_scope_tree(node, bufnr) do + table.insert(scopes, scope) + end + + return scopes +end + +-- Iterates over a nodes scopes moving from the bottom up +---@param node TSNode +---@param bufnr integer +---@return fun(): TSNode|nil +function M.iter_scope_tree(node, bufnr) + local last_node = node + return function() + if not last_node then + return + end + + local scope = M.containing_scope(last_node, bufnr, false) or ts_utils.get_root_for_node(node) + + last_node = scope:parent() + + return scope + end +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 +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)) + end) + + return result +end + +-- Recurse locals results until a node is found. +-- 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 +---@param accumulator function The accumulator function +---@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 + return + end + + if local_def.node then + 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) + end + 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. +-- +-- This is memoized by buffer tick. If the function is called in succession +-- without the buffer tick changing, then the previous result will be used +-- since the syntax tree hasn't changed. +-- +-- Usage lookups require finding the definition of the node, so `find_definition` +-- 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 +M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr) + local definitions = M.get_definitions(bufnr) + 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) + -- Always use the highest valid scope + local scope = scopes[#scopes] + local node_text = ts.get_node_text(node_entry.node, bufnr) + local id = M.get_definition_id(scope, node_text) + + result[id] = node_entry + end + end + + return result +end) + +-- Gets all the scopes of a definition based on the scope type +-- Scope types can be +-- +-- "parent": Uses the parent of the containing scope, basically, skipping a scope +-- "global": Uses the top most scope +-- "local": Uses the containing scope of the definition. This is the default +-- +---@param node TSNode: the definition node +---@param bufnr integer: the buffer +---@param scope_type string: the scope type +function M.get_definition_scopes(node, bufnr, scope_type) + local scopes = {} + local scope_count = 1 ---@type integer|nil + + -- Definition is valid for the containing scope + -- and the containing scope of that scope + if scope_type == "parent" then + scope_count = 2 + -- Definition is valid in all parent scopes + elseif scope_type == "global" then + scope_count = nil + end + + local i = 0 + for scope in M.iter_scope_tree(node, bufnr) do + table.insert(scopes, scope) + i = i + 1 + + if scope_count and i >= scope_count then + break + end + end + + return scopes +end + +---@param node TSNode +---@param bufnr integer +---@return TSNode node +---@return TSNode scope +---@return string|nil kind +function M.find_definition(node, bufnr) + local def_lookup = M.get_definitions_lookup_table(bufnr) + local node_text = ts.get_node_text(node, bufnr) + + for scope in M.iter_scope_tree(node, bufnr) do + local id = M.get_definition_id(scope, node_text) + + if def_lookup[id] then + local entry = def_lookup[id] + + return entry.node, scope, entry.kind + end + end + + return node, ts_utils.get_root_for_node(node), nil +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 +---@return TSNode[]: a list of nodes +function M.find_usages(node, scope_node, bufnr) + bufnr = bufnr or api.nvim_get_current_buf() + local node_text = ts.get_node_text(node, bufnr) + + if not node_text or #node_text < 1 then + return {} + end + + local scope_node = scope_node or ts_utils.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) + + if kind == nil or def_node == node then + table.insert(usages, match.reference.node) + end + end + end + + return usages +end + +---@param node TSNode +---@param bufnr? integer +---@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 + + local scopes = M.get_scopes(bufnr) + if not node or not scopes then + return + end + + local iter_node = node + + while iter_node ~= nil and not vim.tbl_contains(scopes, iter_node) do + iter_node = iter_node:parent() + end + + return iter_node or (allow_scope and node or nil) +end + +function M.nested_scope(node, cursor_pos) + local bufnr = api.nvim_get_current_buf() + + local scopes = M.get_scopes(bufnr) + if not node or not scopes then + return + end + + local row = cursor_pos.row ---@type integer + local col = cursor_pos.col ---@type integer + local scope = M.containing_scope(node) + + for _, child in ipairs(ts_utils.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 + end + end +end + +function M.next_scope(node) + local bufnr = api.nvim_get_current_buf() + + local scopes = M.get_scopes(bufnr) + if not node or not scopes then + return + end + + local scope = M.containing_scope(node) + + local parent = scope:parent() + if not parent then + return + end + + local is_prev = true + for _, child in ipairs(ts_utils.get_named_children(parent)) do + if child == scope then + is_prev = false + elseif not is_prev and vim.tbl_contains(scopes, child) then + return child + end + end +end + +---@param node TSNode +---@return TSNode|nil +function M.previous_scope(node) + local bufnr = api.nvim_get_current_buf() + + local scopes = M.get_scopes(bufnr) + if not node or not scopes then + return + end + + local scope = M.containing_scope(node) + + local parent = scope:parent() + if not parent then + return + end + + local is_prev = true + local children = ts_utils.get_named_children(parent) + for i = #children, 1, -1 do + if children[i] == scope then + is_prev = false + elseif not is_prev and vim.tbl_contains(scopes, children[i]) then + return children[i] + end + end +end + +return M diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/parsers.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/parsers.lua new file mode 100644 index 000000000..53ccce0df --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/parsers.lua @@ -0,0 +1,1870 @@ +local api = vim.api +local ts = vim.treesitter + +local new_lang_api = ts.language.register ~= nil + +local filetype_to_parsername = {} + +if new_lang_api then + filetype_to_parsername = setmetatable({}, { + __newindex = function(_, k, v) + require("nvim-treesitter.utils").notify( + "filetype_to_parsername is deprecated, please use 'vim.treesitter.language.register'", + vim.log.levels.WARN + ) + ts.language.register(v, k) + end, + }) +end + +local function register_lang(lang, ft) + if new_lang_api then + ts.language.register(lang, ft) + return + end + filetype_to_parsername[ft] = lang +end + +for ft, lang in pairs { + javascriptreact = "javascript", + ecma = "javascript", + jsx = "javascript", + sh = "bash", + PKGBUILD = "bash", + html_tags = "html", + ["typescript.tsx"] = "tsx", + ["html.handlebars"] = "glimmer", + systemverilog = "verilog", + cls = "latex", + sty = "latex", + pandoc = "markdown", + rmd = "markdown", + quarto = "markdown", + dosini = "ini", + confini = "ini", +} do + register_lang(lang, ft) +end + +---@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 +---@field use_makefile boolean|nil +---@field cxx_standard string|nil + +---@class ParserInfo +---@field install_info InstallInfo +---@field filetype string +---@field maintainers string[] +---@field experimental boolean|nil +---@field readme_name string|nil + +---@type ParserInfo[] +local list = setmetatable({}, { + __newindex = function(table, parsername, parserconfig) + rawset(table, parsername, parserconfig) + register_lang(parsername, parserconfig.filetype or parsername) + 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/AusCyberman/tree-sitter-agda", + files = { "src/parser.c", "src/scanner.cc" }, + }, + maintainers = { "@Decodetalkers" }, +} + +list.arduino = { + install_info = { + url = "https://github.com/ObserverOfTime/tree-sitter-arduino", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@ObserverOfTime" }, +} + +list.astro = { + install_info = { + url = "https://github.com/virchau13/tree-sitter-astro", + files = { "src/parser.c", "src/scanner.cc" }, + }, + maintainers = { "@virchau13" }, +} + +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/amaanq/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.cc" }, + }, + 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" }, + }, + maintainers = { "@amaanq" }, +} + +list.blueprint = { + install_info = { + url = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", + files = { "src/parser.c" }, + }, + maintainers = { "@gabmus" }, + experimental = true, +} + +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 = { "@Luxed" }, +} + +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.clojure = { + install_info = { + url = "https://github.com/sogaiu/tree-sitter-clojure", + files = { "src/parser.c" }, + }, + maintainers = { "@sogaiu" }, +} + +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.cc" }, + }, + maintainers = { "@addcninblue" }, +} + +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.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.d = { + install_info = { + url = "https://github.com/CyberShadow/tree-sitter-d", + files = { "src/parser.c", "src/scanner.cc" }, + requires_generate_from_grammar = true, + }, + -- Generating grammar takes ~60s + experimental = true, + maintainers = { "@nawordar" }, +} + +list.dart = { + install_info = { + url = "https://github.com/UserNobody14/tree-sitter-dart", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@akinsho" }, +} + +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.dockerfile = { + install_info = { + url = "https://github.com/camdencheek/tree-sitter-dockerfile", + files = { "src/parser.c" }, + }, + maintainers = { "@camdencheek" }, +} + +list.dot = { + install_info = { + url = "https://github.com/rydesun/tree-sitter-dot", + files = { "src/parser.c" }, + }, + maintainers = { "@rydesun" }, +} + +list.ebnf = { + install_info = { + url = "https://github.com/RubixDev/ebnf", + files = { "src/parser.c" }, + location = "crates/tree-sitter-ebnf", + }, + maintainers = { "@RubixDev" }, + experimental = true, +} + +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.erlang = { + install_info = { + url = "https://github.com/WhatsApp/tree-sitter-erlang", + files = { "src/parser.c" }, + }, + maintainers = { "@filmor" }, +} + +list.fennel = { + install_info = { + url = "https://github.com/travonted/tree-sitter-fennel", + files = { "src/parser.c" }, + }, + maintainers = { "@TravonteD" }, +} + +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.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.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.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.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/alexlafroscia/tree-sitter-glimmer", + files = { "src/parser.c", "src/scanner.c" }, + }, + filetype = "handlebars", + maintainers = { "@NullVoxPopuli" }, + readme_name = "Glimmer and Ember", +} + +list.glsl = { + install_info = { + url = "https://github.com/theHamsta/tree-sitter-glsl", + files = { "src/parser.c" }, + generate_requires_npm = true, + }, + maintainers = { "@theHamsta" }, +} + +list.go = { + install_info = { + url = "https://github.com/tree-sitter/tree-sitter-go", + files = { "src/parser.c" }, + }, + maintainers = { "@theHamsta", "@WinWisely268" }, +} + +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.groovy = { + install_info = { + url = "https://github.com/Decodetalkers/tree-sitter-groovy", + files = { "src/parser.c" }, + branch = "gh-pages", + }, + maintainers = { "@Decodetalkers" }, +} + +list.graphql = { + install_info = { + url = "https://github.com/bkegley/tree-sitter-graphql", + files = { "src/parser.c" }, + }, + maintainers = { "@bkegley" }, +} + +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" }, + }, +} + +list.haskell_persistent = { + install_info = { + url = "https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent", + files = { "src/parser.c", "src/scanner.cc" }, + }, + 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.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" }, + generate_requires_npm = true, + }, + maintainers = { "@amaanq" }, +} + +list.hurl = { + install_info = { + url = "https://github.com/pfeiferj/tree-sitter-hurl", + files = { "src/parser.c" }, + }, + maintainers = { "@pfeiferj" }, +} + +list.ini = { + install_info = { + url = "https://github.com/justinmk/tree-sitter-ini", + files = { "src/parser.c" }, + }, + maintainers = { "@theHamsta" }, + experimental = true, +} + +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.javascript = { + install_info = { + url = "https://github.com/tree-sitter/tree-sitter-javascript", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@steelsojka" }, +} + +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" }, + }, + 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 = { "@theHamsta" }, +} + +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.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" }, + }, + filetype = "tex", + maintainers = { "@theHamsta", "@clason" }, +} + +list.ledger = { + install_info = { + url = "https://github.com/cbarrete/tree-sitter-ledger", + files = { "src/parser.c" }, + }, + maintainers = { "@cbarrete" }, +} + +list.llvm = { + install_info = { + url = "https://github.com/benwilliamgraham/tree-sitter-llvm", + files = { "src/parser.c" }, + }, + maintainers = { "@benwilliamgraham" }, +} + +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.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.nickel = { + install_info = { + url = "https://github.com/nickel-lang/tree-sitter-nickel", + files = { "src/parser.c", "src/scanner.cc" }, + }, +} + +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.objc = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-objc", + files = { "src/parser.c" }, + }, + maintainers = { "@amaanq" }, +} + +list.ocaml = { + install_info = { + url = "https://github.com/tree-sitter/tree-sitter-ocaml", + files = { "src/parser.c", "src/scanner.c" }, + location = "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 = "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.org = { + install_info = { + url = "https://github.com/milisims/tree-sitter-org", + files = { "src/parser.c", "src/scanner.c" }, + }, +} + +list.pascal = { + install_info = { + url = "https://github.com/Isopod/tree-sitter-pascal.git", + 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/ganezdragon/tree-sitter-perl", + files = { "src/parser.c", "src/scanner.cc" }, + }, + maintainers = { "@lcrownover" }, +} + +list.php = { + install_info = { + url = "https://github.com/tree-sitter/tree-sitter-php", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@tk-shirasaka" }, +} + +-- 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.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.prisma = { + install_info = { + url = "https://github.com/victorhqc/tree-sitter-prisma", + files = { "src/parser.c" }, + }, + maintainers = { "@elianiva" }, +} + +list.promql = { + install_info = { + url = "https://github.com/MichaHoffmann/tree-sitter-promql", + files = { "src/parser.c" }, + experimental = true, + }, + maintainers = { "@MichaHoffmann" }, +} + +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.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.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 = { "@echasnovski" }, +} + +list.racket = { + install_info = { + url = "https://github.com/6cdh/tree-sitter-racket", + files = { "src/parser.c", "src/scanner.c" }, + }, +} + +list.rasi = { + install_info = { + url = "https://github.com/Fymyte/tree-sitter-rasi", + files = { "src/parser.c" }, + }, + maintainers = { "@Fymyte" }, +} + +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.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 = { "@ema2159" }, + experimental = true, +} + +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.cc" }, + }, + maintainers = { "@TravonteD" }, +} + +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://git.sr.ht/~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.slint = { + install_info = { + url = "https://github.com/jrmoulton/tree-sitter-slint", + files = { "src/parser.c" }, + }, + maintainers = { "@jrmoulton" }, + experimental = true, +} + +list.smali = { + install_info = { + url = "https://git.sr.ht/~yotam/tree-sitter-smali", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@amaanq" }, +} + +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.sparql = { + install_info = { + url = "https://github.com/BonaBeavis/tree-sitter-sparql", + files = { "src/parser.c" }, + }, + maintainers = { "@BonaBeavis" }, +} + +list.sql = { + install_info = { + url = "https://github.com/derekstride/tree-sitter-sql", + files = { "src/parser.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.starlark = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-starlark", + files = { "src/parser.c", "src/scanner.c" }, + }, + filetype = "bzl", + maintainers = { "@amaanq" }, +} + +list.supercollider = { + install_info = { + url = "https://github.com/madskjeldgaard/tree-sitter-supercollider", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@madskjeldgaard" }, +} + +list.surface = { + install_info = { + url = "https://github.com/connorlay/tree-sitter-surface", + files = { "src/parser.c" }, + }, + filetype = "sface", + maintainers = { "@connorlay" }, +} + +list.svelte = { + install_info = { + url = "https://github.com/Himujjal/tree-sitter-svelte", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@elianiva" }, +} + +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, + }, + maintainers = { "@alex-pinkus" }, +} + +list.sxhkdrc = { + install_info = { + url = "https://github.com/RaafatTurki/tree-sitter-sxhkdrc", + files = { "src/parser.c" }, + }, + maintainers = { "@RaafatTurki" }, +} + +list.systemtap = { + install_info = { + url = "https://github.com/ok-ryoko/tree-sitter-systemtap", + files = { "src/parser.c" }, + }, + maintainers = { "@ok-ryoko" }, +} + +list.t32 = { + install_info = { + url = "https://gitlab.com/xasc/tree-sitter-t32.git", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@xasc" }, +} + +list.tablegen = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-tablegen", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@amaanq" }, +} + +list.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" }, +} + +list.terraform = { + install_info = { + url = "https://github.com/MichaHoffmann/tree-sitter-hcl", + files = { "src/parser.c", "src/scanner.c" }, + location = "dialects/terraform", + }, + maintainers = { "@MichaHoffmann" }, +} + +list.thrift = { + install_info = { + url = "https://github.com/duskmoon314/tree-sitter-thrift", + files = { "src/parser.c" }, + }, + maintainers = { "@amaanq", "@duskmoon314" }, +} + +list.tiger = { + install_info = { + url = "https://github.com/ambroisie/tree-sitter-tiger", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@ambroisie" }, +} + +list.tlaplus = { + install_info = { + url = "https://github.com/tlaplus-community/tree-sitter-tlaplus", + files = { "src/parser.c", "src/scanner.cc" }, + }, + filetype = "tla", + maintainers = { "@ahelwer", "@susliko" }, +} + +list.todotxt = { + install_info = { + url = "https://github.com/arnarg/tree-sitter-todotxt.git", + files = { "src/parser.c" }, + }, + maintainers = { "@arnarg" }, + experimental = true, +} + +list.toml = { + install_info = { + url = "https://github.com/ikatyang/tree-sitter-toml", + files = { "src/parser.c", "src/scanner.c" }, + generate_requires_npm = true, + }, + maintainers = { "@tk-shirasaka" }, +} + +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, + }, + filetype = "typescriptreact", + maintainers = { "@steelsojka" }, +} + +list.turtle = { + install_info = { + url = "https://github.com/BonaBeavis/tree-sitter-turtle", + files = { "src/parser.c" }, + }, + maintainers = { "@BonaBeavis" }, +} + +list.twig = { + install_info = { + url = "https://github.com/gbprod/tree-sitter-twig", + files = { "src/parser.c" }, + }, + 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, + }, + maintainers = { "@steelsojka" }, +} + +list.ungrammar = { + install_info = { + url = "https://github.com/Philipp-M/tree-sitter-ungrammar", + files = { "src/parser.c" }, + }, + maintainers = { "@Philipp-M", "@amaanq" }, +} + +list.usd = { + install_info = { + url = "https://github.com/ColinKennedy/tree-sitter-usd", + files = { "src/parser.c" }, + }, + maintainers = { "@ColinKennedy" }, +} + +list.uxntal = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-uxntal", + files = { "src/parser.c", "src/scanner.c" }, + }, + filetype = "tal", + maintainers = { "@amaanq" }, + readme_name = "uxn tal", +} + +list.v = { + install_info = { + url = "https://github.com/v-analyzer/v-analyzer", + files = { "src/parser.c", "src/scanner.c" }, + location = "tree_sitter_v", + }, + filetype = "vlang", + maintainers = { "@kkharji", "@amaanq" }, +} + +list.vala = { + install_info = { + url = "https://github.com/vala-lang/tree-sitter-vala", + files = { "src/parser.c" }, + }, + maintainers = { "@Prince781" }, +} + +list.verilog = { + install_info = { + url = "https://github.com/tree-sitter/tree-sitter-verilog", + files = { "src/parser.c" }, + }, + maintainers = { "@zegervdv" }, +} + +list.vhs = { + install_info = { + url = "https://github.com/charmbracelet/tree-sitter-vhs", + files = { "src/parser.c" }, + }, + filetype = "tape", + maintainers = { "@caarlos0" }, +} + +list.vim = { + install_info = { + url = "https://github.com/neovim/tree-sitter-vim", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@clason" }, +} + +list.vimdoc = { + install_info = { + url = "https://github.com/neovim/tree-sitter-vimdoc", + files = { "src/parser.c" }, + }, + filetype = "help", + maintainers = { "@clason" }, +} + +list.vue = { + install_info = { + url = "https://github.com/ikatyang/tree-sitter-vue", + files = { "src/parser.c", "src/scanner.cc" }, + }, + maintainers = { "@WhyNotHugo" }, +} + +list.wgsl = { + install_info = { + url = "https://github.com/szebniok/tree-sitter-wgsl", + files = { "src/parser.c", "src/scanner.c" }, + }, + 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, + }, + maintainers = { "@theHamsta" }, +} + +list.wing = { + install_info = { + url = "https://github.com/winglang/wing", + files = { "src/parser.c", "src/scanner.c" }, + location = "libs/tree-sitter-wing", + requires_generate_from_grammar = true, + }, + maintainers = { "@gshpychka" }, + experimental = true, +} + +list.yaml = { + install_info = { + url = "https://github.com/ikatyang/tree-sitter-yaml", + files = { "src/parser.c", "src/scanner.cc" }, + }, + maintainers = { "@stsewd" }, +} + +list.yang = { + install_info = { + url = "https://github.com/Hubro/tree-sitter-yang", + files = { "src/parser.c" }, + }, + maintainers = { "@Hubro" }, +} + +list.yuck = { + install_info = { + url = "https://github.com/Philipp-M/tree-sitter-yuck", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@Philipp-M", "@amaanq" }, +} + +list.zig = { + install_info = { + url = "https://github.com/maxxnino/tree-sitter-zig", + files = { "src/parser.c" }, + }, + maintainers = { "@maxxnino" }, +} + +local M = { + list = list, + filetype_to_parsername = filetype_to_parsername, +} + +local function get_lang(ft) + if new_lang_api then + return ts.language.get_lang(ft) + end + return filetype_to_parsername[ft] +end + +function M.ft_to_lang(ft) + local result = get_lang(ft) + if result then + return result + else + ft = vim.split(ft, ".", { plain = true })[1] + return get_lang(ft) or ft + end +end + +-- Get a list of all available parsers +---@return string[] +function M.available_parsers() + local parsers = vim.tbl_keys(M.list) + 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 + 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 + 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")) +end + +return M diff --git a/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query.lua new file mode 100644 index 000000000..51310545b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query.lua @@ -0,0 +1,453 @@ +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 +---@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 buf_lang = parsers.get_buf_lang(bufnr) + + if not buf_lang then + return + end + + local parser = parsers.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 = M.get_query(root_lang, query_name) + if not query then + return + end + + return query, + { + root = root, + source = bufnr, + start = range[1], + -- The end row is exclusive so we need to add 1 to it. + stop = range[3] + 1, + } +end + +-- Given a path (i.e. a List(String)) this functions inserts value at path +---@param object any +---@param path string[] +---@param value any +function M.insert_to_path(object, path, value) + local curr_obj = object + + for index = 1, (#path - 1) do + if curr_obj[path[index]] == nil then + curr_obj[path[index]] = {} + end + + curr_obj = curr_obj[path[index]] + end + + curr_obj[path[#path]] = value +end + +---@param query Query +---@param bufnr integer +---@param start_row integer +---@param end_row integer +function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) + -- A function that splits a string on '.' + ---@param to_split string + ---@return string[] + local function split(to_split) + local t = {} + for str in string.gmatch(to_split, "([^.]+)") do + table.insert(t, str) + end + + return t + end + + local matches = query:iter_matches(qnode, bufnr, start_row, end_row) + + local function iterator() + local pattern, match, metadata = matches() + if pattern ~= nil then + local prepared_match = {} + + -- Extract capture names from each match + for id, node in pairs(match) do + local name = query.captures[id] -- name of the capture in the query + if name ~= nil then + local path = split(name .. ".node") + M.insert_to_path(prepared_match, path, node) + local metadata_path = split(name .. ".metadata") + M.insert_to_path(prepared_match, metadata_path, metadata[id]) + end + end + + -- Add some predicates for testing + ---@type string[][] ( TODO: make pred type so this can be pred[]) + local preds = query.info.patterns[pattern] + if preds then + for _, pred in pairs(preds) do + -- functions + if pred[1] == "set!" and type(pred[2]) == "string" then + M.insert_to_path(prepared_match, split(pred[2]), pred[3]) + end + 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 + + return prepared_match + end + end + 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 +---@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 + +---@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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query_predicates.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query_predicates.lua new file mode 100644 index 000000000..ff0e9999a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/query_predicates.lua @@ -0,0 +1,281 @@ +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", +} + +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, true) + +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@return boolean|nil +local function has_ancestor(match, _pattern, _bufnr, pred) + if not valid_args(pred[1], pred, 2) then + return + end + + local node = match[pred[2]] + local ancestor_types = { unpack(pred, 3) } + if not node then + return true + end + + local just_direct_parent = pred[1]:find("has-parent", 1, true) + + node = node:parent() + while node do + if vim.tbl_contains(ancestor_types, node:type()) then + return true + end + if just_direct_parent then + node = nil + else + node = node:parent() + end + end + return false +end + +query.add_predicate("has-ancestor?", has_ancestor, true) + +query.add_predicate("has-parent?", has_ancestor, true) + +---@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, true) + +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_predicate("has-type?", 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, true) + +---@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.language = configured + else + local parts = vim.split(type_attr_value, "/", {}) + metadata.language = parts[#parts] + end +end, true) + +---@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) + metadata.language = get_parser_from_markdown_info_string(injection_alias) +end, true) + +-- Just avoid some annoying warnings for this directive +query.add_directive("make-range!", function() end, true) + +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@param metadata table +---@return boolean|nil +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) + +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@param metadata table +---@return boolean|nil +query.add_directive("exclude_children!", function(match, _pattern, _bufnr, pred, metadata) + local capture_id = pred[2] + local node = match[capture_id] + local start_row, start_col, end_row, end_col = node:range() + local ranges = {} + for i = 0, node:named_child_count() - 1 do + local child = node:named_child(i) ---@type TSNode + local child_start_row, child_start_col, child_end_row, child_end_col = child:range() + if child_start_row > start_row or child_start_col > start_col then + table.insert(ranges, { + start_row, + start_col, + child_start_row, + child_start_col, + }) + end + start_row = child_end_row + start_col = child_end_col + end + if end_row > start_row or end_col > start_col then + table.insert(ranges, { start_row, start_col, end_row, end_col }) + end + metadata.content = ranges +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 +query.add_directive("trim!", function(match, _, bufnr, pred, metadata) + for _, id in ipairs { select(2, unpack(pred)) } do + local node = match[id] + 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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/shell_command_selectors.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/shell_command_selectors.lua new file mode 100644 index 000000000..0479956f1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/shell_command_selectors.lua @@ -0,0 +1,335 @@ +local fn = vim.fn +local utils = require "nvim-treesitter.utils" + +-- 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", + "/LD", + } + elseif string.match(compiler, "zig$") or string.match(compiler, "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 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 = 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.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", + "-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" + + return { + { + cmd = "git", + info = "Downloading " .. project_name .. "...", + err = clone_error, + opts = { + args = { + "clone", + repo.url, + project_name, + }, + 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 & 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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/statusline.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/statusline.lua new file mode 100644 index 000000000..68ba41aca --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/statusline.lua @@ -0,0 +1,53 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/ts_utils.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/ts_utils.lua new file mode 100644 index 000000000..b3f468934 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/ts_utils.lua @@ -0,0 +1,467 @@ +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.query.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.query.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 ipairs(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 } + + for _, tree in ipairs(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 + + -- 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") } + 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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/tsrange.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/tsrange.lua new file mode 100644 index 000000000..d41585c60 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/tsrange.lua @@ -0,0 +1,154 @@ +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/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/utils.lua b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/utils.lua new file mode 100644 index 000000000..4aa8e5984 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/lua/nvim-treesitter/utils.lua @@ -0,0 +1,237 @@ +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 {})) +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 = vim.tbl_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 +end + +return M diff --git a/bundle/nvim-treesitter-0.9.1/nvim-treesitter-scm-1.rockspec b/bundle/nvim-treesitter-0.9.1/nvim-treesitter-scm-1.rockspec new file mode 100644 index 000000000..a901c5b12 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/nvim-treesitter-scm-1.rockspec @@ -0,0 +1,36 @@ +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' + } +} diff --git a/bundle/nvim-treesitter-0.9.1/parser-info/.gitignore b/bundle/nvim-treesitter-0.9.1/parser-info/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/parser-info/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bundle/nvim-treesitter-0.9.1/parser/.gitignore b/bundle/nvim-treesitter-0.9.1/parser/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/parser/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bundle/nvim-treesitter-0.9.1/plugin/nvim-treesitter.lua b/bundle/nvim-treesitter-0.9.1/plugin/nvim-treesitter.lua new file mode 100644 index 000000000..4ea3925fd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/plugin/nvim-treesitter.lua @@ -0,0 +1,34 @@ +-- 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", {}) + +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", +}) diff --git a/bundle/nvim-treesitter-0.9.1/queries/ada/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/ada/folds.scm new file mode 100644 index 000000000..b8b5735bb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ada/folds.scm @@ -0,0 +1,14 @@ +;; Support for folding in Ada +;; za toggles folding a package, subprogram, if statement or loop + +[ + (package_declaration) + (generic_package_declaration) + (package_body) + (subprogram_body) + (block_statement) + (if_statement) + (loop_statement) + (gnatprep_declarative_if_statement) + (gnatprep_if_statement) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/ada/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/ada/highlights.scm new file mode 100644 index 000000000..a350d31d9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ada/highlights.scm @@ -0,0 +1,196 @@ +;; highlight queries. +;; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries +;; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations +;; for a list of recommended @ tags, though not all of them have matching +;; highlights in neovim. + +[ + "abort" + "abs" + "abstract" + "accept" + "access" + "all" + "array" + "at" + "begin" + "declare" + "delay" + "delta" + "digits" + "do" + "end" + "entry" + "exit" + "generic" + "interface" + "is" + "limited" + "null" + "of" + "others" + "out" + "pragma" + "private" + "range" + "synchronized" + "tagged" + "task" + "terminate" + "until" + "when" +] @keyword +[ + "aliased" + "constant" + "renames" +] @storageclass +[ + "mod" + "new" + "protected" + "record" + "subtype" + "type" +] @keyword.type +[ + "with" + "use" +] @include +[ + "body" + "function" + "overriding" + "procedure" + "package" + "separate" +] @keyword.function +[ + "and" + "in" + "not" + "or" + "xor" +] @keyword.operator +[ + "while" + "loop" + "for" + "parallel" + "reverse" + "some" +] @repeat +[ + "return" +] @keyword.return +[ + "case" + "if" + "else" + "then" + "elsif" + "select" +] @conditional +[ + "exception" + "raise" +] @exception +(comment) @comment @spell +(string_literal) @string +(character_literal) @string +(numeric_literal) @number + +;; Highlight the name of subprograms +(procedure_specification name: (_) @function) +(function_specification name: (_) @function) +(package_declaration name: (_) @function) +(package_body name: (_) @function) +(generic_instantiation name: (_) @function) +(entry_declaration . (identifier) @function) + +;; Some keywords should take different categories depending on the context +(use_clause "use" @include "type" @include) +(with_clause "private" @include) +(with_clause "limited" @include) +(use_clause (_) @namespace) +(with_clause (_) @namespace) + +(loop_statement "end" @keyword.repeat) +(if_statement "end" @conditional) +(loop_parameter_specification "in" @keyword.repeat) +(loop_parameter_specification "in" @keyword.repeat) +(iterator_specification ["in" "of"] @keyword.repeat) +(range_attribute_designator "range" @keyword.repeat) + +(raise_statement "with" @exception) + +(gnatprep_declarative_if_statement) @preproc +(gnatprep_if_statement) @preproc +(gnatprep_identifier) @preproc + +(subprogram_declaration "is" @keyword.function "abstract" @keyword.function) +(aspect_specification "with" @keyword.function) + +(full_type_declaration "is" @keyword.type) +(subtype_declaration "is" @keyword.type) +(record_definition "end" @keyword.type) +(full_type_declaration (_ "access" @keyword.type)) +(array_type_definition "array" @keyword.type "of" @keyword.type) +(access_to_object_definition "access" @keyword.type) +(access_to_object_definition "access" @keyword.type + [ + (general_access_modifier "constant" @keyword.type) + (general_access_modifier "all" @keyword.type) + ] +) +(range_constraint "range" @keyword.type) +(signed_integer_type_definition "range" @keyword.type) +(index_subtype_definition "range" @keyword.type) +(record_type_definition "abstract" @keyword.type) +(record_type_definition "tagged" @keyword.type) +(record_type_definition "limited" @keyword.type) +(record_type_definition (record_definition "null" @keyword.type)) +(private_type_declaration "is" @keyword.type "private" @keyword.type) +(private_type_declaration "tagged" @keyword.type) +(private_type_declaration "limited" @keyword.type) +(task_type_declaration "task" @keyword.type "is" @keyword.type) + +;; Gray the body of expression functions +(expression_function_declaration + (function_specification) + "is" + (_) @attribute +) +(subprogram_declaration (aspect_specification) @attribute) + +;; Highlight full subprogram specifications +;(subprogram_body +; [ +; (procedure_specification) +; (function_specification) +; ] @function.spec +;) + +((comment) @comment.documentation + . [ + (entry_declaration) + (subprogram_declaration) + (parameter_specification) + ]) + +(compilation_unit + . (comment) @comment.documentation) + +(component_list + (component_declaration) + . (comment) @comment.documentation) + +(enumeration_type_definition + (identifier) + . (comment) @comment.documentation) + +;; Highlight errors in red. This is not very useful in practice, as text will +;; be highlighted as user types, and the error could be elsewhere in the code. +;; This also requires defining :hi @error guifg=Red for instance. +(ERROR) @error + diff --git a/bundle/nvim-treesitter-0.9.1/queries/ada/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/ada/locals.scm new file mode 100644 index 000000000..b36d3718c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ada/locals.scm @@ -0,0 +1,33 @@ +;; Better highlighting by referencing to the definition, for variable +;; references. However, this is not yet supported by neovim +;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables + +(compilation) @scope +(package_declaration) @scope +(package_body) @scope +(subprogram_declaration) @scope +(subprogram_body) @scope +(block_statement) @scope + +(with_clause (identifier) @definition.import) +(procedure_specification name: (_) @definition.function) +(function_specification name: (_) @definition.function) +(package_declaration name: (_) @definition.var) +(package_body name: (_) @definition.var) +(generic_instantiation . name: (_) @definition.var) +(component_declaration . (identifier) @definition.var) +(exception_declaration . (identifier) @definition.var) +(formal_object_declaration . (identifier) @definition.var) +(object_declaration . (identifier) @definition.var) +(parameter_specification . (identifier) @definition.var) +(full_type_declaration . (identifier) @definition.type) +(private_type_declaration . (identifier) @definition.type) +(private_extension_declaration . (identifier) @definition.type) +(incomplete_type_declaration . (identifier) @definition.type) +(protected_type_declaration . (identifier) @definition.type) +(formal_complete_type_declaration . (identifier) @definition.type) +(formal_incomplete_type_declaration . (identifier) @definition.type) +(task_type_declaration . (identifier) @definition.type) +(subtype_declaration . (identifier) @definition.type) + +(identifier) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/agda/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/agda/folds.scm new file mode 100644 index 000000000..e3258efb9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/agda/folds.scm @@ -0,0 +1,4 @@ +[ + (record) + (module) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/agda/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/agda/highlights.scm new file mode 100644 index 000000000..ed208f1b6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/agda/highlights.scm @@ -0,0 +1,82 @@ + +;; Constants +(integer) @number + +;; Variables and Symbols + +(typed_binding (atom (qid) @variable)) +(untyped_binding) @variable +(typed_binding (expr) @type) + +(id) @function +(bid) @function + +(function_name (atom (qid) @function)) +(field_name) @function + + +[(data_name) (record_name)] @constructor + +; Set +(SetN) @type.builtin + +(expr . (atom) @function) + +((atom) @boolean + (#any-of? @boolean "true" "false" "True" "False")) + +;; Imports and Module Declarations + +"import" @include + +(module_name) @namespace + +;; Pragmas and comments + +(pragma) @preproc + +(comment) @comment + +;; Keywords +[ + "where" + "data" + "rewrite" + "postulate" + "public" + "private" + "tactic" + "Prop" + "quote" + "renaming" + "open" + "in" + "hiding" + "constructor" + "abstract" + "let" + "field" + "mutual" + "module" + "infix" + "infixl" + "infixr" + "record" + (ARROW) +] +@keyword + +;;;(expr +;;; f_name: (atom) @function) +;; Brackets + +[ + "(" + ")" + "{" + "}"] +@punctuation.bracket + +[ + "=" +] @operator diff --git a/bundle/nvim-treesitter-0.9.1/queries/arduino/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/arduino/folds.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/arduino/folds.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/arduino/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/arduino/highlights.scm new file mode 100644 index 000000000..a4e74ae89 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/arduino/highlights.scm @@ -0,0 +1,111 @@ +; inherits: cpp + +((identifier) @function.builtin + (#any-of? @function.builtin + ; Digital I/O + "digitalRead" + "digitalWrite" + "pinMode" + ; Analog I/O + "analogRead" + "analogReference" + "analogWrite" + ; Zero, Due & MKR Family + "analogReadResolution" + "analogWriteResolution" + ; Advanced I/O + "noTone" + "pulseIn" + "pulseInLong" + "shiftIn" + "shiftOut" + "tone" + ; Time + "delay" + "delayMicroseconds" + "micros" + "millis" + ; Math + "abs" + "constrain" + "map" + "max" + "min" + "pow" + "sq" + "sqrt" + ; Trigonometry + "cos" + "sin" + "tan" + ; Characters + "isAlpha" + "isAlphaNumeric" + "isAscii" + "isControl" + "isDigit" + "isGraph" + "isHexadecimalDigit" + "isLowerCase" + "isPrintable" + "isPunct" + "isSpace" + "isUpperCase" + "isWhitespace" + ; Random Numbers + "random" + "randomSeed" + ; Bits and Bytes + "bit" + "bitClear" + "bitRead" + "bitSet" + "bitWrite" + "highByte" + "lowByte" + ; External Interrupts + "attachInterrupt" + "detachInterrupt" + ; Interrupts + "interrupts" + "noInterrupts" + )) + +((identifier) @type.builtin + (#any-of? @type.builtin + "Serial" + "SPI" + "Stream" + "Wire" + "Keyboard" + "Mouse" + "String" + )) + +((identifier) @constant.builtin + (#any-of? @constant.builtin + "HIGH" + "LOW" + "INPUT" + "OUTPUT" + "INPUT_PULLUP" + "LED_BUILTIN" + )) + +(function_definition + (function_declarator + declarator: (identifier) @function.builtin) + (#any-of? @function.builtin "loop" "setup")) + +(call_expression + function: (primitive_type) @function.builtin) + +(call_expression + function: (identifier) @constructor + (#any-of? @constructor "SPISettings" "String")) + +(declaration + (type_identifier) @type.builtin + (function_declarator + declarator: (identifier) @constructor) + (#eq? @type.builtin "SPISettings")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/arduino/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/arduino/indents.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/arduino/indents.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/arduino/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/arduino/injections.scm new file mode 100644 index 000000000..240162b9b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/arduino/injections.scm @@ -0,0 +1,6 @@ +((preproc_def (preproc_arg) @arduino) + (#lua-match? @arduino "\n")) +(preproc_function_def (preproc_arg) @arduino) +(preproc_call (preproc_arg) @arduino) + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/arduino/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/arduino/locals.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/arduino/locals.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/astro/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/astro/folds.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/astro/folds.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/bundle/nvim-treesitter-0.9.1/queries/astro/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/astro/highlights.scm new file mode 100644 index 000000000..62e8ed247 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/astro/highlights.scm @@ -0,0 +1,5 @@ +; inherits: html + +[ "---" ] @punctuation.delimiter + +[ "{" "}" ] @punctuation.special diff --git a/bundle/nvim-treesitter-0.9.1/queries/astro/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/astro/indents.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/astro/indents.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/bundle/nvim-treesitter-0.9.1/queries/astro/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/astro/injections.scm new file mode 100644 index 000000000..60ea3f5c6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/astro/injections.scm @@ -0,0 +1,19 @@ +; inherits: html + +((frontmatter + (raw_text) @typescript)) + +((interpolation + (raw_text) @tsx)) + +((script_element + (raw_text) @typescript)) + +((style_element + (start_tag + (attribute + (attribute_name) @_lang_attr + (quoted_attribute_value (attribute_value) @_lang_value))) + (raw_text) @scss) + (#eq? @_lang_attr "lang") + (#eq? @_lang_value "scss")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/astro/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/astro/locals.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/astro/locals.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/bundle/nvim-treesitter-0.9.1/queries/awk/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/awk/highlights.scm new file mode 100644 index 000000000..4faf496e6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/awk/highlights.scm @@ -0,0 +1,195 @@ +; adapted from https://github.com/Beaglefoot/tree-sitter-awk + +[ + (identifier) + (field_ref) +] @variable +(field_ref (_) @variable) + +; https://www.gnu.org/software/gawk/manual/html_node/Auto_002dset.html +((identifier) @constant.builtin + (#any-of? @constant.builtin + "ARGC" + "ARGV" + "ARGIND" + "ENVIRON" + "ERRNO" + "FILENAME" + "FNR" + "NF" + "FUNCTAB" + "NR" + "PROCINFO" + "RLENGTH" + "RSTART" + "RT" + "SYMTAB")) + +; https://www.gnu.org/software/gawk/manual/html_node/User_002dmodified.html +((identifier) @variable.builtin + (#any-of? @variable.builtin + "BINMODE" + "CONVFMT" + "FIELDWIDTHS" + "FPAT" + "FS" + "IGNORECASE" + "LINT" + "OFMT" + "OFS" + "ORS" + "PREC" + "ROUNDMODE" + "RS" + "SUBSEP" + "TEXTDOMAIN")) + +(number) @number + +(string) @string +(regex) @string.regex +(escape_sequence) @string.escape + +(comment) @comment @spell + +((program . (comment) @preproc) + (#lua-match? @preproc "^#!/")) + +(ns_qualified_name (namespace) @namespace) +(ns_qualified_name "::" @punctuation.delimiter) + +(func_def name: (_ (identifier) @function) @function) +(func_call name: (_ (identifier) @function) @function) + +(func_def (param_list (identifier) @parameter)) + +[ + "print" + "printf" + "getline" +] @function.builtin + +[ + (delete_statement) + (break_statement) + (continue_statement) + (next_statement) + (nextfile_statement) +] @keyword + +[ + "func" + "function" +] @keyword.function + +[ + "return" + "exit" +] @keyword.return + +[ + "do" + "while" + "for" + "in" +] @repeat + +[ + "if" + "else" + "switch" + "case" + "default" +] @conditional + +[ + "@include" + "@load" +] @include + +"@namespace" @preproc + +[ + "BEGIN" + "END" + "BEGINFILE" + "ENDFILE" +] @label + +(binary_exp [ + "^" + "**" + "*" + "/" + "%" + "+" + "-" + "<" + ">" + "<=" + ">=" + "==" + "!=" + "~" + "!~" + "in" + "&&" + "||" +] @operator) + +(unary_exp [ + "!" + "+" + "-" +] @operator) + +(assignment_exp [ + "=" + "+=" + "-=" + "*=" + "/=" + "%=" + "^=" +] @operator) + +(ternary_exp [ + "?" + ":" +] @conditional.ternary) + +(update_exp [ + "++" + "--" +] @operator) + +(redirected_io_statement [ + ">" + ">>" +] @operator) + +(piped_io_statement [ + "|" + "|&" +] @operator) + +(piped_io_exp [ + "|" + "|&" +] @operator) + +(field_ref "$" @punctuation.delimiter) + +(regex "/" @punctuation.delimiter) +(regex_constant "@" @punctuation.delimiter) + +[ ";" "," ] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket diff --git a/bundle/nvim-treesitter-0.9.1/queries/awk/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/awk/injections.scm new file mode 100644 index 000000000..8cbffc623 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/awk/injections.scm @@ -0,0 +1,2 @@ +(comment) @comment +(regex) @regex diff --git a/bundle/nvim-treesitter-0.9.1/queries/bash/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/bash/folds.scm new file mode 100644 index 000000000..851c67eed --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bash/folds.scm @@ -0,0 +1,8 @@ +[ + (function_definition) + (if_statement) + (case_statement) + (for_statement) + (while_statement) + (c_style_for_statement) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/bash/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/bash/highlights.scm new file mode 100644 index 000000000..063c2b920 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bash/highlights.scm @@ -0,0 +1,148 @@ +(simple_expansion) @none +(expansion + "${" @punctuation.special + "}" @punctuation.special) @none +[ + "(" + ")" + "((" + "))" + "{" + "}" + "[" + "]" + "[[" + "]]" + ] @punctuation.bracket + +[ + ";" + ";;" + (heredoc_start) + ] @punctuation.delimiter + +[ + "$" +] @punctuation.special + +[ + ">" + ">>" + "<" + "<<" + "&" + "&&" + "|" + "||" + "=" + "=~" + "==" + "!=" + ] @operator + +; Do *not* spell check strings since they typically have some sort of +; interpolation in them, or, are typically used for things like filenames, URLs, +; flags and file content. +[ + (string) + (raw_string) + (ansi_c_string) + (heredoc_body) +] @string + +(variable_assignment (word) @string) + +[ + "if" + "then" + "else" + "elif" + "fi" + "case" + "in" + "esac" + ] @conditional + +[ + "for" + "do" + "done" + "select" + "until" + "while" + ] @repeat + +[ + "declare" + "export" + "local" + "readonly" + "unset" + ] @keyword + +"function" @keyword.function + +(special_variable_name) @constant + +; trap -l +((word) @constant.builtin + (#match? @constant.builtin "^SIG(HUP|INT|QUIT|ILL|TRAP|ABRT|BUS|FPE|KILL|USR[12]|SEGV|PIPE|ALRM|TERM|STKFLT|CHLD|CONT|STOP|TSTP|TT(IN|OU)|URG|XCPU|XFSZ|VTALRM|PROF|WINCH|IO|PWR|SYS|RTMIN([+]([1-9]|1[0-5]))?|RTMAX(-([1-9]|1[0-4]))?)$")) + +((word) @boolean + (#any-of? @boolean "true" "false")) + +(comment) @comment @spell +(test_operator) @string + +(command_substitution + [ "$(" ")" ] @punctuation.bracket) + +(process_substitution + [ "<(" ")" ] @punctuation.bracket) + + +(function_definition + name: (word) @function) + +(command_name (word) @function.call) + +((command_name (word) @function.builtin) + (#any-of? @function.builtin + "alias" "bg" "bind" "break" "builtin" "caller" "cd" + "command" "compgen" "complete" "compopt" "continue" + "coproc" "dirs" "disown" "echo" "enable" "eval" + "exec" "exit" "fc" "fg" "getopts" "hash" "help" + "history" "jobs" "kill" "let" "logout" "mapfile" + "popd" "printf" "pushd" "pwd" "read" "readarray" + "return" "set" "shift" "shopt" "source" "suspend" + "test" "time" "times" "trap" "type" "typeset" + "ulimit" "umask" "unalias" "wait")) + +(command + argument: [ + (word) @parameter + (concatenation (word) @parameter) + ]) + +((word) @number + (#lua-match? @number "^[0-9]+$")) + +(file_redirect + descriptor: (file_descriptor) @operator + destination: (word) @parameter) + +(expansion + [ "${" "}" ] @punctuation.bracket) + +(variable_name) @variable + +((variable_name) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +(case_item + value: (word) @parameter) + +(regex) @string.regex + +((program . (comment) @preproc) + (#lua-match? @preproc "^#!/")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/bash/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/bash/injections.scm new file mode 100644 index 000000000..86371b905 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bash/injections.scm @@ -0,0 +1,3 @@ +(comment) @comment + +(regex) @regex diff --git a/bundle/nvim-treesitter-0.9.1/queries/bash/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/bash/locals.scm new file mode 100644 index 000000000..a03bc3a56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bash/locals.scm @@ -0,0 +1,13 @@ +; Scopes +(function_definition) @scope + +; Definitions +(variable_assignment + name: (variable_name) @definition.var) + +(function_definition + name: (word) @definition.function) + +; References +(variable_name) @reference +(word) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/bass/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/bass/folds.scm new file mode 100644 index 000000000..d99e0c1ac --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bass/folds.scm @@ -0,0 +1,5 @@ +[ + (list) + (scope) + (cons) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/bass/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/bass/highlights.scm new file mode 100644 index 000000000..296443d52 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bass/highlights.scm @@ -0,0 +1,109 @@ +;; Variables + +(list (symbol) @variable) + +(cons (symbol) @variable) + +(scope (symbol) @variable) + +(symbind (symbol) @variable) + +;; Constants + +((symbol) @constant + (#lua-match? @constant "^_*[A-Z][A-Z0-9_]*$")) + +;; Functions + +(list + . (symbol) @function) + +;; Namespaces + +(symbind + (symbol) @namespace + . (keyword)) + +;; Includes + +((symbol) @include + (#any-of? @include "use" "import" "load")) + +;; Keywords + +((symbol) @keyword + (#any-of? @keyword "do" "doc")) + +;; Special Functions + +; Keywords construct a symbol + +(keyword) @constructor + +((list + . (symbol) @keyword.function + . (symbol) @function + (symbol)? @parameter) + (#any-of? @keyword.function "def" "defop" "defn" "fn")) + +((cons + . (symbol) @keyword.function + . (symbol) @function + (symbol)? @parameter) + (#any-of? @keyword.function "def" "defop" "defn" "fn")) + +((symbol) @function.builtin + (#any-of? @function.builtin "dump" "mkfs" "json" "log" "error" "now" "cons" "wrap" "unwrap" "eval" "make-scope" "bind" "meta" "with-meta" "null?" "ignore?" "boolean?" "number?" "string?" "symbol?" "scope?" "sink?" "source?" "list?" "pair?" "applicative?" "operative?" "combiner?" "path?" "empty?" "thunk?" "+" "*" "quot" "-" "max" "min" "=" ">" ">=" "<" "<=" "list->source" "across" "emit" "next" "reduce-kv" "assoc" "symbol->string" "string->symbol" "str" "substring" "trim" "scope->list" "string->fs-path" "string->cmd-path" "string->dir" "subpath" "path-name" "path-stem" "with-image" "with-dir" "with-args" "with-cmd" "with-stdin" "with-env" "with-insecure" "with-label" "with-port" "with-tls" "with-mount" "thunk-cmd" "thunk-args" "resolve" "start" "addr" "wait" "read" "cache-dir" "binds?" "recall-memo" "store-memo" "mask" "list" "list*" "first" "rest" "length" "second" "third" "map" "map-pairs" "foldr" "foldl" "append" "filter" "conj" "list->scope" "merge" "apply" "id" "always" "vals" "keys" "memo" "succeeds?" "run" "last" "take" "take-all" "insecure!" "from" "cd" "wrap-cmd" "mkfile" "path-base" "not")) + +((symbol) @function.macro + (#any-of? @function.macro "op" "current-scope" "quote" "let" "provide" "module" "or" "and" "curryfn" "for" "$" "linux")) + +;; Conditionals + +((symbol) @conditional + (#any-of? @conditional "if" "case" "cond" "when")) + +;; Repeats + +((symbol) @repeat + (#any-of? @repeat "each")) + +;; Operators + +((symbol) @operator (#any-of? @operator "&" "*" "+" "-" "<" "<=" "=" ">" ">=")) + +;; Punctuation + +[ "(" ")" ] @punctuation.bracket + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +((symbol) @punctuation.delimiter + (#eq? @punctuation.delimiter "->")) + +;; Literals + +(string) @string + +(escape_sequence) @string.escape + +(path) @text.uri @string.special + +(number) @number + +(boolean) @boolean + +[ + (ignore) + (null) +] @constant.builtin + +[ + "^" +] @character.special + +;; Comments + +(comment) @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/bass/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/bass/indents.scm new file mode 100644 index 000000000..60c5df4eb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bass/indents.scm @@ -0,0 +1,22 @@ +[ + (list) + (scope) + (cons) +] @indent.begin + +[ + ")" + "}" + "]" +] @indent.end + +[ "(" ")" ] @indent.branch + +[ "{" "}" ] @indent.branch + +[ "[" "]" ] @indent.branch + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/bass/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/bass/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bass/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/bass/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/bass/locals.scm new file mode 100644 index 000000000..5a94e7532 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bass/locals.scm @@ -0,0 +1,25 @@ +; Scopes + +[ + (list) + (scope) + (cons) +] @scope + +; References + +(symbol) @reference + +; Definitions + +((list + . (symbol) @_fnkw + . (symbol) @definition.function + (symbol)? @definition.parameter) + (#any-of? @_fnkw "def" "defop" "defn" "fn")) + +((cons + . (symbol) @_fnkw + . (symbol) @definition.function + (symbol)? @definition.parameter) + (#any-of? @_fnkw "def" "defop" "defn" "fn")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/beancount/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/beancount/folds.scm new file mode 100644 index 000000000..ffe319500 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/beancount/folds.scm @@ -0,0 +1,4 @@ +[ + (transaction) + (section) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/beancount/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/beancount/highlights.scm new file mode 100644 index 000000000..5817fb2e2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/beancount/highlights.scm @@ -0,0 +1,24 @@ +(date) @field +(txn) @attribute +(account) @type +(amount) @number +(incomplete_amount) @number +(compound_amount) @number +(amount_tolerance) @number +(currency) @property +(key) @label +(string) @string +(narration) @string @spell +(payee) @string @spell +(tag) @constant +(link) @constant +[ + (minus) (plus) (slash) (asterisk) +] @operator +(comment) @comment @spell +[ + (balance) (open) (close) (commodity) (pad) + (event) (price) (note) (document) (query) + (custom) (pushtag) (poptag) (pushmeta) + (popmeta) (option) (include) (plugin) +] @keyword diff --git a/bundle/nvim-treesitter-0.9.1/queries/bibtex/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/bibtex/folds.scm new file mode 100644 index 000000000..3b24d5fea --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bibtex/folds.scm @@ -0,0 +1,3 @@ +[ + (entry) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/bibtex/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/bibtex/highlights.scm new file mode 100644 index 000000000..00cae314d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bibtex/highlights.scm @@ -0,0 +1,49 @@ +; CREDITS @pfoerster (adapted from https://github.com/latex-lsp/tree-sitter-bibtex) + +[ + (string_type) + (preamble_type) + (entry_type) +] @keyword + +[ + (junk) + (comment) +] @comment + +[ + "=" + "#" +] @operator + +(command) @function.builtin + +(number) @number + +(field + name: (identifier) @field) + +(token + (identifier) @parameter) + +[ + (brace_word) + (quote_word) +] @string + +[ + (key_brace) + (key_paren) +] @symbol + +(string + name: (identifier) @constant) + +[ + "{" + "}" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter diff --git a/bundle/nvim-treesitter-0.9.1/queries/bibtex/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/bibtex/indents.scm new file mode 100644 index 000000000..1ba3e6b47 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bibtex/indents.scm @@ -0,0 +1,10 @@ +[ + (entry) +] @indent.begin + +[ + "{" + "}" +] @indent.branch + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/bicep/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/bicep/folds.scm new file mode 100644 index 000000000..8ec5ba200 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bicep/folds.scm @@ -0,0 +1,25 @@ +[ + (module_declaration) + (metadata_declaration) + (output_declaration) + (parameter_declaration) + (resource_declaration) + (type_declaration) + (variable_declaration) + + (parenthesized_expression) + + (decorators) + (array) + (object) + + (if_statement) + (for_statement) + + (subscript_expression) + (ternary_expression) + + (string) + + (comment) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/bicep/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/bicep/highlights.scm new file mode 100644 index 000000000..b555edb37 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bicep/highlights.scm @@ -0,0 +1,230 @@ +; Includes + +(import_statement + "import" @include) + +(import_with_statement + "import" @include + "with" @include) + +; Namespaces + +(module_declaration + (identifier) @namespace) + +; Builtins + +(primitive_type) @type.builtin + +((member_expression + object: (identifier) @type.builtin) + (#eq? @type.builtin "sys")) + +; Functions + +(call_expression + function: (identifier) @function.call) + +; Properties + +(object_property + (identifier) @property + ":" @punctuation.delimiter + (_)) + +(object_property + (compatible_identifier) @property + ":" @punctuation.delimiter + (_)) + +(property_identifier) @property + +; Attributes + +(decorator + "@" @attribute) + +(decorator + (call_expression (identifier) @attribute)) + +(decorator + (call_expression + (member_expression + object: (identifier) @attribute + property: (property_identifier) @attribute))) + +; Types + +(type_declaration + (identifier) @type) + +(type_declaration + (identifier) + "=" + (identifier) @type) + +(type_declaration + (identifier) + "=" + (array_type (identifier) @type)) + +(type + (identifier) @type) + +(resource_declaration + (identifier) @type) + +(resource_expression + (identifier) @type) + +; Parameters + +(parameter_declaration + (identifier) @parameter + (_)) + +(call_expression + function: (_) + (arguments (identifier) @parameter)) + +(call_expression + function: (_) + (arguments (member_expression object: (identifier) @parameter))) + +; Variables + +(variable_declaration + (identifier) @variable + (_)) + +(metadata_declaration + (identifier) @variable + (_)) + +(output_declaration + (identifier) @variable + (_)) + +(object_property + (_) + ":" + (identifier) @variable) + +(for_statement + "for" + (for_loop_parameters + (loop_variable) @variable + (loop_enumerator) @variable)) + +; Conditionals + +"if" @conditional + +(ternary_expression + "?" @conditional.ternary + ":" @conditional.ternary) + +; Loops + +(for_statement + "for" @repeat + "in" + ":" @punctuation.delimiter) + +; Keywords + +[ + "module" + "metadata" + "output" + "param" + "resource" + "existing" + "targetScope" + "type" + "var" +] @keyword + +; Operators + +[ + "+" + "-" + "*" + "/" + "%" + "||" + "&&" + "|" + "==" + "!=" + "=~" + "!~" + ">" + ">=" + "<=" + "<" + "??" + "=" + "!" +] @operator + +[ + "in" +] @keyword.operator + + +; Literals + +(string) @string +(import_string + "'" @string + (import_name) @namespace + "@" @symbol + (import_version) @string.special) + +(escape_sequence) @string.escape + +(number) @number + +(boolean) @boolean + +(null) @constant.builtin + +; Misc + +(compatible_identifier + "?" @punctuation.special) + +(nullable_return_type) @punctuation.special + +["{" "}"] @punctuation.bracket + +["[" "]"] @punctuation.bracket + +["(" ")"] @punctuation.bracket + +[ + "." + "::" + "=>" +] @punctuation.delimiter + + +; Interpolation + +(interpolation) @none + +(interpolation + "${" @punctuation.special + "}" @punctuation.special) + +(interpolation + (identifier) @variable) + +; Comments + +[ + (comment) + (diagnostic_comment) +] @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/bicep/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/bicep/indents.scm new file mode 100644 index 000000000..cf2e6e1c2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bicep/indents.scm @@ -0,0 +1,18 @@ +[ + (array) + (object) +] @indent.begin + +"}" @indent.end + +[ "{" "}" ] @indent.branch + +[ "[" "]" ] @indent.branch + +[ "(" ")" ] @indent.branch + +[ + (ERROR) + (comment) + (diagnostic_comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/bicep/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/bicep/injections.scm new file mode 100644 index 000000000..c85cfe3b6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bicep/injections.scm @@ -0,0 +1,4 @@ +[ + (comment) + (diagnostic_comment) +] @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/bicep/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/bicep/locals.scm new file mode 100644 index 000000000..361be94fb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/bicep/locals.scm @@ -0,0 +1,74 @@ +; Scopes + +[ + (infrastructure) + (call_expression) + + (lambda_expression) + (subscript_expression) + + (if_statement) + (for_statement) + + (array) + (object) + (interpolation) +] @scope + +; References + +(property_identifier) @reference + +(call_expression + (identifier) @reference) + +(object_property + (_) + ":" + (identifier) @reference) + +(resource_expression + (identifier) @reference) + +; Definitions + +(type) @definition.associated + +(object_property + (identifier) @definition.field + (_)) + +(object_property + (compatible_identifier) @definition.field + (_)) + +(import_name) @definition.import + +(module_declaration + (identifier) @definition.namespace) + +(parameter_declaration + (identifier) @definition.parameter + (_)) + +(type_declaration + (identifier) @definition.type + (_)) + +(variable_declaration + (identifier) @definition.var + (_)) + +(metadata_declaration + (identifier) @definition.var + (_)) + +(output_declaration + (identifier) @definition.var + (_)) + +(for_statement + "for" + (for_loop_parameters + (loop_variable) @definition.var + (loop_enumerator) @definition.var)) diff --git a/bundle/nvim-treesitter-0.9.1/queries/blueprint/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/blueprint/highlights.scm new file mode 100644 index 000000000..3d4b48266 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/blueprint/highlights.scm @@ -0,0 +1,57 @@ +(object_id) @variable + +(string) @string +(escape_sequence) @string.escape + +(comment) @comment + +(constant) @constant.builtin + +(boolean) @boolean + +(using) @include + +(template) @keyword + +(decorator) @attribute + +(property_definition (property_name) @property) + +(object) @type + +(signal_binding (signal_name) @function.builtin) +(signal_binding (function (identifier)) @function) +(signal_binding "swapped" @keyword) + +(styles_list "styles" @function.macro) +(layout_definition "layout" @function.macro) + +(gettext_string "_" @function.builtin) + +(menu_definition "menu" @keyword) +(menu_section "section" @keyword) +(menu_item "item" @function.macro) + +(template_definition (template_name_qualifier) @type.qualifier) + +(import_statement (gobject_library) @namespace) + +(import_statement (version_number) @float) + +(float) @float +(number) @number + +[ + ";" + "." + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket diff --git a/bundle/nvim-treesitter-0.9.1/queries/c/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/c/folds.scm new file mode 100644 index 000000000..5a35334a2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c/folds.scm @@ -0,0 +1,20 @@ +[ + (for_statement) + (if_statement) + (while_statement) + (switch_statement) + (case_statement) + (function_definition) + (struct_specifier) + (enum_specifier) + (comment) + (preproc_if) + (preproc_elif) + (preproc_else) + (preproc_ifdef) + (initializer_list) + (gnu_asm_expression) +] @fold + +(compound_statement + (compound_statement) @fold) diff --git a/bundle/nvim-treesitter-0.9.1/queries/c/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/c/highlights.scm new file mode 100644 index 000000000..29fb5747c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c/highlights.scm @@ -0,0 +1,263 @@ +; Lower priority to prefer @parameter when identifier appears in parameter_declaration. +((identifier) @variable (#set! "priority" 95)) +(preproc_def (preproc_arg) @variable) + +[ + "default" + "enum" + "struct" + "typedef" + "union" + "goto" + "asm" + "__asm__" +] @keyword + +[ + "sizeof" + "offsetof" +] @keyword.operator +(alignof_expression . _ @keyword.operator) + +"return" @keyword.return + +[ + "while" + "for" + "do" + "continue" + "break" +] @repeat + +[ + "if" + "else" + "case" + "switch" +] @conditional + +[ + "#if" + "#ifdef" + "#ifndef" + "#else" + "#elif" + "#endif" + "#elifdef" + "#elifndef" + (preproc_directive) +] @preproc + +"#define" @define + +"#include" @include + +[ ";" ":" "," "::" ] @punctuation.delimiter + +"..." @punctuation.special + +[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket + +[ + "=" + + "-" + "*" + "/" + "+" + "%" + + "~" + "|" + "&" + "^" + "<<" + ">>" + + "->" + "." + + "<" + "<=" + ">=" + ">" + "==" + "!=" + + "!" + "&&" + "||" + + "-=" + "+=" + "*=" + "/=" + "%=" + "|=" + "&=" + "^=" + ">>=" + "<<=" + "--" + "++" +] @operator + +;; Make sure the comma operator is given a highlight group after the comma +;; punctuator so the operator is highlighted properly. +(comma_expression [ "," ] @operator) + +[ + (true) + (false) +] @boolean + +(conditional_expression [ "?" ":" ] @conditional.ternary) + +(string_literal) @string +(system_lib_string) @string +(escape_sequence) @string.escape + +(null) @constant.builtin +(number_literal) @number +(char_literal) @character + +((preproc_arg) @function.macro (#set! "priority" 90)) +(preproc_defined) @function.macro + +(((field_expression + (field_identifier) @property)) @_parent + (#not-has-parent? @_parent template_method function_declarator call_expression)) + +(field_designator) @property +(((field_identifier) @property) + (#has-ancestor? @property field_declaration) + (#not-has-ancestor? @property function_declarator)) + +(statement_identifier) @label + +[ + (type_identifier) + (type_descriptor) +] @type + +(storage_class_specifier) @storageclass + +[ + (type_qualifier) + (gnu_asm_qualifier) + "__extension__" +] @type.qualifier + +(linkage_specification + "extern" @storageclass) + +(type_definition + declarator: (type_identifier) @type.definition) + +(primitive_type) @type.builtin + +(sized_type_specifier _ @type.builtin type: _?) + +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z0-9_]+$")) +(preproc_def (preproc_arg) @constant + (#lua-match? @constant "^[A-Z][A-Z0-9_]+$")) +(enumerator + name: (identifier) @constant) +(case_statement + value: (identifier) @constant) + +((identifier) @constant.builtin + (#any-of? @constant.builtin + "stderr" "stdin" "stdout" + "__FILE__" "__LINE__" "__DATE__" "__TIME__" + "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" + "__cplusplus" "__OBJC__" "__ASSEMBLER__" + "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" + "__TIMESTAMP__" "__clang__" "__clang_major__" + "__clang_minor__" "__clang_patchlevel__" + "__clang_version__" "__clang_literal_encoding__" + "__clang_wide_literal_encoding__" + "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" + "__VA_ARGS__" "__VA_OPT__")) +(preproc_def (preproc_arg) @constant.builtin + (#any-of? @constant.builtin + "stderr" "stdin" "stdout" + "__FILE__" "__LINE__" "__DATE__" "__TIME__" + "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" + "__cplusplus" "__OBJC__" "__ASSEMBLER__" + "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" + "__TIMESTAMP__" "__clang__" "__clang_major__" + "__clang_minor__" "__clang_patchlevel__" + "__clang_version__" "__clang_literal_encoding__" + "__clang_wide_literal_encoding__" + "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" + "__VA_ARGS__" "__VA_OPT__")) + +(attribute_specifier + (argument_list (identifier) @variable.builtin)) +((attribute_specifier + (argument_list (call_expression + function: (identifier) @variable.builtin)))) + +((call_expression + function: (identifier) @function.builtin) + (#lua-match? @function.builtin "^__builtin_")) +((call_expression + function: (identifier) @function.builtin) + (#has-ancestor? @function.builtin attribute_specifier)) + +;; Preproc def / undef +(preproc_def + name: (_) @constant) +(preproc_call + directive: (preproc_directive) @_u + argument: (_) @constant + (#eq? @_u "#undef")) + +(call_expression + function: (identifier) @function.call) +(call_expression + function: (field_expression + field: (field_identifier) @function.call)) +(function_declarator + declarator: (identifier) @function) +(function_declarator + declarator: (parenthesized_declarator + (pointer_declarator + declarator: (field_identifier) @function))) +(preproc_function_def + name: (identifier) @function.macro) + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +;; Parameters +(parameter_declaration + declarator: (identifier) @parameter) + +(parameter_declaration + declarator: (array_declarator) @parameter) + +(parameter_declaration + declarator: (pointer_declarator) @parameter) + +(preproc_params (identifier) @parameter) + +[ + "__attribute__" + "__declspec" + "__based" + "__cdecl" + "__clrcall" + "__stdcall" + "__fastcall" + "__thiscall" + "__vectorcall" + (ms_pointer_modifier) + (attribute_declaration) +] @attribute + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/c/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/c/indents.scm new file mode 100644 index 000000000..cf4c8fa62 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c/indents.scm @@ -0,0 +1,90 @@ +[ + (compound_statement) + (field_declaration_list) + (case_statement) + (enumerator_list) + (compound_literal_expression) + (initializer_list) + (init_declarator) +] @indent.begin + +; With current indent logic, if we capture expression_statement with @indent.begin +; It will be affected by _parent_ node with error subnodes deep down the tree +; So narrow indent capture to check for error inside expression statement only, +(expression_statement + (_) @indent.begin + ";" @indent.end) + +(ERROR + "for" "(" @indent.begin ";" ";" ")" @indent.end) + +((for_statement + body: (_) @_body) @indent.begin + (#not-has-type? @_body compound_statement)) + +(while_statement + condition: (_) @indent.begin) + +((while_statement + body: (_) @_body) @indent.begin + (#not-has-type? @_body compound_statement)) + +( + (if_statement) + . + (ERROR "else" @indent.begin)) + +(if_statement + condition: (_) @indent.begin) + +;; Supports if without braces (but not both if-else without braces) +((if_statement + consequence: + (_ ";" @indent.end) @_consequence + (#not-has-type? @_consequence compound_statement) + alternative: + (else_clause + "else" @indent.branch + [ + (if_statement (compound_statement) @indent.dedent)? @indent.dedent + (compound_statement)? @indent.dedent + (_)? @indent.dedent + ] + )? + ) @indent.begin) + +(else_clause (_ . "{" @indent.branch)) + + +(compound_statement "}" @indent.end) + +[ + ")" + "}" + (statement_identifier) +] @indent.branch + +[ + "#define" + "#ifdef" + "#ifndef" + "#elif" + "#if" + "#else" + "#endif" +] @indent.zero + +[ + (preproc_arg) + (string_literal) +] @indent.ignore + +((ERROR (parameter_declaration)) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) +([(argument_list) (parameter_list)] @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) + +(comment) @indent.auto + diff --git a/bundle/nvim-treesitter-0.9.1/queries/c/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/c/injections.scm new file mode 100644 index 000000000..2ef8f85c1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c/injections.scm @@ -0,0 +1,10 @@ +((preproc_def (preproc_arg) @c) + (#lua-match? @c "\n")) +(preproc_function_def (preproc_arg) @c) +(preproc_call (preproc_arg) @c) + +(comment) @comment + +; TODO: add when asm is added +; (gnu_asm_expression assembly_code: (string_literal) @asm) +; (gnu_asm_expression assembly_code: (concatenated_string (string_literal) @asm)) diff --git a/bundle/nvim-treesitter-0.9.1/queries/c/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/c/locals.scm new file mode 100644 index 000000000..b59f8f37a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c/locals.scm @@ -0,0 +1,53 @@ +;; Functions definitions +(function_declarator + declarator: (identifier) @definition.function) +(preproc_function_def + name: (identifier) @definition.macro) @scope + +(preproc_def + name: (identifier) @definition.macro) +(pointer_declarator + declarator: (identifier) @definition.var) +(parameter_declaration + declarator: (identifier) @definition.parameter) +(init_declarator + declarator: (identifier) @definition.var) +(array_declarator + declarator: (identifier) @definition.var) +(declaration + declarator: (identifier) @definition.var) +(enum_specifier + name: (_) @definition.type + (enumerator_list + (enumerator name: (identifier) @definition.var))) + +;; Type / Struct / Enum +(field_declaration + declarator: (field_identifier) @definition.field) +(type_definition + declarator: (type_identifier) @definition.type) +(struct_specifier + name: (type_identifier) @definition.type) + +;; goto +(labeled_statement (statement_identifier) @definition) + +;; References +(identifier) @reference +((field_identifier) @reference + (#set! reference.kind "field")) +((type_identifier) @reference + (#set! reference.kind "type")) + +(goto_statement (statement_identifier) @reference) + +;; Scope +[ + (for_statement) + (if_statement) + (while_statement) + (translation_unit) + (function_definition) + (compound_statement) ; a block in curly braces + (struct_specifier) +] @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/c_sharp/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/folds.scm new file mode 100644 index 000000000..4b5d94270 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/folds.scm @@ -0,0 +1,15 @@ +body: [ + (declaration_list) + (switch_body) + (enum_member_declaration_list) +] @fold + +accessors: [ + (accessor_list) +] @fold + +initializer: [ + (initializer_expression) +] @fold + +(block) @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/c_sharp/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/highlights.scm new file mode 100644 index 000000000..9895d8341 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/highlights.scm @@ -0,0 +1,412 @@ +(identifier) @variable + +((identifier) @keyword + (#eq? @keyword "value") + (#has-ancestor? @keyword accessor_declaration)) + +(method_declaration + name: (identifier) @method) + +(local_function_statement + name: (identifier) @method) + +(method_declaration + type: (identifier) @type) + +(local_function_statement + type: (identifier) @type) + +(interpolation) @none + +(invocation_expression + (member_access_expression + name: (identifier) @method.call)) + +(invocation_expression + function: (conditional_access_expression + (member_binding_expression + name: (identifier) @method.call))) + +(namespace_declaration + name: [(qualified_name) (identifier)] @namespace) + +(qualified_name + (identifier) @type) + +(invocation_expression + (identifier) @method.call) + +(field_declaration + (variable_declaration + (variable_declarator + (identifier) @field))) + +(initializer_expression + (assignment_expression + left: (identifier) @field)) + +(parameter_list + (parameter + name: (identifier) @parameter)) + +(parameter_list + (parameter + type: (identifier) @type)) + +(integer_literal) @number +(real_literal) @float + +(null_literal) @constant.builtin +(character_literal) @character + +[ + (string_literal) + (verbatim_string_literal) + (interpolated_string_expression) +] @string + +(boolean_literal) @boolean + +[ + (predefined_type) +] @type.builtin + +(implicit_type) @keyword + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +(using_directive + (identifier) @type) + +(using_directive + (name_equals (identifier) @type.definition)) + +(property_declaration + name: (identifier) @property) + +(property_declaration + type: (identifier) @type) + +(nullable_type + (identifier) @type) + +(catch_declaration + type: (identifier) @type) + +(interface_declaration + name: (identifier) @type) +(class_declaration + name: (identifier) @type) +(record_declaration + name: (identifier) @type) +(enum_declaration + name: (identifier) @type) +(constructor_declaration + name: (identifier) @constructor) +(constructor_initializer [ + "base" @constructor +]) + +(variable_declaration + (identifier) @type) +(object_creation_expression + (identifier) @type) + +; Generic Types. +(type_of_expression + (generic_name + (identifier) @type)) + +(type_argument_list + (generic_name + (identifier) @type)) + +(base_list + (generic_name + (identifier) @type)) + +(type_constraint + (generic_name + (identifier) @type)) + +(object_creation_expression + (generic_name + (identifier) @type)) + +(property_declaration + (generic_name + (identifier) @type)) + +(_ + type: (generic_name + (identifier) @type)) +; Generic Method invocation with generic type +(invocation_expression + function: (generic_name + . (identifier) @method.call)) + +(invocation_expression + (member_access_expression + (generic_name + (identifier) @method))) + +(base_list + (identifier) @type) + +(type_argument_list + (identifier) @type) + +(type_parameter_list + (type_parameter) @type) + +(type_parameter_constraints_clause + target: (identifier) @type) + +(attribute + name: (identifier) @attribute) + +(for_each_statement + type: (identifier) @type) + +(tuple_element + type: (identifier) @type) + +(tuple_expression + (argument + (declaration_expression + type: (identifier) @type))) + +(as_expression + right: (identifier) @type) + +(type_of_expression + (identifier) @type) + +(name_colon + (identifier) @parameter) + +(warning_directive) @text.warning +(error_directive) @exception + +(define_directive + (identifier) @constant) @constant.macro +(undef_directive + (identifier) @constant) @constant.macro + +(line_directive) @constant.macro +(line_directive + (preproc_integer_literal) @constant + (preproc_string_literal)? @string) + +(pragma_directive + (identifier) @constant) @constant.macro +(pragma_directive + (preproc_string_literal) @string) @constant.macro + +[ + (nullable_directive) + (region_directive) + (endregion_directive) +] @constant.macro + +[ + "if" + "else" + "switch" + "break" + "case" + (if_directive) + (elif_directive) + (else_directive) + (endif_directive) +] @conditional + +(if_directive + (identifier) @constant) +(elif_directive + (identifier) @constant) + +[ + "while" + "for" + "do" + "continue" + "goto" + "foreach" +] @repeat + +[ + "try" + "catch" + "throw" + "finally" +] @exception + +[ + "+" + "?" + ":" + "++" + "-" + "--" + "&" + "&&" + "|" + "||" + "!" + "!=" + "==" + "*" + "/" + "%" + "<" + "<=" + ">" + ">=" + "=" + "-=" + "+=" + "*=" + "/=" + "%=" + "^" + "^=" + "&=" + "|=" + "~" + ">>" + ">>>" + "<<" + "<<=" + ">>=" + ">>>=" + "=>" +] @operator + +[ + ";" + "." + "," + ":" +] @punctuation.delimiter + +(conditional_expression ["?" ":"] @conditional.ternary) + +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +(type_argument_list ["<" ">"] @punctuation.bracket) + +[ + (this_expression) + (base_expression) +] @variable.builtin + +[ + "using" + "as" +] @include + +(alias_qualified_name + (identifier "global") @include) + +[ + "with" + "new" + "typeof" + "sizeof" + "is" + "and" + "or" + "not" + "stackalloc" + "in" + "out" + "ref" +] @keyword.operator + +[ + "lock" + "params" + "operator" + "default" + "implicit" + "explicit" + "override" + "class" + "delegate" + "enum" + "interface" + "namespace" + "struct" + "get" + "set" + "init" + "where" + "record" + "event" + "add" + "remove" + "checked" + "unchecked" + "fixed" +] @keyword + +[ + "async" + "await" +] @keyword.coroutine + +[ + "const" + "extern" + "readonly" + "static" + "volatile" + "required" +] @storageclass + +[ + "abstract" + "private" + "protected" + "internal" + "public" + "partial" + "sealed" + "virtual" +] @type.qualifier + +(parameter_modifier) @operator + +(query_expression + (_ [ + "from" + "orderby" + "select" + "group" + "by" + "ascending" + "descending" + "equals" + "let" + ] @keyword)) + +[ + "return" + "yield" +] @keyword.return diff --git a/bundle/nvim-treesitter-0.9.1/queries/c_sharp/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/c_sharp/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/locals.scm new file mode 100644 index 000000000..c53eb1a19 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/c_sharp/locals.scm @@ -0,0 +1,41 @@ +;; Definitions +(variable_declarator + . (identifier) @definition.var) + +(variable_declarator + (tuple_pattern + (identifier) @definition.var)) + +(declaration_expression + name: (identifier) @definition.var) + +(for_each_statement + left: (identifier) @definition.var) + +(for_each_statement + left: (tuple_pattern + (identifier) @definition.var)) + +(parameter + (identifier) @definition.parameter) + +(method_declaration + name: (identifier) @definition.method) + +(local_function_statement + name: (identifier) @definition.method) + +(property_declaration + name: (identifier) @definition) + +(type_parameter + (identifier) @definition.type) + +(class_declaration + name: (identifier) @definition) + +;; References +(identifier) @reference + +;; Scope +(block) @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/cairo/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cairo/folds.scm new file mode 100644 index 000000000..1c7af9fcf --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cairo/folds.scm @@ -0,0 +1,31 @@ +[ + (mod_item) + (struct_item) + (trait_item) + (enum_item) + (impl_item) + (type_item) + + (use_declaration) + (let_declaration) + (namespace_definition) + + (arguments) + (implicit_arguments) + (tuple_type) + + (import_statement) + (attribute_statement) + (with_statement) + (if_statement) + + (function_definition) + (struct_definition) + (loop_expression) + (if_expression) + (match_expression) + (call_expression) + (tuple_expression) + + (attribute_item) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/cairo/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cairo/highlights.scm new file mode 100644 index 000000000..0f68121ae --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cairo/highlights.scm @@ -0,0 +1,338 @@ +; Preproc + +[ + "%builtins" + "%lang" +] @preproc + +; Includes + +(import_statement [ "from" "import" ] @include module_name: (dotted_name (identifier) @namespace . )) + +[ + "as" + "use" + "mod" +] @include + +; Variables + +(identifier) @variable + +; Namespaces + +(namespace_definition (identifier) @namespace) + +(mod_item + name: (identifier) @namespace) + +(use_list (self) @namespace) + +(scoped_use_list (self) @namespace) + +(scoped_identifier + path: (identifier) @namespace) + +(scoped_identifier + (scoped_identifier + name: (identifier) @namespace)) + +(scoped_type_identifier + path: (identifier) @namespace) + +((scoped_identifier + path: (identifier) @type) + (#lua-match? @type "^[A-Z]")) + +((scoped_identifier + name: (identifier) @type) + (#lua-match? @type "^[A-Z]")) + +((scoped_identifier + name: (identifier) @constant) + (#lua-match? @constant "^[A-Z][A-Z%d_]*$")) + +((scoped_identifier + path: (identifier) @type + name: (identifier) @constant) + (#lua-match? @type "^[A-Z]") + (#lua-match? @constant "^[A-Z]")) + +((scoped_type_identifier + path: (identifier) @type + name: (type_identifier) @constant) + (#lua-match? @type "^[A-Z]") + (#lua-match? @constant "^[A-Z]")) + +(scoped_use_list + path: (identifier) @namespace) + +(scoped_use_list + path: (scoped_identifier + (identifier) @namespace)) + +(use_list (scoped_identifier (identifier) @namespace . (_))) + +(use_list (identifier) @type (#lua-match? @type "^[A-Z]")) + +(use_as_clause alias: (identifier) @type (#lua-match? @type "^[A-Z]")) + +; Keywords + +[ + ; 0.x + "using" + "namespace" + "struct" + "let" + "const" + "local" + "rel" + "abs" + "dw" + "alloc_locals" + (inst_ret) + "with_attr" + "with" + "call" + "nondet" + + ; 1.0 + "type" + "impl" + "implicits" + "of" + "ref" + "mut" + "trait" + "enum" +] @keyword + +[ + "func" + "fn" + "end" +] @keyword.function + +"return" @keyword.return + +[ + "cast" + "new" + "and" +] @keyword.operator + +[ + "tempvar" + "extern" +] @storageclass + +[ + "if" + "else" + "match" +] @conditional + +[ + "loop" +] @repeat + +[ + "assert" + "static_assert" + "nopanic" +] @exception + +; Fields + +(implicit_arguments (typed_identifier (identifier) @field)) + +(member_expression "." (identifier) @field) + +(call_expression (assignment_expression left: (identifier) @field)) + +(tuple_expression (assignment_expression left: (identifier) @field)) + +(field_identifier) @field + +(shorthand_field_initializer (identifier) @field) + +; Parameters + +(arguments (typed_identifier (identifier) @parameter)) + +(call_expression (tuple_expression (assignment_expression left: (identifier) @parameter))) + +(return_type (tuple_type (named_type . (identifier) @parameter))) + +(parameter (identifier) @parameter) + +; Builtins + +(builtin_directive (identifier) @variable.builtin) +(lang_directive (identifier) @variable.builtin) + +[ + "ap" + "fp" + (self) +] @variable.builtin + +; Functions + +(function_definition "func" (identifier) @function) +(function_definition "fn" (identifier) @function) +(function_signature "fn" (identifier) @function) +(extern_function_statement (identifier) @function) + +(call_expression + function: (identifier) @function.call) + +(call_expression + function: (scoped_identifier + (identifier) @function.call .)) + +(call_expression + function: (field_expression + field: (field_identifier) @function.call)) + +[ + "jmp" +] @function.builtin + +; Types + +(struct_definition . (identifier) @type (typed_identifier (identifier) @field)?) + +(named_type (identifier) @type .) + +[ + (builtin_type) + (primitive_type) +] @type.builtin + +((identifier) @type + (#lua-match? @type "^[A-Z][a-zA-Z0-9_]*$")) + +(type_identifier) @type + +; Constants + +((identifier) @constant + (#lua-match? @constant "^[A-Z_][A-Z0-9_]*$")) + +(enum_variant + name: (identifier) @constant) + +(call_expression + function: (scoped_identifier + "::" + name: (identifier) @constant) + (#lua-match? @constant "^[A-Z]")) + +((match_arm + pattern: (match_pattern (identifier) @constant)) + (#lua-match? @constant "^[A-Z]")) + +((match_arm + pattern: (match_pattern + (scoped_identifier + name: (identifier) @constant))) + (#lua-match? @constant "^[A-Z]")) + +((identifier) @constant.builtin + (#any-of? @constant.builtin "Some" "None" "Ok" "Err")) + +; Constructors + +(unary_expression "new" (call_expression . (identifier) @constructor)) + +((call_expression . (identifier) @constructor) + (#lua-match? @constructor "^%u")) + +; Attributes + +(decorator "@" @attribute (identifier) @attribute) + +(attribute_item (identifier) @function.macro) + +(attribute_item (scoped_identifier (identifier) @function.macro .)) + +; Labels + +(label . (identifier) @label) + +(inst_jmp_to_label "jmp" . (identifier) @label) + +(inst_jnz_to_label "jmp" . (identifier) @label) + +; Operators + +[ + "+" + "-" + "*" + "/" + "**" + "==" + "!=" + "&" + "=" + "++" + "+=" + "@" + "!" + "~" + ".." + "&&" + "||" + "^" + "<" + "<=" + ">" + ">=" + "<<" + ">>" + "%" + "-=" + "*=" + "/=" + "%=" + "&=" + "|=" + "^=" + "<<=" + ">>=" + "?" +] @operator + +; Literals + +(number) @number + +(boolean) @boolean + +[ + (string) + (short_string) +] @string + +; Punctuation + +(attribute_item "#" @punctuation.special) + +[ "." "," ":" ";" "->" "=>" "::" ] @punctuation.delimiter + +[ "{" "}" "(" ")" "[" "]" "%{" "%}" ] @punctuation.bracket + +(type_parameters [ "<" ">" ] @punctuation.bracket) + +(type_arguments [ "<" ">" ] @punctuation.bracket) + +; Comment + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/cairo/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cairo/indents.scm new file mode 100644 index 000000000..76a22e705 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cairo/indents.scm @@ -0,0 +1,45 @@ +[ + (mod_item) + (struct_item) + (enum_item) + (impl_item) + (struct_expression) + (match_expression) + (tuple_expression) + (match_arm) + (match_block) + (call_expression) + (assignment_expression) + (arguments) + (block) + (use_list) + (field_declaration_list) + (enum_variant_list) + (tuple_pattern) +] @indent.begin + +(import_statement "(") @indent.begin + +(block "}" @indent.end) +(enum_item + body: (enum_variant_list "}" @indent.end)) +(match_expression + body: (match_block "}" @indent.end)) +(mod_item + body: (declaration_list "}" @indent.end)) +(struct_item + body: (field_declaration_list "}" @indent.end)) +(trait_item + body: (declaration_list "}" @indent.end)) + +[ + ")" + "]" + "}" +] @indent.branch + +[ + (comment) + (string) + (short_string) +] @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/cairo/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/cairo/injections.scm new file mode 100644 index 000000000..675a81a76 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cairo/injections.scm @@ -0,0 +1,3 @@ +(python_code) @python + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/cairo/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/cairo/locals.scm new file mode 100644 index 000000000..53b33c01d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cairo/locals.scm @@ -0,0 +1,68 @@ +; References + +(identifier) @reference +((type_identifier) @reference + (#set! reference.kind "type")) +((field_identifier) @reference + (#set! reference.kind "field")) + +; Scopes + +[ + (program) + (block) + (function_definition) + (loop_expression) + (if_expression) + (match_expression) + (match_arm) + + (struct_item) + (enum_item) + (impl_item) +] @scope + +(use_declaration + argument: (scoped_identifier + name: (identifier) @definition.import)) + +(use_as_clause + alias: (identifier) @definition.import) + +(use_list + (identifier) @definition.import) ; use std::process::{Child, Command, Stdio}; + +; Functions + +(function_definition + (identifier) @definition.function) + +(function_definition + (identifier) @definition.method + (parameter (self))) + +; Function with parameters, defines parameters + +(parameter + [ (identifier) (self) ] @definition.parameter) + +; Types + +(struct_item + name: (type_identifier) @definition.type) + +(constrained_type_parameter + left: (type_identifier) @definition.type) ; the P in remove_file>(path: P) + +(enum_item + name: (type_identifier) @definition.type) + +; Module + +(mod_item + name: (identifier) @definition.namespace) + +; Variables + +(assignment_expression + left: (identifier) @definition.var) diff --git a/bundle/nvim-treesitter-0.9.1/queries/capnp/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/capnp/folds.scm new file mode 100644 index 000000000..6e3f9c187 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/capnp/folds.scm @@ -0,0 +1,14 @@ +[ + (annotation_targets) + (const_list) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (struct_shorthand) + (union) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/capnp/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/capnp/highlights.scm new file mode 100644 index 000000000..780f03675 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/capnp/highlights.scm @@ -0,0 +1,154 @@ +; Preproc + +[ + (unique_id) + (top_level_annotation_body) +] @preproc + +; Includes + +[ + "import" + "$import" + "embed" + "using" +] @include + +(import_path) @string @text.uri + +; Keywords + +[ + "annotation" + "enum" + "group" + "interface" + "struct" + "union" + "extends" + "namespace" +] @keyword + +; Builtins + +[ + "const" +] @type.qualifier + +[ + (primitive_type) + "List" +] @type.builtin + +; Typedefs + +(type_definition) @type.definition + +; Labels (@number, @number!) + +(field_version) @label + +; Methods + +[ + (annotation_definition_identifier) + (method_identifier) +] @method + +; Fields + +(field_identifier) @field + +; Properties + +(property) @property + +; Parameters + +[ + (param_identifier) + (return_identifier) +] @parameter + +(annotation_target) @parameter.builtin + +; Constants + +[ + (const_identifier) + (local_const) + (enum_member) +] @constant + +(void) @constant.builtin + +; Types + +[ + (enum_identifier) + (extend_type) + (type_identifier) +] @type + +; Attributes + +[ + (annotation_identifier) + (attribute) +] @attribute + +; Operators + +"=" @operator + +; Literals + +[ + (string) + (concatenated_string) + (block_text) + (namespace) +] @string + +(namespace) @text.underline + +(escape_sequence) @string.escape + +(data_string) @string.special + +(number) @number + +(float) @float + +(boolean) @boolean + +(data_hex) @symbol + +; Punctuation + +[ + "*" + "$" + ":" +] @punctuation.special + +["{" "}"] @punctuation.bracket + +["(" ")"] @punctuation.bracket + +["[" "]"] @punctuation.bracket + +[ + "." + "," + ";" + "->" +] @punctuation.delimiter + +; Comments + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/capnp/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/capnp/indents.scm new file mode 100644 index 000000000..bc7979aea --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/capnp/indents.scm @@ -0,0 +1,38 @@ +[ + (annotation_targets) + (const) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (union) + (field) +] @indent.begin + +((struct_shorthand (property)) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) + +((method (field_version)) @indent.align + (#set! indent.open_delimiter field_version)) + +((const_list (const_value)) @indent.align + (#set! indent.open_delimiter "[") + (#set! indent.close_delimiter "]")) + +(concatenated_string) @indent.align + +[ + "}" + ")" +] @indent.end @indent.branch + + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/capnp/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/capnp/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/capnp/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/capnp/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/capnp/locals.scm new file mode 100644 index 000000000..fb436bf06 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/capnp/locals.scm @@ -0,0 +1,90 @@ +[ + (message) + (annotation_targets) + (const_list) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (struct_shorthand) + (union) +] @scope + +[ + (extend_type) + (field_type) +] @reference +(custom_type (type_identifier) @reference) +(custom_type + (generics + (generic_parameters + (generic_identifier) @reference))) + +(annotation_definition_identifier) @definition + +(const_identifier) @definition.constant + +(enum (enum_identifier) @definition.enum) + +[ + (enum_member) + (field_identifier) +] @definition.field + +(method_identifier) @definition.method + +(namespace) @definition.namespace + +[ + (param_identifier) + (return_identifier) +] @definition.parameter + +(group (type_identifier) @definition.type) + +(struct (type_identifier) @definition.type) + +(union (type_identifier) @definition.type) + +(interface (type_identifier) @definition.type) + +; Generics Related (don't know how to combine these) + +(struct + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(interface + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(method + (implicit_generics + (implicit_generic_parameters + (generic_identifier) @definition.parameter))) + +(method + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(annotation + (generics + (generic_parameters + (generic_identifier) @definition.type))) + +(replace_using + (generics + (generic_parameters + (generic_identifier) @definition.type))) + +(return_type + (generics + (generic_parameters + (generic_identifier) @definition.type))) diff --git a/bundle/nvim-treesitter-0.9.1/queries/chatito/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/chatito/folds.scm new file mode 100644 index 000000000..20cb51941 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/chatito/folds.scm @@ -0,0 +1,5 @@ +[ + (intent_def) + (slot_def) + (alias_def) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/chatito/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/chatito/highlights.scm new file mode 100644 index 000000000..f933f43c3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/chatito/highlights.scm @@ -0,0 +1,54 @@ +;; Punctuation + +[ + "%[" + "@[" + "~[" + "*[" + "]" + "(" + ")" +] @punctuation.bracket + +[":" ","] @punctuation.delimiter + +(["\"" "'"] @punctuation.special @conceal + (#set! conceal "")) + +["%" "?" "#"] @character.special + +;; Entities + +(intent) @namespace + +(slot) @type + +(variation) @type.qualifier + +(alias) @property + +(number) @number + +(argument + key: (string) @label + value: (string) @string) + +(escape) @string.escape + +;; Import + +"import" @include + +(file) @string.special + +;; Text + +(word) @text @spell + +;; Comment + +(comment) @comment @spell + +;; Error + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/chatito/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/chatito/indents.scm new file mode 100644 index 000000000..64b4674b7 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/chatito/indents.scm @@ -0,0 +1,7 @@ +[ + (intent_def) + (slot_def) + (alias_def) +] @indent.begin + +(ERROR "]") @indent.begin diff --git a/bundle/nvim-treesitter-0.9.1/queries/chatito/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/chatito/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/chatito/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/chatito/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/chatito/locals.scm new file mode 100644 index 000000000..4d7a6c1a0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/chatito/locals.scm @@ -0,0 +1,10 @@ +;; Definitions + +(intent_def (intent) @definition) +(slot_def (slot) @definition) +(alias_def (alias) @definition) + +;; References + +(slot_ref (slot) @reference) +(alias_ref (alias) @reference) diff --git a/bundle/nvim-treesitter-0.9.1/queries/clojure/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/clojure/folds.scm new file mode 100644 index 000000000..d54daade6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/clojure/folds.scm @@ -0,0 +1 @@ +(source (list_lit) @fold) diff --git a/bundle/nvim-treesitter-0.9.1/queries/clojure/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/clojure/highlights.scm new file mode 100644 index 000000000..d6b1585fd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/clojure/highlights.scm @@ -0,0 +1,376 @@ +;; >> Explanation +;; Parsers for lisps are a bit weird in that they just return the raw forms. +;; This means we have to do a bit of extra work in the queries to get things +;; highlighted as they should be. +;; +;; For the most part this means that some things have to be assigned multiple +;; groups. +;; By doing this we can add a basic capture and then later refine it with more +;; specialized captures. +;; This can mean that sometimes things are highlighted weirdly because they +;; have multiple highlight groups applied to them. + + +;; >> Literals + +( + (dis_expr) @comment + (#set! "priority" 105) ; Higher priority to mark the whole sexpr as a comment +) +(kwd_lit) @symbol +(str_lit) @string +(num_lit) @number +(char_lit) @character +(bool_lit) @boolean +(nil_lit) @constant.builtin +(comment) @comment @spell +(regex_lit) @string.regex + +["'" "`"] @string.escape + +["~" "~@" "#"] @punctuation.special + +["{" "}" "[" "]" "(" ")"] @punctuation.bracket + + + +;; >> Symbols + +; General symbol highlighting +(sym_lit) @variable + +; General function calls +(list_lit + . + (sym_lit) @function.call) +(anon_fn_lit + . + (sym_lit) @function.call) + +; Quoted symbols +(quoting_lit + (sym_lit) @symbol) +(syn_quoting_lit + (sym_lit) @symbol) + +; Used in destructure pattern +((sym_lit) @parameter + (#lua-match? @parameter "^[&]")) + +; Inline function variables +((sym_lit) @variable.builtin + (#lua-match? @variable.builtin "^%%")) + +; Constructor +((sym_lit) @constructor + (#lua-match? @constructor "^-\\>[^\\>].*")) + +; Builtin dynamic variables +((sym_lit) @variable.builtin + (#any-of? @variable.builtin + "*agent*" "*allow-unresolved-vars*" "*assert*" + "*clojure-version*" "*command-line-args*" + "*compile-files*" "*compile-path*" "*compiler-options*" + "*data-readers*" "*default-data-reader-fn*" + "*err*" "*file*" "*flush-on-newline*" "*fn-loader*" + "*in*" "*math-context*" "*ns*" "*out*" + "*print-dup*" "*print-length*" "*print-level*" + "*print-meta*" "*print-namespace-maps*" "*print-readably*" + "*read-eval*" "*reader-resolver*" + "*source-path*" "*suppress-read*" + "*unchecked-math*" "*use-context-classloader*" + "*verbose-defrecords*" "*warn-on-reflection*")) + +; Builtin repl variables +((sym_lit) @variable.builtin + (#any-of? @variable.builtin + "*1" "*2" "*3" "*e")) + +; Gensym +;; Might not be needed +((sym_lit) @variable + (#lua-match? @variable "^.*#$")) + +; Types +;; TODO: improve? +((sym_lit) @type + (#lua-match? @type "^[%u][^/]*$")) +;; Symbols with `.` but not `/` +((sym_lit) @type + (#lua-match? @type "^[^/]+[.][^/]*$")) + +; Interop +((sym_lit) @method + (#match? @method "^\\.[^-]")) +((sym_lit) @field + (#match? @field "^\\.-")) +((sym_lit) @field + (#lua-match? @field "^[%u].*/.+")) +(list_lit + . + (sym_lit) @method + (#lua-match? @method "^[%u].*/.+")) +;; TODO: Special casing for the `.` macro + +; Operators +((sym_lit) @operator + (#any-of? @operator + "*" "*'" "+" "+'" "-" "-'" "/" + "<" "<=" ">" ">=" "=" "==")) +((sym_lit) @keyword.operator + (#any-of? @keyword.operator + "not" "not=" "and" "or")) + +; Definition functions +((sym_lit) @keyword + (#any-of? @keyword + "def" "defonce" "defrecord" "defmacro" "definline" "definterface" + "defmulti" "defmethod" "defstruct" "defprotocol" + "deftype")) +((sym_lit) @keyword + (#eq? @keyword "declare")) +((sym_name) @keyword.coroutine + (#any-of? @keyword.coroutine + "alts!" "alts!!" "await" "await-for" "await1" "chan" "close!" "future" "go" "sync" "thread" "timeout" "!" ">!!")) +((sym_lit) @keyword.function + (#match? @keyword.function "^(defn|defn-|fn|fn[*])$")) + +; Comment +((sym_lit) @comment + (#any-of? @comment "comment")) + +; Conditionals +((sym_lit) @conditional + (#any-of? @conditional + "case" "cond" "cond->" "cond->>" "condp")) +((sym_lit) @conditional + (#any-of? @conditional + "if" "if-let" "if-not" "if-some")) +((sym_lit) @conditional + (#any-of? @conditional + "when" "when-first" "when-let" "when-not" "when-some")) + +; Repeats +((sym_lit) @repeat + (#any-of? @repeat + "doseq" "dotimes" "for" "loop" "recur" "while")) + +; Exception +((sym_lit) @exception + (#any-of? @exception + "throw" "try" "catch" "finally")) + +; Includes +((sym_lit) @include + (#any-of? @include "ns" "import" "require" "use")) + +; Builtin macros +;; TODO: Do all these items belong here? +((sym_lit) @function.macro + (#any-of? @function.macro + "." ".." "->" "->>" "amap" "areduce" "as->" "assert" + "binding" "bound-fn" "delay" "do" "dosync" + "doto" "extend-protocol" "extend-type" + "gen-class" "gen-interface" "io!" "lazy-cat" + "lazy-seq" "let" "letfn" "locking" "memfn" "monitor-enter" + "monitor-exit" "proxy" "proxy-super" "pvalues" + "refer-clojure" "reify" "set!" "some->" "some->>" + "time" "unquote" "unquote-splicing" "var" "vswap!" + "with-bindings" "with-in-str" "with-loading-context" "with-local-vars" + "with-open" "with-out-str" "with-precision" "with-redefs")) + +; All builtin functions +; (->> (ns-publics *ns*) +; (keep (fn [[s v]] (when-not (:macro (meta v)) s))) +; sort +; clojure.pprint/pprint)) +;; ...and then lots of manual filtering... +((sym_lit) @function.builtin + (#any-of? @function.builtin + "->ArrayChunk" "->Eduction" "->Vec" "->VecNode" "->VecSeq" + "-cache-protocol-fn" "-reset-methods" "PrintWriter-on" + "StackTraceElement->vec" "Throwable->map" "accessor" + "aclone" "add-classpath" "add-tap" "add-watch" "agent" + "agent-error" "agent-errors" "aget" "alength" "alias" + "all-ns" "alter" "alter-meta!" "alter-var-root" "ancestors" + "any?" "apply" "array-map" "aset" "aset-boolean" "aset-byte" + "aset-char" "aset-double" "aset-float" "aset-int" + "aset-long" "aset-short" "assoc" "assoc!" "assoc-in" + "associative?" "atom" "bases" "bean" "bigdec" "bigint" "biginteger" + "bit-and" "bit-and-not" "bit-clear" "bit-flip" "bit-not" "bit-or" + "bit-set" "bit-shift-left" "bit-shift-right" "bit-test" + "bit-xor" "boolean" "boolean-array" "boolean?" + "booleans" "bound-fn*" "bound?" "bounded-count" + "butlast" "byte" "byte-array" "bytes" "bytes?" + "cast" "cat" "char" "char-array" "char-escape-string" + "char-name-string" "char?" "chars" "chunk" "chunk-append" + "chunk-buffer" "chunk-cons" "chunk-first" "chunk-next" + "chunk-rest" "chunked-seq?" "class" "class?" + "clear-agent-errors" "clojure-version" "coll?" + "commute" "comp" "comparator" "compare" "compare-and-set!" + "compile" "complement" "completing" "concat" "conj" + "conj!" "cons" "constantly" "construct-proxy" "contains?" + "count" "counted?" "create-ns" "create-struct" "cycle" + "dec" "dec'" "decimal?" "dedupe" "default-data-readers" + "delay?" "deliver" "denominator" "deref" "derive" + "descendants" "destructure" "disj" "disj!" "dissoc" + "dissoc!" "distinct" "distinct?" "doall" "dorun" "double" + "double-array" "eduction" "empty" "empty?" "ensure" "ensure-reduced" + "enumeration-seq" "error-handler" "error-mode" "eval" + "even?" "every-pred" "every?" "extend" "extenders" "extends?" + "false?" "ffirst" "file-seq" "filter" "filterv" "find" + "find-keyword" "find-ns" "find-protocol-impl" + "find-protocol-method" "find-var" "first" "flatten" + "float" "float-array" "float?" "floats" "flush" "fn?" + "fnext" "fnil" "force" "format" "frequencies" + "future-call" "future-cancel" "future-cancelled?" + "future-done?" "future?" "gensym" "get" "get-in" + "get-method" "get-proxy-class" "get-thread-bindings" + "get-validator" "group-by" "halt-when" "hash" + "hash-combine" "hash-map" "hash-ordered-coll" "hash-set" + "hash-unordered-coll" "ident?" "identical?" "identity" + "ifn?" "in-ns" "inc" "inc'" "indexed?" "init-proxy" + "inst-ms" "inst-ms*" "inst?" "instance?" "int" "int-array" + "int?" "integer?" "interleave" "intern" "interpose" "into" + "into-array" "ints" "isa?" "iterate" "iterator-seq" "juxt" + "keep" "keep-indexed" "key" "keys" "keyword" "keyword?" + "last" "line-seq" "list" "list*" "list?" "load" "load-file" + "load-reader" "load-string" "loaded-libs" "long" "long-array" + "longs" "macroexpand" "macroexpand-1" "make-array" "make-hierarchy" + "map" "map-entry?" "map-indexed" "map?" "mapcat" "mapv" + "max" "max-key" "memoize" "merge" "merge-with" "meta" + "method-sig" "methods" "min" "min-key" "mix-collection-hash" + "mod" "munge" "name" "namespace" "namespace-munge" "nat-int?" + "neg-int?" "neg?" "newline" "next" "nfirst" "nil?" "nnext" + "not-any?" "not-empty" "not-every?" "ns-aliases" + "ns-imports" "ns-interns" "ns-map" "ns-name" "ns-publics" + "ns-refers" "ns-resolve" "ns-unalias" "ns-unmap" "nth" + "nthnext" "nthrest" "num" "number?" "numerator" "object-array" + "odd?" "parents" "partial" "partition" "partition-all" + "partition-by" "pcalls" "peek" "persistent!" "pmap" "pop" + "pop!" "pop-thread-bindings" "pos-int?" "pos?" "pr" + "pr-str" "prefer-method" "prefers" "primitives-classnames" + "print" "print-ctor" "print-dup" "print-method" "print-simple" + "print-str" "printf" "println" "println-str" "prn" "prn-str" + "promise" "proxy-call-with-super" "proxy-mappings" "proxy-name" + "push-thread-bindings" "qualified-ident?" "qualified-keyword?" + "qualified-symbol?" "quot" "rand" "rand-int" "rand-nth" "random-sample" + "range" "ratio?" "rational?" "rationalize" "re-find" "re-groups" + "re-matcher" "re-matches" "re-pattern" "re-seq" "read" + "read+string" "read-line" "read-string" "reader-conditional" + "reader-conditional?" "realized?" "record?" "reduce" + "reduce-kv" "reduced" "reduced?" "reductions" "ref" "ref-history-count" + "ref-max-history" "ref-min-history" "ref-set" "refer" + "release-pending-sends" "rem" "remove" "remove-all-methods" + "remove-method" "remove-ns" "remove-tap" "remove-watch" + "repeat" "repeatedly" "replace" "replicate" + "requiring-resolve" "reset!" "reset-meta!" "reset-vals!" + "resolve" "rest" "restart-agent" "resultset-seq" "reverse" + "reversible?" "rseq" "rsubseq" "run!" "satisfies?" + "second" "select-keys" "send" "send-off" "send-via" + "seq" "seq?" "seqable?" "seque" "sequence" "sequential?" + "set" "set-agent-send-executor!" "set-agent-send-off-executor!" + "set-error-handler!" "set-error-mode!" "set-validator!" + "set?" "short" "short-array" "shorts" "shuffle" + "shutdown-agents" "simple-ident?" "simple-keyword?" + "simple-symbol?" "slurp" "some" "some-fn" "some?" + "sort" "sort-by" "sorted-map" "sorted-map-by" + "sorted-set" "sorted-set-by" "sorted?" "special-symbol?" + "spit" "split-at" "split-with" "str" "string?" + "struct" "struct-map" "subs" "subseq" "subvec" "supers" + "swap!" "swap-vals!" "symbol" "symbol?" "tagged-literal" + "tagged-literal?" "take" "take-last" "take-nth" "take-while" + "tap>" "test" "the-ns" "thread-bound?" "to-array" + "to-array-2d" "trampoline" "transduce" "transient" + "tree-seq" "true?" "type" "unchecked-add" "unchecked-add-int" + "unchecked-byte" "unchecked-char" "unchecked-dec" + "unchecked-dec-int" "unchecked-divide-int" "unchecked-double" + "unchecked-float" "unchecked-inc" "unchecked-inc-int" + "unchecked-int" "unchecked-long" "unchecked-multiply" + "unchecked-multiply-int" "unchecked-negate" "unchecked-negate-int" + "unchecked-remainder-int" "unchecked-short" "unchecked-subtract" + "unchecked-subtract-int" "underive" "unquote" + "unquote-splicing" "unreduced" "unsigned-bit-shift-right" + "update" "update-in" "update-proxy" "uri?" "uuid?" + "val" "vals" "var-get" "var-set" "var?" "vary-meta" "vec" + "vector" "vector-of" "vector?" "volatile!" "volatile?" + "vreset!" "with-bindings*" "with-meta" "with-redefs-fn" "xml-seq" + "zero?" "zipmap" + ;; earlier + "drop" "drop-last" "drop-while" + "double?" "doubles" + "ex-data" "ex-info" + ;; 1.10 + "ex-cause" "ex-message" + ;; 1.11 + "NaN?" "abs" "infinite?" "iteration" "random-uuid" + "parse-boolean" "parse-double" "parse-long" "parse-uuid" + "seq-to-map-for-destructuring" "update-keys" "update-vals" + ;; 1.12 + "partitionv" "partitionv-all" "splitv-at")) + + + +;; >> Context based highlighting + +;; def-likes +;; Correctly highlight docstrings +;(list_lit + ;. + ;(sym_lit) @_keyword ; Don't really want to highlight twice + ;(#any-of? @_keyword + ;"def" "defonce" "defrecord" "defmacro" "definline" + ;"defmulti" "defmethod" "defstruct" "defprotocol" + ;"deftype") + ;. + ;(sym_lit) + ;. + ;;; TODO: Add @comment highlight + ;(str_lit)? + ;. + ;(_)) + +; Function definitions +(list_lit + . + (sym_lit) @_keyword.function + (#any-of? @_keyword.function "fn" "fn*" "defn" "defn-") + . + (sym_lit)? @function + . + ;; TODO: Add @comment highlight + (str_lit)?) +;; TODO: Fix parameter highlighting +;; I think there's a bug here in nvim-treesitter +;; TODO: Reproduce bug and file ticket + ;. + ;[(vec_lit + ; (sym_lit)* @parameter) + ; (list_lit + ; (vec_lit + ; (sym_lit)* @parameter))]) + +;[((list_lit +; (vec_lit +; (sym_lit) @parameter) +; (_) +; + +; ((vec_lit +; (sym_lit) @parameter) +; (_))) + + +; Meta punctuation +;; NOTE: When the above `Function definitions` query captures the +;; the @function it also captures the child meta_lit +;; We capture the meta_lit symbol (^) after so that the later +;; highlighting overrides the former +"^" @punctuation.special + +;; namespaces +(list_lit + . + (sym_lit) @_include + (#eq? @_include "ns") + . + (sym_lit) @namespace) diff --git a/bundle/nvim-treesitter-0.9.1/queries/clojure/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/clojure/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/clojure/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/clojure/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/clojure/locals.scm new file mode 100644 index 000000000..e47adce45 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/clojure/locals.scm @@ -0,0 +1 @@ +; placeholder file to get incremental selection to work diff --git a/bundle/nvim-treesitter-0.9.1/queries/cmake/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cmake/folds.scm new file mode 100644 index 000000000..9ac59ad4c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cmake/folds.scm @@ -0,0 +1,8 @@ +[ + (if_condition) + (foreach_loop) + (while_loop) + (function_def) + (macro_def) + (block_def) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/cmake/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cmake/highlights.scm new file mode 100644 index 000000000..af6b70cc8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cmake/highlights.scm @@ -0,0 +1,217 @@ +(normal_command + (identifier) + (argument_list + (argument (unquoted_argument)) @constant + ) + (#lua-match? @constant "^[%u@][%u%d_]+$") +) + +[ + (quoted_argument) + (bracket_argument) +] @string + +(variable_ref) @none +(variable) @variable + +[ + (bracket_comment) + (line_comment) +] @comment @spell + +(normal_command (identifier) @function) + +["ENV" "CACHE"] @storageclass +["$" "{" "}" "<" ">"] @punctuation.special +["(" ")"] @punctuation.bracket + +[ + (function) + (endfunction) + (macro) + (endmacro) +] @keyword.function + +[ + (if) + (elseif) + (else) + (endif) +] @conditional + +[ + (foreach) + (endforeach) + (while) + (endwhile) +] @repeat + +(normal_command + (identifier) @repeat + (#match? @repeat "\\c^(continue|break)$") +) +(normal_command + (identifier) @keyword.return + (#match? @keyword.return "\\c^return$") +) + +(function_command + (function) + (argument_list + . (argument) @function + (argument)* @parameter + ) +) + +(macro_command + (macro) + (argument_list + . (argument) @function.macro + (argument)* @parameter + ) +) + +(block_def + (block_command + (block) @function.builtin + (argument_list + (argument (unquoted_argument) @constant) + ) + (#any-of? @constant "SCOPE_FOR" "POLICIES" "VARIABLES" "PROPAGATE") + ) + (endblock_command (endblock) @function.builtin) +) +; +((argument) @boolean + (#match? @boolean "\\c^(1|on|yes|true|y|0|off|no|false|n|ignore|notfound|.*-notfound)$") +) +; +(if_command + (if) + (argument_list + (argument) @keyword.operator + ) + (#any-of? @keyword.operator "NOT" "AND" "OR" + "COMMAND" "POLICY" "TARGET" "TEST" "DEFINED" "IN_LIST" + "EXISTS" "IS_NEWER_THAN" "IS_DIRECTORY" "IS_SYMLINK" "IS_ABSOLUTE" + "MATCHES" + "LESS" "GREATER" "EQUAL" "LESS_EQUAL" "GREATER_EQUAL" + "STRLESS" "STRGREATER" "STREQUAL" "STRLESS_EQUAL" "STRGREATER_EQUAL" + "VERSION_LESS" "VERSION_GREATER" "VERSION_EQUAL" "VERSION_LESS_EQUAL" "VERSION_GREATER_EQUAL" + ) +) +(elseif_command + (elseif) + (argument_list + (argument) @keyword.operator + ) + (#any-of? @keyword.operator "NOT" "AND" "OR" + "COMMAND" "POLICY" "TARGET" "TEST" "DEFINED" "IN_LIST" + "EXISTS" "IS_NEWER_THAN" "IS_DIRECTORY" "IS_SYMLINK" "IS_ABSOLUTE" + "MATCHES" + "LESS" "GREATER" "EQUAL" "LESS_EQUAL" "GREATER_EQUAL" + "STRLESS" "STRGREATER" "STREQUAL" "STRLESS_EQUAL" "STRGREATER_EQUAL" + "VERSION_LESS" "VERSION_GREATER" "VERSION_EQUAL" "VERSION_LESS_EQUAL" "VERSION_GREATER_EQUAL" + ) +) + +(normal_command + (identifier) @function.builtin + (#match? @function.builtin "\\c^(cmake_host_system_information|cmake_language|cmake_minimum_required|cmake_parse_arguments|cmake_path|cmake_policy|configure_file|execute_process|file|find_file|find_library|find_package|find_path|find_program|foreach|get_cmake_property|get_directory_property|get_filename_component|get_property|include|include_guard|list|macro|mark_as_advanced|math|message|option|separate_arguments|set|set_directory_properties|set_property|site_name|string|unset|variable_watch|add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|build_command|create_test_sourcelist|define_property|enable_language|enable_testing|export|fltk_wrap_ui|get_source_file_property|get_target_property|get_test_property|include_directories|include_external_msproject|include_regular_expression|install|link_directories|link_libraries|load_cache|project|remove_definitions|set_source_files_properties|set_target_properties|set_tests_properties|source_group|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_precompile_headers|target_sources|try_compile|try_run|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload)$") +) + +(normal_command + (identifier) @_function + (argument_list + . (argument) @variable + ) + (#match? @_function "\\c^set$") +) + +(normal_command + (identifier) @_function + (#match? @_function "\\c^set$") + (argument_list + . (argument) + ( + (argument) @_cache @storageclass + . + (argument) @_type @type + (#any-of? @_cache "CACHE") + (#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL") + ) + ) +) + +(normal_command + (identifier) @_function + (#match? @_function "\\c^unset$") + (argument_list + . (argument) + (argument) @storageclass + (#any-of? @storageclass "CACHE" "PARENT_SCOPE") + ) +) + +(normal_command + (identifier) @_function + (#match? @_function "\\c^list$") + (argument_list + . (argument) @constant + (#any-of? @constant "LENGTH" "GET" "JOIN" "SUBLIST" "FIND") + . (argument) @variable + (argument) @variable . + ) +) +(normal_command + (identifier) @_function + (#match? @_function "\\c^list$") + (argument_list + . (argument) @constant + . (argument) @variable + (#any-of? @constant "APPEND" "FILTER" "INSERT" + "POP_BACK" "POP_FRONT" "PREPEND" + "REMOVE_ITEM" "REMOVE_AT" "REMOVE_DUPLICATES" + "REVERSE" "SORT") + ) +) +(normal_command + (identifier) @_function + (#match? @_function "\\c^list$") + (argument_list + . (argument) @_transform @constant + . (argument) @variable + . (argument) @_action @constant + (#eq? @_transform "TRANSFORM") + (#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE") + ) +) +(normal_command + (identifier) @_function + (#match? @_function "\\c^list$") + (argument_list + . (argument) @_transform @constant + . (argument) @variable + . (argument) @_action @constant + . (argument)? @_selector @constant + (#eq? @_transform "TRANSFORM") + (#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE") + (#any-of? @_selector "AT" "FOR" "REGEX") + ) +) +(normal_command + (identifier) @_function + (#match? @_function "\\c^list$") + (argument_list + . (argument) @_transform @constant + (argument) @constant . + (argument) @variable + (#eq? @_transform "TRANSFORM") + (#eq? @constant "OUTPUT_VARIABLE") + ) +) + +(escape_sequence) @string.escape + +((source_file . (line_comment) @preproc) + (#lua-match? @preproc "^#!/")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/cmake/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cmake/indents.scm new file mode 100644 index 000000000..787cc2c98 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cmake/indents.scm @@ -0,0 +1,25 @@ +[ + (normal_command) + (if_condition) + (foreach_loop) + (while_loop) + (function_def) + (macro_def) + (block_def) +] @indent.begin + +[ + (elseif_command) + (else_command) + (endif_command) + (endforeach_command) + (endwhile_command) + (endfunction_command) + (endmacro_command) + (endblock_command) +] @indent.branch + +(")" @indent.branch) +(")" @indent.end) + +(argument_list) @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/comment/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/comment/highlights.scm new file mode 100644 index 000000000..70aa92de2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/comment/highlights.scm @@ -0,0 +1,43 @@ +(_) @spell + +((tag + (name) @text.todo @nospell + ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @text.todo "TODO" "WIP")) + +("text" @text.todo @nospell + (#any-of? @text.todo "TODO" "WIP")) + +((tag + (name) @text.note @nospell + ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @text.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) + +("text" @text.note @nospell + (#any-of? @text.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) + +((tag + (name) @text.warning @nospell + ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @text.warning "HACK" "WARNING" "WARN" "FIX")) + +("text" @text.warning @nospell + (#any-of? @text.warning "HACK" "WARNING" "WARN" "FIX")) + +((tag + (name) @text.danger @nospell + ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @text.danger "FIXME" "BUG" "ERROR")) + +("text" @text.danger @nospell + (#any-of? @text.danger "FIXME" "BUG" "ERROR")) + +; Issue number (#123) +("text" @number + (#lua-match? @number "^#[0-9]+$")) + +((uri) @text.uri @nospell) diff --git a/bundle/nvim-treesitter-0.9.1/queries/commonlisp/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/folds.scm new file mode 100644 index 000000000..d54daade6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/folds.scm @@ -0,0 +1 @@ +(source (list_lit) @fold) diff --git a/bundle/nvim-treesitter-0.9.1/queries/commonlisp/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/highlights.scm new file mode 100644 index 000000000..55c0c8fc2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/highlights.scm @@ -0,0 +1,145 @@ +(sym_lit) @variable + +;; A highlighting for functions/macros in th cl namespace is available in theHamsta/nvim-treesitter-commonlisp +;(list_lit . (sym_lit) @function.builtin (#cl-standard-function? @function.builtin)) +;(list_lit . (sym_lit) @function.builtin (#cl-standard-macro? @function.macro)) + +(dis_expr) @comment + +(defun_keyword) @function.macro +(defun_header + function_name: (_) @function) +(defun_header + lambda_list: (list_lit (sym_lit) @parameter)) +(defun_header + keyword: (defun_keyword "defmethod") + lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @symbol))) +(defun_header + lambda_list: (list_lit (list_lit . (sym_lit) @parameter . (_)))) +(defun_header + specifier: (sym_lit) @symbol) + +[":" "::" "."] @punctuation.special + +[ + (accumulation_verb) + (for_clause_word) + "for" + "and" + "finally" + "thereis" + "always" + "when" + "if" + "unless" + "else" + "do" + "loop" + "below" + "in" + "from" + "across" + "repeat" + "being" + "into" + "with" + "as" + "while" + "until" + "return" + "initially" +] @function.macro +"=" @operator + +(include_reader_macro) @symbol +["#C" "#c"] @number + +[(kwd_lit) (self_referential_reader_macro)] @symbol + +(package_lit + package: (_) @namespace) +"cl" @namespace + +(str_lit) @string + +(num_lit) @number + +((sym_lit) @boolean (#any-of? @boolean "t" "T")) + +(nil_lit) @constant.builtin + +(comment) @comment @spell + +;; dynamic variables +((sym_lit) @variable.builtin + (#lua-match? @variable.builtin "^[*].+[*]$")) + +;; quote +"'" @string.escape +(format_specifier) @string.escape +(quoting_lit) @string.escape + +;; syntax quote +"`" @string.escape +"," @string.escape +",@" @string.escape +(syn_quoting_lit) @string.escape +(unquoting_lit) @none +(unquote_splicing_lit) @none + + +["(" ")"] @punctuation.bracket + +(block_comment) @comment @spell + + +(with_clause + type: (_) @type) +(for_clause + type: (_) @type) + +;; defun-like things +(list_lit + . + (sym_lit) @function.macro + . + (sym_lit) @function + (#eq? @function.macro "deftest")) + +;;; Macros and Special Operators +(list_lit + . + (sym_lit) @function.macro + ;; Generated via https://github.com/theHamsta/nvim-treesitter-commonlisp/blob/22fdc9fd6ed594176cc7299cc6f68dd21c94c63b/scripts/generate-symbols.lisp#L1-L21 + (#any-of? @function.macro + "do*" "step" "handler-bind" "decf" "prog1" "destructuring-bind" "defconstant" "do" "lambda" "with-standard-io-syntax" "case" "restart-bind" "ignore-errors" "with-slots" "prog2" "defclass" "define-condition" "print-unreadable-object" "defvar" "when" "with-open-file" "prog" "incf" "declaim" "and" "loop-finish" "multiple-value-bind" "pop" "psetf" "defmacro" "with-open-stream" "define-modify-macro" "defsetf" "formatter" "call-method" "handler-case" "pushnew" "or" "with-hash-table-iterator" "ecase" "cond" "defun" "remf" "ccase" "define-compiler-macro" "dotimes" "multiple-value-list" "assert" "deftype" "with-accessors" "trace" "with-simple-restart" "do-symbols" "nth-value" "define-symbol-macro" "psetq" "rotatef" "dolist" "check-type" "multiple-value-setq" "push" "pprint-pop" "loop" "define-setf-expander" "pprint-exit-if-list-exhausted" "with-condition-restarts" "defstruct" "with-input-from-string" "with-compilation-unit" "defgeneric" "with-output-to-string" "untrace" "defparameter" "ctypecase" "do-external-symbols" "etypecase" "do-all-symbols" "with-package-iterator" "unless" "defmethod" "in-package" "defpackage" "return" "typecase" "shiftf" "setf" "pprint-logical-block" "time" "restart-case" "prog*" "define-method-combination" "optimize")) + +;; constant +((sym_lit) @constant + (#lua-match? @constant "^[+].+[+]$")) + +(var_quoting_lit + marker: "#'" @symbol + value: (_) @symbol) + +["#" "#p" "#P"] @symbol + +(list_lit + . + (sym_lit) @function.builtin + ;; Generated via https://github.com/theHamsta/nvim-treesitter-commonlisp/blob/22fdc9fd6ed594176cc7299cc6f68dd21c94c63b/scripts/generate-symbols.lisp#L1-L21 + (#any-of? @function.builtin + "apropos-list" "subst" "substitute" "pprint-linear" "file-namestring" "write-char" "do*" "slot-exists-p" "file-author" "macro-function" "rassoc" "make-echo-stream" "arithmetic-error-operation" "position-if-not" "list" "cdadr" "lisp-implementation-type" "vector-push" "let" "length" "string-upcase" "adjoin" "digit-char" "step" "member-if" "handler-bind" "lognot" "apply" "gcd" "slot-unbound" "stringp" "values-list" "stable-sort" "decode-float" "make-list" "rplaca" "isqrt" "export" "synonym-stream-symbol" "function-keywords" "replace" "tanh" "maphash" "code-char" "decf" "array-displacement" "string-not-lessp" "slot-value" "remove-if" "cell-error-name" "vectorp" "cdddar" "two-way-stream-output-stream" "parse-integer" "get-internal-real-time" "fourth" "make-string" "slot-missing" "byte-size" "string-trim" "nstring-downcase" "cdaddr" "<" "labels" "interactive-stream-p" "fifth" "max" "logxor" "pathname-name" "function" "realp" "eql" "logand" "short-site-name" "prog1" "user-homedir-pathname" "list-all-packages" "exp" "cadar" "read-char-no-hang" "package-error-package" "stream-external-format" "bit-andc2" "nsubstitute-if" "mapcar" "complement" "load-logical-pathname-translations" "pprint-newline" "oddp" "caaar" "destructuring-bind" "copy-alist" "acos" "go" "bit-nor" "defconstant" "fceiling" "tenth" "nreverse" "=" "nunion" "slot-boundp" "string>" "count-if" "atom" "char=" "random-state-p" "row-major-aref" "bit-andc1" "translate-pathname" "simple-vector-p" "coerce" "substitute-if-not" "zerop" "invalid-method-error" "compile" "realpart" "remove-if-not" "pprint-tab" "hash-table-rehash-threshold" "invoke-restart" "if" "count" "/=" "do" "initialize-instance" "abs" "schar" "simple-condition-format-control" "delete-package" "subst-if" "lambda" "hash-table-count" "array-has-fill-pointer-p" "bit" "with-standard-io-syntax" "parse-namestring" "proclaim" "array-in-bounds-p" "multiple-value-call" "rplacd" "some" "graphic-char-p" "read-from-string" "consp" "cadaar" "acons" "every" "make-pathname" "mask-field" "case" "set-macro-character" "bit-and" "restart-bind" "echo-stream-input-stream" "compile-file" "fill-pointer" "numberp" "acosh" "array-dimensions" "documentation" "minusp" "inspect" "copy-structure" "integer-length" "ensure-generic-function" "char>=" "quote" "lognor" "make-two-way-stream" "ignore-errors" "tailp" "with-slots" "fboundp" "logical-pathname-translations" "equal" "float-sign" "shadow" "sleep" "numerator" "prog2" "getf" "ldb-test" "round" "locally" "echo-stream-output-stream" "log" "get-macro-character" "alphanumericp" "find-method" "nintersection" "defclass" "define-condition" "print-unreadable-object" "defvar" "broadcast-stream-streams" "floatp" "subst-if-not" "integerp" "translate-logical-pathname" "subsetp" "when" "write-string" "with-open-file" "clrhash" "apropos" "intern" "min" "string-greaterp" "import" "nset-difference" "prog" "incf" "both-case-p" "multiple-value-prog1" "characterp" "streamp" "digit-char-p" "random" "string-lessp" "make-string-input-stream" "copy-symbol" "read-sequence" "logcount" "bit-not" "boundp" "encode-universal-time" "third" "declaim" "map" "cons" "set-syntax-from-char" "and" "cis" "symbol-plist" "loop-finish" "standard-char-p" "multiple-value-bind" "asin" "string" "pop" "complex" "fdefinition" "psetf" "type-error-datum" "output-stream-p" "floor" "write-line" "<=" "defmacro" "rational" "hash-table-test" "with-open-stream" "read-char" "string-capitalize" "get-properties" "y-or-n-p" "use-package" "remove" "compiler-macro-function" "read" "package-nicknames" "remove-duplicates" "make-load-form-saving-slots" "dribble" "define-modify-macro" "make-dispatch-macro-character" "close" "cosh" "open" "finish-output" "string-downcase" "car" "nstring-capitalize" "software-type" "read-preserving-whitespace" "cadr" "fround" "nsublis" "defsetf" "find-all-symbols" "char>" "no-applicable-method" "compute-restarts" "pathname" "bit-orc2" "write-sequence" "pprint-tabular" "symbol-value" "char-name" "get-decoded-time" "formatter" "bit-vector-p" "intersection" "pathname-type" "clear-input" "call-method" "princ-to-string" "symbolp" "make-load-form" "nsubst" "pprint-dispatch" "handler-case" "method-combination-error" "probe-file" "atan" "string<" "type-error-expected-type" "pushnew" "unread-char" "print" "or" "with-hash-table-iterator" "make-sequence" "ecase" "unwind-protect" "require" "sixth" "get-dispatch-macro-character" "char-not-lessp" "read-byte" "tagbody" "file-error-pathname" "catch" "rationalp" "char-downcase" "char-int" "array-rank" "cond" "last" "make-string-output-stream" "array-dimension" "host-namestring" "input-stream-p" "decode-universal-time" "defun" "eval-when" "char-code" "pathname-directory" "evenp" "subseq" "pprint" "ftruncate" "make-instance" "pathname-host" "logbitp" "remf" "1+" "copy-pprint-dispatch" "char-upcase" "error" "read-line" "second" "make-package" "directory" "special-operator-p" "open-stream-p" "rassoc-if-not" "ccase" "equalp" "substitute-if" "*" "char/=" "cdr" "sqrt" "lcm" "logical-pathname" "eval" "define-compiler-macro" "nsubstitute-if-not" "mapcon" "imagpart" "set-exclusive-or" "simple-condition-format-arguments" "expt" "concatenate" "file-position" "macrolet" "keywordp" "hash-table-rehash-size" "+" "eighth" "use-value" "char-equal" "bit-xor" "format" "byte" "dotimes" "namestring" "char-not-equal" "multiple-value-list" "assert" "append" "notany" "typep" "delete-file" "makunbound" "cdaar" "file-write-date" ">" "cdddr" "write-to-string" "funcall" "member-if-not" "deftype" "readtable-case" "with-accessors" "truename" "constantp" "rassoc-if" "caaadr" "tree-equal" "nset-exclusive-or" "nsubstitute" "make-instances-obsolete" "package-use-list" "invoke-debugger" "provide" "count-if-not" "trace" "logandc1" "nthcdr" "char<=" "functionp" "with-simple-restart" "set-dispatch-macro-character" "logorc2" "unexport" "rest" "unbound-slot-instance" "make-hash-table" "hash-table-p" "reinitialize-instance" "nth" "do-symbols" "nreconc" "macroexpand" "store-value" "float-precision" "remprop" "nth-value" "define-symbol-macro" "update-instance-for-redefined-class" "identity" "progv" "progn" "return-from" "readtablep" "rem" "symbol-name" "psetq" "wild-pathname-p" "char" "list*" "char<" "plusp" "pairlis" "cddar" "pprint-indent" "union" "compiled-function-p" "rotatef" "abort" "machine-type" "concatenated-stream-streams" "string-right-trim" "enough-namestring" "arithmetic-error-operands" "ceiling" "dolist" "delete" "make-condition" "string-left-trim" "integer-decode-float" "check-type" "notevery" "function-lambda-expression" "-" "multiple-value-setq" "name-char" "push" "pprint-pop" "compile-file-pathname" "list-length" "nstring-upcase" "eq" "find-if" "method-qualifiers" "caadr" "cddr" "string=" "let*" "remove-method" "pathname-match-p" "find-package" "truncate" "caaddr" "get-setf-expansion" "loop" "define-setf-expander" "caddr" "package-shadowing-symbols" "force-output" "slot-makunbound" "string-not-greaterp" "cdadar" "cdaadr" "logandc2" "make-array" "merge-pathnames" "sin" "1-" "machine-version" "ffloor" "packagep" "set-pprint-dispatch" "flet" "gensym" "pprint-exit-if-list-exhausted" "cos" "get" "mapl" "delete-if" "with-condition-restarts" "atanh" "copy-list" "fill" "char-not-greaterp" "bit-orc1" "mod" "package-used-by-list" "warn" "add-method" "simple-string-p" "find-restart" "describe" "pathname-version" "peek-char" "yes-or-no-p" "complexp" "aref" "not" "position-if" "string>=" "defstruct" "float-radix" "ninth" "caadar" "subtypep" "set" "butlast" "allocate-instance" "with-input-from-string" "assoc" "write" "make-random-state" "bit-eqv" "float-digits" "long-site-name" "with-compilation-unit" "delete-duplicates" "make-symbol" "room" "cdar" "pprint-fill" "defgeneric" "macroexpand-1" "scale-float" "cdaaar" "update-instance-for-different-class" "array-row-major-index" "ed" "file-string-length" "ensure-directories-exist" "copy-readtable" "string<=" "seventh" "with-output-to-string" "signum" "elt" "untrace" "null" "defparameter" "block" "prin1" "revappend" "gentemp" "ctypecase" "ash" "sxhash" "listp" "do-external-symbols" "bit-ior" "etypecase" "sort" "change-class" "find-class" "alpha-char-p" "map-into" "terpri" "do-all-symbols" "ldb" "logorc1" "search" "fmakunbound" "load" "character" "string-not-equal" "pathnamep" "make-broadcast-stream" "arrayp" "mapcan" "cerror" "invoke-restart-interactively" "assoc-if-not" "with-package-iterator" "get-internal-run-time" "read-delimited-list" "unless" "lower-case-p" "restart-name" "/" "boole" "defmethod" "float" "software-version" "vector-pop" "vector-push-extend" "caar" "ldiff" "member" "find-symbol" "reduce" "svref" "describe-object" "logior" "string-equal" "type-of" "position" "cddadr" "pathname-device" "get-output-stream-string" "symbol-package" "tan" "compute-applicable-methods" "cddddr" "nsubst-if-not" "sublis" "set-difference" "two-way-stream-input-stream" "adjustable-array-p" "machine-instance" "signal" "conjugate" "caaaar" "endp" "lisp-implementation-version" "cddaar" "package-name" "adjust-array" "bit-nand" "gethash" "in-package" "symbol-function" "make-concatenated-stream" "defpackage" "class-of" "no-next-method" "logeqv" "deposit-field" "disassemble" "unuse-package" "copy-tree" "find" "asinh" "class-name" "rename-file" "values" "print-not-readable-object" "mismatch" "cadadr" "shadowing-import" "delete-if-not" "maplist" "listen" "return" "stream-element-type" "unintern" "merge" "make-synonym-stream" "prin1-to-string" "nsubst-if" "byte-position" "phase" "muffle-warning" "remhash" "continue" "load-time-value" "hash-table-size" "upgraded-complex-part-type" "char-lessp" "sbit" "upgraded-array-element-type" "file-length" "typecase" "cadddr" "first" "rationalize" "logtest" "find-if-not" "dpb" "mapc" "sinh" "char-greaterp" "shiftf" "denominator" "get-universal-time" "nconc" "setf" "lognand" "rename-package" "pprint-logical-block" "break" "symbol-macrolet" "the" "fresh-line" "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")) + +(list_lit + . + (sym_lit) @operator + (#match? @operator "^([+*-+=<>]|<=|>=|/=)$")) + + +((sym_lit) @symbol +(#lua-match? @symbol "^[&]")) + +[(array_dimension) "#0A" "#0a"] @number + +(char_lit) @character diff --git a/bundle/nvim-treesitter-0.9.1/queries/commonlisp/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/locals.scm new file mode 100644 index 000000000..471fad408 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/commonlisp/locals.scm @@ -0,0 +1,72 @@ + +(defun_header + function_name: (sym_lit) @definition.function (#set! definition.function.scope "parent")) +(defun_header + lambda_list: (list_lit (sym_lit) @definition.parameter)) + +(defun_header + keyword: (defun_keyword "defmethod") + lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @definition.type))) +(defun_header + lambda_list: (list_lit (list_lit . (sym_lit) @definition.parameter . (_)))) + +(sym_lit) @reference + +(defun) @scope + +((list_lit . (sym_lit) @_defvar . (sym_lit) @definition.var) +(#match? @_defvar "^(cl:)?(defvar|defparameter)$")) + +(list_lit + . + (sym_lit) @_deftest + . + (sym_lit) @definition.function + (#eq? @_deftest "deftest")) @scope + +(list_lit + . + (sym_lit) @_deftest + . + (sym_lit) @definition.function + (#eq? @_deftest "deftest")) @scope + +(for_clause . (sym_lit) @definition.var) +(with_clause . (sym_lit) @definition.var) +(loop_macro) @scope + +(list_lit + . + (sym_lit) @_let (#match? @_let "(cl:|cffi:)?(with-accessors|with-foreign-objects|let[*]?)") + . + (list_lit (list_lit . (sym_lit) @definition.var))) @scope + +(list_lit + . + (sym_lit) @_let (#match? @_let "(cl:|alexandria:)?(with-gensyms|dotimes|with-foreign-object)") + . + (list_lit . (sym_lit) @definition.var)) @scope + +(list_lit + . + (kwd_lit) @_import_from (#eq? @_import_from ":import-from") + . + (_) + (kwd_lit (kwd_symbol) @definition.import)) + +(list_lit + . + (kwd_lit) @_import_from (#eq? @_import_from ":import-from") + . + (_) + (sym_lit) @definition.import) + +(list_lit + . + (kwd_lit) @_use (#eq? @_use ":use") + (kwd_lit (kwd_symbol) @definition.import)) + +(list_lit + . + (kwd_lit) @_use (#eq? @_use ":use") + (sym_lit) @definition.import) diff --git a/bundle/nvim-treesitter-0.9.1/queries/cooklang/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cooklang/highlights.scm new file mode 100644 index 000000000..4ced465bd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cooklang/highlights.scm @@ -0,0 +1,22 @@ +(metadata) @comment + +(ingredient + "@" @tag + (name)? @text.title + (amount + (quantity)? @number + (units)? @tag.attribute)?) + +(timer + "~" @tag + (name)? @text.title + (amount + (quantity)? @number + (units)? @tag.attribute)?) + +(cookware + "#" @tag + (name)? @text.title + (amount + (quantity)? @number + (units)? @tag.attribute)?) diff --git a/bundle/nvim-treesitter-0.9.1/queries/corn/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/corn/folds.scm new file mode 100644 index 000000000..c081ecb47 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/corn/folds.scm @@ -0,0 +1,5 @@ +[ + (object) + (array) + (assign_block) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/corn/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/corn/highlights.scm new file mode 100644 index 000000000..9bb0274e5 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/corn/highlights.scm @@ -0,0 +1,22 @@ +"let" @keyword +"in" @keyword + +[ + "{" + "}" + "[" + "]" +] @punctuation.bracket + +"." @punctuation.delimiter + +(input) @constant +(comment) @comment + +(string) @string +(integer) @number +(float) @float +(boolean) @boolean +(null) @keyword + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/corn/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/corn/indents.scm new file mode 100644 index 000000000..1f5a2c402 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/corn/indents.scm @@ -0,0 +1,14 @@ +[ + (assign_block "{") + (object) + (array) +] @indent.begin + +(assign_block "}" @indent.branch) +(assign_block "}" @indent.end) + +(object "}" @indent.branch) +(object "}" @indent.end) + +(array "]" @indent.branch) +(array "]" @indent.end) diff --git a/bundle/nvim-treesitter-0.9.1/queries/corn/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/corn/locals.scm new file mode 100644 index 000000000..f6b0d4c70 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/corn/locals.scm @@ -0,0 +1,16 @@ +; scopes + +[ + (object) + (array) +] @scope + +; definitions + +(assign_block + (assignment + (input) + @definition.constant)) + +(value (input) @reference) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpon/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cpon/folds.scm new file mode 100644 index 000000000..02feec4e1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpon/folds.scm @@ -0,0 +1,5 @@ +[ + (meta_map) + (map) + (array) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpon/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cpon/highlights.scm new file mode 100644 index 000000000..807714a0f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpon/highlights.scm @@ -0,0 +1,50 @@ +; Literals + +(string) @string +(escape_sequence) @string.escape + +(hex_blob + "x" @character.special + (_) @string) + +(esc_blob + "b" @character.special + (_) @string) + +(datetime + "d" @character.special + (_) @string.special) + +(_ key: (_) @label) + +(number) @number + +(float) @float + +(boolean) @boolean + +(null) @constant.builtin + +; Punctuation + +[ + "," + ":" +] @punctuation.delimiter + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +(("\"" @conceal) + (#set! conceal "")) + +; Comments + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpon/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cpon/indents.scm new file mode 100644 index 000000000..8ec2ff57c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpon/indents.scm @@ -0,0 +1,17 @@ +[ + (meta_map) + (map) + (imap) + (array) +] @indent.begin + +[ + "]" + "}" + ">" +] @indent.end @indent.branch + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpon/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/cpon/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpon/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpon/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/cpon/locals.scm new file mode 100644 index 000000000..c1854af91 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpon/locals.scm @@ -0,0 +1,7 @@ +[ + (document) + + (meta_map) + (map) + (array) +] @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpp/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cpp/folds.scm new file mode 100644 index 000000000..23d623b04 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpp/folds.scm @@ -0,0 +1,14 @@ +; inherits: c + +[ + (for_range_loop) + (class_specifier) + (field_declaration + type: (enum_specifier) + default_value: (initializer_list)) + (template_declaration) + (namespace_definition) + (try_statement) + (catch_clause) + (lambda_expression) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpp/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cpp/highlights.scm new file mode 100644 index 000000000..bce3f9061 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpp/highlights.scm @@ -0,0 +1,240 @@ +; inherits: c + +((identifier) @field + (#lua-match? @field "^m?_.*$")) + +(parameter_declaration + declarator: (reference_declarator) @parameter) + +; function(Foo ...foo) +(variadic_parameter_declaration + declarator: (variadic_declarator + (_) @parameter)) +; int foo = 0 +(optional_parameter_declaration + declarator: (_) @parameter) + +;(field_expression) @parameter ;; How to highlight this? + +(((field_expression + (field_identifier) @method)) @_parent + (#has-parent? @_parent template_method function_declarator)) + +(field_declaration + (field_identifier) @field) + +(field_initializer + (field_identifier) @property) + +(function_declarator + declarator: (field_identifier) @method) + +(concept_definition + name: (identifier) @type.definition) + +(alias_declaration + name: (type_identifier) @type.definition) + +(auto) @type.builtin + +(namespace_identifier) @namespace +((namespace_identifier) @type + (#lua-match? @type "^[%u]")) + +(case_statement + value: (qualified_identifier (identifier) @constant)) + +(using_declaration . "using" . "namespace" . [(qualified_identifier) (identifier)] @namespace) + +(destructor_name + (identifier) @method) + +; functions +(function_declarator + (qualified_identifier + (identifier) @function)) +(function_declarator + (qualified_identifier + (qualified_identifier + (identifier) @function))) +(function_declarator + (qualified_identifier + (qualified_identifier + (qualified_identifier + (identifier) @function)))) +((qualified_identifier + (qualified_identifier + (qualified_identifier + (qualified_identifier + (identifier) @function)))) @_parent + (#has-ancestor? @_parent function_declarator)) + +(function_declarator + (template_function + (identifier) @function)) + +(operator_name) @function +"operator" @function +"static_assert" @function.builtin + +(call_expression + (qualified_identifier + (identifier) @function.call)) +(call_expression + (qualified_identifier + (qualified_identifier + (identifier) @function.call))) +(call_expression + (qualified_identifier + (qualified_identifier + (qualified_identifier + (identifier) @function.call)))) +((qualified_identifier + (qualified_identifier + (qualified_identifier + (qualified_identifier + (identifier) @function.call)))) @_parent + (#has-ancestor? @_parent call_expression)) + +(call_expression + (template_function + (identifier) @function.call)) +(call_expression + (qualified_identifier + (template_function + (identifier) @function.call))) +(call_expression + (qualified_identifier + (qualified_identifier + (template_function + (identifier) @function.call)))) +(call_expression + (qualified_identifier + (qualified_identifier + (qualified_identifier + (template_function + (identifier) @function.call))))) +((qualified_identifier + (qualified_identifier + (qualified_identifier + (qualified_identifier + (template_function + (identifier) @function.call))))) @_parent + (#has-ancestor? @_parent call_expression)) + +; methods +(function_declarator + (template_method + (field_identifier) @method)) +(call_expression + (field_expression + (field_identifier) @method.call)) + +; constructors + +((function_declarator + (qualified_identifier + (identifier) @constructor)) + (#lua-match? @constructor "^%u")) + +((call_expression + function: (identifier) @constructor) +(#lua-match? @constructor "^%u")) +((call_expression + function: (qualified_identifier + name: (identifier) @constructor)) +(#lua-match? @constructor "^%u")) + +((call_expression + function: (field_expression + field: (field_identifier) @constructor)) +(#lua-match? @constructor "^%u")) + +;; constructing a type in an initializer list: Constructor (): **SuperType (1)** +((field_initializer + (field_identifier) @constructor + (argument_list)) + (#lua-match? @constructor "^%u")) + + +; Constants + +(this) @variable.builtin +(null "nullptr" @constant.builtin) + +(true) @boolean +(false) @boolean + +; Literals + +(raw_string_literal) @string + +; Keywords + +[ + "try" + "catch" + "noexcept" + "throw" +] @exception + + +[ + "class" + "decltype" + "explicit" + "friend" + "namespace" + "override" + "template" + "typename" + "using" + "concept" + "requires" +] @keyword + +[ + "co_await" +] @keyword.coroutine + +[ + "co_yield" + "co_return" +] @keyword.coroutine.return + +[ + "public" + "private" + "protected" + "virtual" + "final" +] @type.qualifier + +[ + "new" + "delete" + + "xor" + "bitand" + "bitor" + "compl" + "not" + "xor_eq" + "and_eq" + "or_eq" + "not_eq" + "and" + "or" +] @keyword.operator + +"<=>" @operator + +"::" @punctuation.delimiter + +(template_argument_list + ["<" ">"] @punctuation.bracket) + +(template_parameter_list + ["<" ">"] @punctuation.bracket) + +(literal_suffix) @operator diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpp/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cpp/indents.scm new file mode 100644 index 000000000..7df9aea0c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpp/indents.scm @@ -0,0 +1,11 @@ +; inherits: c + +[ + (class_specifier) + (condition_clause) +] @indent.begin + +((field_initializer_list) @indent.begin + (#set! indent.start_at_same_line 1)) +(access_specifier) @indent.branch + diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpp/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/cpp/injections.scm new file mode 100644 index 000000000..1d8e11cb3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpp/injections.scm @@ -0,0 +1,10 @@ +((preproc_def (preproc_arg) @cpp) + (#lua-match? @cpp "\n")) +(preproc_function_def (preproc_arg) @cpp) +(preproc_call (preproc_arg) @cpp) + +(comment) @comment + +(raw_string_literal + delimiter: (raw_string_delimiter) @language + (raw_string_content) @content) diff --git a/bundle/nvim-treesitter-0.9.1/queries/cpp/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/cpp/locals.scm new file mode 100644 index 000000000..570a22af0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cpp/locals.scm @@ -0,0 +1,75 @@ +; inherits: c + +;; Parameters +(variadic_parameter_declaration + declarator: (variadic_declarator + (identifier) @definition.parameter)) +(optional_parameter_declaration + declarator: (identifier) @definition.parameter) +;; Class / struct definitions +(class_specifier) @scope + +(reference_declarator + (identifier) @definition.var) + +(variadic_declarator + (identifier) @definition.var) + +(struct_specifier + name: (qualified_identifier + name: (type_identifier) @definition.type)) + +(class_specifier + name: (type_identifier) @definition.type) + +(concept_definition + name: (identifier) @definition.type) + +(class_specifier + name: (qualified_identifier + name: (type_identifier) @definition.type)) + +(alias_declaration + name: (type_identifier) @definition.type) + +;template +(type_parameter_declaration + (type_identifier) @definition.type) +(template_declaration) @scope + +;; Namespaces +(namespace_definition + name: (namespace_identifier) @definition.namespace + body: (_) @scope) + +(namespace_definition + name: (nested_namespace_specifier) @definition.namespace + body: (_) @scope) + +((namespace_identifier) @reference + (#set! reference.kind "namespace")) + +;; Function definitions +(template_function + name: (identifier) @definition.function) @scope + +(template_method + name: (field_identifier) @definition.method) @scope + +(function_declarator + declarator: (qualified_identifier + name: (identifier) @definition.function)) @scope + +(field_declaration + declarator: (function_declarator + (field_identifier) @definition.method)) + +(lambda_expression) @scope + +;; Control structures +(try_statement + body: (_) @scope) + +(catch_clause) @scope + +(requires_expression) @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/css/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/css/folds.scm new file mode 100644 index 000000000..9d2995c48 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/css/folds.scm @@ -0,0 +1,3 @@ +[ + (rule_set) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/css/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/css/highlights.scm new file mode 100644 index 000000000..b26f0ec96 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/css/highlights.scm @@ -0,0 +1,91 @@ +[ + "@media" + "@charset" + "@namespace" + "@supports" + "@keyframes" + (at_keyword) + (to) + (from) + ] @keyword + +"@import" @include + +(comment) @comment @spell + +[ + (tag_name) + (nesting_selector) + (universal_selector) + ] @type + +(function_name) @function + +[ + "~" + ">" + "+" + "-" + "*" + "/" + "=" + "^=" + "|=" + "~=" + "$=" + "*=" + "and" + "or" + "not" + "only" + ] @operator + +(important) @type.qualifier + +(attribute_selector (plain_value) @string) +(pseudo_element_selector "::" (tag_name) @property) +(pseudo_class_selector (class_name) @property) + +[ + (class_name) + (id_name) + (property_name) + (feature_name) + (attribute_name) + ] @property + +(namespace_name) @namespace + +((property_name) @type.definition + (#lua-match? @type.definition "^[-][-]")) +((plain_value) @type + (#lua-match? @type "^[-][-]")) + +[ + (string_value) + (color_value) + (unit) + ] @string + +[ + (integer_value) + (float_value) + ] @number + +[ + "#" + "," + "." + ":" + "::" + ";" + ] @punctuation.delimiter + +[ + "{" + ")" + "(" + "}" + ] @punctuation.bracket + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/css/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/css/indents.scm new file mode 100644 index 000000000..cd22ed66c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/css/indents.scm @@ -0,0 +1,9 @@ +[ + (block) + (declaration) +] @indent.begin + +(block ("}") @indent.branch) +("}") @indent.dedent + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/css/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/css/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/css/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/cuda/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cuda/folds.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cuda/folds.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/cuda/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cuda/highlights.scm new file mode 100644 index 000000000..275871deb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cuda/highlights.scm @@ -0,0 +1,13 @@ +; inherits: cpp + +[ "<<<" ">>>" ] @punctuation.bracket + +[ + "__host__" + "__device__" + "__global__" + "__forceinline__" + "__noinline__" +] @storageclass + +"__launch_bounds__" @type.qualifier diff --git a/bundle/nvim-treesitter-0.9.1/queries/cuda/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cuda/indents.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cuda/indents.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/cuda/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/cuda/injections.scm new file mode 100644 index 000000000..09deac468 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cuda/injections.scm @@ -0,0 +1,6 @@ +((preproc_def (preproc_arg) @cuda) + (#lua-match? @cuda "\n")) +(preproc_function_def (preproc_arg) @cuda) +(preproc_call (preproc_arg) @cuda) + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/cuda/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/cuda/locals.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cuda/locals.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/cue/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/cue/folds.scm new file mode 100644 index 000000000..934b59e6f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cue/folds.scm @@ -0,0 +1,5 @@ +[ + (import_spec_list) + (field) + (string) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/cue/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/cue/highlights.scm new file mode 100644 index 000000000..8e626d63c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cue/highlights.scm @@ -0,0 +1,164 @@ +; Includes + +[ + "package" + "import" +] @include + +; Namespaces + +(package_identifier) @namespace + +(import_spec ["." "_"] @punctuation.special) + +[ + (attr_path) + (package_path) +] @text.uri ;; In attributes + +; Attributes + +(attribute) @attribute + +; Conditionals + +"if" @conditional + +; Repeats + +[ + "for" +] @repeat + +(for_clause "_" @punctuation.special) + +; Keywords + +[ + "let" +] @keyword + +[ + "in" +] @keyword.operator + +; Operators + +[ + "+" + "-" + "*" + "/" + "|" + "&" + "||" + "&&" + "==" + "!=" + "<" + "<=" + ">" + ">=" + "=~" + "!~" + "!" + "=" +] @operator + +; Fields & Properties + +(field + (label + (identifier) @field)) + +(selector_expression + (_) + (identifier) @property) + +; Functions + +(call_expression + function: (identifier) @function.call) +(call_expression + function: (selector_expression + (_) + (identifier) @function.call)) +(call_expression + function: (builtin_function) @function.call) + +(builtin_function) @function.builtin + +; Variables + +(identifier) @variable + +; Types + +(primitive_type) @type.builtin + +((identifier) @type + (#lua-match? @type "^_?#")) + +[ + (slice_type) + (pointer_type) +] @type ;; In attributes + +; Punctuation + +[ + "," + ":" +] @punctuation.delimiter + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +[ + (ellipsis) + "?" +] @punctuation.special + +; Literals + +(string) @string + +[ + (escape_char) + (escape_unicode) +] @string.escape + +(number) @number + +(float) @float + +(si_unit + (float) + (_) @symbol) + +(boolean) @boolean + +[ + (null) + (top) + (bottom) +] @constant.builtin + +; Interpolations + +(interpolation "\\(" @punctuation.special (_) ")" @punctuation.special) @none + +(interpolation "\\(" (identifier) @variable ")") + +; Comments + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/cue/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/cue/indents.scm new file mode 100644 index 000000000..71a03a778 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cue/indents.scm @@ -0,0 +1,21 @@ +[ + (import_spec_list) + (field) +] @indent.begin + +[ + "}" + "]" + ")" +] @indent.end + +[ "{" "}" ] @indent.branch + +[ "[" "]" ] @indent.branch + +[ "(" ")" ] @indent.branch + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/cue/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/cue/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cue/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/cue/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/cue/locals.scm new file mode 100644 index 000000000..b99a4fca8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/cue/locals.scm @@ -0,0 +1,34 @@ +; Scopes + +[ + (source_file) + (field) + (for_clause) +] @scope + +; References + +(identifier) @reference + +; Definitions + +(import_spec + path: (string) @definition.import) + +(field + (label + (identifier) @definition.field)) + +(package_identifier) @definition.namespace + +(for_clause + (identifier) @definition.variable + (expression)) + +(for_clause + (identifier) + (identifier) @definition.variable + (expression)) + +(let_clause + (identifier) @definition.variable) diff --git a/bundle/nvim-treesitter-0.9.1/queries/d/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/d/folds.scm new file mode 100644 index 000000000..be4dee45e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/d/folds.scm @@ -0,0 +1 @@ +(block_statement) @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/d/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/d/highlights.scm new file mode 100644 index 000000000..229a9bf55 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/d/highlights.scm @@ -0,0 +1,288 @@ +;; Misc + +[ + (line_comment) + (block_comment) + (nesting_block_comment) +] @comment @spell + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((nesting_block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[+][+][^+].*[+]/$")) + +[ + "(" ")" + "[" "]" + "{" "}" +] @punctuation.bracket + +[ + "," + ";" + "." + ":" +] @punctuation.delimiter + +[ + ".." + "$" +] @punctuation.special + +;; Constants + +[ + "__FILE_FULL_PATH__" + "__FILE__" + "__FUNCTION__" + "__LINE__" + "__MODULE__" + "__PRETTY_FUNCTION__" +] @constant.macro + +[ + (wysiwyg_string) + (alternate_wysiwyg_string) + (double_quoted_string) + (hex_string) + (delimited_string) + (token_string) +] @string + +(character_literal) @character + +(integer_literal) @number + +(float_literal) @float + +[ + "true" + "false" +] @boolean + +;; Functions + +(func_declarator + (identifier) @function +) + +[ + "__traits" + "__vector" + "assert" + "is" + "mixin" + "pragma" + "typeid" +] @function.builtin + +(import_expression + "import" @function.builtin +) + +(parameter + (var_declarator + (identifier) @parameter + ) +) + +(function_literal + (identifier) @parameter +) + +(constructor + "this" @constructor +) + +(destructor + "this" @constructor +) + +;; Keywords + +[ + "case" + "default" + "else" + "if" + "switch" +] @conditional + +[ + "break" + "continue" + "do" + "for" + "foreach" + "foreach_reverse" + "while" +] @repeat + +[ + "__parameters" + "alias" + "align" + "asm" + "auto" + "body" + "class" + "debug" + "enum" + "export" + "goto" + "interface" + "invariant" + "macro" + "out" + "override" + "package" + "static" + "struct" + "template" + "union" + "unittest" + "version" + "with" +] @keyword + +[ + "delegate" + "function" +] @keyword.function + +"return" @keyword.return + +[ + "cast" + "new" +] @keyword.operator + +[ + "+" + "++" + "+=" + "-" + "--" + "-=" + "*" + "*=" + "%" + "%=" + "^" + "^=" + "^^" + "^^=" + "/" + "/=" + "|" + "|=" + "||" + "~" + "~=" + "=" + "==" + "=>" + "<" + "<=" + "<<" + "<<=" + ">" + ">=" + ">>" + ">>=" + ">>>" + ">>>=" + "!" + "!=" + "&" + "&&" +] @operator + +[ + "catch" + "finally" + "throw" + "try" +] @exception + +"null" @constant.builtin + +[ + "__gshared" + "const" + "immutable" + "shared" +] @storageclass + +[ + "abstract" + "deprecated" + "extern" + "final" + "inout" + "lazy" + "nothrow" + "private" + "protected" + "public" + "pure" + "ref" + "scope" + "synchronized" +] @type.qualifier + +(alias_assignment + . (identifier) @type.definition) + +(module_declaration + "module" @include +) + +(import_declaration + "import" @include +) + +(type) @type + +(catch_parameter + (qualified_identifier) @type +) + +(var_declarations + (qualified_identifier) @type +) + +(func_declaration + (qualified_identifier) @type +) + +(parameter + (qualified_identifier) @type +) + +(class_declaration + (identifier) @type +) + +(fundamental_type) @type.builtin + +(module_fully_qualified_name (packages (package_name) @namespace)) +(module_name) @namespace + +(at_attribute) @attribute + +(user_defined_attribute + "@" @attribute +) + +;; Variables + +(primary_expression + "this" @variable.builtin +) diff --git a/bundle/nvim-treesitter-0.9.1/queries/d/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/d/indents.scm new file mode 100644 index 000000000..9ced7527d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/d/indents.scm @@ -0,0 +1,17 @@ +[ + (block_statement) + (case_statement) + (token_string) +] @indent.begin + +[ + "(" ")" + "{" "}" + "[" "]" +] @indent.branch + +[ + (line_comment) + (block_comment) + (nesting_block_comment) +] @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/d/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/d/injections.scm new file mode 100644 index 000000000..d95514370 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/d/injections.scm @@ -0,0 +1,7 @@ +[ + (line_comment) + (block_comment) + (nesting_block_comment) +] @comment + +(token_string_tokens) @d diff --git a/bundle/nvim-treesitter-0.9.1/queries/dart/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/dart/folds.scm new file mode 100644 index 000000000..ea398a4b3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dart/folds.scm @@ -0,0 +1,15 @@ +[ + (class_definition) + (enum_declaration) + (extension_declaration) + + (arguments) + (function_body) + + (block) + (switch_block) + + (list_literal) + (set_or_map_literal) + (string_literal) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/dart/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/dart/highlights.scm new file mode 100644 index 000000000..372a6389c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dart/highlights.scm @@ -0,0 +1,272 @@ +(dotted_identifier_list) @string + +; Methods +; -------------------- +(super) @function + +; TODO: add method/call_expression to grammar and +; distinguish method call from variable access +(function_expression_body (identifier) @function) +; ((identifier)(selector (argument_part)) @function) + +; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't +; specifically identify a node as a function call +(((identifier) @function (#lua-match? @function "^_?[%l]")) + . (selector . (argument_part))) @function + +; Annotations +; -------------------- +(annotation + name: (identifier) @attribute) +(marker_annotation + name: (identifier) @attribute) + +; Operators and Tokens +; -------------------- +(template_substitution + "$" @punctuation.special + "{" @punctuation.special + "}" @punctuation.special +) @none + +(template_substitution + "$" @punctuation.special + (identifier_dollar_escaped) @variable +) @none + +(escape_sequence) @string.escape + +[ + "@" + "=>" + ".." + "??" + "==" + "?" + ":" + "&&" + "%" + "<" + ">" + "=" + ">=" + "<=" + "||" + (multiplicative_operator) + (increment_operator) + (is_operator) + (prefix_operator) + (equality_operator) + (additive_operator) +] @operator + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +; Delimiters +; -------------------- +[ + ";" + "." + "," +] @punctuation.delimiter + +; Types +; -------------------- +(class_definition + name: (identifier) @type) +(constructor_signature + name: (identifier) @type) +(scoped_identifier + scope: (identifier) @type) +(function_signature + name: (identifier) @method) +(getter_signature + (identifier) @method) +(setter_signature + name: (identifier) @method) +(enum_declaration + name: (identifier) @type) +(enum_constant + name: (identifier) @type) +(void_type) @type + +((scoped_identifier + scope: (identifier) @type + name: (identifier) @type) + (#lua-match? @type "^[%u%l]")) + +(type_identifier) @type + +(type_alias + (type_identifier) @type.definition) + +; Variables +; -------------------- +; var keyword +(inferred_type) @keyword + +((identifier) @type + (#lua-match? @type "^_?[%u].*[%l]")) ; catch Classes or IClasses not CLASSES + +("Function" @type) + +; properties +(unconditional_assignable_selector + (identifier) @property) + +(conditional_assignable_selector + (identifier) @property) + +; assignments +(assignment_expression + left: (assignable_expression) @variable) + +(this) @variable.builtin + +; Parameters +; -------------------- +(formal_parameter + name: (identifier) @parameter) + +(named_argument + (label (identifier) @parameter)) + +; Literals +; -------------------- +[ + (hex_integer_literal) + (decimal_integer_literal) + (decimal_floating_point_literal) + ; TODO: inaccessible nodes + ; (octal_integer_literal) + ; (hex_floating_point_literal) +] @number + +(symbol_literal) @symbol +(string_literal) @string +(true) @boolean +(false) @boolean +(null_literal) @constant.builtin + +(comment) @comment @spell +(documentation_comment) @comment.documentation @spell + +; Keywords +; -------------------- +[ + "import" + "library" + "export" + "as" + "show" + "hide" +] @include + +; Reserved words (cannot be used as identifiers) +[ + ; TODO: + ; "rethrow" cannot be targeted at all and seems to be an invisible node + ; TODO: + ; the assert keyword cannot be specifically targeted + ; because the grammar selects the whole node or the content + ; of the assertion not just the keyword + ; assert + (case_builtin) + "late" + "required" + "extension" + "on" + "class" + "enum" + "extends" + "in" + "is" + "new" + "super" + "with" +] @keyword + +[ + "return" +] @keyword.return + + +; Built in identifiers: +; alone these are marked as keywords +[ + "deferred" + "factory" + "get" + "implements" + "interface" + "library" + "operator" + "mixin" + "part" + "set" + "typedef" +] @keyword + +[ + "async" + "async*" + "sync*" + "await" + "yield" +] @keyword.coroutine + +[ + (const_builtin) + (final_builtin) + "abstract" + "covariant" + "dynamic" + "external" + "static" +] @type.qualifier + +; when used as an identifier: +((identifier) @variable.builtin + (#any-of? @variable.builtin + "abstract" + "as" + "covariant" + "deferred" + "dynamic" + "export" + "external" + "factory" + "Function" + "get" + "implements" + "import" + "interface" + "library" + "operator" + "mixin" + "part" + "set" + "static" + "typedef")) + +["if" "else" "switch" "default"] @conditional + +[ + "try" + "throw" + "catch" + "finally" + (break_statement) +] @exception + +["do" "while" "continue" "for"] @repeat + +; Error +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/dart/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/dart/indents.scm new file mode 100644 index 000000000..87befcf6c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dart/indents.scm @@ -0,0 +1,45 @@ +[ + (class_body) + (function_body) + (function_expression_body) + (declaration (initializers)) + (switch_block) + (if_statement) + (formal_parameter_list) + (formal_parameter) + (list_literal) + (return_statement) + (arguments) + (try_statement) +] @indent.begin + +(switch_block + (_) @indent.begin + (#set! indent.immediate 1) + (#set! indent.start_at_same_line 1)) + +[ + (switch_statement_case) + (switch_statement_default) +] @indent.branch + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @indent.branch + +[ + "}" +] @indent.end + +(return_statement ";" @indent.end) +(break_statement ";" @indent.end) + +; this one is for dedenting the else block +(if_statement (block) @indent.branch) + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/dart/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/dart/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dart/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/dart/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/dart/locals.scm new file mode 100644 index 000000000..2184bab1d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dart/locals.scm @@ -0,0 +1,34 @@ +;; Definitions + +(function_signature + name: (identifier) @definition.function) + +(formal_parameter + name: (identifier) @definition.parameter) + +(initialized_variable_definition + name: (identifier) @definition.var) + +(initialized_identifier + (identifier) @definition.var) + +(static_final_declaration + (identifier) @definition.var) + +;; References + +(identifier) @reference + +;; Scopes + +(class_definition + body: (_) @scope) +[ + (block) + (if_statement) + (for_statement) + (while_statement) + (try_statement) + (catch_clause) + (finally_clause) +] @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/devicetree/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/devicetree/folds.scm new file mode 100644 index 000000000..206c4bed8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/devicetree/folds.scm @@ -0,0 +1 @@ +(node) @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/devicetree/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/devicetree/highlights.scm new file mode 100644 index 000000000..e3140a5da --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/devicetree/highlights.scm @@ -0,0 +1,35 @@ +(comment) @comment + +[ + (preproc_include) + (dtsi_include) +] @include + +(preproc_def) @constant.macro +(preproc_function_def) @function.macro + +[ + (memory_reservation) + (file_version) +] @attribute + +[ + (string_literal) + (byte_string_literal) + (system_lib_string) +] @string + +(integer_literal) @number + +(identifier) @variable +(node (identifier) @namespace) +(property (identifier) @property) +(labeled_item (identifier) @label) +(call_expression (identifier) @function.macro) + +(reference) @label ; referencing labeled_item.identifier +(unit_address) @constant + +[ "=" ] @operator +[ "(" ")" "[" "]" "{" "}" "<" ">" ] @punctuation.bracket +[ ";" ":" "," "@" ] @punctuation.delimiter diff --git a/bundle/nvim-treesitter-0.9.1/queries/devicetree/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/devicetree/indents.scm new file mode 100644 index 000000000..6cfc81cf2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/devicetree/indents.scm @@ -0,0 +1,14 @@ +[ + (node) + (property) + (integer_cells) +] @indent.begin + +[ + "}" + ">" +] @indent.branch + +[ + (comment) +] @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/devicetree/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/devicetree/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/devicetree/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/devicetree/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/devicetree/locals.scm new file mode 100644 index 000000000..95b124bd1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/devicetree/locals.scm @@ -0,0 +1,4 @@ +[ + (node) + (integer_cells) +]@scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/dhall/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/dhall/folds.scm new file mode 100644 index 000000000..305079aa8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dhall/folds.scm @@ -0,0 +1,14 @@ +[ + (let_binding) + + (application_expression) + (lambda_expression) + + (record_type) + (union_type) + + (list_literal) + (record_literal) + + (block_comment) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/dhall/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/dhall/highlights.scm new file mode 100644 index 000000000..f0c454cf1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dhall/highlights.scm @@ -0,0 +1,171 @@ +;; Text + +;; Imports + +(missing_import) @include + +(local_import) @string.special.path + +(http_import) @string @text.uri + +[ + (env_variable) + (import_hash) +] @string.special + +[ (import_as_location) (import_as_text) ] @type + +;; Types + +([ + (let_binding (label) @type) + (union_type_entry (label) @type) +] (#lua-match? @type "^%u")) + +((primitive_expression + (identifier (label) @type) + (selector (label) @type)) @variable + (#vim-match? @variable "^[A-Z][^.]*$")) + +;; Parameters + +(lambda_expression label: (label) @parameter) + +;; Variables + +(label) @variable + +(identifier [ + (label) @variable + (de_bruijn_index) @operator +]) + +(let_binding label: (label) @variable) + +; Fields + +(record_literal_entry (label) @field) + +(record_type_entry (label) @field) + +(selector + (selector_dot) + (_) @field) + +;; Keywords + +(env_import) @keyword + +[ + "let" + "in" + "assert" +] @keyword + +[ + "using" + "as" + "with" +] @keyword.operator + +;; Operators + +[ + (type_operator) + (assign_operator) + (lambda_operator) + (arrow_operator) + (infix_operator) + (completion_operator) + (assert_operator) + (forall_operator) + (empty_record_literal) +] @operator + +;; Builtins + +(builtin_function) @function.builtin +(builtin [ + "Natural" + "Natural/build" + "Natural/fold" + "Natural/isZero" + "Natural/even" + "Natural/odd" + "Natural/subtract" + "Natural/toInteger" + "Natural/show" + "Integer" + "Integer/toDouble" + "Integer/show" + "Integer/negate" + "Integer/clamp" + "Double" + "Double/show" + "List" + "List/build" + "List/fold" + "List/length" + "List/head" + "List/last" + "List/indexed" + "List/reverse" + "Text" + "Text/show" + "Text/replace" + "Optional" + "Date" + "Time" + "TimeZone" + "Type" + "Kind" + "Sort" +] @type.builtin) + +;; Punctuation + +[ "," "|" ] @punctuation.delimiter +(selector_dot) @punctuation.delimiter + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +;; Conditionals + +[ + "if" + "then" + "else" +] @conditional + +;; Literals + +(text_literal) @string +(interpolation "}" @string) +[ + (double_quote_escaped) + (single_quote_escaped) +] @string.escape + +[ + (integer_literal) + (natural_literal) +] @number + +(double_literal) @float + +(boolean_literal) @boolean + +(builtin "None") @constant.builtin + +;; Comments + +[ + (line_comment) + (block_comment) +] @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/dhall/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/dhall/injections.scm new file mode 100644 index 000000000..e48ce9af3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dhall/injections.scm @@ -0,0 +1,4 @@ +[ + (line_comment) + (block_comment) +] @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/diff/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/diff/highlights.scm new file mode 100644 index 000000000..4b9cbad60 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/diff/highlights.scm @@ -0,0 +1,6 @@ +[(addition) (new_file)] @text.diff.add +[(deletion) (old_file)] @text.diff.delete + +(commit) @constant +(location) @attribute +(command) @function diff --git a/bundle/nvim-treesitter-0.9.1/queries/dockerfile/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/dockerfile/highlights.scm new file mode 100644 index 000000000..592e70423 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dockerfile/highlights.scm @@ -0,0 +1,57 @@ +[ + "FROM" + "AS" + "RUN" + "CMD" + "LABEL" + "EXPOSE" + "ENV" + "ADD" + "COPY" + "ENTRYPOINT" + "VOLUME" + "USER" + "WORKDIR" + "ARG" + "ONBUILD" + "STOPSIGNAL" + "HEALTHCHECK" + "SHELL" + "MAINTAINER" + "CROSS_BUILD" +] @keyword + +[ + ":" + "@" +] @operator + +(comment) @comment @spell + +(image_spec + (image_tag + ":" @punctuation.special) + (image_digest + "@" @punctuation.special)) + +(double_quoted_string) @string + +(expansion + [ + "$" + "{" + "}" + ] @punctuation.special +) + +((variable) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +(arg_instruction + . (unquoted_string) @property) + +(env_instruction + (env_pair . (unquoted_string) @property)) + +(expose_instruction + (expose_port) @number) diff --git a/bundle/nvim-treesitter-0.9.1/queries/dockerfile/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/dockerfile/injections.scm new file mode 100644 index 000000000..c1fdd3f99 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dockerfile/injections.scm @@ -0,0 +1,3 @@ +(comment) @comment + +(shell_command) @bash diff --git a/bundle/nvim-treesitter-0.9.1/queries/dot/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/dot/highlights.scm new file mode 100644 index 000000000..d8b70a949 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dot/highlights.scm @@ -0,0 +1,55 @@ +(identifier) @type + +[ + "strict" + "graph" + "digraph" + "subgraph" + "node" + "edge" +] @keyword + +(string_literal) @string +(number_literal) @number + +[ + (edgeop) + (operator) +] @operator + +[ + "," + ";" +] @punctuation.delimiter + +[ + "{" + "}" + "[" + "]" + "<" + ">" +] @punctuation.bracket + +(subgraph + id: (id + (identifier) @namespace) +) + +(attribute + name: (id + (identifier) @field) +) + +(attribute + value: (id + (identifier) @constant) +) + +(comment) @comment + +(preproc) @preproc + +(comment) @spell + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/dot/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/dot/injections.scm new file mode 100644 index 000000000..529d04d4a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/dot/injections.scm @@ -0,0 +1,2 @@ +(html_internal) @html +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/ebnf/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/ebnf/highlights.scm new file mode 100644 index 000000000..feafa1cef --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ebnf/highlights.scm @@ -0,0 +1,43 @@ +;;;; Simple tokens ;;;; +(terminal) @string.grammar + +(special_sequence) @string.special.grammar + +(integer) @number + +(comment) @comment + +;;;; Identifiers ;;;; + +; Allow different highlighting for specific casings +((identifier) @type + (#lua-match? @type "^%u")) + +((identifier) @symbol + (#lua-match? @symbol "^%l")) + +((identifier) @constant + (#lua-match? @constant "^%u[%u%d_]+$")) + +;;; Punctuation ;;;; +[ + ";" + "," +] @punctuation.delimiter + +[ + "|" + "*" + "-" +] @operator + +"=" @keyword.operator + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket diff --git a/bundle/nvim-treesitter-0.9.1/queries/ecma/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/ecma/folds.scm new file mode 100644 index 000000000..50f235a5d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ecma/folds.scm @@ -0,0 +1,22 @@ +[ + (for_in_statement) + (for_statement) + (while_statement) + (arrow_function) + (function) + (function_declaration) + (class_declaration) + (method_definition) + (do_statement) + (with_statement) + (switch_statement) + (switch_case) + (switch_default) + (import_statement) + (if_statement) + (try_statement) + (catch_clause) + (object) + (generator_function) + (generator_function_declaration) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/ecma/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/ecma/highlights.scm new file mode 100644 index 000000000..2c921b2b2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ecma/highlights.scm @@ -0,0 +1,357 @@ +; Types + +; Javascript + +; Variables +;----------- +(identifier) @variable + +; Properties +;----------- + +(property_identifier) @property +(shorthand_property_identifier) @property +(private_property_identifier) @property + +(variable_declarator + name: (object_pattern + (shorthand_property_identifier_pattern))) @variable + +; Special identifiers +;-------------------- + +((identifier) @type + (#lua-match? @type "^[A-Z]")) + +((identifier) @constant + (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$")) + +((shorthand_property_identifier) @constant + (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$")) + +((identifier) @variable.builtin + (#any-of? @variable.builtin + "arguments" + "module" + "console" + "window" + "document")) + +((identifier) @type.builtin + (#any-of? @type.builtin + "Object" + "Function" + "Boolean" + "Symbol" + "Number" + "Math" + "Date" + "String" + "RegExp" + "Map" + "Set" + "WeakMap" + "WeakSet" + "Promise" + "Array" + "Int8Array" + "Uint8Array" + "Uint8ClampedArray" + "Int16Array" + "Uint16Array" + "Int32Array" + "Uint32Array" + "Float32Array" + "Float64Array" + "ArrayBuffer" + "DataView" + "Error" + "EvalError" + "InternalError" + "RangeError" + "ReferenceError" + "SyntaxError" + "TypeError" + "URIError")) + +((identifier) @namespace.builtin + (#eq? @namespace.builtin "Intl")) + +((identifier) @function.builtin + (#any-of? @function.builtin + "eval" + "isFinite" + "isNaN" + "parseFloat" + "parseInt" + "decodeURI" + "decodeURIComponent" + "encodeURI" + "encodeURIComponent" + "require")) + +; Function and method definitions +;-------------------------------- + +(function + name: (identifier) @function) +(function_declaration + name: (identifier) @function) +(generator_function + name: (identifier) @function) +(generator_function_declaration + name: (identifier) @function) +(method_definition + name: [(property_identifier) (private_property_identifier)] @method) +(method_definition + name: (property_identifier) @constructor + (#eq? @constructor "constructor")) + +(pair + key: (property_identifier) @method + value: (function)) +(pair + key: (property_identifier) @method + value: (arrow_function)) + +(assignment_expression + left: (member_expression + property: (property_identifier) @method) + right: (arrow_function)) +(assignment_expression + left: (member_expression + property: (property_identifier) @method) + right: (function)) + +(variable_declarator + name: (identifier) @function + value: (arrow_function)) +(variable_declarator + name: (identifier) @function + value: (function)) + +(assignment_expression + left: (identifier) @function + right: (arrow_function)) +(assignment_expression + left: (identifier) @function + right: (function)) + +; Function and method calls +;-------------------------- + +(call_expression + function: (identifier) @function.call) + +(call_expression + function: (member_expression + property: [(property_identifier) (private_property_identifier)] @method.call)) + +; Constructor +;------------ + +(new_expression + constructor: (identifier) @constructor) + +; Variables +;---------- +(namespace_import + (identifier) @namespace) + +; Decorators +;---------- +(decorator "@" @attribute (identifier) @attribute) +(decorator "@" @attribute (call_expression (identifier) @attribute)) + +; Literals +;--------- + +[ + (this) + (super) +] @variable.builtin + +((identifier) @variable.builtin + (#eq? @variable.builtin "self")) + +[ + (true) + (false) +] @boolean + +[ + (null) + (undefined) +] @constant.builtin + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +(hash_bang_line) @preproc + +((string_fragment) @preproc + (#eq? @preproc "use strict")) + +(string) @string +(template_string) @string +(escape_sequence) @string.escape +(regex_pattern) @string.regex +(regex_flags) @character.special +(regex "/" @punctuation.bracket) ; Regex delimiters + +(number) @number +((identifier) @number + (#any-of? @number "NaN" "Infinity")) + +; Punctuation +;------------ + +";" @punctuation.delimiter +"." @punctuation.delimiter +"," @punctuation.delimiter + +(pair ":" @punctuation.delimiter) +(pair_pattern ":" @punctuation.delimiter) +(switch_case ":" @punctuation.delimiter) +(switch_default ":" @punctuation.delimiter) + +[ + "--" + "-" + "-=" + "&&" + "+" + "++" + "+=" + "&=" + "/=" + "**=" + "<<=" + "<" + "<=" + "<<" + "=" + "==" + "===" + "!=" + "!==" + "=>" + ">" + ">=" + ">>" + "||" + "%" + "%=" + "*" + "**" + ">>>" + "&" + "|" + "^" + "??" + "*=" + ">>=" + ">>>=" + "^=" + "|=" + "&&=" + "||=" + "??=" + "..." +] @operator + +(binary_expression "/" @operator) +(ternary_expression ["?" ":"] @conditional.ternary) +(unary_expression ["!" "~" "-" "+"] @operator) +(unary_expression ["delete" "void"] @keyword.operator) + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +((template_substitution ["${" "}"] @punctuation.special) @none) + +; Keywords +;---------- + +[ + "if" + "else" + "switch" + "case" +] @conditional + +[ + "import" + "from" +] @include + +(export_specifier "as" @include) +(import_specifier "as" @include) +(namespace_export "as" @include) +(namespace_import "as" @include) + +[ + "for" + "of" + "do" + "while" + "continue" +] @repeat + +[ + "break" + "class" + "const" + "debugger" + "export" + "extends" + "get" + "let" + "set" + "static" + "target" + "var" + "with" +] @keyword + +[ + "async" + "await" +] @keyword.coroutine + +[ + "return" + "yield" +] @keyword.return + +[ + "function" +] @keyword.function + +[ + "new" + "delete" + "in" + "instanceof" + "typeof" +] @keyword.operator + +[ + "throw" + "try" + "catch" + "finally" +] @exception + +(export_statement + "default" @keyword) +(switch_default + "default" @conditional) diff --git a/bundle/nvim-treesitter-0.9.1/queries/ecma/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/ecma/indents.scm new file mode 100644 index 000000000..538c5bdc7 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ecma/indents.scm @@ -0,0 +1,57 @@ +[ + (arguments) + (array) + (binary_expression) + (class_body) + (export_clause) + (formal_parameters) + (named_imports) + (object) + (object_pattern) + (parenthesized_expression) + (return_statement) + (statement_block) + (switch_case) + (switch_default) + (switch_statement) + (template_substitution) + (ternary_expression) +] @indent.begin + +(arguments (call_expression) @indent.begin) +(binary_expression (call_expression) @indent.begin) +(expression_statement (call_expression) @indent.begin) +(arrow_function + body: (_) @_body + (#not-has-type? @_body statement_block) +) @indent.begin +(assignment_expression + right: (_) @_right + (#not-has-type? @_right arrow_function function) +) @indent.begin +(variable_declarator + value: (_) @_value + (#not-has-type? @_value arrow_function call_expression function) +) @indent.begin + +(arguments ")" @indent.end) +(object "}" @indent.end) +(statement_block "}" @indent.end) + +[ + (arguments (object)) + ")" + "}" + "]" +] @indent.branch +(statement_block "{" @indent.branch) + +(parenthesized_expression ("(" (_) ")" @indent.end)) +["}" "]"] @indent.end + +(template_string) @indent.ignore + +[ + (comment) + (ERROR) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/ecma/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/ecma/injections.scm new file mode 100644 index 000000000..ba0ea4fa1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ecma/injections.scm @@ -0,0 +1,103 @@ +(((comment) @_jsdoc_comment + (#lua-match? @_jsdoc_comment "^/[*][*][^*].*[*]/$")) @jsdoc) + +(comment) @comment + +; html(`...`), html`...`, sql(...) etc +(call_expression + function: ((identifier) @language) + arguments: [ + (arguments + (template_string) @content) + (template_string) @content + ] + (#offset! @content 0 1 0 -1) + (#not-eq? @content "svg")) + +; svg`...` or svg(`...`), which uses the html parser, so is not included in the previous query +(call_expression + function: ((identifier) @_name (#eq? @_name "svg")) + arguments: [ + (arguments + (template_string) @html) + (template_string) @html + ] + (#offset! @html 0 1 0 -1)) + + +(call_expression + function: ((identifier) @_name + (#eq? @_name "gql")) + arguments: ((template_string) @graphql + (#offset! @graphql 0 1 0 -1))) + +(call_expression + function: ((identifier) @_name + (#eq? @_name "hbs")) + arguments: ((template_string) @glimmer + (#offset! @glimmer 0 1 0 -1))) + +((glimmer_template) @glimmer) + +; styled.div`` +(call_expression + function: (member_expression + object: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @css + (#offset! @css 0 1 0 -1))) + +; styled(Component)`` +(call_expression + function: (call_expression + function: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @css + (#offset! @css 0 1 0 -1))) + +; styled.div.attrs({ prop: "foo" })`` +(call_expression + function: (call_expression + function: (member_expression + object: (member_expression + object: (identifier) @_name + (#eq? @_name "styled")))) + arguments: ((template_string) @css + (#offset! @css 0 1 0 -1))) + + +; styled(Component).attrs({ prop: "foo" })`` +(call_expression + function: (call_expression + function: (member_expression + object: (call_expression + function: (identifier) @_name + (#eq? @_name "styled")))) + arguments: ((template_string) @css + (#offset! @css 0 1 0 -1))) + +(regex_pattern) @regex + +; ((comment) @_gql_comment +; (#eq? @_gql_comment "/* GraphQL */") +; (template_string) @graphql) + +((template_string) @graphql + (#lua-match? @graphql "^`#graphql") + (#offset! @graphql 0 1 0 -1)) + +; el.innerHTML = `` +(assignment_expression + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "innerHTML" "outerHTML")) + right: (template_string) @html + (#offset! @html 0 1 0 -1)) + +; el.innerHTML = '' +(assignment_expression + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "innerHTML" "outerHTML")) + right: (string) @html + (#offset! @html 0 1 0 -1)) diff --git a/bundle/nvim-treesitter-0.9.1/queries/ecma/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/ecma/locals.scm new file mode 100644 index 000000000..4c035d269 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/ecma/locals.scm @@ -0,0 +1,37 @@ +; Scopes +;------- + +(statement_block) @scope +(function) @scope +(arrow_function) @scope +(function_declaration) @scope +(method_definition) @scope +(for_statement) @scope +(for_in_statement) @scope +(catch_clause) @scope + +; Definitions +;------------ + +(variable_declarator + name: (identifier) @definition.var) + +(import_specifier + (identifier) @definition.import) + +(namespace_import + (identifier) @definition.import) + +(function_declaration + ((identifier) @definition.function) + (#set! definition.var.scope parent)) + +(method_definition + ((property_identifier) @definition.function) + (#set! definition.var.scope parent)) + +; References +;------------ + +(identifier) @reference +(shorthand_property_identifier) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/eex/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/eex/highlights.scm new file mode 100644 index 000000000..781b39466 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/eex/highlights.scm @@ -0,0 +1,15 @@ +[ + "%>" + "--%>" + "<%!--" + "<%" + "<%#" + "<%%=" + "<%=" +] @tag.delimiter + +; EEx comments are highlighted as such +(comment) @comment + +; Tree-sitter parser errors +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/eex/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/eex/injections.scm new file mode 100644 index 000000000..f43206f55 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/eex/injections.scm @@ -0,0 +1,5 @@ +; EEx expressions are Elixir +(expression) @elixir + +; EEx expressions can span multiple interpolated lines +(partial_expression) @elixir @combined diff --git a/bundle/nvim-treesitter-0.9.1/queries/elixir/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/elixir/folds.scm new file mode 100644 index 000000000..b99a6d9e0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elixir/folds.scm @@ -0,0 +1,9 @@ +[ + (anonymous_function) + (arguments) + (block) + (do_block) + (list) + (map) + (tuple) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/elixir/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/elixir/highlights.scm new file mode 100644 index 000000000..c86372e29 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elixir/highlights.scm @@ -0,0 +1,226 @@ +; Punctuation +[ + "," + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "<<" + ">>" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "%" +] @punctuation.special + +; Parser Errors +(ERROR) @error + +; Identifiers +(identifier) @variable + +; Unused Identifiers +((identifier) @comment (#lua-match? @comment "^_")) + +; Comments +(comment) @comment @spell + +; Strings +(string) @string + +; Modules +(alias) @type + +; Atoms & Keywords +[ + (atom) + (quoted_atom) + (keyword) + (quoted_keyword) +] @symbol + +; Interpolation +(interpolation ["#{" "}"] @string.special) + +; Escape sequences +(escape_sequence) @string.escape + +; Integers +(integer) @number + +; Floats +(float) @float + +; Characters +[ + (char) + (charlist) +] @character + +; Booleans +(boolean) @boolean + +; Nil +(nil) @constant.builtin + +; Operators +(operator_identifier) @operator + +(unary_operator operator: _ @operator) + +(binary_operator operator: _ @operator) + +; Pipe Operator +(binary_operator operator: "|>" right: (identifier) @function) + +(dot operator: _ @operator) + +(stab_clause operator: _ @operator) + +; Local Function Calls +(call target: (identifier) @function.call) + +; Remote Function Calls +(call target: (dot left: [ + (atom) @type + (_) +] right: (identifier) @function.call) (arguments)) + +; Definition Function Calls +(call target: ((identifier) @keyword.function (#any-of? @keyword.function + "def" + "defdelegate" + "defexception" + "defguard" + "defguardp" + "defimpl" + "defmacro" + "defmacrop" + "defmodule" + "defn" + "defnp" + "defoverridable" + "defp" + "defprotocol" + "defstruct" + )) + (arguments [ + (call (identifier) @function) + (binary_operator left: (call target: (identifier) @function) operator: "when")])?) + +; Kernel Keywords & Special Forms +(call target: ((identifier) @keyword (#any-of? @keyword + "alias" + "case" + "catch" + "cond" + "else" + "for" + "if" + "import" + "quote" + "raise" + "receive" + "require" + "reraise" + "super" + "throw" + "try" + "unless" + "unquote" + "unquote_splicing" + "use" + "with" +))) + +; Special Constants +((identifier) @constant.builtin (#any-of? @constant.builtin + "__CALLER__" + "__DIR__" + "__ENV__" + "__MODULE__" + "__STACKTRACE__" +)) + +; Reserved Keywords +[ + "after" + "catch" + "do" + "end" + "fn" + "rescue" + "when" + "else" +] @keyword + +; Operator Keywords +[ + "and" + "in" + "not in" + "not" + "or" +] @keyword.operator + +; Capture Operator +(unary_operator + operator: "&" + operand: [ + (integer) @operator + (binary_operator + left: [ + (call target: (dot left: (_) right: (identifier) @function)) + (identifier) @function + ] operator: "/" right: (integer) @operator) + ]) + +; Non-String Sigils +(sigil + "~" @string.special + ((sigil_name) @string.special) @_sigil_name + quoted_start: _ @string.special + quoted_end: _ @string.special + ((sigil_modifiers) @string.special)? + (#not-any-of? @_sigil_name "s" "S")) + +; String Sigils +(sigil + "~" @string + ((sigil_name) @string) @_sigil_name + quoted_start: _ @string + (quoted_content) @string + quoted_end: _ @string + ((sigil_modifiers) @string)? + (#any-of? @_sigil_name "s" "S")) + +; Module attributes +(unary_operator + operator: "@" + operand: [ + (identifier) + (call target: (identifier)) + ] @constant) @constant + +; Documentation +(unary_operator + operator: "@" + operand: (call + target: ((identifier) @_identifier (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment.documentation + (arguments [ + (string) + (boolean) + (charlist) + (sigil + "~" @comment.documentation + ((sigil_name) @comment.documentation) + quoted_start: _ @comment.documentation + (quoted_content) @comment.documentation + quoted_end: _ @comment.documentation) + ] @comment.documentation))) @comment.documentation diff --git a/bundle/nvim-treesitter-0.9.1/queries/elixir/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/elixir/indents.scm new file mode 100644 index 000000000..0ba8fd442 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elixir/indents.scm @@ -0,0 +1,23 @@ +[ + (block) + (do_block) + (list) + (map) + (stab_clause) + (tuple) + (arguments) +] @indent.begin + +[ + ")" + "]" + "after" + "catch" + "else" + "rescue" + "}" + "end" +] @indent.end @indent.branch + +; Elixir pipelines are not indented, but other binary operator chains are +((binary_operator operator: _ @_operator) @indent.begin (#not-eq? @_operator "|>")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/elixir/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/elixir/injections.scm new file mode 100644 index 000000000..423fddea7 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elixir/injections.scm @@ -0,0 +1,48 @@ +; Comments +(comment) @comment + +; Documentation +(unary_operator + operator: "@" + operand: (call + target: ((identifier) @_identifier (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) + (arguments [ + (string (quoted_content) @markdown) + (sigil (quoted_content) @markdown) + ]))) + +; HEEx +(sigil + (sigil_name) @_sigil_name + (quoted_content) @heex +(#eq? @_sigil_name "H")) + +; Surface +(sigil + (sigil_name) @_sigil_name + (quoted_content) @surface +(#eq? @_sigil_name "F")) + +; Zigler +(sigil + (sigil_name) @_sigil_name + (quoted_content) @eex +(#any-of? @_sigil_name "E" "L")) + +(sigil + (sigil_name) @_sigil_name + (quoted_content) @zig +(#any-of? @_sigil_name "z" "Z")) + +; Regex +(sigil + (sigil_name) @_sigil_name + (quoted_content) @regex +(#any-of? @_sigil_name "r" "R")) + +; Jason +(sigil + (sigil_name) @_sigil_name + (quoted_content) @json +(#any-of? @_sigil_name "j" "J")) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/elixir/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/elixir/locals.scm new file mode 100644 index 000000000..79a9676df --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elixir/locals.scm @@ -0,0 +1,164 @@ +; References +(identifier) @reference +(alias) @reference + +; Module Definitions +(call + target: ((identifier) @_identifier (#eq? @_identifier "defmodule")) + (arguments (alias) @definition.type)) + +; Pattern Match Definitions +(binary_operator left: [ + (identifier) @definition.var + (_ (identifier) @definition.var) + (_ (_ (identifier) @definition.var)) + (_ (_ (_ (identifier) @definition.var))) + (_ (_ (_ (_ (identifier) @definition.var)))) + (_ (_ (_ (_ (_ (identifier) @definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))))) +] operator: "=") + +; Stab Clause Definitions +(stab_clause + left: [ + (arguments [ + (identifier) @definition.var + (_ (identifier) @definition.var) + (_ (_ (identifier) @definition.var)) + (_ (_ (_ (identifier) @definition.var))) + (_ (_ (_ (_ (identifier) @definition.var)))) + (_ (_ (_ (_ (_ (identifier) @definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))))) + ]) + (binary_operator + left: (arguments [ + (identifier) @definition.var + (_ (identifier) @definition.var) + (_ (_ (identifier) @definition.var)) + (_ (_ (_ (identifier) @definition.var))) + (_ (_ (_ (_ (identifier) @definition.var)))) + (_ (_ (_ (_ (_ (identifier) @definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.var)))))))))))))))))))) + ]) operator: "when") +]) + +; Aliases +(call + target: ((identifier) @_identifier (#any-of? @_identifier "require" "alias" "use" "import")) + (arguments [ + (alias) @definition.import + (_ (alias) @definition.import) + (_ (_ (alias) @definition.import)) + (_ (_ (_ (alias) @definition.import))) + (_ (_ (_ (_ (alias) @definition.import)))) + ] +)) + +; Local Function Definitions & Scopes +(call + target: ((identifier) @_identifier (#any-of? @_identifier "def" "defp" "defmacro" "defmacrop" "defguard" "defguardp" "defn" "defnp" "for")) + (arguments [ + (identifier) @definition.function + (binary_operator left: (identifier) @definition.function operator: "when") + (binary_operator (identifier) @definition.parameter) + (call target: (identifier) @definition.function (arguments [ + (identifier) @definition.parameter + (_ (identifier) @definition.parameter) + (_ (_ (identifier) @definition.parameter)) + (_ (_ (_ (identifier) @definition.parameter))) + (_ (_ (_ (_ (identifier) @definition.parameter)))) + (_ (_ (_ (_ (_ (identifier) @definition.parameter))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))))) + ])) + ]?) (#set! definition.function.scope parent) + (do_block)? +) @scope + +; ExUnit Test Definitions & Scopes +(call + target: ((identifier) @_identifier (#eq? @_identifier "test")) + (arguments [ + (string) + ((string) . "," . [ + (identifier) @definition.parameter + (_ (identifier) @definition.parameter) + (_ (_ (identifier) @definition.parameter)) + (_ (_ (_ (identifier) @definition.parameter))) + (_ (_ (_ (_ (identifier) @definition.parameter)))) + (_ (_ (_ (_ (_ (identifier) @definition.parameter))))) + (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @definition.parameter)))))))))))))))))))) + ]) +]) (do_block)?) @scope + +; Stab Clause Scopes +(stab_clause) @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/elm/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/elm/highlights.scm new file mode 100644 index 000000000..fbd3a4c3f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elm/highlights.scm @@ -0,0 +1,205 @@ +[ + (line_comment) + (block_comment) +] @comment @spell + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^{[-]|[^|]")) + + +; Keywords +;--------- + +[ + "if" + "then" + "else" + (case) + (of) +] @conditional + +[ + "let" + "in" + (as) + (port) + (alias) + (infix) + (module) + (type) +] @keyword + +[ + (import) + (exposing) +] @include + + +; Punctuation +;------------ + +[ + (double_dot) +] @punctuation.special + +[ + "," + "|" + (dot) +] @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + + +; Variables +;---------- + +(value_qid + (lower_case_identifier) @variable) +(value_declaration + (function_declaration_left (lower_case_identifier) @variable)) +(type_annotation + (lower_case_identifier) @variable) +(port_annotation + (lower_case_identifier) @variable) +(anything_pattern + (underscore) @variable) +(record_base_identifier + (lower_case_identifier) @variable) +(lower_pattern + (lower_case_identifier) @variable) +(exposed_value + (lower_case_identifier) @variable) + +(value_qid + ((dot) (lower_case_identifier) @field)) +(field_access_expr + ((dot) (lower_case_identifier) @field)) + +(function_declaration_left + (anything_pattern (underscore) @parameter)) +(function_declaration_left + (lower_pattern (lower_case_identifier) @parameter)) + + +; Functions +;---------- + +(value_declaration + functionDeclarationLeft: + (function_declaration_left + (lower_case_identifier) @function + (pattern))) +(value_declaration + functionDeclarationLeft: + (function_declaration_left + (lower_case_identifier) @function + pattern: (_))) +(value_declaration + functionDeclarationLeft: + (function_declaration_left + (lower_case_identifier) @function) + body: (anonymous_function_expr)) +(type_annotation + name: (lower_case_identifier) @function + typeExpression: (type_expression (arrow))) +(port_annotation + name: (lower_case_identifier) @function + typeExpression: (type_expression (arrow))) + +(function_call_expr + target: (value_expr + (value_qid (lower_case_identifier) @function.call))) + + +; Operators +;---------- + +[ + (operator_identifier) + (eq) + (colon) + (arrow) + (backslash) + "::" +] @operator + + +; Modules +;-------- + +(module_declaration + (upper_case_qid (upper_case_identifier) @namespace)) +(import_clause + (upper_case_qid (upper_case_identifier) @namespace)) +(as_clause + (upper_case_identifier) @namespace) +(value_expr + (value_qid (upper_case_identifier) @namespace)) + + +; Types +;------ + +(type_declaration + (upper_case_identifier) @type) +(type_ref + (upper_case_qid (upper_case_identifier) @type)) +(type_variable + (lower_case_identifier) @type) +(lower_type_name + (lower_case_identifier) @type) +(exposed_type + (upper_case_identifier) @type) + +(type_alias_declaration + (upper_case_identifier) @type.definition) + +(field_type + name: (lower_case_identifier) @property) +(field + name: (lower_case_identifier) @property) + +(type_declaration + (union_variant (upper_case_identifier) @constructor)) +(nullary_constructor_argument_pattern + (upper_case_qid (upper_case_identifier) @constructor)) +(union_pattern + (upper_case_qid (upper_case_identifier) @constructor)) +(value_expr + (upper_case_qid (upper_case_identifier)) @constructor) + + +; Literals +;--------- + +(number_constant_expr + (number_literal) @number) + +(upper_case_qid + ((upper_case_identifier) @boolean (#any-of? @boolean "True" "False"))) + +[ + (open_quote) + (close_quote) +] @string +(string_constant_expr + (string_escape) @string) +(string_constant_expr + (regular_string_part) @string) + +[ + (open_char) + (close_char) +] @character +(char_constant_expr + (string_escape) @character) +(char_constant_expr + (regular_string_part) @character) diff --git a/bundle/nvim-treesitter-0.9.1/queries/elm/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/elm/injections.scm new file mode 100644 index 000000000..6395776e1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elm/injections.scm @@ -0,0 +1,3 @@ +[(line_comment) (block_comment)] @comment + +(glsl_content) @glsl diff --git a/bundle/nvim-treesitter-0.9.1/queries/elsa/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/elsa/folds.scm new file mode 100644 index 000000000..afdfec308 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elsa/folds.scm @@ -0,0 +1 @@ +(reduction) @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/elsa/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/elsa/highlights.scm new file mode 100644 index 000000000..7021a0970 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elsa/highlights.scm @@ -0,0 +1,41 @@ +; Keywords + +[ + "eval" + "let" +] @keyword + +; Function + +(function) @function + +; Method + +(method) @method + +; Parameter + +(parameter) @parameter + +; Variables + +(identifier) @variable + +; Operators + +[ + "\\" + "->" + "=" + (step) +] @operator + +; Punctuation + +["(" ")"] @punctuation.bracket + +":" @punctuation.delimiter + +; Comments + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/elsa/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/elsa/indents.scm new file mode 100644 index 000000000..6ddd1aa64 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elsa/indents.scm @@ -0,0 +1,6 @@ +(reduction) @indent.begin + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/elsa/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/elsa/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elsa/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/elsa/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/elsa/locals.scm new file mode 100644 index 000000000..de7030796 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elsa/locals.scm @@ -0,0 +1,12 @@ +[ + (source_file) + (reduction) +] @scope + +(identifier) @reference + +(function) @definition.function + +(method) @definition.method + +(parameter) @definition.parameter diff --git a/bundle/nvim-treesitter-0.9.1/queries/elvish/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/elvish/highlights.scm new file mode 100644 index 000000000..af7c41dd8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elvish/highlights.scm @@ -0,0 +1,70 @@ +(comment) @comment + +["if" "elif"] @conditional +(if (else "else" @conditional)) + +["while" "for"] @repeat +(while (else "else" @repeat)) +(for (else "else" @repeat)) + +["try" "catch" "finally"] @exception +(try (else "else" @exception)) + +"use" @include +(import (bareword) @string.special) + +(wildcard ["*" "**" "?"] @character.special) + +(command argument: (bareword) @parameter) +(command head: (identifier) @function.call) +((command head: (identifier) @keyword.return) + (#eq? @keyword.return "return")) +((command (identifier) @keyword.operator) + (#any-of? @keyword.operator "and" "or" "coalesce")) +[ + "+" "-" "*" "/" "%" "<" "<=""==" "!=" ">" + ">=" "s" ">=s" +] @function.builtin + +[">" "<" ">>" "<>" "|"] @operator + +(io_port) @number + +(function_definition + "fn" @keyword.function + (identifier) @function) + +(parameter_list) @parameter +(parameter_list "|" @punctuation.bracket) + +["var" "set" "tmp" "del"] @keyword +(variable_declaration + (lhs (identifier) @variable)) + +(variable_assignment + (lhs (identifier) @variable)) + +(temporary_assignment + (lhs (identifier) @variable)) + +(variable_deletion + (identifier) @variable) + + +(number) @number +(string) @string + +(variable (identifier) @variable) +((variable (identifier) @function) + (#match? @function ".+\\~$")) +((variable (identifier) @boolean) + (#any-of? @boolean "true" "false")) +((variable (identifier) @constant.builtin) + (#any-of? @constant.builtin + "_" "after-chdir" "args" "before-chdir" "buildinfo" "nil" + "notify-bg-job-success" "num-bg-jobs" "ok" "paths" "pid" + "pwd" "value-out-indicator" "version")) + +["$" "@"] @punctuation.special +["(" ")" "[" "]" "{" "}"] @punctuation.bracket +";" @punctuation.delimiter diff --git a/bundle/nvim-treesitter-0.9.1/queries/elvish/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/elvish/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/elvish/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/embedded_template/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/embedded_template/highlights.scm new file mode 100644 index 000000000..0bf76a7d4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/embedded_template/highlights.scm @@ -0,0 +1,12 @@ +(comment_directive) @comment + +[ + "<%#" + "<%" + "<%=" + "<%_" + "<%-" + "%>" + "-%>" + "_%>" +] @keyword diff --git a/bundle/nvim-treesitter-0.9.1/queries/embedded_template/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/embedded_template/injections.scm new file mode 100644 index 000000000..d55c87e09 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/embedded_template/injections.scm @@ -0,0 +1,2 @@ +(content) @html @combined +(code) @ruby @combined diff --git a/bundle/nvim-treesitter-0.9.1/queries/erlang/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/erlang/folds.scm new file mode 100644 index 000000000..65c2d8ed1 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/erlang/folds.scm @@ -0,0 +1,9 @@ +[ + (fun_decl) + (anonymous_fun) + (case_expr) + (maybe_expr) + (map_expr) + (export_attribute) + (export_type_attribute) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/erlang/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/erlang/highlights.scm new file mode 100644 index 000000000..ef851f695 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/erlang/highlights.scm @@ -0,0 +1,129 @@ +((atom) @constant (#set! "priority" "90")) +(var) @variable + +(char) @character +(integer) @number +(float) @float + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[%%][%%]")) + +;; keyword +[ + "fun" + "div" +] @keyword + +;; bracket +[ + "(" + ")" + "{" + "}" + "[" + "]" + "#" +] @punctuation.bracket + +;;; Comparisons +[ + "==" + "=:=" + "=/=" + "=<" + ">=" + "<" + ">" +] @operator ;; .comparison + +;;; operator +[ + ":" + ":=" + "!" + ;; "-" + "+" + "=" + "->" + "=>" + "|" + "?=" +] @operator + +[ + "," + "." + ";" +] @punctuation.delimiter + +;; conditional +[ + "receive" + "if" + "case" + "of" + "when" + "after" + "end" + "maybe" + "else" +] @conditional + +[ + "catch" + "try" +] @exception + +((atom) @boolean (#any-of? @boolean "true" "false")) + +;; Macros +((macro_call_expr) @constant.macro (#set! "priority" 101)) + +;; Preprocessor +(pp_define + lhs: _ @constant.macro (#set! "priority" 101) +) +(_preprocessor_directive) @preproc (#set! "priority" 99) + +;; Attributes +(pp_include) @include +(pp_include_lib) @include +(export_attribute) @include +(export_type_attribute) @type.definition +(export_type_attribute types: (fa fun: _ @type (#set! "priority" 101))) +(behaviour_attribute) @include +(module_attribute (atom) @namespace) @include +(wild_attribute name: (attr_name name: _ @attribute)) @attribute + +;; Records +(record_expr) @type +(record_field_expr _ @field) @type +(record_field_name _ @field) @type +(record_name "#" @type name: _ @type) @type +(record_decl name: _ @type) @type.definition +(record_field name: _ @field) +(record_field name: _ @field ty: _ @type) + +;; Type alias +(type_alias name: _ @type) @type.definition +(spec) @type.definition + +[(string) (binary)] @string + +;;; expr_function_call +(call expr: [(atom) (remote) (var)] @function) +(call (atom) @exception (#any-of? @exception "error" "throw" "exit")) + +;;; Parenthesized expression: (SomeFunc)(), only highlight the parens +(call + expr: (paren_expr "(" @function.call ")" @function.call) +) + +;;; function +(external_fun) @function.call +(internal_fun fun: (atom) @function.call) +(function_clause name: (atom) @function) +(fa fun: (atom) @function) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/fennel/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/fennel/folds.scm new file mode 100644 index 000000000..c8427b188 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fennel/folds.scm @@ -0,0 +1 @@ +[(list) (table) (sequential_table) (let) (fn) (let_clause) (quoted_list) (local) (global)] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/fennel/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/fennel/highlights.scm new file mode 100644 index 000000000..14c91d976 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fennel/highlights.scm @@ -0,0 +1,121 @@ +(comment) @comment @spell + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + ":" + ":until" + "&" + "&as" + "?" +] @punctuation.special + +(nil) @constant.builtin +(vararg) @punctuation.special + +(boolean) @boolean +(number) @number + +(string) @string +(escape_sequence) @string.escape + +(symbol) @variable + +(multi_symbol + "." @punctuation.delimiter + (symbol) @field) + +(multi_symbol_method + ":" @punctuation.delimiter + (symbol) @method.call .) + +(list . (symbol) @function.call) +(list . (multi_symbol (symbol) @function.call .)) + +((symbol) @variable.builtin + (#lua-match? @variable.builtin "^[$]")) + +(binding) @symbol + +[ + "fn" + "lambda" + "hashfn" + "#" +] @keyword.function + +(fn name: [ + (symbol) @function + (multi_symbol (symbol) @function .) +]) + +(lambda name: [ + (symbol) @function + (multi_symbol (symbol) @function .) +]) + +[ + "for" + "each" +] @repeat +((symbol) @repeat + (#any-of? @repeat + "while")) + +[ + "match" +] @conditional +((symbol) @conditional + (#any-of? @conditional + "if" "when")) + +[ + "global" + "local" + "let" + "set" + "var" + "where" + "or" +] @keyword +((symbol) @keyword + (#any-of? @keyword + "comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values")) + +((symbol) @include + (#any-of? @include + "require" "require-macros" "import-macros" "include")) + +[ + "collect" + "icollect" + "accumulate" +] @function.macro + +((symbol) @function.macro + (#any-of? @function.macro + "->" "->>" "-?>" "-?>>" "?." "doto" "macro" "macrodebug" "partial" "pick-args" + "pick-values" "with-open")) + +; Lua builtins +((symbol) @constant.builtin + (#any-of? @constant.builtin + "arg" "_ENV" "_G" "_VERSION")) + +((symbol) @function.builtin + (#any-of? @function.builtin + "assert" "collectgarbage" "dofile" "error" "getmetatable" "ipairs" + "load" "loadfile" "next" "pairs" "pcall" "print" "rawequal" "rawget" + "rawlen" "rawset" "require" "select" "setmetatable" "tonumber" "tostring" + "type" "warn" "xpcall")) + +((symbol) @function.builtin + (#any-of? @function.builtin + "loadstring" "module" "setfenv" "unpack")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/fennel/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/fennel/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fennel/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/fennel/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/fennel/locals.scm new file mode 100644 index 000000000..3018732f9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fennel/locals.scm @@ -0,0 +1,26 @@ +[ + (program) + (fn) + (lambda) + (let) + (each) + (for) + (match) +] @scope + +( + (list . (symbol) @_special) @scope + (#any-of? @_special + "while" "if" "when" "do" "collect" "icollect" "accumulate") +) + +(fn name: (symbol) @definition.function + (#set! definition.function.scope "parent")) +(lambda name: (symbol) @definition.function + (#set! definition.function.scope "parent")) + +; TODO: use @definition.parameter for parameters +(binding (symbol) @definition.var) +(for_clause . (symbol) @definition.var) + +(symbol) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/firrtl/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/firrtl/folds.scm new file mode 100644 index 000000000..437b2c81c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/firrtl/folds.scm @@ -0,0 +1,6 @@ +[ + (circuit) + (module) + (when) + (else) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/firrtl/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/firrtl/highlights.scm new file mode 100644 index 000000000..551b2e751 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/firrtl/highlights.scm @@ -0,0 +1,189 @@ +; Namespaces + +(circuit (identifier) @namespace) + +(module (identifier) @namespace) + +; Types + +((identifier) @type + (#lua-match? @type "^[A-Z][A-Za-z0-9_$]*$")) + +; Keywords + +[ + "circuit" + "module" + "extmodule" + + "flip" + "parameter" + "reset" + "wire" + + "cmem" + "smem" + "mem" + + "reg" + "with" + "mport" + "inst" + "of" + "node" + "is" + "invalid" + "skip" + + "infer" + "read" + "write" + "rdwr" + + "defname" +] @keyword + +; Qualifiers + +(qualifier) @type.qualifier + +; Storageclasses + +[ + "input" + "output" +] @storageclass + +; Conditionals + +[ + "when" + "else" +] @conditional + +; Annotations + +(info) @attribute + +; Builtins + +[ + "stop" + "printf" + "assert" + "assume" + "cover" + "attach" + "mux" + "validif" +] @function.builtin + +[ + "UInt" + "SInt" + "Analog" + "Fixed" + "Clock" + "AsyncReset" + "Reset" +] @type.builtin + +; Fields + +[ + "data-type" + "depth" + "read-latency" + "write-latency" + "read-under-write" + "reader" + "writer" + "readwriter" +] @field.builtin + +((field_id) @field + (#set! "priority" 105)) + +(port (identifier) @field) + +(wire (identifier) @field) + +(cmem (identifier) @field) + +(smem (identifier) @field) + +(memory (identifier) @field) + +(register (identifier) @field) + +; Parameters + +(primitive_operation (identifier) @parameter) + +(mux (identifier) @parameter) +(printf (identifier) @parameter) +(reset (identifier) @parameter) +(stop (identifier) @parameter) + +; Variables + +(identifier) @variable + +; Operators + +(primop) @keyword.operator + +[ + "+" + "-" + "=" + "=>" + "<=" + "<-" +] @operator + +; Literals + +[ + (uint) + (number) +] @number + +(number_str) @string.special + +(double) @float + +(string) @string + +(escape_sequence) @string.escape + +[ + "old" + "new" + "undefined" +] @constant.builtin + +; Punctuation + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ + "," + "." + ":" +] @punctuation.delimiter + +; Comments + +(comment) @comment @spell + +["=>" "<=" "="] @operator + +; Error +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/firrtl/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/firrtl/indents.scm new file mode 100644 index 000000000..8bc1e2019 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/firrtl/indents.scm @@ -0,0 +1,12 @@ +[ + (circuit) + (module) + (memory) + (when) + (else) +] @indent.begin + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/firrtl/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/firrtl/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/firrtl/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/firrtl/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/firrtl/locals.scm new file mode 100644 index 000000000..bb7fc56bd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/firrtl/locals.scm @@ -0,0 +1,38 @@ +; Scopes + +[ + (source_file) + (circuit) + (module) + + (else) + (when) +] @scope + +; References + +(identifier) @reference + +; Definitions + +(port (identifier) @definition.field) + +(wire (identifier) @definition.field) + +(cmem (identifier) @definition.field) + +(smem (identifier) @definition.field) + +(memory (identifier) @definition.field) + +(register (identifier) @definition.field) + +(circuit (identifier) @definition.namespace) + +(module (identifier) @definition.namespace) + +(parameter (identifier) @definition.parameter) + +(rdwr (identifier) @definition.var) + +(node (identifier) @definition.var) diff --git a/bundle/nvim-treesitter-0.9.1/queries/fish/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/fish/folds.scm new file mode 100644 index 000000000..6075e2e04 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fish/folds.scm @@ -0,0 +1,8 @@ +[ + (function_definition) + (if_statement) + (switch_statement) + (for_statement) + (while_statement) + (begin_statement) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/fish/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/fish/highlights.scm new file mode 100644 index 000000000..d12cbd781 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fish/highlights.scm @@ -0,0 +1,168 @@ +;; Fish highlighting + +;; Operators + +[ + "&&" + "||" + "|" + "&" + ".." + "!" + (direction) + (stream_redirect) +] @operator + +;; match operators of test command +(command + name: (word) @function.builtin (#eq? @function.builtin "test") + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + +;; match operators of [ command +(command + name: (word) @punctuation.bracket (#eq? @punctuation.bracket "[") + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + +[ + "not" + "and" + "or" +] @keyword.operator + +;; Conditionals + +(if_statement +[ + "if" + "end" +] @conditional) + +(switch_statement +[ + "switch" + "end" +] @conditional) + +(case_clause +[ + "case" +] @conditional) + +(else_clause +[ + "else" +] @conditional) + +(else_if_clause +[ + "else" + "if" +] @conditional) + +;; Loops/Blocks + +(while_statement +[ + "while" + "end" +] @repeat) + +(for_statement +[ + "for" + "end" +] @repeat) + +(begin_statement +[ + "begin" + "end" +] @repeat) + +;; Keywords + +[ + "in" + (break) + (continue) +] @keyword + +"return" @keyword.return + +;; Punctuation + +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter + +;; Commands + +(command + argument: [ + (word) @parameter (#lua-match? @parameter "^[-]") + ] +) + +(command_substitution "$" @punctuation.bracket) + +; non-builtin command names +(command name: (word) @function.call) + +; derived from builtin -n (fish 3.2.2) +(command + 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") + ] +) + +;; Functions + +(function_definition ["function" "end"] @keyword.function) + +(function_definition + name: [ + (word) (concatenation) + ] +@function) + +(function_definition + option: [ + (word) + (concatenation (word)) + ] @parameter (#lua-match? @parameter "^[-]") +) + +;; Strings + +[(double_quote_string) (single_quote_string)] @string +(escape_sequence) @string.escape + +;; Variables + +(variable_name) @variable +(variable_expansion) @constant + +;; Nodes + +[(integer) (float)] @number +(comment) @comment +(comment) @spell + +((word) @boolean +(#any-of? @boolean "true" "false")) + +((program . (comment) @preproc) + (#lua-match? @preproc "^#!/")) + +;; Error + +(ERROR) @error + diff --git a/bundle/nvim-treesitter-0.9.1/queries/fish/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/fish/indents.scm new file mode 100644 index 000000000..526c56e69 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fish/indents.scm @@ -0,0 +1,18 @@ +[ + (function_definition) + (while_statement) + (for_statement) + (if_statement) + (begin_statement) + (switch_statement) +] @indent.begin + +[ + "else" ; else and else if must both start the line with "else", so tag the string directly + "case" + "end" +] @indent.branch + +"end" @indent.end + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/fish/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/fish/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fish/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/fish/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/fish/locals.scm new file mode 100644 index 000000000..a522c78dc --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fish/locals.scm @@ -0,0 +1,18 @@ +;; Scopes +[ + (command) + (function_definition) + (if_statement) + (for_statement) + (begin_statement) + (while_statement) + (switch_statement) +] @scope + +;; Definitions +(function_definition + name: (word) @definition.function) + +;; References +(variable_name) @reference +(word) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/foam/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/foam/folds.scm new file mode 100644 index 000000000..2e499c2e2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/foam/folds.scm @@ -0,0 +1,7 @@ +[ + (comment) + (list) + (dict_core) +] @fold + +(code (code_body)* @fold) diff --git a/bundle/nvim-treesitter-0.9.1/queries/foam/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/foam/highlights.scm new file mode 100644 index 000000000..5d45b0a34 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/foam/highlights.scm @@ -0,0 +1,61 @@ +;; Comments +(comment) @comment + +;; Generic Key-value pairs and dictionary keywords +(key_value + keyword: (identifier) @function +) +(dict + key: (identifier) @type +) + +;; Macros +(macro + "$" @conditional + (prev_scope)* @conditional + (identifier)* @namespace +) + + +;; Directives +"#" @conditional +(preproc_call + directive: (identifier)* @conditional + argument: (identifier)* @namespace +) +((preproc_call + argument: (identifier)* @namespace) @conditional + (#eq? @conditional "ifeq")) +((preproc_call) @conditional + (#any-of? @conditional "else" "endif")) + +;; Literals +(number_literal) @float +(string_literal) @string +(escape_sequence) @string.escape +(boolean) @boolean + +;; Treat [m^2 s^-2] the same as if it was put in numbers format +(dimensions dimension: (identifier) @float) + +;; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" + "#{" + "#}" + "|-" + "-|" + "" + "$$" +] @punctuation.bracket + +";" @punctuation.delimiter + +((identifier) @constant.builtin + (#any-of? @constant.builtin "uniform" "non-uniform" "and" "or")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/foam/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/foam/indents.scm new file mode 100644 index 000000000..a52cafea6 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/foam/indents.scm @@ -0,0 +1,11 @@ +[ + "{" + "}" +] @indent.branch + +[(dict) (key_value)] @indent.begin + + +[ + (comment) +] @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/foam/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/foam/injections.scm new file mode 100644 index 000000000..4afdb63b0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/foam/injections.scm @@ -0,0 +1,12 @@ +;; Pass code blocks to Cpp highlighter +(code (code_body) @cpp) + +;; Pass identifiers to Go highlighter (Cheating I know) +;;((identifier) @lua) + +;; Highlight regex syntax inside literal strings +((string_literal) @regex) + +;; Highlight PyFoam syntax as Python statements +(pyfoam_variable code_body: (_) @python) +(pyfoam_expression code_body: (_) @python) diff --git a/bundle/nvim-treesitter-0.9.1/queries/foam/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/foam/locals.scm new file mode 100644 index 000000000..2abe743dd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/foam/locals.scm @@ -0,0 +1,6 @@ +(dict) @scope + +(dict key: (_) @definition.type) + +(key_value keyword: (_) @definition.parameter) +(key_value value: (macro (identifier)*)* @reference) diff --git a/bundle/nvim-treesitter-0.9.1/queries/fortran/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/fortran/folds.scm new file mode 100644 index 000000000..a2edc64d3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fortran/folds.scm @@ -0,0 +1,11 @@ +;; by @oponkork +[ + (if_statement) + (where_statement) + (enum_statement) + (do_loop_statement) + (derived_type_definition) + (function) + (subroutine) + (interface) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/fortran/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/fortran/highlights.scm new file mode 100644 index 000000000..a6b55413b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fortran/highlights.scm @@ -0,0 +1,332 @@ +; Preprocs + +(preproc_file_line) @preproc + +; Namespaces + +(program_statement + (name) @namespace) + +(end_program_statement + (name) @namespace) + +(module_statement + (name) @namespace) + +(end_module_statement + (name) @namespace) + +(submodule_statement + (name) @namespace) + +(end_submodule_statement + (name) @namespace) + +; Includes + +[ + "import" + "include" + "use" +] @include + +(import_statement + "," + ["all" "none"] @keyword) + +; Attributes + +[ + (none) + "implicit" + "intent" +] @attribute + +(implicit_statement + "type" @attribute) + +; Keywords + +[ + "attributes" + "associate" + "block" + "class" + "classis" + "contains" + "default" + "dimension" + "endassociate" + "endenum" + "endinterface" + "endmodule" + "endselect" + "endsubmodule" + "endtype" + "enum" + "enumerator" + "equivalence" + "extends" + "goto" + "interface" + "intrinsic" + "non_intrinsic" + "module" + "submodule" + "namelist" + "parameter" + "quiet" + "rank" + "save" + "selectcase" + "selectrank" + "selecttype" + "sequence" + "stop" + "target" + "type" + "typeis" +] @keyword + +[ + (default) +] @keyword + +; Types + +[ + (type_name) +] @type + +[ + (intrinsic_type) +] @type.builtin + +; Qualifiers + +[ + "abstract" + "allocatable" + "automatic" + "constant" + "contiguous" + "data" + "deferred" + "device" + "external" + "family" + "final" + "generic" + "global" + "grid_global" + "host" + "initial" + "local" + "local_init" + "managed" + "nopass" + "non_overridable" + "optional" + "pass" + "pinned" + "pointer" + "private" + "property" + "protected" + "public" + "shared" + "static" + "texture" + "value" + "volatile" + (procedure_qualifier) +] @type.qualifier + +[ + "common" + "in" + "inout" + "out" +] @storageclass + +; Labels + +[ + (statement_label) + (statement_label_reference) +] @label + +[ + "call" + "endfunction" + "endprogram" + "endprocedure" + "endsubroutine" + "function" + "procedure" + "program" + "subroutine" +] @keyword.function + +[ + "result" + "return" +] @keyword.return + +; Functions + +(function_statement + (name) @function) + +(end_function_statement + (name) @function) + +(subroutine_statement + (name) @function) + +(end_subroutine_statement + (name) @function) + +(module_procedure_statement + (name) @function) + +(end_module_procedure_statement + (name) @function) + +(subroutine_call + (identifier) @function.call) + +[ + "character" + "close" + "bind" + "format" + "open" + "print" + "read" + "write" +] @function.builtin + +; Exceptions + +[ + "error" +] @exception + +; Conditionals + +[ + "else" + "elseif" + "elsewhere" + "endif" + "endwhere" + "if" + "then" + "where" +] @conditional + +; Repeats + +[ + "do" + "concurrent" + "enddo" + "endforall" + "forall" + "while" + "continue" + "cycle" + "exit" +] @repeat + +; Variables + +(identifier) @variable + +; Parameters + +(keyword_argument + name: (identifier) @parameter) + +(parameters + (identifier) @parameter) + +; Properties + +(derived_type_member_expression + (type_member) @property) + +; Operators + +[ + "+" + "-" + "*" + "**" + "/" + "=" + "<" + ">" + "<=" + ">=" + "==" + "/=" + "//" + (assumed_rank) +] @operator + +[ + "\\.and\\." + "\\.or\\." + "\\.eqv\\." + "\\.neqv\\." + "\\.lt\\." + "\\.gt\\." + "\\.le\\." + "\\.ge\\." + "\\.eq\\." + "\\.ne\\." + "\\.not\\." +] @keyword.operator + +; Punctuation + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ "<<<" ">>>" ] @punctuation.bracket + +(array_literal + ["(/" "/)"] @punctuation.bracket) + +[ + ":" + "," + "/" + "%" + "::" + "=>" +] @punctuation.delimiter + +; Literals + +(string_literal) @string + +(number_literal) @number + +(boolean_literal) @boolean + +(null_literal) @constant.builtin + +; Comments + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^!>")) + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/fortran/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/fortran/indents.scm new file mode 100644 index 000000000..86704c4f4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fortran/indents.scm @@ -0,0 +1,27 @@ +[ + (module) + (program) + (subroutine) + (function) + ; (interface) + (if_statement) + (do_loop_statement) + (where_statement) + (derived_type_definition) + (enum) +] @indent.begin + +[ + (end_module_statement) + (end_program_statement) + (end_subroutine_statement) + (end_function_statement) + ; (end_interface_statement) + (end_if_statement) + (end_do_loop_statement) + (else_clause) + (elseif_clause) + (end_type_statement) + (end_enum_statement) + (end_where_statement) +] @indent.branch diff --git a/bundle/nvim-treesitter-0.9.1/queries/fsh/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/fsh/highlights.scm new file mode 100644 index 000000000..e4c0edd8e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fsh/highlights.scm @@ -0,0 +1,91 @@ +[ + "(" + ")" +] @punctuation.bracket + +[ + "^" + "=" + ":" +] @operator + +[ + "#" + ".." + "*" + "->" +] @punctuation.special + +; Entities +[ + "Profile" + "Alias" + "Extension" + "Invariant" + "Instance" + "ValueSet" + "CodeSystem" + "Mapping" + "Logical" + "Resource" + "RuleSet" +] @keyword + +; Metadata Keywords +[ + "Parent" + "Title" + "Description" + "Id" + "Severity" + "InstanceOf" + "Usage" + "Source" + "XPath" + "Target" +] @keyword + +; Rule Keywords +[ + "contentReference" + "insert" + "and" + "or" + "contains" + "named" + "only" + "obeys" + "valueset" + "codes" + "from" + "include" + "exclude" + "where" + "system" + "exactly" +] @keyword.operator + +; Types +[ + "Reference" + "Canonical" +] @type.builtin + + +(sd_metadata (parent (name))) @type +(target_type (name)) @type + +; Strings +(string) @string +(multiline_string) @string + +; Constants +(strength_value) @constant +(bool) @constant.boolean +(flag) @constant + +; Special Params +(code_value) @parameter + +; Extras +(fsh_comment) @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/func/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/func/highlights.scm new file mode 100644 index 000000000..c1662a180 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/func/highlights.scm @@ -0,0 +1,175 @@ +; Include + +"#include" @include +(include_path) @string + +; Preproc + +[ + "#pragma" +] @preproc + +(pragma_directive + [ + "version" + "not-version" + "test-version-set" + ] @preproc) + +; Keywords + +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "type" +] @keyword + +[ + "return" +] @keyword.return + +; Conditionals + +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @conditional + +; Exceptions + +[ + "try" + "catch" +] @exception + +; Repeats + +[ + "do" + "forall" + "repeat" + "while" +] @repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @type.qualifier + +; Variables + +(identifier) @variable + +; Constants + +(const_var_declarations + name: (identifier) @constant) + +; Functions/Methods + +(function_definition + name: (function_name) @function) + +(function_application + function: (identifier) @function) + +(method_call + method_name: (identifier) @method.call) + +; Parameters + +(parameter) @parameter + +; Types + +(type_identifier) @type + +(primitive_type) @type.builtin + +; Operators + +[ + "=" + "+=" + "-=" + "*=" + "/=" + "~/=" + "^/=" + "%=" + "~%=" + "^%=" + "<<=" + ">>=" + "~>>=" + "^>>=" + "&=" + "|=" + "^=" + "==" + "<" + ">" + "<=" + ">=" + "!=" + "<=>" + "<<" + ">>" + "~>>" + "^>>" + "-" + "+" + "|" + "^" + "*" + "/" + "%" + "~/" + "^/" + "~%" + "^%" + "/%" + "&" + "~" +] @operator + +; Literals + +[ + (string) + (asm_instruction) +] @string + +[ + (string_type) + (underscore) +] @character.special + +(number) @number + +; Punctuation + +["{" "}"] @punctuation.bracket + +["(" ")" "()"] @punctuation.bracket + +["[" "]"] @punctuation.bracket + +[ + ";" + "," + "->" +] @punctuation.delimiter + +; Comments + +(comment) @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/fusion/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/fusion/folds.scm new file mode 100644 index 000000000..179fc160b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fusion/folds.scm @@ -0,0 +1,6 @@ +[ + (comment) + (block) + (afx_comment) + (afx_element) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/fusion/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/fusion/highlights.scm new file mode 100644 index 000000000..bb24a413f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fusion/highlights.scm @@ -0,0 +1,120 @@ +(comment) @comment +(afx_comment) @comment + +; identifiers afx +(afx_opening_element + (afx_identifier) @tag) +(afx_closing_element + (afx_identifier) @tag) +(afx_element_self_closing + (afx_identifier) @tag) + +(afx_attribute + (afx_property_identifier) @tag.attribute) + +(afx_text) @text + +; identifiers eel + +(eel_object_path + (eel_path_identifier) @variable.builtin + (#any-of? @variable.builtin "this" "props") +) + +(eel_object_path + (eel_path_identifier) @variable) + +(eel_object_pair + key: (eel_property_name) @property) + +(eel_method_name) @function + +(eel_parameter) @variable + +; identifiers fusion +; ----------- + +(path_part) @property +(meta_property) @attribute +(prototype_signature + "prototype" @keyword + +) +(include_statement + [ + "include" + ] @include + (source_file) @text.uri +) + +(namespace_declaration + "namespace" @keyword + (alias_namespace) @namespace) + +(type + name: (type_name) @type) + +; tokens +; ------ +(afx_opening_element + [ + "<" + ">" + ] @punctuation.bracket) + + (afx_closing_element + [ + "<" + ">" + "/" + ] @punctuation.bracket) + +(afx_element_self_closing + [ + "<" + "/>" + ] @punctuation.bracket) + +[ + (package_name) + (alias_namespace) +] @namespace + +(namespace_declaration "=" @operator) +(assignment "=" @operator) +(copy "<" @operator) +(deletion) @operator +(eel_binary_expression + operator: _ @operator) +(eel_not_expression + [ + "!" + "not" + ] @operator) + +(string) @string +(number) @number +(boolean) @boolean +(null) @constant.builtin + +(value_expression + start: _ @punctuation.special + end: _ @punctuation.special +) +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + ":" + "." + "?" +] @punctuation.delimiter + +(eel_ternary_expression + ["?" ":"] @conditional.ternary) diff --git a/bundle/nvim-treesitter-0.9.1/queries/fusion/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/fusion/indents.scm new file mode 100644 index 000000000..73133191b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fusion/indents.scm @@ -0,0 +1,19 @@ +[ + (block) + (value_dsl) + (afx_element) + (afx_element_self_closing) + (eel_array) + (eel_object) +] @indent.begin + + +(block end: _ @indent.branch) +(value_dsl end: _ @indent.branch) +(eel_array end: _ @indent.branch) +(eel_object end: _ @indent.branch) +[ + (afx_closing_element) +] @indent.branch + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/fusion/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/fusion/locals.scm new file mode 100644 index 000000000..24dc57bbe --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/fusion/locals.scm @@ -0,0 +1,21 @@ +;; Fusion base +(block) @scope + +(namespace_declaration + (alias_namespace) @definition.namespace) + +(property + (path (path_part) @definition.field)) + +(type + namespace: (package_name)? @definition.namespace + name: (type_name) @definition.type +) + +;; Eel Expressions +(eel_arrow_function) @scope +(eel_object) @scope + +(eel_parameter) @definition.parameter +(eel_object_pair + key: (eel_property_name) @definition.field) diff --git a/bundle/nvim-treesitter-0.9.1/queries/gdscript/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/gdscript/folds.scm new file mode 100644 index 000000000..946b0fea3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gdscript/folds.scm @@ -0,0 +1,25 @@ +[ + ; Body fold will "join" the next adjacent fold into a SUPER fold. + ; This is an issue with the grammar. + ; (body) + + (if_statement) + (elif_clause) + (else_clause) + (for_statement) + (while_statement) + (class_definition) + (enum_definition) + (match_statement) + (pattern_section) + (function_definition) + (lambda) + (constructor_definition) +] @fold + +; It's nice to be able to fold the if/elif/else clauses and the entire +; if_statement. +(if_statement (body) @fold) + +; Fold strings that are probably doc strings. +(expression_statement (string) @fold) diff --git a/bundle/nvim-treesitter-0.9.1/queries/gdscript/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gdscript/highlights.scm new file mode 100644 index 000000000..a6581bb97 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gdscript/highlights.scm @@ -0,0 +1,344 @@ +;; Basic +(ERROR) @error + +(identifier) @variable +(name) @variable +(type) @type +(comment) @comment @spell +(string_name) @string +(string) @string +(float) @float +(integer) @number +(null) @constant +(setter) @function +(getter) @function +(set_body "set" @keyword.function) +(get_body "get" @keyword.function) +(static_keyword) @type.qualifier +(tool_statement) @keyword +(breakpoint_statement) @debug +(inferred_type) @operator +[(true) (false)] @boolean + +[ + (get_node) + (node_path) +] @text.uri + +(class_name_statement + (name) @type) @keyword + +(const_statement + "const" @type.qualifier + (name) @constant) + +(expression_statement (string) @comment @spell) + +;; Identifier naming conventions +((identifier) @type + (#lua-match? @type "^[A-Z]")) +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +;; Functions +(constructor_definition) @constructor + +(function_definition + (name) @function (parameters + (identifier) @parameter)*) + +(typed_parameter (identifier) @parameter) +(default_parameter (identifier) @parameter) + +(call (identifier) @function.call) +(call (identifier) @include + (#any-of? @include "preload" "load")) + +;; Properties and Methods + +; We'll use @property since that's the term Godot uses. +; But, should (source (variable_statement (name))) be @property, too? Since a +; script file is a class in gdscript. +(class_definition + (body (variable_statement (name) @property))) + +; Same question but for methods? +(class_definition + (body (function_definition (name) @method))) + +(attribute_call (identifier) @method.call) +(attribute (_) (identifier) @property) + +;; Enums + +(enumerator left: (identifier) @constant) + +;; Special Builtins + +((identifier) @variable.builtin + (#any-of? @variable.builtin "self" "super")) + +(attribute_call (identifier) @keyword.operator + (#eq? @keyword.operator "new")) + +;; Match Pattern + +(underscore) @constant ; The "_" pattern. +(pattern_open_ending) @operator ; The ".." pattern. + +;; Alternations +["(" ")" "[" "]" "{" "}"] @punctuation.bracket + +["," "." ":"] @punctuation.delimiter + +["if" "elif" "else" "match"] @conditional + +["for" "while" "break" "continue"] @repeat + +[ + "~" + "-" + "*" + "/" + "%" + "+" + "-" + "<<" + ">>" + "&" + "^" + "|" + "<" + ">" + "==" + "!=" + ">=" + "<=" + "!" + "&&" + "||" + "=" + "+=" + "-=" + "*=" + "/=" + "%=" + "&=" + "|=" + "->" +] @operator + +[ + "and" + "as" + "in" + "is" + "not" + "or" +] @keyword.operator + +[ + "pass" + "class" + "class_name" + "extends" + "signal" + "enum" + "var" + "onready" + "export" + "setget" + "remote" + "master" + "puppet" + "remotesync" + "mastersync" + "puppetsync" +] @keyword + +"func" @keyword.function + +[ + "return" +] @keyword.return + +[ + "await" +] @keyword.coroutine + +(call (identifier) @keyword.coroutine + (#eq? @keyword.coroutine "yield")) + + +;; Builtins +; generated from +; - https://github.com/godotengine/godot/blob/491ded18983a4ae963ce9c29e8df5d5680873ccb/doc/classes/@GlobalScope.xml +; - https://github.com/godotengine/godot/blob/491ded18983a4ae963ce9c29e8df5d5680873ccb/modules/gdscript/doc_classes/@GDScript.xml +; some from: +; - https://github.com/godotengine/godot-vscode-plugin/blob/0636797c22bf1e23a41fd24d55cdb9be62e0c992/syntaxes/GDScript.tmLanguage.json + +;; Built-in Annotations + +((annotation "@" @attribute (identifier) @attribute) + (#any-of? @attribute + ; @GDScript + "export" "export_category" "export_color_no_alpha" "export_dir" + "export_enum" "export_exp_easing" "export_file" "export_flags" + "export_flags_2d_navigation" "export_flags_2d_physics" + "export_flags_2d_render" "export_flags_3d_navigation" + "export_flags_3d_physics" "export_flags_3d_render" "export_global_dir" + "export_global_file" "export_group" "export_multiline" "export_node_path" + "export_placeholder" "export_range" "export_subgroup" "icon" "onready" + "rpc" "tool" "warning_ignore" + )) + +;; Builtin Types + +([(identifier) (type)] @type.builtin + (#any-of? @type.builtin + ; from godot-vscode-plugin + "Vector2" "Vector2i" "Vector3" "Vector3i" + "Color" "Rect2" "Rect2i" "Array" "Basis" "Dictionary" + "Plane" "Quat" "RID" "Rect3" "Transform" "Transform2D" + "Transform3D" "AABB" "String" "NodePath" "Object" + "PoolByteArray" "PoolIntArray" "PoolRealArray" + "PoolStringArray" "PoolVector2Array" "PoolVector3Array" + "PoolColorArray" "bool" "int" "float" "StringName" "Quaternion" + "PackedByteArray" "PackedInt32Array" "PackedInt64Array" + "PackedFloat32Array" "PackedFloat64Array" "PackedStringArray" + "PackedVector2Array" "PackedVector2iArray" "PackedVector3Array" + "PackedVector3iArray" "PackedColorArray" + + ; @GlobalScope + "AudioServer" "CameraServer" "ClassDB" "DisplayServer" "Engine" + "EngineDebugger" "GDExtensionManager" "Geometry2D" "Geometry3D" "GodotSharp" + "IP" "Input" "InputMap" "JavaClassWrapper" "JavaScriptBridge" "Marshalls" + "NavigationMeshGenerator" "NavigationServer2D" "NavigationServer3D" "OS" + "Performance" "PhysicsServer2D" "PhysicsServer2DManager" "PhysicsServer3D" + "PhysicsServer3DManager" "ProjectSettings" "RenderingServer" "ResourceLoader" + "ResourceSaver" "ResourceUID" "TextServerManager" "ThemeDB" "Time" + "TranslationServer" "WorkerThreadPool" "XRServer" + )) + +;; Builtin Funcs + +(call (identifier) @function.builtin + (#any-of? @function.builtin + ; @GlobalScope + "abs" "absf" "absi" "acos" "asin" "atan" "atan2" "bezier_derivative" + "bezier_interpolate" "bytes_to_var" "bytes_to_var_with_objects" "ceil" "ceilf" + "ceili" "clamp" "clampf" "clampi" "cos" "cosh" "cubic_interpolate" + "cubic_interpolate_angle" "cubic_interpolate_angle_in_time" + "cubic_interpolate_in_time" "db_to_linear" "deg_to_rad" "ease" "error_string" + "exp" "floor" "floorf" "floori" "fmod" "fposmod" "hash" "instance_from_id" + "inverse_lerp" "is_equal_approx" "is_finite" "is_inf" "is_instance_id_valid" + "is_instance_valid" "is_nan" "is_same" "is_zero_approx" "lerp" "lerp_angle" + "lerpf" "linear_to_db" "log" "max" "maxf" "maxi" "min" "minf" "mini" + "move_toward" "nearest_po2" "pingpong" "posmod" "pow" "print" "print_rich" + "print_verbose" "printerr" "printraw" "prints" "printt" "push_error" + "push_warning" "rad_to_deg" "rand_from_seed" "randf" "randf_range" "randfn" + "randi" "randi_range" "randomize" "remap" "rid_allocate_id" "rid_from_int64" + "round" "roundf" "roundi" "seed" "sign" "signf" "signi" "sin" "sinh" + "smoothstep" "snapped" "snappedf" "snappedi" "sqrt" "step_decimals" "str" + "str_to_var" "tan" "tanh" "typeof" "var_to_bytes" "var_to_bytes_with_objects" + "var_to_str" "weakref" "wrap" "wrapf" "wrapi" + + ; @GDScript + "Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict" + "is_instance_of" "len" "print_debug" "print_stack" "range" + "type_exists" + )) + +;; Builtin Constants + +((identifier) @constant.builtin + (#any-of? @constant.builtin + ; @GDScript + "PI" "TAU" "INF" "NAN" + + ; @GlobalScope + "SIDE_LEFT" "SIDE_TOP" "SIDE_RIGHT" "SIDE_BOTTOM" "CORNER_TOP_LEFT" "CORNER_TOP_RIGHT" "CORNER_BOTTOM_RIGHT" + "CORNER_BOTTOM_LEFT" "VERTICAL" "HORIZONTAL" "CLOCKWISE" "COUNTERCLOCKWISE" "HORIZONTAL_ALIGNMENT_LEFT" + "HORIZONTAL_ALIGNMENT_CENTER" "HORIZONTAL_ALIGNMENT_RIGHT" "HORIZONTAL_ALIGNMENT_FILL" "VERTICAL_ALIGNMENT_TOP" + "VERTICAL_ALIGNMENT_CENTER" "VERTICAL_ALIGNMENT_BOTTOM" "VERTICAL_ALIGNMENT_FILL" "INLINE_ALIGNMENT_TOP_TO" + "INLINE_ALIGNMENT_CENTER_TO" "INLINE_ALIGNMENT_BASELINE_TO" "INLINE_ALIGNMENT_BOTTOM_TO" "INLINE_ALIGNMENT_TO_TOP" + "INLINE_ALIGNMENT_TO_CENTER" "INLINE_ALIGNMENT_TO_BASELINE" "INLINE_ALIGNMENT_TO_BOTTOM" "INLINE_ALIGNMENT_TOP" + "INLINE_ALIGNMENT_CENTER" "INLINE_ALIGNMENT_BOTTOM" "INLINE_ALIGNMENT_IMAGE_MASK" "INLINE_ALIGNMENT_TEXT_MASK" + "EULER_ORDER_XYZ" "EULER_ORDER_XZY" "EULER_ORDER_YXZ" "EULER_ORDER_YZX" "EULER_ORDER_ZXY" "EULER_ORDER_ZYX" "KEY_NONE" + "KEY_SPECIAL" "KEY_ESCAPE" "KEY_TAB" "KEY_BACKTAB" "KEY_BACKSPACE" "KEY_ENTER" "KEY_KP_ENTER" "KEY_INSERT" "KEY_DELETE" + "KEY_PAUSE" "KEY_PRINT" "KEY_SYSREQ" "KEY_CLEAR" "KEY_HOME" "KEY_END" "KEY_LEFT" "KEY_UP" "KEY_RIGHT" "KEY_DOWN" + "KEY_PAGEUP" "KEY_PAGEDOWN" "KEY_SHIFT" "KEY_CTRL" "KEY_META" "KEY_ALT" "KEY_CAPSLOCK" "KEY_NUMLOCK" "KEY_SCROLLLOCK" + "KEY_F1" "KEY_F2" "KEY_F3" "KEY_F4" "KEY_F5" "KEY_F6" "KEY_F7" "KEY_F8" "KEY_F9" "KEY_F10" "KEY_F11" "KEY_F12" + "KEY_F13" "KEY_F14" "KEY_F15" "KEY_F16" "KEY_F17" "KEY_F18" "KEY_F19" "KEY_F20" "KEY_F21" "KEY_F22" "KEY_F23" "KEY_F24" + "KEY_F25" "KEY_F26" "KEY_F27" "KEY_F28" "KEY_F29" "KEY_F30" "KEY_F31" "KEY_F32" "KEY_F33" "KEY_F34" "KEY_F35" + "KEY_KP_MULTIPLY" "KEY_KP_DIVIDE" "KEY_KP_SUBTRACT" "KEY_KP_PERIOD" "KEY_KP_ADD" "KEY_KP_0" "KEY_KP_1" "KEY_KP_2" + "KEY_KP_3" "KEY_KP_4" "KEY_KP_5" "KEY_KP_6" "KEY_KP_7" "KEY_KP_8" "KEY_KP_9" "KEY_MENU" "KEY_HYPER" "KEY_HELP" + "KEY_BACK" "KEY_FORWARD" "KEY_STOP" "KEY_REFRESH" "KEY_VOLUMEDOWN" "KEY_VOLUMEMUTE" "KEY_VOLUMEUP" "KEY_MEDIAPLAY" + "KEY_MEDIASTOP" "KEY_MEDIAPREVIOUS" "KEY_MEDIANEXT" "KEY_MEDIARECORD" "KEY_HOMEPAGE" "KEY_FAVORITES" "KEY_SEARCH" + "KEY_STANDBY" "KEY_OPENURL" "KEY_LAUNCHMAIL" "KEY_LAUNCHMEDIA" "KEY_LAUNCH0" "KEY_LAUNCH1" "KEY_LAUNCH2" "KEY_LAUNCH3" + "KEY_LAUNCH4" "KEY_LAUNCH5" "KEY_LAUNCH6" "KEY_LAUNCH7" "KEY_LAUNCH8" "KEY_LAUNCH9" "KEY_LAUNCHA" "KEY_LAUNCHB" + "KEY_LAUNCHC" "KEY_LAUNCHD" "KEY_LAUNCHE" "KEY_LAUNCHF" "KEY_UNKNOWN" "KEY_SPACE" "KEY_EXCLAM" "KEY_QUOTEDBL" + "KEY_NUMBERSIGN" "KEY_DOLLAR" "KEY_PERCENT" "KEY_AMPERSAND" "KEY_APOSTROPHE" "KEY_PARENLEFT" "KEY_PARENRIGHT" + "KEY_ASTERISK" "KEY_PLUS" "KEY_COMMA" "KEY_MINUS" "KEY_PERIOD" "KEY_SLASH" "KEY_0" "KEY_1" "KEY_2" "KEY_3" "KEY_4" + "KEY_5" "KEY_6" "KEY_7" "KEY_8" "KEY_9" "KEY_COLON" "KEY_SEMICOLON" "KEY_LESS" "KEY_EQUAL" "KEY_GREATER" "KEY_QUESTION" + "KEY_AT" "KEY_A" "KEY_B" "KEY_C" "KEY_D" "KEY_E" "KEY_F" "KEY_G" "KEY_H" "KEY_I" "KEY_J" "KEY_K" "KEY_L" "KEY_M" + "KEY_N" "KEY_O" "KEY_P" "KEY_Q" "KEY_R" "KEY_S" "KEY_T" "KEY_U" "KEY_V" "KEY_W" "KEY_X" "KEY_Y" "KEY_Z" + "KEY_BRACKETLEFT" "KEY_BACKSLASH" "KEY_BRACKETRIGHT" "KEY_ASCIICIRCUM" "KEY_UNDERSCORE" "KEY_QUOTELEFT" "KEY_BRACELEFT" + "KEY_BAR" "KEY_BRACERIGHT" "KEY_ASCIITILDE" "KEY_YEN" "KEY_SECTION" "KEY_GLOBE" "KEY_KEYBOARD" "KEY_JIS_EISU" + "KEY_JIS_KANA" "KEY_CODE_MASK" "KEY_MODIFIER_MASK" "KEY_MASK_CMD_OR_CTRL" "KEY_MASK_SHIFT" "KEY_MASK_ALT" + "KEY_MASK_META" "KEY_MASK_CTRL" "KEY_MASK_KPAD" "KEY_MASK_GROUP_SWITCH" "MOUSE_BUTTON_NONE" "MOUSE_BUTTON_LEFT" + "MOUSE_BUTTON_RIGHT" "MOUSE_BUTTON_MIDDLE" "MOUSE_BUTTON_WHEEL_UP" "MOUSE_BUTTON_WHEEL_DOWN" "MOUSE_BUTTON_WHEEL_LEFT" + "MOUSE_BUTTON_WHEEL_RIGHT" "MOUSE_BUTTON_XBUTTON1" "MOUSE_BUTTON_XBUTTON2" "MOUSE_BUTTON_MASK_LEFT" + "MOUSE_BUTTON_MASK_RIGHT" "MOUSE_BUTTON_MASK_MIDDLE" "MOUSE_BUTTON_MASK_MB_XBUTTON1" "MOUSE_BUTTON_MASK_MB_XBUTTON2" + "JOY_BUTTON_INVALID" "JOY_BUTTON_A" "JOY_BUTTON_B" "JOY_BUTTON_X" "JOY_BUTTON_Y" "JOY_BUTTON_BACK" "JOY_BUTTON_GUIDE" + "JOY_BUTTON_START" "JOY_BUTTON_LEFT_STICK" "JOY_BUTTON_RIGHT_STICK" "JOY_BUTTON_LEFT_SHOULDER" + "JOY_BUTTON_RIGHT_SHOULDER" "JOY_BUTTON_DPAD_UP" "JOY_BUTTON_DPAD_DOWN" "JOY_BUTTON_DPAD_LEFT" "JOY_BUTTON_DPAD_RIGHT" + "JOY_BUTTON_MISC1" "JOY_BUTTON_PADDLE1" "JOY_BUTTON_PADDLE2" "JOY_BUTTON_PADDLE3" "JOY_BUTTON_PADDLE4" + "JOY_BUTTON_TOUCHPAD" "JOY_BUTTON_SDL_MAX" "JOY_BUTTON_MAX" "JOY_AXIS_INVALID" "JOY_AXIS_LEFT_X" "JOY_AXIS_LEFT_Y" + "JOY_AXIS_RIGHT_X" "JOY_AXIS_RIGHT_Y" "JOY_AXIS_TRIGGER_LEFT" "JOY_AXIS_TRIGGER_RIGHT" "JOY_AXIS_SDL_MAX" + "JOY_AXIS_MAX" "MIDI_MESSAGE_NONE" "MIDI_MESSAGE_NOTE_OFF" "MIDI_MESSAGE_NOTE_ON" "MIDI_MESSAGE_AFTERTOUCH" + "MIDI_MESSAGE_CONTROL_CHANGE" "MIDI_MESSAGE_PROGRAM_CHANGE" "MIDI_MESSAGE_CHANNEL_PRESSURE" "MIDI_MESSAGE_PITCH_BEND" + "MIDI_MESSAGE_SYSTEM_EXCLUSIVE" "MIDI_MESSAGE_QUARTER_FRAME" "MIDI_MESSAGE_SONG_POSITION_POINTER" + "MIDI_MESSAGE_SONG_SELECT" "MIDI_MESSAGE_TUNE_REQUEST" "MIDI_MESSAGE_TIMING_CLOCK" "MIDI_MESSAGE_START" + "MIDI_MESSAGE_CONTINUE" "MIDI_MESSAGE_STOP" "MIDI_MESSAGE_ACTIVE_SENSING" "MIDI_MESSAGE_SYSTEM_RESET" "OK" "FAILED" + "ERR_UNAVAILABLE" "ERR_UNCONFIGURED" "ERR_UNAUTHORIZED" "ERR_PARAMETER_RANGE_ERROR" "ERR_OUT_OF_MEMORY" + "ERR_FILE_NOT_FOUND" "ERR_FILE_BAD_DRIVE" "ERR_FILE_BAD_PATH" "ERR_FILE_NO_PERMISSION" "ERR_FILE_ALREADY_IN_USE" + "ERR_FILE_CANT_OPEN" "ERR_FILE_CANT_WRITE" "ERR_FILE_CANT_READ" "ERR_FILE_UNRECOGNIZED" "ERR_FILE_CORRUPT" + "ERR_FILE_MISSING_DEPENDENCIES" "ERR_FILE_EOF" "ERR_CANT_OPEN" "ERR_CANT_CREATE" "ERR_QUERY_FAILED" + "ERR_ALREADY_IN_USE" "ERR_LOCKED" "ERR_TIMEOUT" "ERR_CANT_CONNECT" "ERR_CANT_RESOLVE" "ERR_CONNECTION_ERROR" + "ERR_CANT_ACQUIRE_RESOURCE" "ERR_CANT_FORK" "ERR_INVALID_DATA" "ERR_INVALID_PARAMETER" "ERR_ALREADY_EXISTS" + "ERR_DOES_NOT_EXIST" "ERR_DATABASE_CANT_READ" "ERR_DATABASE_CANT_WRITE" "ERR_COMPILATION_FAILED" "ERR_METHOD_NOT_FOUND" + "ERR_LINK_FAILED" "ERR_SCRIPT_FAILED" "ERR_CYCLIC_LINK" "ERR_INVALID_DECLARATION" "ERR_DUPLICATE_SYMBOL" + "ERR_PARSE_ERROR" "ERR_BUSY" "ERR_SKIP" "ERR_HELP" "ERR_BUG" "ERR_PRINTER_ON_FIRE" "PROPERTY_HINT_NONE" + "PROPERTY_HINT_RANGE" "PROPERTY_HINT_ENUM" "PROPERTY_HINT_ENUM_SUGGESTION" "PROPERTY_HINT_EXP_EASING" + "PROPERTY_HINT_LINK" "PROPERTY_HINT_FLAGS" "PROPERTY_HINT_LAYERS_2D_RENDER" "PROPERTY_HINT_LAYERS_2D_PHYSICS" + "PROPERTY_HINT_LAYERS_2D_NAVIGATION" "PROPERTY_HINT_LAYERS_3D_RENDER" "PROPERTY_HINT_LAYERS_3D_PHYSICS" + "PROPERTY_HINT_LAYERS_3D_NAVIGATION" "PROPERTY_HINT_FILE" "PROPERTY_HINT_DIR" "PROPERTY_HINT_GLOBAL_FILE" + "PROPERTY_HINT_GLOBAL_DIR" "PROPERTY_HINT_RESOURCE_TYPE" "PROPERTY_HINT_MULTILINE_TEXT" "PROPERTY_HINT_EXPRESSION" + "PROPERTY_HINT_PLACEHOLDER_TEXT" "PROPERTY_HINT_COLOR_NO_ALPHA" "PROPERTY_HINT_OBJECT_ID" "PROPERTY_HINT_TYPE_STRING" + "PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" "PROPERTY_HINT_OBJECT_TOO_BIG" "PROPERTY_HINT_NODE_PATH_VALID_TYPES" + "PROPERTY_HINT_SAVE_FILE" "PROPERTY_HINT_GLOBAL_SAVE_FILE" "PROPERTY_HINT_INT_IS_OBJECTID" + "PROPERTY_HINT_INT_IS_POINTER" "PROPERTY_HINT_ARRAY_TYPE" "PROPERTY_HINT_LOCALE_ID" "PROPERTY_HINT_LOCALIZABLE_STRING" + "PROPERTY_HINT_NODE_TYPE" "PROPERTY_HINT_HIDE_QUATERNION_EDIT" "PROPERTY_HINT_PASSWORD" "PROPERTY_HINT_MAX" + "PROPERTY_USAGE_NONE" "PROPERTY_USAGE_STORAGE" "PROPERTY_USAGE_EDITOR" "PROPERTY_USAGE_INTERNAL" + "PROPERTY_USAGE_CHECKABLE" "PROPERTY_USAGE_CHECKED" "PROPERTY_USAGE_GROUP" "PROPERTY_USAGE_CATEGORY" + "PROPERTY_USAGE_SUBGROUP" "PROPERTY_USAGE_CLASS_IS_BITFIELD" "PROPERTY_USAGE_NO_INSTANCE_STATE" + "PROPERTY_USAGE_RESTART_IF_CHANGED" "PROPERTY_USAGE_SCRIPT_VARIABLE" "PROPERTY_USAGE_STORE_IF_NULL" + "PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" "PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" "PROPERTY_USAGE_CLASS_IS_ENUM" + "PROPERTY_USAGE_NIL_IS_VARIANT" "PROPERTY_USAGE_ARRAY" "PROPERTY_USAGE_ALWAYS_DUPLICATE" + "PROPERTY_USAGE_NEVER_DUPLICATE" "PROPERTY_USAGE_HIGH_END_GFX" "PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" + "PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" "PROPERTY_USAGE_KEYING_INCREMENTS" "PROPERTY_USAGE_DEFERRED_SET_RESOURCE" + "PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" "PROPERTY_USAGE_EDITOR_BASIC_SETTING" "PROPERTY_USAGE_READ_ONLY" + "PROPERTY_USAGE_DEFAULT" "PROPERTY_USAGE_NO_EDITOR" "METHOD_FLAG_NORMAL" "METHOD_FLAG_EDITOR" "METHOD_FLAG_CONST" + "METHOD_FLAG_VIRTUAL" "METHOD_FLAG_VARARG" "METHOD_FLAG_STATIC" "METHOD_FLAG_OBJECT_CORE" "METHOD_FLAGS_DEFAULT" + "TYPE_NIL" "TYPE_BOOL" "TYPE_INT" "TYPE_FLOAT" "TYPE_STRING" "TYPE_VECTOR2" "TYPE_VECTOR2I" "TYPE_RECT2" "TYPE_RECT2I" + "TYPE_VECTOR3" "TYPE_VECTOR3I" "TYPE_TRANSFORM2D" "TYPE_VECTOR4" "TYPE_VECTOR4I" "TYPE_PLANE" "TYPE_QUATERNION" + "TYPE_AABB" "TYPE_BASIS" "TYPE_TRANSFORM3D" "TYPE_PROJECTION" "TYPE_COLOR" "TYPE_STRING_NAME" "TYPE_NODE_PATH" + "TYPE_RID" "TYPE_OBJECT" "TYPE_CALLABLE" "TYPE_SIGNAL" "TYPE_DICTIONARY" "TYPE_ARRAY" "TYPE_PACKED_BYTE_ARRAY" + "TYPE_PACKED_INT32_ARRAY" "TYPE_PACKED_INT64_ARRAY" "TYPE_PACKED_FLOAT32_ARRAY" "TYPE_PACKED_FLOAT64_ARRAY" + "TYPE_PACKED_STRING_ARRAY" "TYPE_PACKED_VECTOR2_ARRAY" "TYPE_PACKED_VECTOR3_ARRAY" "TYPE_PACKED_COLOR_ARRAY" "TYPE_MAX" + "OP_EQUAL" "OP_NOT_EQUAL" "OP_LESS" "OP_LESS_EQUAL" "OP_GREATER" "OP_GREATER_EQUAL" "OP_ADD" "OP_SUBTRACT" + "OP_MULTIPLY" "OP_DIVIDE" "OP_NEGATE" "OP_POSITIVE" "OP_MODULE" "OP_POWER" "OP_SHIFT_LEFT" "OP_SHIFT_RIGHT" + "OP_BIT_AND" "OP_BIT_OR" "OP_BIT_XOR" "OP_BIT_NEGATE" "OP_AND" "OP_OR" "OP_XOR" "OP_NOT" "OP_IN" "OP_MAX" + )) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/gdscript/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/gdscript/indents.scm new file mode 100644 index 000000000..4eb579b22 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gdscript/indents.scm @@ -0,0 +1,78 @@ +[ + (lambda) + (function_definition) + + (for_statement) + (while_statement) + (if_statement) + (class_definition) + (match_statement) + (pattern_section) + (setget) + (match_body) + (set_body) + (get_body) +] @indent.begin + +[ + (elif_clause) + (else_clause) +] @indent.branch + +[ + (string) + (comment) + (array) + (dictionary) + (parenthesized_expression) + (ERROR) +] @indent.auto + +[ + (pass_statement) + (continue_statement) + (break_statement) + (return_statement) +] @indent.dedent + +[ + (ERROR "[") + (ERROR "(") + (ERROR "{") +] @indent.begin + +;; This only works with expanded tabs. +; ((parameters) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")")) +; ((arguments) @indent.align (#set! indent.open_delimiter "(") (#set! indent.close_delimiter ")")) + +;; The following queries either do not agree with the current body parsing or are +;; attempted workarounds. Specifically as the last statement of a body. Opening +;; a new line in between statements works well. +;; +;; The overall experience is poor, so I've opted for @indent.auto. +;; +;; The gdscript parser will need to be patched to accommodate more interactive +;; edits. As far as I can tell the parser greedily consumes whitespace +;; as a zero-width token which causes trouble when inserting indents. + +;; This indents correctly with tabs. +; (arguments) @indent.begin +; (parameters) @indent.begin +; (array) @indent.begin +; (dictionary) @indent.begin +; (parenthesized_expression) @indent.begin + +;; Partial workaround for when the cursor is on the bracket character and a newline +;; is created with . Without this the newline is opened with extra +;; indentation. +; (body (_ (array "]" @indent.end) ) _) +;; Problematic behaviors occur at the last statement of a body. +;; with @dedent: +;; - [ | ] i will dedent ] to 0. +;; - [ +;; ]| o will open new line at correct indentation. +;; with @auto: +;; - [ | ] i same +;; - [ +;; ]| o will open new line with extra indent. +;(body (_ (array "]" @indent.auto) ) .) diff --git a/bundle/nvim-treesitter-0.9.1/queries/gdscript/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gdscript/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gdscript/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/gdscript/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/gdscript/locals.scm new file mode 100644 index 000000000..2c352b4a3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gdscript/locals.scm @@ -0,0 +1,92 @@ +;; Scopes + +[ + (if_statement) + (elif_clause) + (else_clause) + (for_statement) + (while_statement) + (function_definition) + (constructor_definition) + (class_definition) + (match_statement) + (pattern_section) + (lambda) + (get_body) + (set_body) +] @scope + +;; Parameters + +(parameters (identifier) @definition.parameter) +(default_parameter (identifier) @definition.parameter) +(typed_parameter (identifier) @definition.parameter) +(typed_default_parameter (identifier) @definition.parameter) + +;; Signals + +; Can gdscript 2 signals be considered fields? +(signal_statement (name) @definition.field) + +;; Variable Definitions + +(const_statement (name) @definition.constant) +; onready and export variations are only properties. +(variable_statement (name) @definition.var) + +(setter) @reference +(getter) @reference + +;; Function Definition + +((function_definition (name) @definition.function) + (#set! "definition.function.scope" "parent")) + +;; Lambda + +; lambda names are not accessible and are only for debugging. +(lambda (name) @definition.function) + +;; Source + +(class_name_statement (name) @definition.type) + +(source (variable_statement (name) @definition.field)) +(source (onready_variable_statement (name) @definition.field)) +(source (export_variable_statement (name) @definition.field)) + +;; Class + +((class_definition (name) @definition.type) + (#set! "definition.type.scope" "parent")) + +(class_definition + (body (variable_statement (name) @definition.field))) +(class_definition + (body (onready_variable_statement (name) @definition.field))) +(class_definition + (body (export_variable_statement (name) @definition.field))) +(class_definition + (body (signal_statement (name) @definition.field))) + +; Although a script is also a class, let's only define functions in an inner class as +; methods. +((class_definition + (body (function_definition (name) @definition.method))) + (#set! "definition.method.scope" "parent")) + +;; Enum + +((enum_definition (name) @definition.enum)) + +;; Repeat + +(for_statement . (identifier) @definition.var) + +;; Match Statement + +(pattern_binding (identifier) @definition.var) + +;; References + +(identifier) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/git_config/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/git_config/folds.scm new file mode 100644 index 000000000..e69de29bb diff --git a/bundle/nvim-treesitter-0.9.1/queries/git_config/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/git_config/highlights.scm new file mode 100644 index 000000000..18b75bc64 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/git_config/highlights.scm @@ -0,0 +1,49 @@ +; Sections + +(section_name) @type + +((section_name) @include + (#eq? @include "include")) + +((section_header + (section_name) @include + (subsection_name)) + (#eq? @include "includeIf")) + +(variable (name) @property) + +; Operators + +[ + "=" +] @operator + +; Literals + +(integer) @number +[ + (true) + (false) +] @boolean + +(string) @string + +((string) @text.uri + (#lua-match? @text.uri "^[.]?[/]")) + +((string) @text.uri + (#lua-match? @text.uri "^[~]")) + +(section_header + [ + "\"" + (subsection_name) + ] @string.special) + +; Punctuation + +[ "[" "]" ] @punctuation.bracket + +; Comments + +(comment) @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/git_rebase/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/git_rebase/highlights.scm new file mode 100644 index 000000000..466bd2f16 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/git_rebase/highlights.scm @@ -0,0 +1,8 @@ +((command) @keyword + (label)? @constant + (message)? @text @spell) + +(option) @operator + +(comment) @comment + diff --git a/bundle/nvim-treesitter-0.9.1/queries/git_rebase/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/git_rebase/injections.scm new file mode 100644 index 000000000..27388618e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/git_rebase/injections.scm @@ -0,0 +1,5 @@ +((operation + (command) @_command + (message) @bash) +(#any-of? @_command "exec" "x")) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/gitattributes/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gitattributes/highlights.scm new file mode 100644 index 000000000..73ec71438 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gitattributes/highlights.scm @@ -0,0 +1,53 @@ +(dir_sep) @punctuation.delimiter + +(quoted_pattern + ("\"" @punctuation.special)) + +(range_notation) @string.special + +(range_notation + [ "[" "]" ] @punctuation.bracket) + +(wildcard) @character.special + +(range_negation) @operator + +(character_class) @constant + +(class_range ("-" @operator)) + +[ + (ansi_c_escape) + (escaped_char) +] @string.escape + +(attribute + (attr_name) @parameter) + +(attribute + (builtin_attr) @variable.builtin) + +[ + (attr_reset) + (attr_unset) + (attr_set) +] @operator + +(boolean_value) @boolean + +(string_value) @string + +(macro_tag) @preproc + +(macro_def + macro_name: (_) @property) + +[ + (pattern_negation) + (redundant_escape) + (trailing_slash) +] @error + +(ERROR) @error + +(comment) @comment @spell diff --git a/bundle/nvim-treesitter-0.9.1/queries/gitattributes/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gitattributes/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gitattributes/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/gitcommit/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gitcommit/highlights.scm new file mode 100644 index 000000000..ff0c4ddb3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gitcommit/highlights.scm @@ -0,0 +1,33 @@ +(comment) @comment +(generated_comment) @comment +(title) @text.title +(text) @text +(branch) @text.reference +(change) @keyword +(filepath) @text.uri +(arrow) @punctuation.delimiter + +(subject) @text.title @spell +(subject (overflow) @text @spell) +(prefix (type) @keyword @nospell) +(prefix (scope) @parameter @nospell) +(prefix [ + "(" + ")" + ":" +] @punctuation.delimiter) +(prefix [ + "!" +] @punctuation.special) + +(message) @text @spell + +(trailer (token) @label) +(trailer (value) @text) + +(breaking_change (token) @text.warning) +(breaking_change (value) @text @spell) + +(scissor) @comment + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/gitcommit/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gitcommit/injections.scm new file mode 100644 index 000000000..eecdeee47 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gitcommit/injections.scm @@ -0,0 +1,2 @@ +((diff) @diff (#exclude_children! @diff)) +(rebase_command) @git_rebase diff --git a/bundle/nvim-treesitter-0.9.1/queries/gitignore/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gitignore/highlights.scm new file mode 100644 index 000000000..6e83ea6f2 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gitignore/highlights.scm @@ -0,0 +1,31 @@ +(comment) @comment @spell + +[ + (directory_separator) + (directory_separator_escaped) +] @punctuation.delimiter + +[ + (wildcard_char_single) + (wildcard_chars) + (wildcard_chars_allow_slash) + (bracket_negation) +] @operator + +(negation) @punctuation.special + +[ + (pattern_char_escaped) + (bracket_char_escaped) +] @string.escape + +;; bracket expressions +[ + "[" + "]" +] @punctuation.bracket + +(bracket_char) @constant +(bracket_range + "-" @operator) +(bracket_char_class) @constant.builtin diff --git a/bundle/nvim-treesitter-0.9.1/queries/gleam/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/gleam/folds.scm new file mode 100644 index 000000000..7c3b16741 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gleam/folds.scm @@ -0,0 +1,7 @@ +; Folds +[ + (case) + (function) + (anonymous_function) + (type_definition) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/gleam/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gleam/highlights.scm new file mode 100644 index 000000000..051cbffc0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gleam/highlights.scm @@ -0,0 +1,172 @@ +; Keywords +[ + "as" + "let" + "panic" + "todo" + "type" + "use" +] @keyword + +; Function Keywords +[ + "fn" +] @keyword.function + +; Imports +[ + "import" +] @include + +; Conditionals +[ + "case" + "if" +] @conditional + +; Exceptions +[ + "assert" +] @exception + +; Punctuation +[ + "(" + ")" + "<<" + ">>" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + "." + ":" + "->" +] @punctuation.delimiter + +[ + "#" +] @punctuation.special + +; Operators +[ + "%" + "&&" + "*" + "*." + "+" + "+." + "-" + "-." + ".." + "/" + "/." + "<" + "<." + "<=" + "<=." + "=" + "==" + ">" + ">." + ">=" + ">=." + "|>" + "||" +] @operator + +; Identifiers +(identifier) @variable + +; Comments +[ + (comment) +] @comment @spell + +[ + (module_comment) + (statement_comment) +] @comment.documentation @spell + +; Unused Identifiers +[ + (discard) + (hole) +] @comment + +; Modules & Imports +(module) @namespace +(import alias: ((identifier) @namespace)?) +(remote_type_identifier module: (identifier) @namespace) +(unqualified_import name: (identifier) @function) + +; Strings +(string) @string + +; Bit Strings +(bit_string_segment) @string.special + +; Numbers +(integer) @number + +(float) @float + +; Function Parameter Labels +(function_call arguments: (arguments (argument label: (label) @label))) +(function_parameter label: (label)? @label name: (identifier) @parameter) + +; Records +(record arguments: (arguments (argument label: (label) @property)?)) +(record_pattern_argument label: (label) @property) +(record_update_argument label: (label) @property) +(field_access record: (identifier) @variable field: (label) @property) +(data_constructor_argument (label) @property) + +; Types +[ + (type_identifier) + (type_parameter) + (type_var) +] @type + +((type_identifier) @type.builtin + (#any-of? @type.builtin "Int" "Float" "String" "List")) + +; Type Qualifiers +[ + "const" + "external" + (opacity_modifier) + (visibility_modifier) +] @type.qualifier + +; Tuples +(tuple_access index: (integer) @operator) + +; Functions +(function name: (identifier) @function) +(function_call function: (identifier) @function.call) +(function_call function: (field_access field: (label) @function.call)) + +; External Functions +(external_function name: (identifier) @function) +(external_function_body (string) @namespace . (string) @function) + +; Constructors +(constructor_name) @type @constructor + +([(type_identifier) (constructor_name)] @constant.builtin + (#any-of? @constant.builtin "Ok" "Error")) + +; Booleans +((constructor_name) @boolean (#any-of? @boolean "True" "False")) + +; Pipe Operator +(binary_expression operator: "|>" right: (identifier) @function) + +; Parser Errors +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/gleam/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/gleam/indents.scm new file mode 100644 index 000000000..37f88df66 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gleam/indents.scm @@ -0,0 +1,28 @@ +; Gleam indents similar to Rust and JavaScript +[ + (anonymous_function) + (assert) + (case) + (case_clause) + (constant) + (external_function) + (function) + (import) + (let) + (list) + (constant) + (function) + (type_definition) + (type_alias) + (todo) + (tuple) +] @indent.begin + +[ + ")" + "]" + "}" +] @indent.end @indent.branch + +; Gleam pipelines are not indented, but other binary expression chains are +((binary_expression operator: _ @_operator) @indent.begin (#not-eq? @_operator "|>")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/gleam/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gleam/injections.scm new file mode 100644 index 000000000..ed4c2de91 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gleam/injections.scm @@ -0,0 +1,6 @@ +; Comments +[ + (module_comment) + (statement_comment) + (comment) +] @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/gleam/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/gleam/locals.scm new file mode 100644 index 000000000..8872e51f0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gleam/locals.scm @@ -0,0 +1,24 @@ +; Let Binding Definition +(let pattern: (identifier) @definition) + +; List Pattern Definitions +(list_pattern (identifier) @definition) +(list_pattern assign: (identifier) @definition) + +; Tuple Pattern Definition +(tuple_pattern (identifier) @definition) + +; Record Pattern Definition +(record_pattern_argument pattern: (identifier) @definition) + +; Function Parameter Definition +(function_parameter name: (identifier) @definition) + +; References +(identifier) @reference + +; Function Body Scope +(function_body) @scope + +; Case Scope +(case_clause) @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/glimmer/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/glimmer/folds.scm new file mode 100644 index 000000000..cfe9d35b0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/glimmer/folds.scm @@ -0,0 +1,4 @@ +[ + (element_node (element_node_start)) + (block_statement) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/glimmer/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/glimmer/highlights.scm new file mode 100644 index 000000000..70a48cf83 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/glimmer/highlights.scm @@ -0,0 +1,88 @@ +; === Tag Names === + +; Tags that start with a lower case letter are HTML tags +; We'll also use this highlighting for named blocks (which start with `:`) +((tag_name) @tag + (#lua-match? @tag "^:?[%l]")) +; Tags that start with a capital letter are Glimmer components +((tag_name) @constructor + (#lua-match? @constructor "^%u")) + +(attribute_name) @property + +(string_literal) @string +(number_literal) @number +(boolean_literal) @boolean + +(concat_statement) @string + +; === Block Statements === + +; Highlight the brackets +(block_statement_start) @tag.delimiter +(block_statement_end) @tag.delimiter + +; Highlight `if`/`each`/`let` +(block_statement_start path: (identifier) @conditional) +(block_statement_end path: (identifier) @conditional) +((mustache_statement (identifier) @conditional) + (#lua-match? @conditional "else")) + +; == Mustache Statements === + +; Highlight the whole statement, to color brackets and separators +(mustache_statement) @tag.delimiter + +; An identifier in a mustache expression is a variable +((mustache_statement [ + (path_expression (identifier) @variable) + (identifier) @variable + ]) + (#not-any-of? @variable "yield" "outlet" "this" "else")) +; As are arguments in a block statement +(block_statement_start argument: [ + (path_expression (identifier) @variable) + (identifier) @variable + ]) +; As is an identifier in a block param +(block_params (identifier) @variable) +; As are helper arguments +((helper_invocation argument: [ + (path_expression (identifier) @variable) + (identifier) @variable + ]) + (#not-eq? @variable "this")) +; `this` should be highlighted as a built-in variable +((identifier) @variable.builtin + (#eq? @variable.builtin "this")) + +; If the identifier is just "yield" or "outlet", it's a keyword +((mustache_statement (identifier) @keyword) + (#any-of? @keyword "yield" "outlet")) + +; Helpers are functions +((helper_invocation helper: [ + (path_expression (identifier) @function) + (identifier) @function + ]) + (#not-any-of? @function "if" "yield")) +((helper_invocation helper: (identifier) @conditional) + (#eq? @conditional "if")) +((helper_invocation helper: (identifier) @keyword) + (#eq? @keyword "yield")) + +(hash_pair key: (identifier) @property) + +(comment_statement) @comment + +(attribute_node "=" @operator) + +(block_params "as" @keyword) +(block_params "|" @operator) + +[ + "<" + ">" + "" +] @tag.delimiter diff --git a/bundle/nvim-treesitter-0.9.1/queries/glimmer/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/glimmer/indents.scm new file mode 100644 index 000000000..8bccf33fa --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/glimmer/indents.scm @@ -0,0 +1,22 @@ +[ + (element_node (element_node_start)) + (element_node_void) + (block_statement (block_statement_start)) + (mustache_statement) +] @indent.begin + +(element_node (element_node_end [">"] @indent.end)) +(element_node_void "/>" @indent.end) +[ + ">" + "/>" + "" + ">=" + ">>" + ">>=" + "|" + "|=" + "||" + "~" +] @operator + +; Keywords + +[ + "break" + "const" + "continue" + "default" + "defer" + "goto" + "interface" + "range" + "select" + "struct" + "type" + "var" + "fallthrough" +] @keyword + +"func" @keyword.function +"return" @keyword.return +"go" @keyword.coroutine + +"for" @repeat + +[ + "import" + "package" +] @include + +[ + "else" + "case" + "switch" + "if" + ] @conditional + + +;; Builtin types + +[ "chan" "map" ] @type.builtin + +((type_identifier) @type.builtin + (#any-of? @type.builtin + "any" + "bool" + "byte" + "comparable" + "complex128" + "complex64" + "error" + "float32" + "float64" + "int" + "int16" + "int32" + "int64" + "int8" + "rune" + "string" + "uint" + "uint16" + "uint32" + "uint64" + "uint8" + "uintptr")) + + +;; Builtin functions + +((identifier) @function.builtin + (#any-of? @function.builtin + "append" + "cap" + "clear" + "close" + "complex" + "copy" + "delete" + "imag" + "len" + "make" + "max" + "min" + "new" + "panic" + "print" + "println" + "real" + "recover")) + + +; Delimiters + +"." @punctuation.delimiter +"," @punctuation.delimiter +":" @punctuation.delimiter +";" @punctuation.delimiter + +"(" @punctuation.bracket +")" @punctuation.bracket +"{" @punctuation.bracket +"}" @punctuation.bracket +"[" @punctuation.bracket +"]" @punctuation.bracket + + +; Literals + +(interpreted_string_literal) @string +(raw_string_literal) @string +(rune_literal) @string +(escape_sequence) @string.escape + +(int_literal) @number +(float_literal) @float +(imaginary_literal) @number + +[ + (true) + (false) +] @boolean + +[ + (nil) + (iota) +] @constant.builtin + +(keyed_element + . (literal_element (identifier) @field)) +(field_declaration name: (field_identifier) @field) + +; Comments + +(comment) @comment @spell + +;; Doc Comments + +(source_file . (comment)+ @comment.documentation) + +(source_file + (comment)+ @comment.documentation + . (const_declaration)) + +(source_file + (comment)+ @comment.documentation + . (function_declaration)) + +(source_file + (comment)+ @comment.documentation + . (type_declaration)) + +(source_file + (comment)+ @comment.documentation + . (var_declaration)) + +; Errors + +(ERROR) @error + +; Spell + +((interpreted_string_literal) @spell + (#not-has-parent? @spell import_spec)) diff --git a/bundle/nvim-treesitter-0.9.1/queries/go/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/go/indents.scm new file mode 100644 index 000000000..5f0039ac4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/go/indents.scm @@ -0,0 +1,33 @@ +[ + (import_declaration) + (const_declaration) + (var_declaration) + (type_declaration) + (func_literal) + (literal_value) + (expression_case) + (communication_case) + (type_case) + (default_case) + (block) + (call_expression) + (parameter_list) + (struct_type) +] @indent.begin + +[ + "}" +] @indent.branch + +(const_declaration ")" @indent.branch) +(import_spec_list ")" @indent.branch) +(var_declaration ")" @indent.branch) + +[ + "}" + ")" +] @indent.end + +(parameter_list ")" @indent.branch) + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/go/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/go/injections.scm new file mode 100644 index 000000000..e0bdc99b9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/go/injections.scm @@ -0,0 +1,13 @@ +(comment) @comment + +(call_expression + (selector_expression) @_function (#any-of? @_function + "regexp.Match" + "regexp.MatchReader" + "regexp.MatchString" + "regexp.Compile" + "regexp.CompilePOSIX" + "regexp.MustCompile" + "regexp.MustCompilePOSIX") + (argument_list + . [(raw_string_literal) (interpreted_string_literal)] @regex (#offset! @regex 0 1 0 -1))) diff --git a/bundle/nvim-treesitter-0.9.1/queries/go/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/go/locals.scm new file mode 100644 index 000000000..b027c217a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/go/locals.scm @@ -0,0 +1,79 @@ +( + (function_declaration + name: (identifier) @definition.function) ;@function +) + +( + (method_declaration + name: (field_identifier) @definition.method); @method +) + +(short_var_declaration + left: (expression_list + (identifier) @definition.var)) + +(var_spec + name: (identifier) @definition.var) + +(parameter_declaration (identifier) @definition.var) +(variadic_parameter_declaration (identifier) @definition.var) + +(for_statement + (range_clause + left: (expression_list + (identifier) @definition.var))) + +(const_declaration + (const_spec + name: (identifier) @definition.var)) + +(type_declaration + (type_spec + name: (type_identifier) @definition.type)) + +;; reference +(identifier) @reference +(type_identifier) @reference +(field_identifier) @reference +((package_identifier) @reference + (#set! reference.kind "namespace")) + +(package_clause + (package_identifier) @definition.namespace) + +(import_spec_list + (import_spec + name: (package_identifier) @definition.namespace)) + +;; Call references +((call_expression + function: (identifier) @reference) + (#set! reference.kind "call" )) + +((call_expression + function: (selector_expression + field: (field_identifier) @reference)) + (#set! reference.kind "call" )) + + +((call_expression + function: (parenthesized_expression + (identifier) @reference)) + (#set! reference.kind "call" )) + +((call_expression + function: (parenthesized_expression + (selector_expression + field: (field_identifier) @reference))) + (#set! reference.kind "call" )) + +;; Scopes + +(func_literal) @scope +(source_file) @scope +(function_declaration) @scope +(if_statement) @scope +(block) @scope +(expression_switch_statement) @scope +(for_statement) @scope +(method_declaration) @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/godot_resource/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/folds.scm new file mode 100644 index 000000000..943e0628f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/folds.scm @@ -0,0 +1,3 @@ +[ + (section) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/godot_resource/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/highlights.scm new file mode 100644 index 000000000..005ddaacb --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/highlights.scm @@ -0,0 +1,28 @@ +(identifier) @type.builtin + +(attribute (identifier) @property) +(property (path) @property) +(constructor (identifier) @constructor) + +(string) @string +(integer) @number +(float) @float + +(true) @constant.builtin +(false) @constant.builtin + +[ + "[" + "]" +] @tag.delimiter + +[ + "(" + ")" + "{" + "}" +] @punctuation.bracket + +"=" @operator + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/godot_resource/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/locals.scm new file mode 100644 index 000000000..1dce04f0c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/godot_resource/locals.scm @@ -0,0 +1,3 @@ +[ + (section) +] @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/gomod/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gomod/highlights.scm new file mode 100644 index 000000000..46cd3b65e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gomod/highlights.scm @@ -0,0 +1,18 @@ +[ + "require" + "replace" + "go" + "exclude" + "retract" + "module" +] @keyword + +"=>" @operator + +(comment) @comment +(module_path) @text.uri + +[ +(version) +(go_version) +] @string diff --git a/bundle/nvim-treesitter-0.9.1/queries/gomod/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gomod/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gomod/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/gosum/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gosum/highlights.scm new file mode 100644 index 000000000..bb65bd71f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gosum/highlights.scm @@ -0,0 +1,31 @@ +[ + "alpha" + "beta" + "dev" + "pre" + "rc" + "+incompatible" +] @keyword + + +(module_path) @string @text.uri +(module_version) @string.special + +(hash_version) @attribute +(hash) @symbol + +[ + (number) + (number_with_decimal) + (hex_number) +] @number + +(checksum + "go.mod" @string) + +[ + ":" + "." + "-" + "/" +] @punctuation.delimiter diff --git a/bundle/nvim-treesitter-0.9.1/queries/gowork/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/gowork/highlights.scm new file mode 100644 index 000000000..9c84bcc44 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gowork/highlights.scm @@ -0,0 +1,14 @@ +[ + "replace" + "go" + "use" +] @keyword + +"=>" @operator + +(comment) @comment + +[ +(version) +(go_version) +] @string diff --git a/bundle/nvim-treesitter-0.9.1/queries/gowork/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/gowork/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/gowork/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/graphql/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/graphql/highlights.scm new file mode 100644 index 000000000..48f27f983 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/graphql/highlights.scm @@ -0,0 +1,165 @@ +; Types +;------ + +(scalar_type_definition + (name) @type) + +(object_type_definition + (name) @type) + +(interface_type_definition + (name) @type) + +(union_type_definition + (name) @type) + +(enum_type_definition + (name) @type) + +(input_object_type_definition + (name) @type) + +(scalar_type_extension + (name) @type) + +(object_type_extension + (name) @type) + +(interface_type_extension + (name) @type) + +(union_type_extension + (name) @type) + +(enum_type_extension + (name) @type) + +(input_object_type_extension + (name) @type) + +(named_type + (name) @type) + +; Directives +;----------- + +(directive_definition + "@" @attribute + (name) @attribute) + +(directive) @attribute + +; Properties +;----------- + +(field + (name) @property) + +(field + (alias + (name) @property)) + +(field_definition + (name) @property) + +(object_value + (object_field + (name) @property)) + +(enum_value + (name) @property) + +; Variable Definitions and Arguments +;----------------------------------- + +(operation_definition + (name) @variable) + +(fragment_name + (name) @variable) + +(input_fields_definition + (input_value_definition + (name) @parameter)) + +(argument + (name) @parameter) + +(arguments_definition + (input_value_definition + (name) @parameter)) + +(variable_definition + (variable) @parameter) + +(argument + (value + (variable) @variable)) + +; Constants +;---------- + +(string_value) @string + +(int_value) @number + +(float_value) @float + +(boolean_value) @boolean + +; Literals +;--------- + +(description + (string_value) @string.documentation @spell) + +(comment) @comment @spell + +(directive_location + (executable_directive_location) @type.builtin) + +(directive_location + (type_system_directive_location) @type.builtin) + +; Keywords +;---------- + +[ + "query" + "mutation" + "subscription" + "fragment" + "scalar" + "type" + "interface" + "union" + "enum" + "input" + "extend" + "directive" + "schema" + "on" + "repeatable" + "implements" +] @keyword + +; Punctuation +;------------ + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +"=" @operator + +"|" @punctuation.delimiter +"&" @punctuation.delimiter +":" @punctuation.delimiter + +"..." @punctuation.special +"!" @punctuation.special diff --git a/bundle/nvim-treesitter-0.9.1/queries/graphql/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/graphql/indents.scm new file mode 100644 index 000000000..df47aff88 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/graphql/indents.scm @@ -0,0 +1,9 @@ +[ + (definition) + (selection) +] @indent.begin + +[ + "{" + "}" +] @indent.branch diff --git a/bundle/nvim-treesitter-0.9.1/queries/graphql/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/graphql/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/graphql/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/groovy/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/groovy/highlights.scm new file mode 100644 index 000000000..a9b38ef5b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/groovy/highlights.scm @@ -0,0 +1,95 @@ +(unit + (identifier) @variable) +(string + (identifier) @variable) + +(escape_sequence) @string.escape + +(block + (unit + (identifier) @namespace)) + +(func + (identifier) @function) + +(number) @number + +((identifier) @boolean + (#any-of? @boolean "true" "false" "True" "False")) + +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z%d_]*$")) + +((identifier) @constant.builtin + (#eq? @constant.builtin "null")) + +((identifier) @type + (#any-of? @type + "String" + "Map" + "Object" + "Boolean" + "Integer" + "List")) + +((identifier) @function.builtin + (#any-of? @function.builtin + "void" + "id" + "version" + "apply" + "implementation" + "testImplementation" + "androidTestImplementation" + "debugImplementation")) + +((identifier) @keyword + (#any-of? @keyword + "static" + "class" + "def" + "import" + "package" + "assert" + "extends" + "implements" + "instanceof" + "interface" + "new")) + +((identifier) @type.qualifier + (#any-of? @type.qualifier + "abstract" + "protected" + "private" + "public")) + +((identifier) @exception + (#any-of? @exception + "throw" + "finally" + "try" + "catch")) + +(string) @string + +[ + (line_comment) + (block_comment) +] @comment @spell + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +[ + (operators) + (leading_key) +] @operator + +["(" ")" "[" "]" "{" "}"] @punctuation.bracket diff --git a/bundle/nvim-treesitter-0.9.1/queries/groovy/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/groovy/injections.scm new file mode 100644 index 000000000..0a63c9bfe --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/groovy/injections.scm @@ -0,0 +1,4 @@ +[ + (block_comment) + (line_comment) +] @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/hack/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hack/highlights.scm new file mode 100644 index 000000000..a75b166ca --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hack/highlights.scm @@ -0,0 +1,317 @@ +(variable) @variable +(identifier) @variable +((variable) @variable.builtin + (#eq? @variable.builtin "$this")) + +(braced_expression) @none + +(scoped_identifier + (qualified_identifier + (identifier) @type)) + +[ + (comment) + (heredoc) +] @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +"function" @keyword.function + +[ + "type" + "interface" + "implements" + "class" + "using" + "namespace" + "attribute" + "const" + "extends" + "insteadof" +] @keyword + +[ + "async" + "await" +] @keyword.coroutine + +[ + "use" + "include" + "include_once" + "require" + "require_once" +] @include + +[ + "new" + "print" + "echo" + "newtype" + "clone" + "as" +] @keyword.operator + +"return" @keyword.return + +[ + (abstract_modifier) + (final_modifier) + (static_modifier) + (visibility_modifier) + (xhp_modifier) +] @type.qualifier + +[ + "shape" + "tuple" + (array_type) + "bool" + "float" + "int" + "string" + "arraykey" + "void" + "nonnull" + "mixed" + "dynamic" + "noreturn" +] @type.builtin + +[ + (null) +] @constant.builtin + +[ + (true) + (false) +] @boolean + +(type_specifier) @type +(new_expression + (_) @type) + +(alias_declaration "newtype" . (_) @type) +(alias_declaration "type" . (_) @type) + +(class_declaration + name: (identifier) @type) +(type_parameter + name: (identifier) @type) + +(collection + (qualified_identifier + (identifier) @type .)) + +[ + "@required" + "@lateinit" + (attribute_modifier) +] @attribute + +[ + "=" + "??=" + ".=" + "|=" + "^=" + "&=" + "<<=" + ">>=" + "+=" + "-=" + "*=" + "/=" + "%=" + "**=" + + "==>" + "|>" + "??" + "||" + "&&" + "|" + "^" + "&" + "==" + "!=" + "===" + "!==" + "<" + ">" + "<=" + ">=" + "<=>" + "<<" + ">>" + "->" + "+" + "-" + "." + "*" + "/" + "%" + "**" + + "++" + "--" + "!" + + "?:" + + "=" + "??=" + ".=" + "|=" + "^=" + "&=" + "<<=" + ">>=" + "+=" + "-=" + "*=" + "/=" + "%=" + "**=" + "=>" + + ;; type modifiers + "@" + "?" + "~" +] @operator + +(integer) @number +(float) @float + +(parameter + (variable) @parameter) + +(call_expression + function: (qualified_identifier (identifier) @function.call .)) + +(call_expression + function: (scoped_identifier (identifier) @function.call .)) + +(call_expression + function: (selection_expression + (qualified_identifier (identifier) @method.call .))) + +(qualified_identifier + (_) @namespace . + (_)) + +(use_statement + (qualified_identifier + (_) @namespace .) + (use_clause)) + +(use_statement + (use_type "namespace") + (use_clause + (qualified_identifier + (identifier) @namespace .) + alias: (identifier)? @namespace)) + +(use_statement + (use_type "const") + (use_clause + (qualified_identifier + (identifier) @constant .) + alias: (identifier)? @constant)) + +(use_statement + (use_type "function") + (use_clause + (qualified_identifier + (identifier) @function .) + alias: (identifier)? @function)) + +(use_statement + (use_type "type") + (use_clause + (qualified_identifier + (identifier) @type .) + alias: (identifier)? @type)) + +(use_clause + (use_type "namespace") + (qualified_identifier + (_) @namespace .) + alias: (identifier)? @namespace) + +(use_clause + (use_type "function") + (qualified_identifier + (_) @function .) + alias: (identifier)? @function) + +(use_clause + (use_type "const") + (qualified_identifier + (_) @constant .) + alias: (identifier)? @constant) + +(use_clause + (use_type "type") + (qualified_identifier + (_) @type .) + alias: (identifier)? @type) + +(function_declaration + name: (identifier) @function) +(method_declaration + name: (identifier) @method) + +(type_arguments + [ "<" ">" ] @punctuation.bracket) +[ "(" ")" "[" "]" "{" "}" "<<" ">>"] @punctuation.bracket + +(xhp_open + [ "<" ">" ] @tag.delimiter) +(xhp_close + [ "" ] @tag.delimiter) + +[ "." ";" "::" ":" "," ] @punctuation.delimiter +(qualified_identifier + "\\" @punctuation.delimiter) + +(ternary_expression + ["?" ":"] @conditional.ternary) + +[ + "if" + "else" + "elseif" + "switch" + "case" +] @conditional + +[ + "try" + "catch" + "finally" +] @exception + +[ + "for" + "while" + "foreach" + "do" + "continue" + "break" +] @repeat + +[ + (string) + (xhp_string) +] @string + +[ + (xhp_open) + (xhp_close) +] @tag + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/hare/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/hare/folds.scm new file mode 100644 index 000000000..28f18b175 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hare/folds.scm @@ -0,0 +1,21 @@ +[ + (imports) + + (function_declaration) + (enum_type) + (struct_type) + (tuple_type) + (union_type) + + (block) + (if_statement) + (for_statement) + (call_expression) + (switch_expression) + (match_expression) + (case) + + (array_literal) + (struct_literal) + (tuple_literal) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/hare/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hare/highlights.scm new file mode 100644 index 000000000..063af31b3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hare/highlights.scm @@ -0,0 +1,255 @@ +; Variables + +(identifier) @variable + +; Types + +(type) @type + +(scoped_type_identifier + (identifier) . (identifier) @type) + +(struct_literal + . (identifier) @type) + +(builtin_type) @type.builtin + +; Constants + +((identifier) @constant + (#lua-match? @constant "^[A-Z_]+$")) + +; Includes + +[ + "use" +] @include + +(use_statement + (scoped_type_identifier + (identifier) @namespace)) +(use_statement + (identifier) @namespace "{") +(use_statement + . (identifier) @namespace .) + +((scoped_type_identifier + path: (_) @namespace) + (#set! "priority" 105)) + +; Keywords + +[ + "def" + "enum" + "export" + "let" + "struct" + "type" + "union" +] @keyword + +[ + "fn" +] @keyword.function + +[ + "defer" + "yield" + "return" +] @keyword.return + +[ + "as" + "is" +] @keyword.operator + +; Typedefs + +(type_declaration + "type" (identifier) @type.definition . "=") + +; Qualifiers + +[ + "const" + "static" + "nullable" +] @type.qualifier + +; Attributes + +[ + "@fini" + "@init" + "@test" + "@noreturn" + "@packed" + (declaration_attribute) +] @attribute + +; Labels + +((label) @label + (#set! "priority" 105)) + +; Functions + +(function_declaration + "fn" . (identifier) @function) + +(call_expression + . (identifier) @function.call) + +(call_expression + . (scoped_type_identifier + . (identifier) . "::" . (identifier) @method.call)) + +((call_expression + . (identifier) @function.builtin) + (#any-of? @function.builtin "align" "assert" "free" "len" "offset" "size")) + +(size_expression + "size" @function.builtin) + +((function_declaration + "fn" . (identifier) @constructor) + (#eq? @constructor "init")) + +((call_expression + . (identifier) @constructor) + (#eq? @constructor "init")) + +; Parameters + +(parameter + (_) @parameter . ":") + +; Fields + +((member_expression + "." (_) @field) + (#set! "priority" 105)) + +(field + . (identifier) @field) + +(field_assignment + . (identifier) @field) + +; Repeats + +[ + "for" +] @repeat + +; Conditionals + +[ + "if" + "else" + "break" + "switch" + "match" + "case" +] @conditional + +; Operators + +[ + "+" + "-" + "*" + "/" + "%" + "||" + "&&" + "^^" + "|" + "&" + "^" + "==" + "!=" + ">" + ">=" + "<=" + "<" + "<<" + ">>" + "~" + "!" + "+=" + "-=" + "*=" + "/=" + "%=" + "<<=" + ">>=" + "|=" + "&=" + "^=" + "||=" + "&&=" + "^^=" + "=" + "?" +] @operator + +; Punctuation + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ + ".." + "..." + "_" +] @punctuation.special + +(pointer_type "*" @punctuation.special) + +(slice_type "*" @punctuation.special) + +(error_type "!" @punctuation.special) + +[ + "," + "." + ":" + ";" + "::" + "=>" +] @punctuation.delimiter + +; Literals + +[ + (string) + (raw_string) +] @string + +(rune) @character + +(escape_sequence) @string.escape + +(number) @number + +(float) @float + +(boolean) @boolean + +[ + (void) + (null) +] @constant.builtin + +; Comments + +(comment) @comment @spell + +; Errors + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/hare/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/hare/indents.scm new file mode 100644 index 000000000..b3aadcd6e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hare/indents.scm @@ -0,0 +1,36 @@ +[ + (enum_type) + (struct_type) + (tuple_type) + (union_type) + + (block) + (for_statement) + (call_expression) + (case) + + (array_literal) + (struct_literal) + (tuple_literal) +] @indent.begin + +(if_statement + ("(" condition: (_) ")") @indent.begin) + +[ + "}" + "]" + ")" +] @indent.end + +[ "{" "}" ] @indent.branch + +[ "[" "]" ] @indent.branch + +[ "(" ")" ] @indent.branch + +[ + (ERROR) + (comment) + (concatenated_string) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/hare/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/hare/injections.scm new file mode 100644 index 000000000..2992a948d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hare/injections.scm @@ -0,0 +1,8 @@ +(comment) @comment + +((call_expression + . (_) @_fnname + . "(" + . (_ [(string_content) (raw_string_content)] @regex) + . ")") + (#any-of? @_fnname "compile" "regex::compile")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/hare/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/hare/locals.scm new file mode 100644 index 000000000..62eb6665b --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hare/locals.scm @@ -0,0 +1,47 @@ +; Scopes + +[ + (module) + (function_declaration) + (if_statement) + (for_statement) + (match_expression) + (switch_expression) +] @scope + +; References + +[ + (identifier) + (scoped_type_identifier) +] @reference + +; Definitions + +(global_binding + (identifier) @definition.constant . ":" (_)) + +(const_declaration + "const" (identifier) @definition.constant . "=") + +(field + . (identifier) @definition.field) + +(field_assignment + . (identifier) @definition.field) + +(function_declaration + "fn" . (identifier) @definition.function) + +(parameter + (_) @definition.parameter . ":") + +(type_declaration + "type" (identifier) @definition.type . "=") + +(type_declaration + "type" (identifier) @definition.enum . "=" (enum_type)) + +(let_declaration + "let" . (identifier) @definition.variable ","?) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/haskell/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/haskell/folds.scm new file mode 100644 index 000000000..28eadf8f3 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/haskell/folds.scm @@ -0,0 +1,5 @@ +[ + (exp_apply) + (exp_do) + (function) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/haskell/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/haskell/highlights.scm new file mode 100644 index 000000000..01fecb43e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/haskell/highlights.scm @@ -0,0 +1,160 @@ +;; ---------------------------------------------------------------------------- +;; Literals and comments + +(integer) @number +(exp_negation) @number +(exp_literal (float)) @float +(char) @character +(string) @string + +(con_unit) @symbol ; unit, as in () + +(comment) @comment + + +;; ---------------------------------------------------------------------------- +;; Punctuation + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + (comma) + ";" +] @punctuation.delimiter + + +;; ---------------------------------------------------------------------------- +;; Keywords, operators, includes + +[ + "forall" + "∀" +] @repeat + +(pragma) @preproc + +[ + "if" + "then" + "else" + "case" + "of" +] @conditional + +[ + "import" + "qualified" + "module" +] @include + +[ + (operator) + (constructor_operator) + (type_operator) + (tycon_arrow) + (qualified_module) ; grabs the `.` (dot), ex: import System.IO + (qualified_type) + (qualified_variable) + (all_names) + (wildcard) + "." + ".." + "=" + "|" + "::" + "=>" + "->" + "<-" + "\\" + "`" + "@" +] @operator + +(module) @namespace + +[ + (where) + "let" + "in" + "class" + "instance" + "pattern" + "data" + "newtype" + "family" + "type" + "as" + "hiding" + "deriving" + "via" + "stock" + "anyclass" + "do" + "mdo" + "rec" + "infix" + "infixl" + "infixr" +] @keyword + + +;; ---------------------------------------------------------------------------- +;; Functions and variables + +(variable) @variable +(pat_wildcard) @variable +(signature name: (variable) @variable) + +(function + name: (variable) @function + patterns: (patterns)) +(function + name: (variable) @function + rhs: (exp_lambda)) +((signature (variable) @function (fun)) . (function (variable))) +((signature (variable) @_type (fun)) . (function (variable) @function) (#eq? @function @_type)) +((signature (variable) @function (context (fun))) . (function (variable))) +((signature (variable) @_type (context (fun))) . (function (variable) @function) (#eq? @function @_type)) +((signature (variable) @function (forall (context (fun)))) . (function (variable))) +((signature (variable) @_type (forall (context (fun)))) . (function (variable) @function) (#eq? @function @_type)) + +(exp_infix (variable) @operator) ; consider infix functions as operators +(exp_section_right (variable) @operator) ; partially applied infix functions (sections) also get highlighted as operators +(exp_section_left (variable) @operator) + +(exp_infix (exp_name) @function.call (#set! "priority" 101)) +(exp_apply . (exp_name (variable) @function.call)) +(exp_apply . (exp_name (qualified_variable (variable) @function.call))) + + +;; ---------------------------------------------------------------------------- +;; Types + +(type) @type +(type_star) @type +(type_variable) @type + +(constructor) @constructor + +; True or False +((constructor) @boolean (#any-of? @boolean "True" "False")) + + +;; ---------------------------------------------------------------------------- +;; Quasi-quotes + +(quoter) @function.call +; Highlighting of quasiquote_body is handled by injections.scm + +;; ---------------------------------------------------------------------------- +;; Spell checking + +(comment) @spell + diff --git a/bundle/nvim-treesitter-0.9.1/queries/haskell/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/haskell/injections.scm new file mode 100644 index 000000000..f210566c4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/haskell/injections.scm @@ -0,0 +1,85 @@ +;; ----------------------------------------------------------------------------- +;; General language injection + +(quasiquote + ((quoter) @language) + ((quasiquote_body) @content) +) + +(comment) @comment + +;; ----------------------------------------------------------------------------- +;; shakespeare library +;; NOTE: doesn't support templating + +; TODO: add once CoffeeScript parser is added +; ; CoffeeScript: Text.Coffee +; (quasiquote +; (quoter) @_name +; (#eq? @_name "coffee") +; ((quasiquote_body) @coffeescript) + +; CSS: Text.Cassius, Text.Lucius +(quasiquote + (quoter) @_name + (#any-of? @_name "cassius" "lucius") + ((quasiquote_body) @css) +) + +; HTML: Text.Hamlet +(quasiquote + (quoter) @_name + (#any-of? @_name "shamlet" "xshamlet" "hamlet" "xhamlet" "ihamlet") + ((quasiquote_body) @html) +) + +; JS: Text.Julius +(quasiquote + (quoter) @_name + (#any-of? @_name "js" "julius") + ((quasiquote_body) @javascript) +) + +; TS: Text.TypeScript +(quasiquote + (quoter) @_name + (#any-of? @_name "tsc" "tscJSX") + ((quasiquote_body) @typescript) +) + + +;; ----------------------------------------------------------------------------- +;; HSX + +(quasiquote + (quoter) @_name + (#eq? @_name "hsx") + ((quasiquote_body) @html) +) + +;; ----------------------------------------------------------------------------- +;; Inline JSON from aeson + +(quasiquote + (quoter) @_name + (#eq? @_name "aesonQQ") + ((quasiquote_body) @json) +) + + +;; ----------------------------------------------------------------------------- +;; SQL + +; postgresql-simple +(quasiquote + (quoter) @_name + (#eq? @_name "sql") + ((quasiquote_body) @sql) +) + +; persistent +(quasiquote + (quoter) @_name + (#any-of? @_name "persistUpperCase" "persistLowerCase" "persistWith") + ((quasiquote_body) @haskell_persistent) +) diff --git a/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/folds.scm new file mode 100644 index 000000000..2bdffd177 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/folds.scm @@ -0,0 +1,3 @@ +[ + (entity_definition) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/highlights.scm new file mode 100644 index 000000000..afb32f11d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/haskell_persistent/highlights.scm @@ -0,0 +1,38 @@ +;; ---------------------------------------------------------------------------- +;; Literals and comments + +(integer) @number +(float) @float +(char) @character +(string) @string +(attribute_name) @attribute +(attribute_exclamation_mark) @attribute + +(con_unit) @symbol ; unit, as in () + +(comment) @comment @spell + +;; ---------------------------------------------------------------------------- +;; Keywords, operators, includes + +[ + "Id" + "Primary" + "Foreign" + "deriving" +] @keyword + +"=" @operator + + +;; ---------------------------------------------------------------------------- +;; Functions and variables + +(variable) @variable + +;; ---------------------------------------------------------------------------- +;; Types + +(type) @type + +(constructor) @constructor diff --git a/bundle/nvim-treesitter-0.9.1/queries/hcl/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/hcl/folds.scm new file mode 100644 index 000000000..cb20b2aa8 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hcl/folds.scm @@ -0,0 +1,6 @@ +[ + (comment) + (block) + (heredoc_template) + (object) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/hcl/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hcl/highlights.scm new file mode 100644 index 000000000..ba22f99d7 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hcl/highlights.scm @@ -0,0 +1,99 @@ +; highlights.scm + +[ + "!" + "\*" + "/" + "%" + "\+" + "-" + ">" + ">=" + "<" + "<=" + "==" + "!=" + "&&" + "||" +] @operator + +[ + "{" + "}" + "[" + "]" + "(" + ")" +] @punctuation.bracket + +[ + "." + ".*" + "," + "[*]" +] @punctuation.delimiter + +[ + (ellipsis) + "\?" + "=>" +] @punctuation.special + +[ + ":" + "=" +] @none + +[ + "for" + "endfor" + "in" +] @repeat + +[ + "if" + "else" + "endif" +] @conditional + +[ + (quoted_template_start) ; " + (quoted_template_end); " + (template_literal) ; non-interpolation/directive content +] @string + +[ + (heredoc_identifier) ; END + (heredoc_start) ; << or <<- +] @punctuation.delimiter + +[ + (template_interpolation_start) ; ${ + (template_interpolation_end) ; } + (template_directive_start) ; %{ + (template_directive_end) ; } + (strip_marker) ; ~ +] @punctuation.special + +(numeric_lit) @number +(bool_lit) @boolean +(null_lit) @constant +(comment) @comment @spell +(identifier) @variable + +(body (block (identifier) @keyword)) +(body (block (body (block (identifier) @type)))) +(function_call (identifier) @function) +(attribute (identifier) @field) + +; { key: val } +; +; highlight identifier keys as though they were block attributes +(object_elem key: (expression (variable_expr (identifier) @field))) + +; var.foo, data.bar +; +; first element in get_attr is a variable.builtin or a reference to a variable.builtin +(expression (variable_expr (identifier) @variable.builtin) (get_attr (identifier) @field)) + +(ERROR) @error diff --git a/bundle/nvim-treesitter-0.9.1/queries/hcl/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/hcl/indents.scm new file mode 100644 index 000000000..93264de9d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hcl/indents.scm @@ -0,0 +1,15 @@ +[ + (block) + (object) + (tuple) + (function_call) +] @indent.begin + +[ + "]" + ")" + "}" +] @indent.branch @indent.end + +(comment) @indent.auto +(ERROR) @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/hcl/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/hcl/injections.scm new file mode 100644 index 000000000..94451beb4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hcl/injections.scm @@ -0,0 +1,7 @@ +(comment) @comment + +(heredoc_template + (template_literal) @content + (heredoc_identifier) @language + (#set! "language" @language) + (#downcase! "language")) diff --git a/bundle/nvim-treesitter-0.9.1/queries/heex/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/heex/folds.scm new file mode 100644 index 000000000..88d4f17ff --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/heex/folds.scm @@ -0,0 +1,6 @@ +; HEEx tags, components, and slots fold similar to HTML +[ + (component) + (tag) + (slot) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/heex/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/heex/highlights.scm new file mode 100644 index 000000000..7dd4dd6fd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/heex/highlights.scm @@ -0,0 +1,56 @@ +; HEEx delimiters +[ + "%>" + "--%>" + "-->" + "/>" + "" + "{" + "}" +] @tag.delimiter + +; HEEx operators are highlighted as such +"=" @operator + +; HEEx inherits the DOCTYPE tag from HTML +(doctype) @constant + +; HEEx comments are highlighted as such +(comment) @comment + +; HEEx text content is treated as markup +(text) @text + +; Tree-sitter parser errors +(ERROR) @error + +; HEEx tags and slots are highlighted as HTML +[ + (tag_name) + (slot_name) +] @tag + +; HEEx attributes are highlighted as HTML attributes +(attribute_name) @tag.attribute +[ + (attribute_value) + (quoted_attribute_value) +] @string + +; HEEx components are highlighted as modules and function calls +(component_name [ + (module) @type + (function) @function + "." @punctuation.delimiter +]) diff --git a/bundle/nvim-treesitter-0.9.1/queries/heex/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/heex/indents.scm new file mode 100644 index 000000000..82a2f8912 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/heex/indents.scm @@ -0,0 +1,20 @@ +; HEEx tags, components, and slots indent like HTML +[ + (component) + (slot) + (tag) +] @indent.begin + +; Dedent at the end of each tag, component, and slot +[ + (end_component) + (end_slot) + (end_tag) +] @indent.branch @indent.dedent + +; Self-closing tags and components should not change +; indentation level of sibling nodes +[ + (self_closing_component) + (self_closing_tag) +] @indent.auto diff --git a/bundle/nvim-treesitter-0.9.1/queries/heex/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/heex/injections.scm new file mode 100644 index 000000000..fffd1dc53 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/heex/injections.scm @@ -0,0 +1,11 @@ +; HEEx directives can span multiple interpolated lines of Elixir +(directive [ + (expression_value) + (partial_expression_value) +] @elixir @combined) + +; HEEx Elixir expressions are always within a tag or component +(expression (expression_value) @elixir) + +; HEEx comments +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/heex/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/heex/locals.scm new file mode 100644 index 000000000..4371bc979 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/heex/locals.scm @@ -0,0 +1,13 @@ +; HEEx tags, components, and slots are references +[ + (component_name) + (slot_name) + (tag_name) +] @reference + +; Create a new scope within each HEEx tag, component, and slot +[ + (component) + (slot) + (tag) +] @scope diff --git a/bundle/nvim-treesitter-0.9.1/queries/hjson/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/hjson/folds.scm new file mode 100644 index 000000000..41269219e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hjson/folds.scm @@ -0,0 +1 @@ +; inherits: json diff --git a/bundle/nvim-treesitter-0.9.1/queries/hjson/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hjson/highlights.scm new file mode 100644 index 000000000..c8eed139f --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hjson/highlights.scm @@ -0,0 +1,16 @@ +(true) @boolean +(false) @boolean +(null) @constant.builtin +(number) @number +(pair key: (string) @label) +(pair value: (string) @string) +(array (string) @string) +; (string_content (escape_sequence) @string.escape) +(ERROR) @error +; "," @punctuation.delimiter +"[" @punctuation.bracket +"]" @punctuation.bracket +"{" @punctuation.bracket +"}" @punctuation.bracket + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/hjson/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/hjson/indents.scm new file mode 100644 index 000000000..3b01ca999 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hjson/indents.scm @@ -0,0 +1,3 @@ +; inherits: json + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/hjson/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/hjson/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hjson/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/hjson/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/hjson/locals.scm new file mode 100644 index 000000000..41269219e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hjson/locals.scm @@ -0,0 +1 @@ +; inherits: json diff --git a/bundle/nvim-treesitter-0.9.1/queries/hlsl/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/hlsl/folds.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hlsl/folds.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/hlsl/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hlsl/highlights.scm new file mode 100644 index 000000000..68e9e44bd --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hlsl/highlights.scm @@ -0,0 +1,35 @@ +; inherits: cpp + +[ + "in" + "out" + "inout" + "uniform" + "shared" + "groupshared" + "discard" + "cbuffer" + "row_major" + "column_major" + "globallycoherent" + "centroid" + "noperspective" + "nointerpolation" + "sample" + "linear" + "snorm" + "unorm" + "point" + "line" + "triangleadj" + "lineadj" + "triangle" +] @type.qualifier + +( + (identifier) @variable.builtin + (#lua-match? @variable.builtin "^SV_") +) + +(hlsl_attribute) @attribute +(hlsl_attribute ["[" "]"] @attribute) diff --git a/bundle/nvim-treesitter-0.9.1/queries/hlsl/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/hlsl/indents.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hlsl/indents.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/hlsl/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/hlsl/injections.scm new file mode 100644 index 000000000..52e88686c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hlsl/injections.scm @@ -0,0 +1,6 @@ +((preproc_def (preproc_arg) @hlsl) + (#lua-match? @hlsl "\n")) +(preproc_function_def (preproc_arg) @hlsl) +(preproc_call (preproc_arg) @hlsl) + +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/hlsl/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/hlsl/locals.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hlsl/locals.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/bundle/nvim-treesitter-0.9.1/queries/hocon/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hocon/highlights.scm new file mode 100644 index 000000000..3fb8249a9 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hocon/highlights.scm @@ -0,0 +1,37 @@ +(comment) @comment + +(null) @constant.builtin +[ (true) (false) ] @boolean +(number) @number +(unit) @keyword +(string) @string +(multiline_string) @string +(string (escape_sequence) @string.escape) +(unquoted_string) @string + +[ "url" + "file" + "classpath" + "required" +] @keyword + +(include "include" @include) + +(substitution ["${" "${?" "}"] @punctuation.special) +(substitution (_) @field) + +(path (_) @field) +(value [":" "=" "+=" ] @operator) + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ "," ] @punctuation.delimiter +(unquoted_path "." @punctuation.delimiter) + diff --git a/bundle/nvim-treesitter-0.9.1/queries/hocon/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/hocon/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hocon/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/bundle/nvim-treesitter-0.9.1/queries/hoon/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/hoon/folds.scm new file mode 100644 index 000000000..93d1386e7 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hoon/folds.scm @@ -0,0 +1,6 @@ +[ + (bartisTall) + (luslusTall) + (lusbucTall) + (barcenTall) + ] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/hoon/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/hoon/highlights.scm new file mode 100644 index 000000000..f7136f63e --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hoon/highlights.scm @@ -0,0 +1,33 @@ +(number) @number + +(string) @string + +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +[ + (coreTerminator) + (seriesTerminator) +] @punctuation.delimiter + + +(rune) @operator + +(term) @constant + +(aura) @constant.builtin + +(Gap) @comment + +(boolean) @constant.builtin + +(date) @string.special + +(mold) @symbol +(specialIndex) @number.builtin +(lark) @operator +(fullContext) @symbol diff --git a/bundle/nvim-treesitter-0.9.1/queries/hoon/locals.scm b/bundle/nvim-treesitter-0.9.1/queries/hoon/locals.scm new file mode 100644 index 000000000..159783fd0 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/hoon/locals.scm @@ -0,0 +1,4 @@ +(tisfasTall + name: (name) @definition.var) + +(name) @reference diff --git a/bundle/nvim-treesitter-0.9.1/queries/html/folds.scm b/bundle/nvim-treesitter-0.9.1/queries/html/folds.scm new file mode 100644 index 000000000..69b57eac5 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/html/folds.scm @@ -0,0 +1,5 @@ +[ + (element) + (style_element) + (script_element) +] @fold diff --git a/bundle/nvim-treesitter-0.9.1/queries/html/highlights.scm b/bundle/nvim-treesitter-0.9.1/queries/html/highlights.scm new file mode 100644 index 000000000..6da261c0a --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/html/highlights.scm @@ -0,0 +1,5 @@ +; inherits: html_tags + +(doctype) @constant + +"" + "" +] @tag.delimiter + +"=" @operator diff --git a/bundle/nvim-treesitter-0.9.1/queries/html_tags/indents.scm b/bundle/nvim-treesitter-0.9.1/queries/html_tags/indents.scm new file mode 100644 index 000000000..2d9fd3864 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/html_tags/indents.scm @@ -0,0 +1,34 @@ +[ + ( + (element + (start_tag + (tag_name) @_not_special) + ) + (#not-any-of? @_not_special "meta" "link") + ) + (element (self_closing_tag)) +] @indent.begin + +; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them +; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined +( + (start_tag + (tag_name) @_special) + (#any-of? @_special "meta" "link") +) @indent.begin + + +; These are the nodes that will be captured when we do `normal o` +; But last element has already been ended, so capturing this +; to mark end of last element +(element (end_tag [">"] @indent.end)) +(element (self_closing_tag "/>" @indent.end)) + +; Script/style elements aren't indented, so only branch the end tag of other elements +(element (end_tag) @indent.branch) +[ + ">" + "/>" +] @indent.branch + +(comment) @indent.ignore diff --git a/bundle/nvim-treesitter-0.9.1/queries/html_tags/injections.scm b/bundle/nvim-treesitter-0.9.1/queries/html_tags/injections.scm new file mode 100644 index 000000000..29608a5a4 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/queries/html_tags/injections.scm @@ -0,0 +1,74 @@ +; +; +; Add "lang" to predicate check so that vue/svelte can inherit this +; without having this element being captured twice +( + (style_element + (start_tag) @_no_type_lang + (#not-lua-match? @_no_type_lang "%slang%s*=") + (#not-lua-match? @_no_type_lang "%stype%s*=") + (raw_text) @css)) + +( + (style_element + (start_tag + (attribute + (attribute_name) @_type + (quoted_attribute_value (attribute_value) @_css))) + (raw_text) @css) + (#eq? @_type "type") + (#eq? @_css "text/css") +) + +; +; +( + (script_element + (start_tag) @_no_type_lang + (#not-lua-match? @_no_type_lang "%slang%s*=") + (#not-lua-match? @_no_type_lang "%stype%s*=") + (raw_text) @javascript)) + +; + diff --git a/bundle/nvim-treesitter-0.9.1/tests/indent/html/self_closing_tag.html b/bundle/nvim-treesitter-0.9.1/tests/indent/html/self_closing_tag.html new file mode 100644 index 000000000..79376b83d --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/indent/html/self_closing_tag.html @@ -0,0 +1,14 @@ + + + + + + + + + +
+ + + + diff --git a/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/negative-assertions.vue b/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/negative-assertions.vue new file mode 100644 index 000000000..fdc871919 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/negative-assertions.vue @@ -0,0 +1,4 @@ + + + + diff --git a/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/test-vue-injections.vue b/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/test-vue-injections.vue new file mode 100644 index 000000000..75d3d831c --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/query/injections/vue/test-vue-injections.vue @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/bash-on-github-actions.yml b/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/bash-on-github-actions.yml new file mode 100644 index 000000000..ba56de193 --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/bash-on-github-actions.yml @@ -0,0 +1,32 @@ +name: CI +on: + push: + branches: [master] + pull_request: + branches: [master] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '16' + - name: Install dependencies + run: npm ci + # ^ bash + - name: Run tests + run: npm test + # ^ bash + - name: Parse Petalisp + run: | + git submodule init + git submodule update + if (( $(node_modules/tree-sitter-cli/tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then # There are 2 known failures (strings that are not format strings but use ~X syntax) + exit 1 + else + echo "Successfully parsed Petalisp" + fi + # ^ bash + - name: Run tests + run: npm test diff --git a/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/promql-on-prometheus-rules.yaml b/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/promql-on-prometheus-rules.yaml new file mode 100644 index 000000000..9d3e872ce --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/query/injections/yaml/promql-on-prometheus-rules.yaml @@ -0,0 +1,12 @@ +groups: +- name: Hardware alerts + rules: + - alert: Node down + expr: up{job="node_exporter"} == 0 + # ^ promql + for: 3m + labels: + severity: warning + annotations: + title: Node {{ $labels.instance }} is down + description: Failed to scrape {{ $labels.job }} on {{ $labels.instance }} for more than 3 minutes. Node seems down. diff --git a/bundle/nvim-treesitter-0.9.1/tests/unit/ts_utils_spec.lua b/bundle/nvim-treesitter-0.9.1/tests/unit/ts_utils_spec.lua new file mode 100644 index 000000000..397fa7eaf --- /dev/null +++ b/bundle/nvim-treesitter-0.9.1/tests/unit/ts_utils_spec.lua @@ -0,0 +1,114 @@ +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)