From 692b051b09935653befdb8f7ba8afdb640adf17b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 12 Jun 2023 09:54:30 -0600 Subject: feat!: drop modules, general refactor and cleanup --- runtime/queries/ada/folds.scm | 13 + runtime/queries/ada/highlights.scm | 286 +++++++ runtime/queries/ada/injections.scm | 5 + runtime/queries/ada/locals.scm | 91 +++ runtime/queries/agda/folds.scm | 4 + runtime/queries/agda/highlights.scm | 87 ++ runtime/queries/agda/injections.scm | 14 + runtime/queries/angular/folds.scm | 1 + runtime/queries/angular/highlights.scm | 154 ++++ runtime/queries/angular/indents.scm | 16 + runtime/queries/angular/injections.scm | 1 + runtime/queries/angular/locals.scm | 1 + runtime/queries/apex/folds.scm | 6 + runtime/queries/apex/highlights.scm | 257 ++++++ runtime/queries/apex/injections.scm | 5 + runtime/queries/apex/locals.scm | 67 ++ runtime/queries/arduino/folds.scm | 1 + runtime/queries/arduino/highlights.scm | 53 ++ runtime/queries/arduino/indents.scm | 1 + runtime/queries/arduino/injections.scm | 1 + runtime/queries/arduino/locals.scm | 1 + runtime/queries/asm/highlights.scm | 66 ++ runtime/queries/asm/injections.scm | 5 + runtime/queries/astro/folds.scm | 1 + runtime/queries/astro/highlights.scm | 29 + runtime/queries/astro/indents.scm | 1 + runtime/queries/astro/injections.scm | 32 + runtime/queries/astro/locals.scm | 1 + runtime/queries/authzed/highlights.scm | 60 ++ runtime/queries/authzed/injections.scm | 26 + runtime/queries/awk/highlights.scm | 233 ++++++ runtime/queries/awk/injections.scm | 17 + runtime/queries/bash/folds.scm | 9 + runtime/queries/bash/highlights.scm | 261 ++++++ runtime/queries/bash/injections.scm | 79 ++ runtime/queries/bash/locals.scm | 14 + runtime/queries/bass/folds.scm | 5 + runtime/queries/bass/highlights.scm | 126 +++ runtime/queries/bass/indents.scm | 31 + runtime/queries/bass/injections.scm | 5 + runtime/queries/bass/locals.scm | 26 + runtime/queries/beancount/folds.scm | 4 + runtime/queries/beancount/highlights.scm | 57 ++ runtime/queries/beancount/injections.scm | 5 + runtime/queries/bibtex/folds.scm | 1 + runtime/queries/bibtex/highlights.scm | 57 ++ runtime/queries/bibtex/indents.scm | 8 + runtime/queries/bibtex/injections.scm | 2 + runtime/queries/bicep/folds.scm | 19 + runtime/queries/bicep/highlights.scm | 234 ++++++ runtime/queries/bicep/indents.scm | 27 + runtime/queries/bicep/injections.scm | 5 + runtime/queries/bicep/locals.scm | 73 ++ runtime/queries/bitbake/folds.scm | 24 + runtime/queries/bitbake/highlights.scm | 406 ++++++++++ runtime/queries/bitbake/indents.scm | 172 ++++ runtime/queries/bitbake/injections.scm | 15 + runtime/queries/bitbake/locals.scm | 117 +++ runtime/queries/blade/folds.scm | 14 + runtime/queries/blade/highlights.scm | 15 + runtime/queries/blade/indents.scm | 3 + runtime/queries/blade/injections.scm | 15 + runtime/queries/blueprint/highlights.scm | 75 ++ runtime/queries/blueprint/injections.scm | 2 + runtime/queries/bp/folds.scm | 6 + runtime/queries/bp/highlights.scm | 56 ++ runtime/queries/bp/indents.scm | 38 + runtime/queries/bp/injections.scm | 2 + runtime/queries/bp/locals.scm | 15 + runtime/queries/brightscript/folds.scm | 8 + runtime/queries/brightscript/highlights.scm | 177 +++++ runtime/queries/brightscript/indents.scm | 39 + runtime/queries/brightscript/injections.scm | 2 + runtime/queries/c/folds.scm | 23 + runtime/queries/c/highlights.scm | 341 ++++++++ runtime/queries/c/indents.scm | 99 +++ runtime/queries/c/injections.scm | 128 +++ runtime/queries/c/locals.scm | 67 ++ runtime/queries/c_sharp/folds.scm | 17 + runtime/queries/c_sharp/highlights.scm | 577 ++++++++++++++ runtime/queries/c_sharp/injections.scm | 2 + runtime/queries/c_sharp/locals.scm | 42 + runtime/queries/caddy/folds.scm | 1 + runtime/queries/caddy/highlights.scm | 55 ++ runtime/queries/caddy/indents.scm | 8 + runtime/queries/caddy/injections.scm | 2 + runtime/queries/cairo/folds.scm | 26 + runtime/queries/cairo/highlights.scm | 414 ++++++++++ runtime/queries/cairo/indents.scm | 57 ++ runtime/queries/cairo/injections.scm | 5 + runtime/queries/cairo/locals.scm | 66 ++ runtime/queries/capnp/folds.scm | 14 + runtime/queries/capnp/highlights.scm | 141 ++++ runtime/queries/capnp/indents.scm | 40 + runtime/queries/capnp/injections.scm | 2 + runtime/queries/capnp/locals.scm | 97 +++ runtime/queries/chatito/folds.scm | 5 + runtime/queries/chatito/highlights.scm | 54 ++ runtime/queries/chatito/indents.scm | 8 + runtime/queries/chatito/injections.scm | 2 + runtime/queries/chatito/locals.scm | 16 + runtime/queries/circom/folds.scm | 13 + runtime/queries/circom/highlights.scm | 137 ++++ runtime/queries/circom/injections.scm | 2 + runtime/queries/circom/locals.scm | 12 + runtime/queries/clojure/folds.scm | 2 + runtime/queries/clojure/highlights.scm | 347 ++++++++ runtime/queries/clojure/injections.scm | 2 + runtime/queries/clojure/locals.scm | 1 + runtime/queries/cmake/folds.scm | 8 + runtime/queries/cmake/highlights.scm | 221 ++++++ runtime/queries/cmake/indents.scm | 26 + runtime/queries/cmake/injections.scm | 5 + runtime/queries/comment/highlights.scm | 49 ++ runtime/queries/commonlisp/folds.scm | 2 + runtime/queries/commonlisp/highlights.scm | 315 ++++++++ runtime/queries/commonlisp/injections.scm | 5 + runtime/queries/commonlisp/locals.scm | 109 +++ runtime/queries/cooklang/highlights.scm | 31 + runtime/queries/cooklang/injections.scm | 2 + runtime/queries/corn/folds.scm | 5 + runtime/queries/corn/highlights.scm | 37 + runtime/queries/corn/indents.scm | 24 + runtime/queries/corn/injections.scm | 2 + runtime/queries/corn/locals.scm | 13 + runtime/queries/cpon/folds.scm | 5 + runtime/queries/cpon/highlights.scm | 54 ++ runtime/queries/cpon/indents.scm | 17 + runtime/queries/cpon/injections.scm | 2 + runtime/queries/cpon/locals.scm | 6 + runtime/queries/cpp/folds.scm | 14 + runtime/queries/cpp/highlights.scm | 268 +++++++ runtime/queries/cpp/indents.scm | 8 + runtime/queries/cpp/injections.scm | 9 + runtime/queries/cpp/locals.scm | 78 ++ runtime/queries/css/folds.scm | 10 + runtime/queries/css/highlights.scm | 109 +++ runtime/queries/css/indents.scm | 11 + runtime/queries/css/injections.scm | 2 + runtime/queries/csv/highlights.scm | 3 + runtime/queries/cuda/folds.scm | 1 + runtime/queries/cuda/highlights.scm | 17 + runtime/queries/cuda/indents.scm | 1 + runtime/queries/cuda/injections.scm | 1 + runtime/queries/cuda/locals.scm | 1 + runtime/queries/cue/folds.scm | 5 + runtime/queries/cue/highlights.scm | 164 ++++ runtime/queries/cue/indents.scm | 30 + runtime/queries/cue/injections.scm | 2 + runtime/queries/cue/locals.scm | 31 + runtime/queries/cylc/folds.scm | 10 + runtime/queries/cylc/highlights.scm | 72 ++ runtime/queries/cylc/indents.scm | 16 + runtime/queries/cylc/injections.scm | 11 + runtime/queries/d/folds.scm | 4 + runtime/queries/d/highlights.scm | 374 +++++++++ runtime/queries/d/indents.scm | 24 + runtime/queries/d/injections.scm | 19 + runtime/queries/d/locals.scm | 79 ++ runtime/queries/dart/folds.scm | 13 + runtime/queries/dart/highlights.scm | 303 +++++++ runtime/queries/dart/indents.scm | 49 ++ runtime/queries/dart/injections.scm | 2 + runtime/queries/dart/locals.scm | 32 + runtime/queries/desktop/folds.scm | 1 + runtime/queries/desktop/highlights.scm | 94 +++ runtime/queries/desktop/injections.scm | 8 + runtime/queries/devicetree/folds.scm | 1 + runtime/queries/devicetree/highlights.scm | 61 ++ runtime/queries/devicetree/indents.scm | 12 + runtime/queries/devicetree/injections.scm | 2 + runtime/queries/devicetree/locals.scm | 4 + runtime/queries/dhall/folds.scm | 10 + runtime/queries/dhall/highlights.scm | 200 +++++ runtime/queries/dhall/injections.scm | 5 + runtime/queries/diff/folds.scm | 5 + runtime/queries/diff/highlights.scm | 49 ++ runtime/queries/diff/injections.scm | 2 + runtime/queries/disassembly/highlights.scm | 30 + runtime/queries/disassembly/injections.scm | 6 + runtime/queries/djot/folds.scm | 7 + runtime/queries/djot/highlights.scm | 372 +++++++++ runtime/queries/djot/indents.scm | 10 + runtime/queries/djot/injections.scm | 24 + runtime/queries/djot/locals.scm | 17 + runtime/queries/dockerfile/highlights.scm | 68 ++ runtime/queries/dockerfile/injections.scm | 12 + runtime/queries/dot/highlights.scm | 49 ++ runtime/queries/dot/indents.scm | 9 + runtime/queries/dot/injections.scm | 5 + runtime/queries/doxygen/highlights.scm | 61 ++ runtime/queries/doxygen/indents.scm | 1 + runtime/queries/doxygen/injections.scm | 15 + runtime/queries/dtd/folds.scm | 4 + runtime/queries/dtd/highlights.scm | 148 ++++ runtime/queries/dtd/injections.scm | 2 + runtime/queries/dtd/locals.scm | 11 + runtime/queries/earthfile/highlights.scm | 129 +++ runtime/queries/earthfile/injections.scm | 9 + runtime/queries/ebnf/highlights.scm | 42 + runtime/queries/ebnf/injections.scm | 2 + runtime/queries/ecma/folds.scm | 24 + runtime/queries/ecma/highlights.scm | 392 +++++++++ runtime/queries/ecma/indents.scm | 82 ++ runtime/queries/ecma/injections.scm | 203 +++++ runtime/queries/ecma/locals.scm | 42 + runtime/queries/editorconfig/folds.scm | 1 + runtime/queries/editorconfig/highlights.scm | 55 ++ runtime/queries/editorconfig/injections.scm | 2 + runtime/queries/eds/folds.scm | 1 + runtime/queries/eds/highlights.scm | 45 ++ runtime/queries/eex/highlights.scm | 12 + runtime/queries/eex/injections.scm | 8 + runtime/queries/elixir/folds.scm | 10 + runtime/queries/elixir/highlights.scm | 217 +++++ runtime/queries/elixir/indents.scm | 25 + runtime/queries/elixir/injections.scm | 59 ++ runtime/queries/elixir/locals.scm | 200 +++++ runtime/queries/elm/folds.scm | 14 + runtime/queries/elm/highlights.scm | 229 ++++++ runtime/queries/elm/injections.scm | 8 + runtime/queries/elsa/folds.scm | 1 + runtime/queries/elsa/highlights.scm | 36 + runtime/queries/elsa/indents.scm | 6 + runtime/queries/elsa/injections.scm | 2 + runtime/queries/elsa/locals.scm | 12 + runtime/queries/elvish/highlights.scm | 157 ++++ runtime/queries/elvish/injections.scm | 2 + runtime/queries/embedded_template/highlights.scm | 12 + runtime/queries/embedded_template/injections.scm | 7 + runtime/queries/enforce/folds.scm | 10 + runtime/queries/enforce/highlights.scm | 190 +++++ runtime/queries/enforce/indents.scm | 30 + runtime/queries/enforce/injections.scm | 13 + runtime/queries/enforce/locals.scm | 40 + runtime/queries/erlang/folds.scm | 9 + runtime/queries/erlang/highlights.scm | 184 +++++ runtime/queries/erlang/injections.scm | 2 + runtime/queries/facility/folds.scm | 6 + runtime/queries/facility/highlights.scm | 90 +++ runtime/queries/facility/indents.scm | 7 + runtime/queries/facility/injections.scm | 8 + runtime/queries/faust/highlights.scm | 219 +++++ runtime/queries/faust/injections.scm | 2 + runtime/queries/fennel/folds.scm | 51 ++ runtime/queries/fennel/highlights.scm | 193 +++++ runtime/queries/fennel/injections.scm | 134 ++++ runtime/queries/fennel/locals.scm | 56 ++ runtime/queries/fidl/folds.scm | 6 + runtime/queries/fidl/highlights.scm | 67 ++ runtime/queries/fidl/injections.scm | 2 + runtime/queries/firrtl/folds.scm | 6 + runtime/queries/firrtl/highlights.scm | 198 +++++ runtime/queries/firrtl/indents.scm | 12 + runtime/queries/firrtl/injections.scm | 2 + runtime/queries/firrtl/locals.scm | 45 ++ runtime/queries/fish/folds.scm | 8 + runtime/queries/fish/highlights.scm | 204 +++++ runtime/queries/fish/indents.scm | 18 + runtime/queries/fish/injections.scm | 2 + runtime/queries/fish/locals.scm | 19 + runtime/queries/foam/folds.scm | 8 + runtime/queries/foam/highlights.scm | 64 ++ runtime/queries/foam/indents.scm | 11 + runtime/queries/foam/injections.scm | 23 + runtime/queries/foam/locals.scm | 11 + runtime/queries/forth/folds.scm | 1 + runtime/queries/forth/highlights.scm | 19 + runtime/queries/forth/indents.scm | 3 + runtime/queries/forth/injections.scm | 2 + runtime/queries/forth/locals.scm | 3 + runtime/queries/fortran/folds.scm | 11 + runtime/queries/fortran/highlights.scm | 319 ++++++++ runtime/queries/fortran/indents.scm | 27 + runtime/queries/fortran/injections.scm | 2 + runtime/queries/fsh/highlights.scm | 97 +++ runtime/queries/fsh/injections.scm | 2 + runtime/queries/fsharp/highlights.scm | 411 ++++++++++ runtime/queries/fsharp/injections.scm | 11 + runtime/queries/func/highlights.scm | 167 ++++ runtime/queries/func/injections.scm | 2 + runtime/queries/fusion/folds.scm | 6 + runtime/queries/fusion/highlights.scm | 132 +++ runtime/queries/fusion/indents.scm | 24 + runtime/queries/fusion/injections.scm | 5 + runtime/queries/fusion/locals.scm | 23 + runtime/queries/gap/folds.scm | 12 + runtime/queries/gap/highlights.scm | 208 +++++ runtime/queries/gap/injections.scm | 2 + runtime/queries/gap/locals.scm | 43 + runtime/queries/gaptst/folds.scm | 7 + runtime/queries/gaptst/highlights.scm | 19 + runtime/queries/gaptst/injections.scm | 9 + runtime/queries/gdscript/folds.scm | 26 + runtime/queries/gdscript/highlights.scm | 422 ++++++++++ runtime/queries/gdscript/indents.scm | 78 ++ runtime/queries/gdscript/injections.scm | 2 + runtime/queries/gdscript/locals.scm | 121 +++ runtime/queries/gdshader/highlights.scm | 142 ++++ runtime/queries/gdshader/injections.scm | 2 + runtime/queries/git_config/folds.scm | 2 + runtime/queries/git_config/highlights.scm | 59 ++ runtime/queries/git_config/injections.scm | 69 ++ runtime/queries/git_rebase/highlights.scm | 7 + runtime/queries/git_rebase/injections.scm | 8 + runtime/queries/gitattributes/highlights.scm | 55 ++ runtime/queries/gitattributes/injections.scm | 2 + runtime/queries/gitattributes/locals.scm | 8 + runtime/queries/gitcommit/highlights.scm | 49 ++ runtime/queries/gitcommit/injections.scm | 5 + runtime/queries/gitignore/highlights.scm | 36 + runtime/queries/gitignore/injections.scm | 2 + runtime/queries/gleam/folds.scm | 7 + runtime/queries/gleam/highlights.scm | 200 +++++ runtime/queries/gleam/indents.scm | 30 + runtime/queries/gleam/injections.scm | 7 + runtime/queries/gleam/locals.scm | 31 + runtime/queries/glimmer/folds.scm | 5 + runtime/queries/glimmer/highlights.scm | 117 +++ runtime/queries/glimmer/indents.scm | 34 + runtime/queries/glimmer/injections.scm | 21 + runtime/queries/glimmer/locals.scm | 9 + runtime/queries/glimmer_javascript/highlights.scm | 61 ++ runtime/queries/glimmer_javascript/indents.scm | 5 + runtime/queries/glimmer_javascript/injections.scm | 7 + runtime/queries/glimmer_javascript/locals.scm | 1 + runtime/queries/glimmer_typescript/highlights.scm | 6 + runtime/queries/glimmer_typescript/indents.scm | 3 + runtime/queries/glimmer_typescript/injections.scm | 7 + runtime/queries/glsl/folds.scm | 1 + runtime/queries/glsl/highlights.scm | 35 + runtime/queries/glsl/indents.scm | 1 + runtime/queries/glsl/injections.scm | 1 + runtime/queries/glsl/locals.scm | 1 + runtime/queries/gn/folds.scm | 6 + runtime/queries/gn/highlights.scm | 78 ++ runtime/queries/gn/indents.scm | 12 + runtime/queries/gn/injections.scm | 2 + runtime/queries/gn/locals.scm | 6 + runtime/queries/gnuplot/highlights.scm | 648 +++++++++++++++ runtime/queries/gnuplot/injections.scm | 2 + runtime/queries/go/folds.scm | 19 + runtime/queries/go/highlights.scm | 254 ++++++ runtime/queries/go/indents.scm | 48 ++ runtime/queries/go/injections.scm | 42 + runtime/queries/go/locals.scm | 88 ++ runtime/queries/goctl/folds.scm | 11 + runtime/queries/goctl/highlights.scm | 79 ++ runtime/queries/goctl/indents.scm | 15 + runtime/queries/goctl/injections.scm | 3 + runtime/queries/godot_resource/folds.scm | 1 + runtime/queries/godot_resource/highlights.scm | 49 ++ runtime/queries/godot_resource/injections.scm | 2 + runtime/queries/godot_resource/locals.scm | 1 + runtime/queries/gomod/highlights.scm | 34 + runtime/queries/gomod/injections.scm | 2 + runtime/queries/gosum/highlights.scm | 32 + runtime/queries/gotmpl/folds.scm | 8 + runtime/queries/gotmpl/highlights.scm | 133 ++++ runtime/queries/gotmpl/injections.scm | 31 + runtime/queries/gotmpl/locals.scm | 12 + runtime/queries/gowork/highlights.scm | 14 + runtime/queries/gowork/injections.scm | 2 + runtime/queries/gpg/highlights.scm | 54 ++ runtime/queries/gpg/injections.scm | 2 + runtime/queries/graphql/highlights.scm | 163 ++++ runtime/queries/graphql/indents.scm | 11 + runtime/queries/graphql/injections.scm | 2 + runtime/queries/gren/highlights.scm | 121 +++ runtime/queries/gren/injections.scm | 5 + runtime/queries/groovy/folds.scm | 6 + runtime/queries/groovy/highlights.scm | 269 +++++++ runtime/queries/groovy/indents.scm | 35 + runtime/queries/groovy/injections.scm | 5 + runtime/queries/groovy/locals.scm | 6 + runtime/queries/gstlaunch/highlights.scm | 35 + runtime/queries/hack/highlights.scm | 366 +++++++++ runtime/queries/hack/injections.scm | 5 + runtime/queries/hare/folds.scm | 18 + runtime/queries/hare/highlights.scm | 272 +++++++ runtime/queries/hare/indents.scm | 45 ++ runtime/queries/hare/injections.scm | 18 + runtime/queries/hare/locals.scm | 65 ++ runtime/queries/haskell/folds.scm | 6 + runtime/queries/haskell/highlights.scm | 467 +++++++++++ runtime/queries/haskell/injections.scm | 84 ++ runtime/queries/haskell/locals.scm | 9 + runtime/queries/haskell_persistent/folds.scm | 1 + runtime/queries/haskell_persistent/highlights.scm | 38 + runtime/queries/hcl/folds.scm | 6 + runtime/queries/hcl/highlights.scm | 118 +++ runtime/queries/hcl/indents.scm | 16 + runtime/queries/hcl/injections.scm | 7 + runtime/queries/heex/folds.scm | 6 + runtime/queries/heex/highlights.scm | 54 ++ runtime/queries/heex/indents.scm | 20 + runtime/queries/heex/injections.scm | 30 + runtime/queries/heex/locals.scm | 13 + runtime/queries/helm/folds.scm | 1 + runtime/queries/helm/highlights.scm | 49 ++ runtime/queries/helm/injections.scm | 36 + runtime/queries/helm/locals.scm | 1 + runtime/queries/hjson/folds.scm | 1 + runtime/queries/hjson/highlights.scm | 28 + runtime/queries/hjson/indents.scm | 3 + runtime/queries/hjson/injections.scm | 2 + runtime/queries/hjson/locals.scm | 1 + runtime/queries/hlsl/folds.scm | 1 + runtime/queries/hlsl/highlights.scm | 38 + runtime/queries/hlsl/indents.scm | 1 + runtime/queries/hlsl/injections.scm | 1 + runtime/queries/hlsl/locals.scm | 1 + runtime/queries/hlsplaylist/highlights.scm | 41 + runtime/queries/hlsplaylist/injections.scm | 2 + runtime/queries/hocon/folds.scm | 4 + runtime/queries/hocon/highlights.scm | 65 ++ runtime/queries/hocon/injections.scm | 2 + runtime/queries/hoon/folds.scm | 6 + runtime/queries/hoon/highlights.scm | 35 + runtime/queries/hoon/injections.scm | 2 + runtime/queries/hoon/locals.scm | 4 + runtime/queries/html/folds.scm | 5 + runtime/queries/html/highlights.scm | 7 + runtime/queries/html/indents.scm | 1 + runtime/queries/html/injections.scm | 26 + runtime/queries/html/locals.scm | 1 + runtime/queries/html_tags/highlights.scm | 106 +++ runtime/queries/html_tags/indents.scm | 37 + runtime/queries/html_tags/injections.scm | 91 +++ runtime/queries/htmldjango/folds.scm | 4 + runtime/queries/htmldjango/highlights.scm | 73 ++ runtime/queries/htmldjango/indents.scm | 5 + runtime/queries/htmldjango/injections.scm | 9 + runtime/queries/http/folds.scm | 5 + runtime/queries/http/highlights.scm | 64 ++ runtime/queries/http/injections.scm | 24 + runtime/queries/hurl/folds.scm | 19 + runtime/queries/hurl/highlights.scm | 148 ++++ runtime/queries/hurl/indents.scm | 14 + runtime/queries/hurl/injections.scm | 15 + runtime/queries/hyprlang/folds.scm | 1 + runtime/queries/hyprlang/highlights.scm | 65 ++ runtime/queries/hyprlang/indents.scm | 6 + runtime/queries/hyprlang/injections.scm | 31 + runtime/queries/idl/highlights.scm | 379 +++++++++ runtime/queries/idl/indents.scm | 10 + runtime/queries/idl/injections.scm | 8 + runtime/queries/idris/folds.scm | 1 + runtime/queries/idris/highlights.scm | 228 ++++++ runtime/queries/idris/injections.scm | 2 + runtime/queries/idris/locals.scm | 33 + runtime/queries/ini/folds.scm | 1 + runtime/queries/ini/highlights.scm | 16 + runtime/queries/ini/injections.scm | 3 + runtime/queries/inko/folds.scm | 18 + runtime/queries/inko/highlights.scm | 203 +++++ runtime/queries/inko/indents.scm | 41 + runtime/queries/inko/injections.scm | 2 + runtime/queries/inko/locals.scm | 57 ++ runtime/queries/ipkg/folds.scm | 13 + runtime/queries/ipkg/highlights.scm | 56 ++ runtime/queries/ipkg/indents.scm | 33 + runtime/queries/ipkg/injections.scm | 5 + runtime/queries/ipkg/locals.scm | 24 + runtime/queries/ispc/folds.scm | 8 + runtime/queries/ispc/highlights.scm | 110 +++ runtime/queries/ispc/indents.scm | 9 + runtime/queries/ispc/injections.scm | 1 + runtime/queries/ispc/locals.scm | 18 + runtime/queries/janet_simple/folds.scm | 2 + runtime/queries/janet_simple/highlights.scm | 178 +++++ runtime/queries/janet_simple/injections.scm | 2 + runtime/queries/janet_simple/locals.scm | 1 + runtime/queries/java/folds.scm | 8 + runtime/queries/java/highlights.scm | 330 ++++++++ runtime/queries/java/indents.scm | 40 + runtime/queries/java/injections.scm | 31 + runtime/queries/java/locals.scm | 100 +++ runtime/queries/javadoc/highlights.scm | 86 ++ runtime/queries/javadoc/indents.scm | 1 + runtime/queries/javadoc/injections.scm | 30 + runtime/queries/javascript/folds.scm | 1 + runtime/queries/javascript/highlights.scm | 56 ++ runtime/queries/javascript/indents.scm | 1 + runtime/queries/javascript/injections.scm | 1 + runtime/queries/javascript/locals.scm | 69 ++ runtime/queries/jinja/highlights.scm | 19 + runtime/queries/jinja/injections.scm | 5 + runtime/queries/jinja_inline/highlights.scm | 157 ++++ runtime/queries/jinja_inline/injections.scm | 2 + runtime/queries/jq/highlights.scm | 158 ++++ runtime/queries/jq/injections.scm | 23 + runtime/queries/jq/locals.scm | 10 + runtime/queries/jsdoc/highlights.scm | 42 + runtime/queries/json/folds.scm | 5 + runtime/queries/json/highlights.scm | 38 + runtime/queries/json/indents.scm | 9 + runtime/queries/json/locals.scm | 4 + runtime/queries/json5/highlights.scm | 15 + runtime/queries/json5/injections.scm | 2 + runtime/queries/jsonc/folds.scm | 1 + runtime/queries/jsonc/highlights.scm | 3 + runtime/queries/jsonc/indents.scm | 3 + runtime/queries/jsonc/injections.scm | 2 + runtime/queries/jsonc/locals.scm | 1 + runtime/queries/jsonnet/folds.scm | 10 + runtime/queries/jsonnet/highlights.scm | 135 ++++ runtime/queries/jsonnet/injections.scm | 2 + runtime/queries/jsonnet/locals.scm | 27 + runtime/queries/jsx/folds.scm | 1 + runtime/queries/jsx/highlights.scm | 157 ++++ runtime/queries/jsx/indents.scm | 21 + runtime/queries/jsx/injections.scm | 11 + runtime/queries/julia/folds.scm | 14 + runtime/queries/julia/highlights.scm | 372 +++++++++ runtime/queries/julia/indents.scm | 52 ++ runtime/queries/julia/injections.scm | 42 + runtime/queries/julia/locals.scm | 75 ++ runtime/queries/just/folds.scm | 6 + runtime/queries/just/highlights.scm | 149 ++++ runtime/queries/just/indents.scm | 14 + runtime/queries/just/injections.scm | 44 + runtime/queries/just/locals.scm | 35 + runtime/queries/kcl/folds.scm | 10 + runtime/queries/kcl/highlights.scm | 201 +++++ runtime/queries/kcl/injections.scm | 26 + runtime/queries/kconfig/folds.scm | 9 + runtime/queries/kconfig/highlights.scm | 105 +++ runtime/queries/kconfig/indents.scm | 12 + runtime/queries/kconfig/injections.scm | 2 + runtime/queries/kconfig/locals.scm | 24 + runtime/queries/kdl/folds.scm | 7 + runtime/queries/kdl/highlights.scm | 71 ++ runtime/queries/kdl/indents.scm | 14 + runtime/queries/kdl/injections.scm | 5 + runtime/queries/kdl/locals.scm | 16 + runtime/queries/kotlin/folds.scm | 13 + runtime/queries/kotlin/highlights.scm | 398 ++++++++++ runtime/queries/kotlin/injections.scm | 48 ++ runtime/queries/kotlin/locals.scm | 78 ++ runtime/queries/koto/folds.scm | 9 + runtime/queries/koto/highlights.scm | 138 ++++ runtime/queries/koto/injections.scm | 2 + runtime/queries/koto/locals.scm | 28 + runtime/queries/kusto/highlights.scm | 60 ++ runtime/queries/kusto/injections.scm | 2 + runtime/queries/lalrpop/folds.scm | 5 + runtime/queries/lalrpop/highlights.scm | 98 +++ runtime/queries/lalrpop/injections.scm | 15 + runtime/queries/lalrpop/locals.scm | 5 + runtime/queries/latex/folds.scm | 14 + runtime/queries/latex/highlights.scm | 342 ++++++++ runtime/queries/latex/injections.scm | 36 + runtime/queries/ledger/folds.scm | 1 + runtime/queries/ledger/highlights.scm | 54 ++ runtime/queries/ledger/indents.scm | 1 + runtime/queries/ledger/injections.scm | 5 + runtime/queries/leo/highlights.scm | 225 ++++++ runtime/queries/leo/indents.scm | 61 ++ runtime/queries/leo/injections.scm | 2 + runtime/queries/linkerscript/folds.scm | 6 + runtime/queries/linkerscript/highlights.scm | 173 ++++ runtime/queries/linkerscript/indents.scm | 11 + runtime/queries/linkerscript/injections.scm | 2 + runtime/queries/linkerscript/locals.scm | 16 + runtime/queries/liquid/highlights.scm | 134 ++++ runtime/queries/liquid/injections.scm | 27 + runtime/queries/liquidsoap/folds.scm | 21 + runtime/queries/liquidsoap/highlights.scm | 111 +++ runtime/queries/liquidsoap/indents.scm | 66 ++ runtime/queries/liquidsoap/injections.scm | 2 + runtime/queries/liquidsoap/locals.scm | 35 + runtime/queries/llvm/highlights.scm | 180 +++++ runtime/queries/llvm/injections.scm | 2 + runtime/queries/lua/folds.scm | 12 + runtime/queries/lua/highlights.scm | 265 +++++++ runtime/queries/lua/indents.scm | 47 ++ runtime/queries/lua/injections.scm | 202 +++++ runtime/queries/lua/locals.scm | 54 ++ runtime/queries/luadoc/highlights.scm | 198 +++++ runtime/queries/luap/highlights.scm | 45 ++ runtime/queries/luau/folds.scm | 3 + runtime/queries/luau/highlights.scm | 305 +++++++ runtime/queries/luau/indents.scm | 3 + runtime/queries/luau/injections.scm | 44 + runtime/queries/luau/locals.scm | 54 ++ runtime/queries/m68k/folds.scm | 1 + runtime/queries/m68k/highlights.scm | 81 ++ runtime/queries/m68k/injections.scm | 2 + runtime/queries/m68k/locals.scm | 26 + runtime/queries/make/folds.scm | 6 + runtime/queries/make/highlights.scm | 170 ++++ runtime/queries/make/injections.scm | 8 + runtime/queries/markdown/folds.scm | 12 + runtime/queries/markdown/highlights.scm | 123 +++ runtime/queries/markdown/indents.scm | 1 + runtime/queries/markdown/injections.scm | 26 + runtime/queries/markdown_inline/highlights.scm | 123 +++ runtime/queries/markdown_inline/injections.scm | 7 + runtime/queries/matlab/folds.scm | 13 + runtime/queries/matlab/highlights.scm | 216 +++++ runtime/queries/matlab/indents.scm | 40 + runtime/queries/matlab/injections.scm | 2 + runtime/queries/matlab/locals.scm | 33 + runtime/queries/menhir/highlights.scm | 73 ++ runtime/queries/menhir/injections.scm | 9 + runtime/queries/mermaid/folds.scm | 10 + runtime/queries/mermaid/highlights.scm | 249 ++++++ runtime/queries/mermaid/indents.scm | 18 + runtime/queries/mermaid/injections.scm | 2 + runtime/queries/meson/folds.scm | 9 + runtime/queries/meson/highlights.scm | 77 ++ runtime/queries/meson/indents.scm | 25 + runtime/queries/meson/injections.scm | 2 + runtime/queries/mlir/highlights.scm | 348 ++++++++ runtime/queries/mlir/injections.scm | 2 + runtime/queries/mlir/locals.scm | 12 + runtime/queries/muttrc/highlights.scm | 55 ++ runtime/queries/muttrc/injections.scm | 8 + runtime/queries/nasm/highlights.scm | 162 ++++ runtime/queries/nasm/injections.scm | 2 + runtime/queries/nginx/folds.scm | 1 + runtime/queries/nginx/highlights.scm | 59 ++ runtime/queries/nginx/injections.scm | 2 + runtime/queries/nickel/highlights.scm | 74 ++ runtime/queries/nickel/indents.scm | 13 + runtime/queries/nickel/injections.scm | 2 + runtime/queries/nim/folds.scm | 41 + runtime/queries/nim/highlights.scm | 926 ++++++++++++++++++++++ runtime/queries/nim/injections.scm | 79 ++ runtime/queries/nim/locals.scm | 328 ++++++++ runtime/queries/nim_format_string/highlights.scm | 20 + runtime/queries/nim_format_string/injections.scm | 4 + runtime/queries/ninja/folds.scm | 1 + runtime/queries/ninja/highlights.scm | 101 +++ runtime/queries/ninja/indents.scm | 5 + runtime/queries/ninja/injections.scm | 2 + runtime/queries/nix/folds.scm | 11 + runtime/queries/nix/highlights.scm | 210 +++++ runtime/queries/nix/indents.scm | 75 ++ runtime/queries/nix/injections.scm | 219 +++++ runtime/queries/nix/locals.scm | 34 + runtime/queries/nqc/folds.scm | 1 + runtime/queries/nqc/highlights.scm | 13 + runtime/queries/nqc/indents.scm | 1 + runtime/queries/nqc/injections.scm | 1 + runtime/queries/nqc/locals.scm | 1 + runtime/queries/nu/folds.scm | 11 + runtime/queries/nu/highlights.scm | 377 +++++++++ runtime/queries/nu/indents.scm | 27 + runtime/queries/nu/injections.scm | 5 + runtime/queries/objc/folds.scm | 20 + runtime/queries/objc/highlights.scm | 268 +++++++ runtime/queries/objc/indents.scm | 1 + runtime/queries/objc/injections.scm | 10 + runtime/queries/objc/locals.scm | 1 + runtime/queries/objdump/highlights.scm | 60 ++ runtime/queries/objdump/injections.scm | 6 + runtime/queries/ocaml/folds.scm | 30 + runtime/queries/ocaml/highlights.scm | 329 ++++++++ runtime/queries/ocaml/indents.scm | 77 ++ runtime/queries/ocaml/injections.scm | 2 + runtime/queries/ocaml/locals.scm | 87 ++ runtime/queries/ocaml_interface/folds.scm | 1 + runtime/queries/ocaml_interface/highlights.scm | 327 ++++++++ runtime/queries/ocaml_interface/indents.scm | 1 + runtime/queries/ocaml_interface/injections.scm | 1 + runtime/queries/ocaml_interface/locals.scm | 1 + runtime/queries/ocamllex/highlights.scm | 70 ++ runtime/queries/ocamllex/injections.scm | 5 + runtime/queries/odin/folds.scm | 7 + runtime/queries/odin/highlights.scm | 350 ++++++++ runtime/queries/odin/indents.scm | 46 ++ runtime/queries/odin/injections.scm | 2 + runtime/queries/odin/locals.scm | 63 ++ runtime/queries/pascal/folds.scm | 31 + runtime/queries/pascal/highlights.scm | 524 ++++++++++++ runtime/queries/pascal/indents.scm | 33 + runtime/queries/pascal/injections.scm | 5 + runtime/queries/pascal/locals.scm | 54 ++ runtime/queries/passwd/highlights.scm | 16 + runtime/queries/pem/folds.scm | 1 + runtime/queries/pem/highlights.scm | 12 + runtime/queries/pem/injections.scm | 2 + runtime/queries/perl/folds.scm | 36 + runtime/queries/perl/highlights.scm | 324 ++++++++ runtime/queries/perl/injections.scm | 15 + runtime/queries/php/folds.scm | 1 + runtime/queries/php/highlights.scm | 1 + runtime/queries/php/indents.scm | 1 + runtime/queries/php/injections.scm | 5 + runtime/queries/php/locals.scm | 1 + runtime/queries/php_only/folds.scm | 17 + runtime/queries/php_only/highlights.scm | 479 +++++++++++ runtime/queries/php_only/indents.scm | 68 ++ runtime/queries/php_only/injections.scm | 43 + runtime/queries/php_only/locals.scm | 84 ++ runtime/queries/phpdoc/highlights.scm | 72 ++ runtime/queries/pioasm/highlights.scm | 93 +++ runtime/queries/pioasm/injections.scm | 15 + runtime/queries/po/folds.scm | 8 + runtime/queries/po/highlights.scm | 32 + runtime/queries/po/injections.scm | 2 + runtime/queries/pod/highlights.scm | 76 ++ runtime/queries/poe_filter/folds.scm | 1 + runtime/queries/poe_filter/highlights.scm | 52 ++ runtime/queries/poe_filter/indents.scm | 5 + runtime/queries/poe_filter/injections.scm | 2 + runtime/queries/pony/folds.scm | 33 + runtime/queries/pony/highlights.scm | 333 ++++++++ runtime/queries/pony/indents.scm | 71 ++ runtime/queries/pony/injections.scm | 5 + runtime/queries/pony/locals.scm | 86 ++ runtime/queries/powershell/folds.scm | 13 + runtime/queries/powershell/highlights.scm | 333 ++++++++ runtime/queries/powershell/indents.scm | 41 + runtime/queries/powershell/injections.scm | 27 + runtime/queries/powershell/locals.scm | 85 ++ runtime/queries/printf/highlights.scm | 1 + runtime/queries/prisma/folds.scm | 7 + runtime/queries/prisma/highlights.scm | 47 ++ runtime/queries/prisma/injections.scm | 5 + runtime/queries/problog/folds.scm | 1 + runtime/queries/problog/highlights.scm | 4 + runtime/queries/problog/indents.scm | 1 + runtime/queries/problog/injections.scm | 1 + runtime/queries/prolog/folds.scm | 6 + runtime/queries/prolog/highlights.scm | 43 + runtime/queries/prolog/indents.scm | 16 + runtime/queries/prolog/injections.scm | 2 + runtime/queries/promql/highlights.scm | 55 ++ runtime/queries/promql/injections.scm | 11 + runtime/queries/properties/highlights.scm | 50 ++ runtime/queries/properties/injections.scm | 2 + runtime/queries/properties/locals.scm | 5 + runtime/queries/proto/folds.scm | 5 + runtime/queries/proto/highlights.scm | 82 ++ runtime/queries/proto/indents.scm | 11 + runtime/queries/proto/injections.scm | 2 + runtime/queries/prql/highlights.scm | 135 ++++ runtime/queries/prql/injections.scm | 13 + runtime/queries/psv/highlights.scm | 3 + runtime/queries/pug/highlights.scm | 116 +++ runtime/queries/pug/injections.scm | 11 + runtime/queries/puppet/folds.scm | 13 + runtime/queries/puppet/highlights.scm | 238 ++++++ runtime/queries/puppet/indents.scm | 23 + runtime/queries/puppet/injections.scm | 6 + runtime/queries/puppet/locals.scm | 64 ++ runtime/queries/purescript/highlights.scm | 196 +++++ runtime/queries/purescript/injections.scm | 2 + runtime/queries/purescript/locals.scm | 11 + runtime/queries/pymanifest/highlights.scm | 25 + runtime/queries/pymanifest/injections.scm | 2 + runtime/queries/python/folds.scm | 28 + runtime/queries/python/highlights.scm | 443 +++++++++++ runtime/queries/python/indents.scm | 213 +++++ runtime/queries/python/injections.scm | 18 + runtime/queries/python/locals.scm | 124 +++ runtime/queries/ql/folds.scm | 7 + runtime/queries/ql/highlights.scm | 154 ++++ runtime/queries/ql/indents.scm | 23 + runtime/queries/ql/injections.scm | 6 + runtime/queries/ql/locals.scm | 49 ++ runtime/queries/qmldir/highlights.scm | 20 + runtime/queries/qmldir/injections.scm | 2 + runtime/queries/qmljs/folds.scm | 8 + runtime/queries/qmljs/highlights.scm | 116 +++ runtime/queries/qmljs/injections.scm | 1 + runtime/queries/query/folds.scm | 6 + runtime/queries/query/highlights.scm | 102 +++ runtime/queries/query/indents.scm | 25 + runtime/queries/query/injections.scm | 28 + runtime/queries/query/locals.scm | 21 + runtime/queries/r/highlights.scm | 148 ++++ runtime/queries/r/indents.scm | 33 + runtime/queries/r/injections.scm | 2 + runtime/queries/r/locals.scm | 22 + runtime/queries/racket/folds.scm | 2 + runtime/queries/racket/highlights.scm | 685 ++++++++++++++++ runtime/queries/racket/injections.scm | 5 + runtime/queries/ralph/highlights.scm | 137 ++++ runtime/queries/ralph/injections.scm | 2 + runtime/queries/rasi/folds.scm | 5 + runtime/queries/rasi/highlights.scm | 138 ++++ runtime/queries/rasi/indents.scm | 6 + runtime/queries/rasi/injections.scm | 2 + runtime/queries/rasi/locals.scm | 10 + runtime/queries/razor/folds.scm | 14 + runtime/queries/razor/highlights.scm | 58 ++ runtime/queries/razor/injections.scm | 11 + runtime/queries/rbs/folds.scm | 5 + runtime/queries/rbs/highlights.scm | 162 ++++ runtime/queries/rbs/indents.scm | 24 + runtime/queries/rbs/injections.scm | 2 + runtime/queries/re2c/folds.scm | 4 + runtime/queries/re2c/highlights.scm | 183 +++++ runtime/queries/re2c/indents.scm | 11 + runtime/queries/re2c/injections.scm | 13 + runtime/queries/re2c/locals.scm | 1 + runtime/queries/readline/folds.scm | 1 + runtime/queries/readline/highlights.scm | 69 ++ runtime/queries/readline/indents.scm | 11 + runtime/queries/readline/injections.scm | 2 + runtime/queries/regex/highlights.scm | 53 ++ runtime/queries/rego/highlights.scm | 84 ++ runtime/queries/rego/injections.scm | 2 + runtime/queries/requirements/highlights.scm | 52 ++ runtime/queries/requirements/injections.scm | 2 + runtime/queries/rescript/folds.scm | 12 + runtime/queries/rescript/highlights.scm | 335 ++++++++ runtime/queries/rescript/indents.scm | 36 + runtime/queries/rescript/injections.scm | 33 + runtime/queries/rescript/locals.scm | 9 + runtime/queries/rnoweb/folds.scm | 1 + runtime/queries/rnoweb/highlights.scm | 1 + runtime/queries/rnoweb/injections.scm | 12 + runtime/queries/robot/folds.scm | 5 + runtime/queries/robot/highlights.scm | 129 +++ runtime/queries/robot/indents.scm | 44 + runtime/queries/robot/injections.scm | 5 + runtime/queries/robots/highlights.scm | 7 + runtime/queries/robots/injections.scm | 2 + runtime/queries/roc/highlights.scm | 175 ++++ runtime/queries/roc/indents.scm | 60 ++ runtime/queries/roc/injections.scm | 30 + runtime/queries/roc/locals.scm | 49 ++ runtime/queries/ron/folds.scm | 7 + runtime/queries/ron/highlights.scm | 62 ++ runtime/queries/ron/indents.scm | 21 + runtime/queries/ron/injections.scm | 5 + runtime/queries/ron/locals.scm | 25 + runtime/queries/rst/highlights.scm | 149 ++++ runtime/queries/rst/injections.scm | 72 ++ runtime/queries/rst/locals.scm | 38 + runtime/queries/ruby/folds.scm | 12 + runtime/queries/ruby/highlights.scm | 306 +++++++ runtime/queries/ruby/indents.scm | 43 + runtime/queries/ruby/injections.scm | 23 + runtime/queries/ruby/locals.scm | 93 +++ runtime/queries/runescript/highlights.scm | 119 +++ runtime/queries/runescript/injections.scm | 2 + runtime/queries/rust/folds.scm | 25 + runtime/queries/rust/highlights.scm | 531 +++++++++++++ runtime/queries/rust/indents.scm | 132 +++ runtime/queries/rust/injections.scm | 89 +++ runtime/queries/rust/locals.scm | 98 +++ runtime/queries/scala/folds.scm | 16 + runtime/queries/scala/highlights.scm | 311 ++++++++ runtime/queries/scala/injections.scm | 2 + runtime/queries/scala/locals.scm | 49 ++ runtime/queries/scfg/highlights.scm | 10 + runtime/queries/scfg/injections.scm | 2 + runtime/queries/scheme/folds.scm | 2 + runtime/queries/scheme/highlights.scm | 161 ++++ runtime/queries/scheme/injections.scm | 2 + runtime/queries/scss/folds.scm | 1 + runtime/queries/scss/highlights.scm | 87 ++ runtime/queries/scss/indents.scm | 7 + runtime/queries/scss/injections.scm | 2 + runtime/queries/sflog/highlights.scm | 48 ++ runtime/queries/slang/folds.scm | 9 + runtime/queries/slang/highlights.scm | 350 ++++++++ runtime/queries/slang/indents.scm | 6 + runtime/queries/slang/injections.scm | 5 + runtime/queries/slang/locals.scm | 1 + runtime/queries/slim/folds.scm | 1 + runtime/queries/slim/highlights.scm | 82 ++ runtime/queries/slim/indents.scm | 4 + runtime/queries/slim/injections.scm | 39 + runtime/queries/slim/locals.scm | 7 + runtime/queries/slint/folds.scm | 11 + runtime/queries/slint/highlights.scm | 263 ++++++ runtime/queries/slint/indents.scm | 26 + runtime/queries/slint/injections.scm | 2 + runtime/queries/slint/locals.scm | 117 +++ runtime/queries/smali/folds.scm | 12 + runtime/queries/smali/highlights.scm | 226 ++++++ runtime/queries/smali/indents.scm | 35 + runtime/queries/smali/injections.scm | 2 + runtime/queries/smali/locals.scm | 43 + runtime/queries/smithy/highlights.scm | 114 +++ runtime/queries/smithy/injections.scm | 5 + runtime/queries/snakemake/folds.scm | 8 + runtime/queries/snakemake/highlights.scm | 82 ++ runtime/queries/snakemake/indents.scm | 25 + runtime/queries/snakemake/injections.scm | 5 + runtime/queries/snakemake/locals.scm | 4 + runtime/queries/solidity/folds.scm | 20 + runtime/queries/solidity/highlights.scm | 315 ++++++++ runtime/queries/solidity/injections.scm | 2 + runtime/queries/soql/highlights.scm | 161 ++++ runtime/queries/sosl/highlights.scm | 30 + runtime/queries/sourcepawn/highlights.scm | 303 +++++++ runtime/queries/sourcepawn/injections.scm | 3 + runtime/queries/sourcepawn/locals.scm | 19 + runtime/queries/sparql/folds.scm | 26 + runtime/queries/sparql/highlights.scm | 249 ++++++ runtime/queries/sparql/indents.scm | 18 + runtime/queries/sparql/injections.scm | 8 + runtime/queries/sparql/locals.scm | 14 + runtime/queries/sql/folds.scm | 1 + runtime/queries/sql/highlights.scm | 427 ++++++++++ runtime/queries/sql/indents.scm | 29 + runtime/queries/sql/injections.scm | 5 + runtime/queries/squirrel/folds.scm | 23 + runtime/queries/squirrel/highlights.scm | 316 ++++++++ runtime/queries/squirrel/indents.scm | 63 ++ runtime/queries/squirrel/injections.scm | 12 + runtime/queries/squirrel/locals.scm | 75 ++ runtime/queries/ssh_config/folds.scm | 4 + runtime/queries/ssh_config/highlights.scm | 108 +++ runtime/queries/ssh_config/indents.scm | 12 + runtime/queries/ssh_config/injections.scm | 17 + runtime/queries/ssh_config/locals.scm | 7 + runtime/queries/starlark/folds.scm | 17 + runtime/queries/starlark/highlights.scm | 337 ++++++++ runtime/queries/starlark/indents.scm | 56 ++ runtime/queries/starlark/injections.scm | 1 + runtime/queries/starlark/locals.scm | 96 +++ runtime/queries/strace/highlights.scm | 56 ++ runtime/queries/strace/injections.scm | 2 + runtime/queries/styled/folds.scm | 1 + runtime/queries/styled/highlights.scm | 1 + runtime/queries/styled/indents.scm | 1 + runtime/queries/styled/injections.scm | 1 + runtime/queries/supercollider/folds.scm | 6 + runtime/queries/supercollider/highlights.scm | 103 +++ runtime/queries/supercollider/indents.scm | 33 + runtime/queries/supercollider/injections.scm | 5 + runtime/queries/supercollider/locals.scm | 29 + runtime/queries/superhtml/highlights.scm | 44 + runtime/queries/superhtml/injections.scm | 7 + runtime/queries/surface/folds.scm | 6 + runtime/queries/surface/highlights.scm | 44 + runtime/queries/surface/indents.scm | 14 + runtime/queries/surface/injections.scm | 10 + runtime/queries/svelte/folds.scm | 13 + runtime/queries/svelte/highlights.scm | 43 + runtime/queries/svelte/indents.scm | 34 + runtime/queries/svelte/injections.scm | 47 ++ runtime/queries/svelte/locals.scm | 1 + runtime/queries/sway/folds.scm | 20 + runtime/queries/sway/highlights.scm | 336 ++++++++ runtime/queries/sway/indents.scm | 95 +++ runtime/queries/sway/injections.scm | 5 + runtime/queries/sway/locals.scm | 16 + runtime/queries/swift/folds.scm | 35 + runtime/queries/swift/highlights.scm | 347 ++++++++ runtime/queries/swift/indents.scm | 122 +++ runtime/queries/swift/injections.scm | 5 + runtime/queries/swift/locals.scm | 21 + runtime/queries/sxhkdrc/folds.scm | 1 + runtime/queries/sxhkdrc/highlights.scm | 19 + runtime/queries/sxhkdrc/injections.scm | 5 + runtime/queries/systemtap/folds.scm | 18 + runtime/queries/systemtap/highlights.scm | 158 ++++ runtime/queries/systemtap/injections.scm | 5 + runtime/queries/systemtap/locals.scm | 35 + runtime/queries/t32/folds.scm | 1 + runtime/queries/t32/highlights.scm | 223 ++++++ runtime/queries/t32/indents.scm | 22 + runtime/queries/t32/injections.scm | 2 + runtime/queries/t32/locals.scm | 36 + runtime/queries/tablegen/folds.scm | 13 + runtime/queries/tablegen/highlights.scm | 159 ++++ runtime/queries/tablegen/indents.scm | 39 + runtime/queries/tablegen/injections.scm | 9 + runtime/queries/tablegen/locals.scm | 51 ++ runtime/queries/tact/folds.scm | 20 + runtime/queries/tact/highlights.scm | 342 ++++++++ runtime/queries/tact/indents.scm | 52 ++ runtime/queries/tact/injections.scm | 2 + runtime/queries/tact/locals.scm | 83 ++ runtime/queries/tcl/folds.scm | 1 + runtime/queries/tcl/highlights.scm | 114 +++ runtime/queries/tcl/indents.scm | 25 + runtime/queries/tcl/injections.scm | 2 + runtime/queries/teal/folds.scm | 13 + runtime/queries/teal/highlights.scm | 237 ++++++ runtime/queries/teal/indents.scm | 18 + runtime/queries/teal/injections.scm | 43 + runtime/queries/teal/locals.scm | 36 + runtime/queries/templ/folds.scm | 15 + runtime/queries/templ/highlights.scm | 60 ++ runtime/queries/templ/injections.scm | 13 + runtime/queries/tera/highlights.scm | 153 ++++ runtime/queries/tera/injections.scm | 7 + runtime/queries/terraform/folds.scm | 1 + runtime/queries/terraform/highlights.scm | 41 + runtime/queries/terraform/indents.scm | 1 + runtime/queries/terraform/injections.scm | 1 + runtime/queries/textproto/folds.scm | 5 + runtime/queries/textproto/highlights.scm | 23 + runtime/queries/textproto/indents.scm | 14 + runtime/queries/textproto/injections.scm | 2 + runtime/queries/thrift/folds.scm | 12 + runtime/queries/thrift/highlights.scm | 237 ++++++ runtime/queries/thrift/indents.scm | 23 + runtime/queries/thrift/injections.scm | 2 + runtime/queries/thrift/locals.scm | 70 ++ runtime/queries/tiger/folds.scm | 17 + runtime/queries/tiger/highlights.scm | 121 +++ runtime/queries/tiger/indents.scm | 104 +++ runtime/queries/tiger/injections.scm | 4 + runtime/queries/tiger/locals.scm | 39 + runtime/queries/tlaplus/folds.scm | 5 + runtime/queries/tlaplus/highlights.scm | 380 +++++++++ runtime/queries/tlaplus/injections.scm | 5 + runtime/queries/tlaplus/locals.scm | 167 ++++ runtime/queries/tmux/highlights.scm | 52 ++ runtime/queries/tmux/injections.scm | 5 + runtime/queries/todotxt/highlights.scm | 16 + runtime/queries/toml/folds.scm | 5 + runtime/queries/toml/highlights.scm | 39 + runtime/queries/toml/indents.scm | 11 + runtime/queries/toml/injections.scm | 2 + runtime/queries/toml/locals.scm | 4 + runtime/queries/tsv/highlights.scm | 7 + runtime/queries/tsx/folds.scm | 1 + runtime/queries/tsx/highlights.scm | 1 + runtime/queries/tsx/indents.scm | 1 + runtime/queries/tsx/injections.scm | 1 + runtime/queries/tsx/locals.scm | 1 + runtime/queries/turtle/folds.scm | 5 + runtime/queries/turtle/highlights.scm | 62 ++ runtime/queries/turtle/indents.scm | 11 + runtime/queries/turtle/injections.scm | 2 + runtime/queries/turtle/locals.scm | 12 + runtime/queries/twig/highlights.scm | 81 ++ runtime/queries/twig/injections.scm | 6 + runtime/queries/typescript/folds.scm | 8 + runtime/queries/typescript/highlights.scm | 208 +++++ runtime/queries/typescript/indents.scm | 7 + runtime/queries/typescript/injections.scm | 1 + runtime/queries/typescript/locals.scm | 31 + runtime/queries/typespec/highlights.scm | 135 ++++ runtime/queries/typespec/indents.scm | 18 + runtime/queries/typespec/injections.scm | 5 + runtime/queries/typoscript/folds.scm | 1 + runtime/queries/typoscript/highlights.scm | 47 ++ runtime/queries/typoscript/indents.scm | 5 + runtime/queries/typoscript/injections.scm | 2 + runtime/queries/typst/folds.scm | 11 + runtime/queries/typst/highlights.scm | 131 +++ runtime/queries/typst/indents.scm | 12 + runtime/queries/typst/injections.scm | 2 + runtime/queries/udev/highlights.scm | 67 ++ runtime/queries/udev/injections.scm | 14 + runtime/queries/udev/locals.scm | 29 + runtime/queries/ungrammar/folds.scm | 1 + runtime/queries/ungrammar/highlights.scm | 26 + runtime/queries/ungrammar/indents.scm | 6 + runtime/queries/ungrammar/injections.scm | 2 + runtime/queries/ungrammar/locals.scm | 8 + runtime/queries/unison/folds.scm | 10 + runtime/queries/unison/highlights.scm | 125 +++ runtime/queries/unison/injections.scm | 2 + runtime/queries/usd/folds.scm | 1 + runtime/queries/usd/highlights.scm | 154 ++++ runtime/queries/usd/indents.scm | 42 + runtime/queries/usd/injections.scm | 2 + runtime/queries/usd/locals.scm | 4 + runtime/queries/uxntal/folds.scm | 6 + runtime/queries/uxntal/highlights.scm | 87 ++ runtime/queries/uxntal/indents.scm | 23 + runtime/queries/uxntal/injections.scm | 2 + runtime/queries/uxntal/locals.scm | 21 + runtime/queries/v/folds.scm | 8 + runtime/queries/v/highlights.scm | 300 +++++++ runtime/queries/v/indents.scm | 20 + runtime/queries/v/injections.scm | 23 + runtime/queries/v/locals.scm | 37 + runtime/queries/vala/folds.scm | 11 + runtime/queries/vala/highlights.scm | 346 ++++++++ runtime/queries/vala/injections.scm | 2 + runtime/queries/vento/highlights.scm | 13 + runtime/queries/vento/injections.scm | 9 + runtime/queries/verilog/folds.scm | 23 + runtime/queries/verilog/highlights.scm | 605 ++++++++++++++ runtime/queries/verilog/injections.scm | 2 + runtime/queries/vhdl/folds.scm | 46 ++ runtime/queries/vhdl/highlights.scm | 428 ++++++++++ runtime/queries/vhdl/injections.scm | 7 + runtime/queries/vhs/highlights.scm | 52 ++ runtime/queries/vhs/injections.scm | 2 + runtime/queries/vim/folds.scm | 4 + runtime/queries/vim/highlights.scm | 354 +++++++++ runtime/queries/vim/injections.scm | 44 + runtime/queries/vim/locals.scm | 19 + runtime/queries/vimdoc/highlights.scm | 74 ++ runtime/queries/vimdoc/injections.scm | 4 + runtime/queries/vrl/folds.scm | 6 + runtime/queries/vrl/highlights.scm | 108 +++ runtime/queries/vrl/indents.scm | 24 + runtime/queries/vrl/injections.scm | 6 + runtime/queries/vrl/locals.scm | 16 + runtime/queries/vue/folds.scm | 6 + runtime/queries/vue/highlights.scm | 43 + runtime/queries/vue/indents.scm | 7 + runtime/queries/vue/injections.scm | 77 ++ runtime/queries/wgsl/folds.scm | 10 + runtime/queries/wgsl/highlights.scm | 127 +++ runtime/queries/wgsl/indents.scm | 43 + runtime/queries/wgsl/injections.scm | 5 + runtime/queries/wgsl_bevy/folds.scm | 2 + runtime/queries/wgsl_bevy/highlights.scm | 44 + runtime/queries/wgsl_bevy/indents.scm | 7 + runtime/queries/wing/folds.scm | 17 + runtime/queries/wing/highlights.scm | 179 +++++ runtime/queries/wing/injections.scm | 15 + runtime/queries/wing/locals.scm | 6 + runtime/queries/wit/folds.scm | 12 + runtime/queries/wit/highlights.scm | 166 ++++ runtime/queries/wit/injections.scm | 2 + runtime/queries/xcompose/highlights.scm | 38 + runtime/queries/xcompose/injections.scm | 2 + runtime/queries/xcompose/locals.scm | 5 + runtime/queries/xml/folds.scm | 5 + runtime/queries/xml/highlights.scm | 199 +++++ runtime/queries/xml/indents.scm | 16 + runtime/queries/xml/injections.scm | 32 + runtime/queries/xml/locals.scm | 35 + runtime/queries/xresources/folds.scm | 10 + runtime/queries/xresources/highlights.scm | 75 ++ runtime/queries/xresources/injections.scm | 5 + runtime/queries/xresources/locals.scm | 12 + runtime/queries/yaml/folds.scm | 4 + runtime/queries/yaml/highlights.scm | 99 +++ runtime/queries/yaml/indents.scm | 7 + runtime/queries/yaml/injections.scm | 81 ++ runtime/queries/yaml/locals.scm | 9 + runtime/queries/yang/folds.scm | 1 + runtime/queries/yang/highlights.scm | 79 ++ runtime/queries/yang/indents.scm | 20 + runtime/queries/yang/injections.scm | 10 + runtime/queries/yuck/folds.scm | 9 + runtime/queries/yuck/highlights.scm | 154 ++++ runtime/queries/yuck/indents.scm | 30 + runtime/queries/yuck/injections.scm | 26 + runtime/queries/yuck/locals.scm | 21 + runtime/queries/zathurarc/highlights.scm | 36 + runtime/queries/zathurarc/injections.scm | 9 + runtime/queries/zig/folds.scm | 23 + runtime/queries/zig/highlights.scm | 283 +++++++ runtime/queries/zig/indents.scm | 28 + runtime/queries/zig/injections.scm | 10 + runtime/queries/zig/locals.scm | 96 +++ runtime/queries/ziggy/highlights.scm | 41 + runtime/queries/ziggy/indents.scm | 10 + runtime/queries/ziggy_schema/highlights.scm | 38 + runtime/queries/ziggy_schema/indents.scm | 3 + 1152 files changed, 64147 insertions(+) create mode 100644 runtime/queries/ada/folds.scm create mode 100644 runtime/queries/ada/highlights.scm create mode 100644 runtime/queries/ada/injections.scm create mode 100644 runtime/queries/ada/locals.scm create mode 100644 runtime/queries/agda/folds.scm create mode 100644 runtime/queries/agda/highlights.scm create mode 100644 runtime/queries/agda/injections.scm create mode 100644 runtime/queries/angular/folds.scm create mode 100644 runtime/queries/angular/highlights.scm create mode 100644 runtime/queries/angular/indents.scm create mode 100644 runtime/queries/angular/injections.scm create mode 100644 runtime/queries/angular/locals.scm create mode 100644 runtime/queries/apex/folds.scm create mode 100644 runtime/queries/apex/highlights.scm create mode 100644 runtime/queries/apex/injections.scm create mode 100644 runtime/queries/apex/locals.scm create mode 100644 runtime/queries/arduino/folds.scm create mode 100644 runtime/queries/arduino/highlights.scm create mode 100644 runtime/queries/arduino/indents.scm create mode 100644 runtime/queries/arduino/injections.scm create mode 100644 runtime/queries/arduino/locals.scm create mode 100644 runtime/queries/asm/highlights.scm create mode 100644 runtime/queries/asm/injections.scm create mode 100644 runtime/queries/astro/folds.scm create mode 100644 runtime/queries/astro/highlights.scm create mode 100644 runtime/queries/astro/indents.scm create mode 100644 runtime/queries/astro/injections.scm create mode 100644 runtime/queries/astro/locals.scm create mode 100644 runtime/queries/authzed/highlights.scm create mode 100644 runtime/queries/authzed/injections.scm create mode 100644 runtime/queries/awk/highlights.scm create mode 100644 runtime/queries/awk/injections.scm create mode 100644 runtime/queries/bash/folds.scm create mode 100644 runtime/queries/bash/highlights.scm create mode 100644 runtime/queries/bash/injections.scm create mode 100644 runtime/queries/bash/locals.scm create mode 100644 runtime/queries/bass/folds.scm create mode 100644 runtime/queries/bass/highlights.scm create mode 100644 runtime/queries/bass/indents.scm create mode 100644 runtime/queries/bass/injections.scm create mode 100644 runtime/queries/bass/locals.scm create mode 100644 runtime/queries/beancount/folds.scm create mode 100644 runtime/queries/beancount/highlights.scm create mode 100644 runtime/queries/beancount/injections.scm create mode 100644 runtime/queries/bibtex/folds.scm create mode 100644 runtime/queries/bibtex/highlights.scm create mode 100644 runtime/queries/bibtex/indents.scm create mode 100644 runtime/queries/bibtex/injections.scm create mode 100644 runtime/queries/bicep/folds.scm create mode 100644 runtime/queries/bicep/highlights.scm create mode 100644 runtime/queries/bicep/indents.scm create mode 100644 runtime/queries/bicep/injections.scm create mode 100644 runtime/queries/bicep/locals.scm create mode 100644 runtime/queries/bitbake/folds.scm create mode 100644 runtime/queries/bitbake/highlights.scm create mode 100644 runtime/queries/bitbake/indents.scm create mode 100644 runtime/queries/bitbake/injections.scm create mode 100644 runtime/queries/bitbake/locals.scm create mode 100644 runtime/queries/blade/folds.scm create mode 100644 runtime/queries/blade/highlights.scm create mode 100644 runtime/queries/blade/indents.scm create mode 100644 runtime/queries/blade/injections.scm create mode 100644 runtime/queries/blueprint/highlights.scm create mode 100644 runtime/queries/blueprint/injections.scm create mode 100644 runtime/queries/bp/folds.scm create mode 100644 runtime/queries/bp/highlights.scm create mode 100644 runtime/queries/bp/indents.scm create mode 100644 runtime/queries/bp/injections.scm create mode 100644 runtime/queries/bp/locals.scm create mode 100644 runtime/queries/brightscript/folds.scm create mode 100644 runtime/queries/brightscript/highlights.scm create mode 100644 runtime/queries/brightscript/indents.scm create mode 100644 runtime/queries/brightscript/injections.scm create mode 100644 runtime/queries/c/folds.scm create mode 100644 runtime/queries/c/highlights.scm create mode 100644 runtime/queries/c/indents.scm create mode 100644 runtime/queries/c/injections.scm create mode 100644 runtime/queries/c/locals.scm create mode 100644 runtime/queries/c_sharp/folds.scm create mode 100644 runtime/queries/c_sharp/highlights.scm create mode 100644 runtime/queries/c_sharp/injections.scm create mode 100644 runtime/queries/c_sharp/locals.scm create mode 100644 runtime/queries/caddy/folds.scm create mode 100644 runtime/queries/caddy/highlights.scm create mode 100644 runtime/queries/caddy/indents.scm create mode 100644 runtime/queries/caddy/injections.scm create mode 100644 runtime/queries/cairo/folds.scm create mode 100644 runtime/queries/cairo/highlights.scm create mode 100644 runtime/queries/cairo/indents.scm create mode 100644 runtime/queries/cairo/injections.scm create mode 100644 runtime/queries/cairo/locals.scm create mode 100644 runtime/queries/capnp/folds.scm create mode 100644 runtime/queries/capnp/highlights.scm create mode 100644 runtime/queries/capnp/indents.scm create mode 100644 runtime/queries/capnp/injections.scm create mode 100644 runtime/queries/capnp/locals.scm create mode 100644 runtime/queries/chatito/folds.scm create mode 100644 runtime/queries/chatito/highlights.scm create mode 100644 runtime/queries/chatito/indents.scm create mode 100644 runtime/queries/chatito/injections.scm create mode 100644 runtime/queries/chatito/locals.scm create mode 100644 runtime/queries/circom/folds.scm create mode 100644 runtime/queries/circom/highlights.scm create mode 100644 runtime/queries/circom/injections.scm create mode 100644 runtime/queries/circom/locals.scm create mode 100644 runtime/queries/clojure/folds.scm create mode 100644 runtime/queries/clojure/highlights.scm create mode 100644 runtime/queries/clojure/injections.scm create mode 100644 runtime/queries/clojure/locals.scm create mode 100644 runtime/queries/cmake/folds.scm create mode 100644 runtime/queries/cmake/highlights.scm create mode 100644 runtime/queries/cmake/indents.scm create mode 100644 runtime/queries/cmake/injections.scm create mode 100644 runtime/queries/comment/highlights.scm create mode 100644 runtime/queries/commonlisp/folds.scm create mode 100644 runtime/queries/commonlisp/highlights.scm create mode 100644 runtime/queries/commonlisp/injections.scm create mode 100644 runtime/queries/commonlisp/locals.scm create mode 100644 runtime/queries/cooklang/highlights.scm create mode 100644 runtime/queries/cooklang/injections.scm create mode 100644 runtime/queries/corn/folds.scm create mode 100644 runtime/queries/corn/highlights.scm create mode 100644 runtime/queries/corn/indents.scm create mode 100644 runtime/queries/corn/injections.scm create mode 100644 runtime/queries/corn/locals.scm create mode 100644 runtime/queries/cpon/folds.scm create mode 100644 runtime/queries/cpon/highlights.scm create mode 100644 runtime/queries/cpon/indents.scm create mode 100644 runtime/queries/cpon/injections.scm create mode 100644 runtime/queries/cpon/locals.scm create mode 100644 runtime/queries/cpp/folds.scm create mode 100644 runtime/queries/cpp/highlights.scm create mode 100644 runtime/queries/cpp/indents.scm create mode 100644 runtime/queries/cpp/injections.scm create mode 100644 runtime/queries/cpp/locals.scm create mode 100644 runtime/queries/css/folds.scm create mode 100644 runtime/queries/css/highlights.scm create mode 100644 runtime/queries/css/indents.scm create mode 100644 runtime/queries/css/injections.scm create mode 100644 runtime/queries/csv/highlights.scm create mode 100644 runtime/queries/cuda/folds.scm create mode 100644 runtime/queries/cuda/highlights.scm create mode 100644 runtime/queries/cuda/indents.scm create mode 100644 runtime/queries/cuda/injections.scm create mode 100644 runtime/queries/cuda/locals.scm create mode 100644 runtime/queries/cue/folds.scm create mode 100644 runtime/queries/cue/highlights.scm create mode 100644 runtime/queries/cue/indents.scm create mode 100644 runtime/queries/cue/injections.scm create mode 100644 runtime/queries/cue/locals.scm create mode 100644 runtime/queries/cylc/folds.scm create mode 100644 runtime/queries/cylc/highlights.scm create mode 100644 runtime/queries/cylc/indents.scm create mode 100644 runtime/queries/cylc/injections.scm create mode 100644 runtime/queries/d/folds.scm create mode 100644 runtime/queries/d/highlights.scm create mode 100644 runtime/queries/d/indents.scm create mode 100644 runtime/queries/d/injections.scm create mode 100644 runtime/queries/d/locals.scm create mode 100644 runtime/queries/dart/folds.scm create mode 100644 runtime/queries/dart/highlights.scm create mode 100644 runtime/queries/dart/indents.scm create mode 100644 runtime/queries/dart/injections.scm create mode 100644 runtime/queries/dart/locals.scm create mode 100644 runtime/queries/desktop/folds.scm create mode 100644 runtime/queries/desktop/highlights.scm create mode 100644 runtime/queries/desktop/injections.scm create mode 100644 runtime/queries/devicetree/folds.scm create mode 100644 runtime/queries/devicetree/highlights.scm create mode 100644 runtime/queries/devicetree/indents.scm create mode 100644 runtime/queries/devicetree/injections.scm create mode 100644 runtime/queries/devicetree/locals.scm create mode 100644 runtime/queries/dhall/folds.scm create mode 100644 runtime/queries/dhall/highlights.scm create mode 100644 runtime/queries/dhall/injections.scm create mode 100644 runtime/queries/diff/folds.scm create mode 100644 runtime/queries/diff/highlights.scm create mode 100644 runtime/queries/diff/injections.scm create mode 100644 runtime/queries/disassembly/highlights.scm create mode 100644 runtime/queries/disassembly/injections.scm create mode 100644 runtime/queries/djot/folds.scm create mode 100644 runtime/queries/djot/highlights.scm create mode 100644 runtime/queries/djot/indents.scm create mode 100644 runtime/queries/djot/injections.scm create mode 100644 runtime/queries/djot/locals.scm create mode 100644 runtime/queries/dockerfile/highlights.scm create mode 100644 runtime/queries/dockerfile/injections.scm create mode 100644 runtime/queries/dot/highlights.scm create mode 100644 runtime/queries/dot/indents.scm create mode 100644 runtime/queries/dot/injections.scm create mode 100644 runtime/queries/doxygen/highlights.scm create mode 100644 runtime/queries/doxygen/indents.scm create mode 100644 runtime/queries/doxygen/injections.scm create mode 100644 runtime/queries/dtd/folds.scm create mode 100644 runtime/queries/dtd/highlights.scm create mode 100644 runtime/queries/dtd/injections.scm create mode 100644 runtime/queries/dtd/locals.scm create mode 100644 runtime/queries/earthfile/highlights.scm create mode 100644 runtime/queries/earthfile/injections.scm create mode 100644 runtime/queries/ebnf/highlights.scm create mode 100644 runtime/queries/ebnf/injections.scm create mode 100644 runtime/queries/ecma/folds.scm create mode 100644 runtime/queries/ecma/highlights.scm create mode 100644 runtime/queries/ecma/indents.scm create mode 100644 runtime/queries/ecma/injections.scm create mode 100644 runtime/queries/ecma/locals.scm create mode 100644 runtime/queries/editorconfig/folds.scm create mode 100644 runtime/queries/editorconfig/highlights.scm create mode 100644 runtime/queries/editorconfig/injections.scm create mode 100644 runtime/queries/eds/folds.scm create mode 100644 runtime/queries/eds/highlights.scm create mode 100644 runtime/queries/eex/highlights.scm create mode 100644 runtime/queries/eex/injections.scm create mode 100644 runtime/queries/elixir/folds.scm create mode 100644 runtime/queries/elixir/highlights.scm create mode 100644 runtime/queries/elixir/indents.scm create mode 100644 runtime/queries/elixir/injections.scm create mode 100644 runtime/queries/elixir/locals.scm create mode 100644 runtime/queries/elm/folds.scm create mode 100644 runtime/queries/elm/highlights.scm create mode 100644 runtime/queries/elm/injections.scm create mode 100644 runtime/queries/elsa/folds.scm create mode 100644 runtime/queries/elsa/highlights.scm create mode 100644 runtime/queries/elsa/indents.scm create mode 100644 runtime/queries/elsa/injections.scm create mode 100644 runtime/queries/elsa/locals.scm create mode 100644 runtime/queries/elvish/highlights.scm create mode 100644 runtime/queries/elvish/injections.scm create mode 100644 runtime/queries/embedded_template/highlights.scm create mode 100644 runtime/queries/embedded_template/injections.scm create mode 100644 runtime/queries/enforce/folds.scm create mode 100644 runtime/queries/enforce/highlights.scm create mode 100644 runtime/queries/enforce/indents.scm create mode 100644 runtime/queries/enforce/injections.scm create mode 100644 runtime/queries/enforce/locals.scm create mode 100644 runtime/queries/erlang/folds.scm create mode 100644 runtime/queries/erlang/highlights.scm create mode 100644 runtime/queries/erlang/injections.scm create mode 100644 runtime/queries/facility/folds.scm create mode 100644 runtime/queries/facility/highlights.scm create mode 100644 runtime/queries/facility/indents.scm create mode 100644 runtime/queries/facility/injections.scm create mode 100644 runtime/queries/faust/highlights.scm create mode 100644 runtime/queries/faust/injections.scm create mode 100644 runtime/queries/fennel/folds.scm create mode 100644 runtime/queries/fennel/highlights.scm create mode 100644 runtime/queries/fennel/injections.scm create mode 100644 runtime/queries/fennel/locals.scm create mode 100644 runtime/queries/fidl/folds.scm create mode 100644 runtime/queries/fidl/highlights.scm create mode 100644 runtime/queries/fidl/injections.scm create mode 100644 runtime/queries/firrtl/folds.scm create mode 100644 runtime/queries/firrtl/highlights.scm create mode 100644 runtime/queries/firrtl/indents.scm create mode 100644 runtime/queries/firrtl/injections.scm create mode 100644 runtime/queries/firrtl/locals.scm create mode 100644 runtime/queries/fish/folds.scm create mode 100644 runtime/queries/fish/highlights.scm create mode 100644 runtime/queries/fish/indents.scm create mode 100644 runtime/queries/fish/injections.scm create mode 100644 runtime/queries/fish/locals.scm create mode 100644 runtime/queries/foam/folds.scm create mode 100644 runtime/queries/foam/highlights.scm create mode 100644 runtime/queries/foam/indents.scm create mode 100644 runtime/queries/foam/injections.scm create mode 100644 runtime/queries/foam/locals.scm create mode 100644 runtime/queries/forth/folds.scm create mode 100644 runtime/queries/forth/highlights.scm create mode 100644 runtime/queries/forth/indents.scm create mode 100644 runtime/queries/forth/injections.scm create mode 100644 runtime/queries/forth/locals.scm create mode 100644 runtime/queries/fortran/folds.scm create mode 100644 runtime/queries/fortran/highlights.scm create mode 100644 runtime/queries/fortran/indents.scm create mode 100644 runtime/queries/fortran/injections.scm create mode 100644 runtime/queries/fsh/highlights.scm create mode 100644 runtime/queries/fsh/injections.scm create mode 100644 runtime/queries/fsharp/highlights.scm create mode 100644 runtime/queries/fsharp/injections.scm create mode 100644 runtime/queries/func/highlights.scm create mode 100644 runtime/queries/func/injections.scm create mode 100644 runtime/queries/fusion/folds.scm create mode 100644 runtime/queries/fusion/highlights.scm create mode 100644 runtime/queries/fusion/indents.scm create mode 100644 runtime/queries/fusion/injections.scm create mode 100644 runtime/queries/fusion/locals.scm create mode 100644 runtime/queries/gap/folds.scm create mode 100644 runtime/queries/gap/highlights.scm create mode 100644 runtime/queries/gap/injections.scm create mode 100644 runtime/queries/gap/locals.scm create mode 100644 runtime/queries/gaptst/folds.scm create mode 100644 runtime/queries/gaptst/highlights.scm create mode 100644 runtime/queries/gaptst/injections.scm create mode 100644 runtime/queries/gdscript/folds.scm create mode 100644 runtime/queries/gdscript/highlights.scm create mode 100644 runtime/queries/gdscript/indents.scm create mode 100644 runtime/queries/gdscript/injections.scm create mode 100644 runtime/queries/gdscript/locals.scm create mode 100644 runtime/queries/gdshader/highlights.scm create mode 100644 runtime/queries/gdshader/injections.scm create mode 100644 runtime/queries/git_config/folds.scm create mode 100644 runtime/queries/git_config/highlights.scm create mode 100644 runtime/queries/git_config/injections.scm create mode 100644 runtime/queries/git_rebase/highlights.scm create mode 100644 runtime/queries/git_rebase/injections.scm create mode 100644 runtime/queries/gitattributes/highlights.scm create mode 100644 runtime/queries/gitattributes/injections.scm create mode 100644 runtime/queries/gitattributes/locals.scm create mode 100644 runtime/queries/gitcommit/highlights.scm create mode 100644 runtime/queries/gitcommit/injections.scm create mode 100644 runtime/queries/gitignore/highlights.scm create mode 100644 runtime/queries/gitignore/injections.scm create mode 100644 runtime/queries/gleam/folds.scm create mode 100644 runtime/queries/gleam/highlights.scm create mode 100644 runtime/queries/gleam/indents.scm create mode 100644 runtime/queries/gleam/injections.scm create mode 100644 runtime/queries/gleam/locals.scm create mode 100644 runtime/queries/glimmer/folds.scm create mode 100644 runtime/queries/glimmer/highlights.scm create mode 100644 runtime/queries/glimmer/indents.scm create mode 100644 runtime/queries/glimmer/injections.scm create mode 100644 runtime/queries/glimmer/locals.scm create mode 100644 runtime/queries/glimmer_javascript/highlights.scm create mode 100644 runtime/queries/glimmer_javascript/indents.scm create mode 100644 runtime/queries/glimmer_javascript/injections.scm create mode 100644 runtime/queries/glimmer_javascript/locals.scm create mode 100644 runtime/queries/glimmer_typescript/highlights.scm create mode 100644 runtime/queries/glimmer_typescript/indents.scm create mode 100644 runtime/queries/glimmer_typescript/injections.scm create mode 100644 runtime/queries/glsl/folds.scm create mode 100644 runtime/queries/glsl/highlights.scm create mode 100644 runtime/queries/glsl/indents.scm create mode 100644 runtime/queries/glsl/injections.scm create mode 100644 runtime/queries/glsl/locals.scm create mode 100644 runtime/queries/gn/folds.scm create mode 100644 runtime/queries/gn/highlights.scm create mode 100644 runtime/queries/gn/indents.scm create mode 100644 runtime/queries/gn/injections.scm create mode 100644 runtime/queries/gn/locals.scm create mode 100644 runtime/queries/gnuplot/highlights.scm create mode 100644 runtime/queries/gnuplot/injections.scm create mode 100644 runtime/queries/go/folds.scm create mode 100644 runtime/queries/go/highlights.scm create mode 100644 runtime/queries/go/indents.scm create mode 100644 runtime/queries/go/injections.scm create mode 100644 runtime/queries/go/locals.scm create mode 100644 runtime/queries/goctl/folds.scm create mode 100644 runtime/queries/goctl/highlights.scm create mode 100644 runtime/queries/goctl/indents.scm create mode 100644 runtime/queries/goctl/injections.scm create mode 100644 runtime/queries/godot_resource/folds.scm create mode 100644 runtime/queries/godot_resource/highlights.scm create mode 100644 runtime/queries/godot_resource/injections.scm create mode 100644 runtime/queries/godot_resource/locals.scm create mode 100644 runtime/queries/gomod/highlights.scm create mode 100644 runtime/queries/gomod/injections.scm create mode 100644 runtime/queries/gosum/highlights.scm create mode 100644 runtime/queries/gotmpl/folds.scm create mode 100644 runtime/queries/gotmpl/highlights.scm create mode 100644 runtime/queries/gotmpl/injections.scm create mode 100644 runtime/queries/gotmpl/locals.scm create mode 100644 runtime/queries/gowork/highlights.scm create mode 100644 runtime/queries/gowork/injections.scm create mode 100644 runtime/queries/gpg/highlights.scm create mode 100644 runtime/queries/gpg/injections.scm create mode 100644 runtime/queries/graphql/highlights.scm create mode 100644 runtime/queries/graphql/indents.scm create mode 100644 runtime/queries/graphql/injections.scm create mode 100644 runtime/queries/gren/highlights.scm create mode 100644 runtime/queries/gren/injections.scm create mode 100644 runtime/queries/groovy/folds.scm create mode 100644 runtime/queries/groovy/highlights.scm create mode 100644 runtime/queries/groovy/indents.scm create mode 100644 runtime/queries/groovy/injections.scm create mode 100644 runtime/queries/groovy/locals.scm create mode 100644 runtime/queries/gstlaunch/highlights.scm create mode 100644 runtime/queries/hack/highlights.scm create mode 100644 runtime/queries/hack/injections.scm create mode 100644 runtime/queries/hare/folds.scm create mode 100644 runtime/queries/hare/highlights.scm create mode 100644 runtime/queries/hare/indents.scm create mode 100644 runtime/queries/hare/injections.scm create mode 100644 runtime/queries/hare/locals.scm create mode 100644 runtime/queries/haskell/folds.scm create mode 100644 runtime/queries/haskell/highlights.scm create mode 100644 runtime/queries/haskell/injections.scm create mode 100644 runtime/queries/haskell/locals.scm create mode 100644 runtime/queries/haskell_persistent/folds.scm create mode 100644 runtime/queries/haskell_persistent/highlights.scm create mode 100644 runtime/queries/hcl/folds.scm create mode 100644 runtime/queries/hcl/highlights.scm create mode 100644 runtime/queries/hcl/indents.scm create mode 100644 runtime/queries/hcl/injections.scm create mode 100644 runtime/queries/heex/folds.scm create mode 100644 runtime/queries/heex/highlights.scm create mode 100644 runtime/queries/heex/indents.scm create mode 100644 runtime/queries/heex/injections.scm create mode 100644 runtime/queries/heex/locals.scm create mode 100644 runtime/queries/helm/folds.scm create mode 100644 runtime/queries/helm/highlights.scm create mode 100644 runtime/queries/helm/injections.scm create mode 100644 runtime/queries/helm/locals.scm create mode 100644 runtime/queries/hjson/folds.scm create mode 100644 runtime/queries/hjson/highlights.scm create mode 100644 runtime/queries/hjson/indents.scm create mode 100644 runtime/queries/hjson/injections.scm create mode 100644 runtime/queries/hjson/locals.scm create mode 100644 runtime/queries/hlsl/folds.scm create mode 100644 runtime/queries/hlsl/highlights.scm create mode 100644 runtime/queries/hlsl/indents.scm create mode 100644 runtime/queries/hlsl/injections.scm create mode 100644 runtime/queries/hlsl/locals.scm create mode 100644 runtime/queries/hlsplaylist/highlights.scm create mode 100644 runtime/queries/hlsplaylist/injections.scm create mode 100644 runtime/queries/hocon/folds.scm create mode 100644 runtime/queries/hocon/highlights.scm create mode 100644 runtime/queries/hocon/injections.scm create mode 100644 runtime/queries/hoon/folds.scm create mode 100644 runtime/queries/hoon/highlights.scm create mode 100644 runtime/queries/hoon/injections.scm create mode 100644 runtime/queries/hoon/locals.scm create mode 100644 runtime/queries/html/folds.scm create mode 100644 runtime/queries/html/highlights.scm create mode 100644 runtime/queries/html/indents.scm create mode 100644 runtime/queries/html/injections.scm create mode 100644 runtime/queries/html/locals.scm create mode 100644 runtime/queries/html_tags/highlights.scm create mode 100644 runtime/queries/html_tags/indents.scm create mode 100644 runtime/queries/html_tags/injections.scm create mode 100644 runtime/queries/htmldjango/folds.scm create mode 100644 runtime/queries/htmldjango/highlights.scm create mode 100644 runtime/queries/htmldjango/indents.scm create mode 100644 runtime/queries/htmldjango/injections.scm create mode 100644 runtime/queries/http/folds.scm create mode 100644 runtime/queries/http/highlights.scm create mode 100644 runtime/queries/http/injections.scm create mode 100644 runtime/queries/hurl/folds.scm create mode 100644 runtime/queries/hurl/highlights.scm create mode 100644 runtime/queries/hurl/indents.scm create mode 100644 runtime/queries/hurl/injections.scm create mode 100644 runtime/queries/hyprlang/folds.scm create mode 100644 runtime/queries/hyprlang/highlights.scm create mode 100644 runtime/queries/hyprlang/indents.scm create mode 100644 runtime/queries/hyprlang/injections.scm create mode 100644 runtime/queries/idl/highlights.scm create mode 100644 runtime/queries/idl/indents.scm create mode 100644 runtime/queries/idl/injections.scm create mode 100644 runtime/queries/idris/folds.scm create mode 100644 runtime/queries/idris/highlights.scm create mode 100644 runtime/queries/idris/injections.scm create mode 100644 runtime/queries/idris/locals.scm create mode 100644 runtime/queries/ini/folds.scm create mode 100644 runtime/queries/ini/highlights.scm create mode 100644 runtime/queries/ini/injections.scm create mode 100644 runtime/queries/inko/folds.scm create mode 100644 runtime/queries/inko/highlights.scm create mode 100644 runtime/queries/inko/indents.scm create mode 100644 runtime/queries/inko/injections.scm create mode 100644 runtime/queries/inko/locals.scm create mode 100644 runtime/queries/ipkg/folds.scm create mode 100644 runtime/queries/ipkg/highlights.scm create mode 100644 runtime/queries/ipkg/indents.scm create mode 100644 runtime/queries/ipkg/injections.scm create mode 100644 runtime/queries/ipkg/locals.scm create mode 100644 runtime/queries/ispc/folds.scm create mode 100644 runtime/queries/ispc/highlights.scm create mode 100644 runtime/queries/ispc/indents.scm create mode 100644 runtime/queries/ispc/injections.scm create mode 100644 runtime/queries/ispc/locals.scm create mode 100644 runtime/queries/janet_simple/folds.scm create mode 100644 runtime/queries/janet_simple/highlights.scm create mode 100644 runtime/queries/janet_simple/injections.scm create mode 100644 runtime/queries/janet_simple/locals.scm create mode 100644 runtime/queries/java/folds.scm create mode 100644 runtime/queries/java/highlights.scm create mode 100644 runtime/queries/java/indents.scm create mode 100644 runtime/queries/java/injections.scm create mode 100644 runtime/queries/java/locals.scm create mode 100644 runtime/queries/javadoc/highlights.scm create mode 100644 runtime/queries/javadoc/indents.scm create mode 100644 runtime/queries/javadoc/injections.scm create mode 100644 runtime/queries/javascript/folds.scm create mode 100644 runtime/queries/javascript/highlights.scm create mode 100644 runtime/queries/javascript/indents.scm create mode 100644 runtime/queries/javascript/injections.scm create mode 100644 runtime/queries/javascript/locals.scm create mode 100644 runtime/queries/jinja/highlights.scm create mode 100644 runtime/queries/jinja/injections.scm create mode 100644 runtime/queries/jinja_inline/highlights.scm create mode 100644 runtime/queries/jinja_inline/injections.scm create mode 100644 runtime/queries/jq/highlights.scm create mode 100644 runtime/queries/jq/injections.scm create mode 100644 runtime/queries/jq/locals.scm create mode 100644 runtime/queries/jsdoc/highlights.scm create mode 100644 runtime/queries/json/folds.scm create mode 100644 runtime/queries/json/highlights.scm create mode 100644 runtime/queries/json/indents.scm create mode 100644 runtime/queries/json/locals.scm create mode 100644 runtime/queries/json5/highlights.scm create mode 100644 runtime/queries/json5/injections.scm create mode 100644 runtime/queries/jsonc/folds.scm create mode 100644 runtime/queries/jsonc/highlights.scm create mode 100644 runtime/queries/jsonc/indents.scm create mode 100644 runtime/queries/jsonc/injections.scm create mode 100644 runtime/queries/jsonc/locals.scm create mode 100644 runtime/queries/jsonnet/folds.scm create mode 100644 runtime/queries/jsonnet/highlights.scm create mode 100644 runtime/queries/jsonnet/injections.scm create mode 100644 runtime/queries/jsonnet/locals.scm create mode 100644 runtime/queries/jsx/folds.scm create mode 100644 runtime/queries/jsx/highlights.scm create mode 100644 runtime/queries/jsx/indents.scm create mode 100644 runtime/queries/jsx/injections.scm create mode 100644 runtime/queries/julia/folds.scm create mode 100644 runtime/queries/julia/highlights.scm create mode 100644 runtime/queries/julia/indents.scm create mode 100644 runtime/queries/julia/injections.scm create mode 100644 runtime/queries/julia/locals.scm create mode 100644 runtime/queries/just/folds.scm create mode 100644 runtime/queries/just/highlights.scm create mode 100644 runtime/queries/just/indents.scm create mode 100644 runtime/queries/just/injections.scm create mode 100644 runtime/queries/just/locals.scm create mode 100644 runtime/queries/kcl/folds.scm create mode 100644 runtime/queries/kcl/highlights.scm create mode 100644 runtime/queries/kcl/injections.scm create mode 100644 runtime/queries/kconfig/folds.scm create mode 100644 runtime/queries/kconfig/highlights.scm create mode 100644 runtime/queries/kconfig/indents.scm create mode 100644 runtime/queries/kconfig/injections.scm create mode 100644 runtime/queries/kconfig/locals.scm create mode 100644 runtime/queries/kdl/folds.scm create mode 100644 runtime/queries/kdl/highlights.scm create mode 100644 runtime/queries/kdl/indents.scm create mode 100644 runtime/queries/kdl/injections.scm create mode 100644 runtime/queries/kdl/locals.scm create mode 100644 runtime/queries/kotlin/folds.scm create mode 100644 runtime/queries/kotlin/highlights.scm create mode 100644 runtime/queries/kotlin/injections.scm create mode 100644 runtime/queries/kotlin/locals.scm create mode 100644 runtime/queries/koto/folds.scm create mode 100644 runtime/queries/koto/highlights.scm create mode 100644 runtime/queries/koto/injections.scm create mode 100644 runtime/queries/koto/locals.scm create mode 100644 runtime/queries/kusto/highlights.scm create mode 100644 runtime/queries/kusto/injections.scm create mode 100644 runtime/queries/lalrpop/folds.scm create mode 100644 runtime/queries/lalrpop/highlights.scm create mode 100644 runtime/queries/lalrpop/injections.scm create mode 100644 runtime/queries/lalrpop/locals.scm create mode 100644 runtime/queries/latex/folds.scm create mode 100644 runtime/queries/latex/highlights.scm create mode 100644 runtime/queries/latex/injections.scm create mode 100644 runtime/queries/ledger/folds.scm create mode 100644 runtime/queries/ledger/highlights.scm create mode 100644 runtime/queries/ledger/indents.scm create mode 100644 runtime/queries/ledger/injections.scm create mode 100644 runtime/queries/leo/highlights.scm create mode 100644 runtime/queries/leo/indents.scm create mode 100644 runtime/queries/leo/injections.scm create mode 100644 runtime/queries/linkerscript/folds.scm create mode 100644 runtime/queries/linkerscript/highlights.scm create mode 100644 runtime/queries/linkerscript/indents.scm create mode 100644 runtime/queries/linkerscript/injections.scm create mode 100644 runtime/queries/linkerscript/locals.scm create mode 100644 runtime/queries/liquid/highlights.scm create mode 100644 runtime/queries/liquid/injections.scm create mode 100644 runtime/queries/liquidsoap/folds.scm create mode 100644 runtime/queries/liquidsoap/highlights.scm create mode 100644 runtime/queries/liquidsoap/indents.scm create mode 100644 runtime/queries/liquidsoap/injections.scm create mode 100644 runtime/queries/liquidsoap/locals.scm create mode 100644 runtime/queries/llvm/highlights.scm create mode 100644 runtime/queries/llvm/injections.scm create mode 100644 runtime/queries/lua/folds.scm create mode 100644 runtime/queries/lua/highlights.scm create mode 100644 runtime/queries/lua/indents.scm create mode 100644 runtime/queries/lua/injections.scm create mode 100644 runtime/queries/lua/locals.scm create mode 100644 runtime/queries/luadoc/highlights.scm create mode 100644 runtime/queries/luap/highlights.scm create mode 100644 runtime/queries/luau/folds.scm create mode 100644 runtime/queries/luau/highlights.scm create mode 100644 runtime/queries/luau/indents.scm create mode 100644 runtime/queries/luau/injections.scm create mode 100644 runtime/queries/luau/locals.scm create mode 100644 runtime/queries/m68k/folds.scm create mode 100644 runtime/queries/m68k/highlights.scm create mode 100644 runtime/queries/m68k/injections.scm create mode 100644 runtime/queries/m68k/locals.scm create mode 100644 runtime/queries/make/folds.scm create mode 100644 runtime/queries/make/highlights.scm create mode 100644 runtime/queries/make/injections.scm create mode 100644 runtime/queries/markdown/folds.scm create mode 100644 runtime/queries/markdown/highlights.scm create mode 100644 runtime/queries/markdown/indents.scm create mode 100644 runtime/queries/markdown/injections.scm create mode 100644 runtime/queries/markdown_inline/highlights.scm create mode 100644 runtime/queries/markdown_inline/injections.scm create mode 100644 runtime/queries/matlab/folds.scm create mode 100644 runtime/queries/matlab/highlights.scm create mode 100644 runtime/queries/matlab/indents.scm create mode 100644 runtime/queries/matlab/injections.scm create mode 100644 runtime/queries/matlab/locals.scm create mode 100644 runtime/queries/menhir/highlights.scm create mode 100644 runtime/queries/menhir/injections.scm create mode 100644 runtime/queries/mermaid/folds.scm create mode 100644 runtime/queries/mermaid/highlights.scm create mode 100644 runtime/queries/mermaid/indents.scm create mode 100644 runtime/queries/mermaid/injections.scm create mode 100644 runtime/queries/meson/folds.scm create mode 100644 runtime/queries/meson/highlights.scm create mode 100644 runtime/queries/meson/indents.scm create mode 100644 runtime/queries/meson/injections.scm create mode 100644 runtime/queries/mlir/highlights.scm create mode 100644 runtime/queries/mlir/injections.scm create mode 100644 runtime/queries/mlir/locals.scm create mode 100644 runtime/queries/muttrc/highlights.scm create mode 100644 runtime/queries/muttrc/injections.scm create mode 100644 runtime/queries/nasm/highlights.scm create mode 100644 runtime/queries/nasm/injections.scm create mode 100644 runtime/queries/nginx/folds.scm create mode 100644 runtime/queries/nginx/highlights.scm create mode 100644 runtime/queries/nginx/injections.scm create mode 100644 runtime/queries/nickel/highlights.scm create mode 100644 runtime/queries/nickel/indents.scm create mode 100644 runtime/queries/nickel/injections.scm create mode 100644 runtime/queries/nim/folds.scm create mode 100644 runtime/queries/nim/highlights.scm create mode 100644 runtime/queries/nim/injections.scm create mode 100644 runtime/queries/nim/locals.scm create mode 100644 runtime/queries/nim_format_string/highlights.scm create mode 100644 runtime/queries/nim_format_string/injections.scm create mode 100644 runtime/queries/ninja/folds.scm create mode 100644 runtime/queries/ninja/highlights.scm create mode 100644 runtime/queries/ninja/indents.scm create mode 100644 runtime/queries/ninja/injections.scm create mode 100644 runtime/queries/nix/folds.scm create mode 100644 runtime/queries/nix/highlights.scm create mode 100644 runtime/queries/nix/indents.scm create mode 100644 runtime/queries/nix/injections.scm create mode 100644 runtime/queries/nix/locals.scm create mode 100644 runtime/queries/nqc/folds.scm create mode 100644 runtime/queries/nqc/highlights.scm create mode 100644 runtime/queries/nqc/indents.scm create mode 100644 runtime/queries/nqc/injections.scm create mode 100644 runtime/queries/nqc/locals.scm create mode 100644 runtime/queries/nu/folds.scm create mode 100644 runtime/queries/nu/highlights.scm create mode 100644 runtime/queries/nu/indents.scm create mode 100644 runtime/queries/nu/injections.scm create mode 100644 runtime/queries/objc/folds.scm create mode 100644 runtime/queries/objc/highlights.scm create mode 100644 runtime/queries/objc/indents.scm create mode 100644 runtime/queries/objc/injections.scm create mode 100644 runtime/queries/objc/locals.scm create mode 100644 runtime/queries/objdump/highlights.scm create mode 100644 runtime/queries/objdump/injections.scm create mode 100644 runtime/queries/ocaml/folds.scm create mode 100644 runtime/queries/ocaml/highlights.scm create mode 100644 runtime/queries/ocaml/indents.scm create mode 100644 runtime/queries/ocaml/injections.scm create mode 100644 runtime/queries/ocaml/locals.scm create mode 100644 runtime/queries/ocaml_interface/folds.scm create mode 100644 runtime/queries/ocaml_interface/highlights.scm create mode 100644 runtime/queries/ocaml_interface/indents.scm create mode 100644 runtime/queries/ocaml_interface/injections.scm create mode 100644 runtime/queries/ocaml_interface/locals.scm create mode 100644 runtime/queries/ocamllex/highlights.scm create mode 100644 runtime/queries/ocamllex/injections.scm create mode 100644 runtime/queries/odin/folds.scm create mode 100644 runtime/queries/odin/highlights.scm create mode 100644 runtime/queries/odin/indents.scm create mode 100644 runtime/queries/odin/injections.scm create mode 100644 runtime/queries/odin/locals.scm create mode 100644 runtime/queries/pascal/folds.scm create mode 100644 runtime/queries/pascal/highlights.scm create mode 100644 runtime/queries/pascal/indents.scm create mode 100644 runtime/queries/pascal/injections.scm create mode 100644 runtime/queries/pascal/locals.scm create mode 100644 runtime/queries/passwd/highlights.scm create mode 100644 runtime/queries/pem/folds.scm create mode 100644 runtime/queries/pem/highlights.scm create mode 100644 runtime/queries/pem/injections.scm create mode 100644 runtime/queries/perl/folds.scm create mode 100644 runtime/queries/perl/highlights.scm create mode 100644 runtime/queries/perl/injections.scm create mode 100644 runtime/queries/php/folds.scm create mode 100644 runtime/queries/php/highlights.scm create mode 100644 runtime/queries/php/indents.scm create mode 100644 runtime/queries/php/injections.scm create mode 100644 runtime/queries/php/locals.scm create mode 100644 runtime/queries/php_only/folds.scm create mode 100644 runtime/queries/php_only/highlights.scm create mode 100644 runtime/queries/php_only/indents.scm create mode 100644 runtime/queries/php_only/injections.scm create mode 100644 runtime/queries/php_only/locals.scm create mode 100644 runtime/queries/phpdoc/highlights.scm create mode 100644 runtime/queries/pioasm/highlights.scm create mode 100644 runtime/queries/pioasm/injections.scm create mode 100644 runtime/queries/po/folds.scm create mode 100644 runtime/queries/po/highlights.scm create mode 100644 runtime/queries/po/injections.scm create mode 100644 runtime/queries/pod/highlights.scm create mode 100644 runtime/queries/poe_filter/folds.scm create mode 100644 runtime/queries/poe_filter/highlights.scm create mode 100644 runtime/queries/poe_filter/indents.scm create mode 100644 runtime/queries/poe_filter/injections.scm create mode 100644 runtime/queries/pony/folds.scm create mode 100644 runtime/queries/pony/highlights.scm create mode 100644 runtime/queries/pony/indents.scm create mode 100644 runtime/queries/pony/injections.scm create mode 100644 runtime/queries/pony/locals.scm create mode 100644 runtime/queries/powershell/folds.scm create mode 100644 runtime/queries/powershell/highlights.scm create mode 100644 runtime/queries/powershell/indents.scm create mode 100644 runtime/queries/powershell/injections.scm create mode 100644 runtime/queries/powershell/locals.scm create mode 100644 runtime/queries/printf/highlights.scm create mode 100644 runtime/queries/prisma/folds.scm create mode 100644 runtime/queries/prisma/highlights.scm create mode 100644 runtime/queries/prisma/injections.scm create mode 100644 runtime/queries/problog/folds.scm create mode 100644 runtime/queries/problog/highlights.scm create mode 100644 runtime/queries/problog/indents.scm create mode 100644 runtime/queries/problog/injections.scm create mode 100644 runtime/queries/prolog/folds.scm create mode 100644 runtime/queries/prolog/highlights.scm create mode 100644 runtime/queries/prolog/indents.scm create mode 100644 runtime/queries/prolog/injections.scm create mode 100644 runtime/queries/promql/highlights.scm create mode 100644 runtime/queries/promql/injections.scm create mode 100644 runtime/queries/properties/highlights.scm create mode 100644 runtime/queries/properties/injections.scm create mode 100644 runtime/queries/properties/locals.scm create mode 100644 runtime/queries/proto/folds.scm create mode 100644 runtime/queries/proto/highlights.scm create mode 100644 runtime/queries/proto/indents.scm create mode 100644 runtime/queries/proto/injections.scm create mode 100644 runtime/queries/prql/highlights.scm create mode 100644 runtime/queries/prql/injections.scm create mode 100644 runtime/queries/psv/highlights.scm create mode 100644 runtime/queries/pug/highlights.scm create mode 100644 runtime/queries/pug/injections.scm create mode 100644 runtime/queries/puppet/folds.scm create mode 100644 runtime/queries/puppet/highlights.scm create mode 100644 runtime/queries/puppet/indents.scm create mode 100644 runtime/queries/puppet/injections.scm create mode 100644 runtime/queries/puppet/locals.scm create mode 100644 runtime/queries/purescript/highlights.scm create mode 100644 runtime/queries/purescript/injections.scm create mode 100644 runtime/queries/purescript/locals.scm create mode 100644 runtime/queries/pymanifest/highlights.scm create mode 100644 runtime/queries/pymanifest/injections.scm create mode 100644 runtime/queries/python/folds.scm create mode 100644 runtime/queries/python/highlights.scm create mode 100644 runtime/queries/python/indents.scm create mode 100644 runtime/queries/python/injections.scm create mode 100644 runtime/queries/python/locals.scm create mode 100644 runtime/queries/ql/folds.scm create mode 100644 runtime/queries/ql/highlights.scm create mode 100644 runtime/queries/ql/indents.scm create mode 100644 runtime/queries/ql/injections.scm create mode 100644 runtime/queries/ql/locals.scm create mode 100644 runtime/queries/qmldir/highlights.scm create mode 100644 runtime/queries/qmldir/injections.scm create mode 100644 runtime/queries/qmljs/folds.scm create mode 100644 runtime/queries/qmljs/highlights.scm create mode 100644 runtime/queries/qmljs/injections.scm create mode 100644 runtime/queries/query/folds.scm create mode 100644 runtime/queries/query/highlights.scm create mode 100644 runtime/queries/query/indents.scm create mode 100644 runtime/queries/query/injections.scm create mode 100644 runtime/queries/query/locals.scm create mode 100644 runtime/queries/r/highlights.scm create mode 100644 runtime/queries/r/indents.scm create mode 100644 runtime/queries/r/injections.scm create mode 100644 runtime/queries/r/locals.scm create mode 100644 runtime/queries/racket/folds.scm create mode 100644 runtime/queries/racket/highlights.scm create mode 100644 runtime/queries/racket/injections.scm create mode 100644 runtime/queries/ralph/highlights.scm create mode 100644 runtime/queries/ralph/injections.scm create mode 100644 runtime/queries/rasi/folds.scm create mode 100644 runtime/queries/rasi/highlights.scm create mode 100644 runtime/queries/rasi/indents.scm create mode 100644 runtime/queries/rasi/injections.scm create mode 100644 runtime/queries/rasi/locals.scm create mode 100644 runtime/queries/razor/folds.scm create mode 100644 runtime/queries/razor/highlights.scm create mode 100644 runtime/queries/razor/injections.scm create mode 100644 runtime/queries/rbs/folds.scm create mode 100644 runtime/queries/rbs/highlights.scm create mode 100644 runtime/queries/rbs/indents.scm create mode 100644 runtime/queries/rbs/injections.scm create mode 100644 runtime/queries/re2c/folds.scm create mode 100644 runtime/queries/re2c/highlights.scm create mode 100644 runtime/queries/re2c/indents.scm create mode 100644 runtime/queries/re2c/injections.scm create mode 100644 runtime/queries/re2c/locals.scm create mode 100644 runtime/queries/readline/folds.scm create mode 100644 runtime/queries/readline/highlights.scm create mode 100644 runtime/queries/readline/indents.scm create mode 100644 runtime/queries/readline/injections.scm create mode 100644 runtime/queries/regex/highlights.scm create mode 100644 runtime/queries/rego/highlights.scm create mode 100644 runtime/queries/rego/injections.scm create mode 100644 runtime/queries/requirements/highlights.scm create mode 100644 runtime/queries/requirements/injections.scm create mode 100644 runtime/queries/rescript/folds.scm create mode 100644 runtime/queries/rescript/highlights.scm create mode 100644 runtime/queries/rescript/indents.scm create mode 100644 runtime/queries/rescript/injections.scm create mode 100644 runtime/queries/rescript/locals.scm create mode 100644 runtime/queries/rnoweb/folds.scm create mode 100644 runtime/queries/rnoweb/highlights.scm create mode 100644 runtime/queries/rnoweb/injections.scm create mode 100644 runtime/queries/robot/folds.scm create mode 100644 runtime/queries/robot/highlights.scm create mode 100644 runtime/queries/robot/indents.scm create mode 100644 runtime/queries/robot/injections.scm create mode 100644 runtime/queries/robots/highlights.scm create mode 100644 runtime/queries/robots/injections.scm create mode 100644 runtime/queries/roc/highlights.scm create mode 100644 runtime/queries/roc/indents.scm create mode 100644 runtime/queries/roc/injections.scm create mode 100644 runtime/queries/roc/locals.scm create mode 100644 runtime/queries/ron/folds.scm create mode 100644 runtime/queries/ron/highlights.scm create mode 100644 runtime/queries/ron/indents.scm create mode 100644 runtime/queries/ron/injections.scm create mode 100644 runtime/queries/ron/locals.scm create mode 100644 runtime/queries/rst/highlights.scm create mode 100644 runtime/queries/rst/injections.scm create mode 100644 runtime/queries/rst/locals.scm create mode 100644 runtime/queries/ruby/folds.scm create mode 100644 runtime/queries/ruby/highlights.scm create mode 100644 runtime/queries/ruby/indents.scm create mode 100644 runtime/queries/ruby/injections.scm create mode 100644 runtime/queries/ruby/locals.scm create mode 100644 runtime/queries/runescript/highlights.scm create mode 100644 runtime/queries/runescript/injections.scm create mode 100644 runtime/queries/rust/folds.scm create mode 100644 runtime/queries/rust/highlights.scm create mode 100644 runtime/queries/rust/indents.scm create mode 100644 runtime/queries/rust/injections.scm create mode 100644 runtime/queries/rust/locals.scm create mode 100644 runtime/queries/scala/folds.scm create mode 100644 runtime/queries/scala/highlights.scm create mode 100644 runtime/queries/scala/injections.scm create mode 100644 runtime/queries/scala/locals.scm create mode 100644 runtime/queries/scfg/highlights.scm create mode 100644 runtime/queries/scfg/injections.scm create mode 100644 runtime/queries/scheme/folds.scm create mode 100644 runtime/queries/scheme/highlights.scm create mode 100644 runtime/queries/scheme/injections.scm create mode 100644 runtime/queries/scss/folds.scm create mode 100644 runtime/queries/scss/highlights.scm create mode 100644 runtime/queries/scss/indents.scm create mode 100644 runtime/queries/scss/injections.scm create mode 100644 runtime/queries/sflog/highlights.scm create mode 100644 runtime/queries/slang/folds.scm create mode 100644 runtime/queries/slang/highlights.scm create mode 100644 runtime/queries/slang/indents.scm create mode 100644 runtime/queries/slang/injections.scm create mode 100644 runtime/queries/slang/locals.scm create mode 100644 runtime/queries/slim/folds.scm create mode 100644 runtime/queries/slim/highlights.scm create mode 100644 runtime/queries/slim/indents.scm create mode 100644 runtime/queries/slim/injections.scm create mode 100644 runtime/queries/slim/locals.scm create mode 100644 runtime/queries/slint/folds.scm create mode 100644 runtime/queries/slint/highlights.scm create mode 100644 runtime/queries/slint/indents.scm create mode 100644 runtime/queries/slint/injections.scm create mode 100644 runtime/queries/slint/locals.scm create mode 100644 runtime/queries/smali/folds.scm create mode 100644 runtime/queries/smali/highlights.scm create mode 100644 runtime/queries/smali/indents.scm create mode 100644 runtime/queries/smali/injections.scm create mode 100644 runtime/queries/smali/locals.scm create mode 100644 runtime/queries/smithy/highlights.scm create mode 100644 runtime/queries/smithy/injections.scm create mode 100644 runtime/queries/snakemake/folds.scm create mode 100644 runtime/queries/snakemake/highlights.scm create mode 100644 runtime/queries/snakemake/indents.scm create mode 100644 runtime/queries/snakemake/injections.scm create mode 100644 runtime/queries/snakemake/locals.scm create mode 100644 runtime/queries/solidity/folds.scm create mode 100644 runtime/queries/solidity/highlights.scm create mode 100644 runtime/queries/solidity/injections.scm create mode 100644 runtime/queries/soql/highlights.scm create mode 100644 runtime/queries/sosl/highlights.scm create mode 100644 runtime/queries/sourcepawn/highlights.scm create mode 100644 runtime/queries/sourcepawn/injections.scm create mode 100644 runtime/queries/sourcepawn/locals.scm create mode 100644 runtime/queries/sparql/folds.scm create mode 100644 runtime/queries/sparql/highlights.scm create mode 100644 runtime/queries/sparql/indents.scm create mode 100644 runtime/queries/sparql/injections.scm create mode 100644 runtime/queries/sparql/locals.scm create mode 100644 runtime/queries/sql/folds.scm create mode 100644 runtime/queries/sql/highlights.scm create mode 100644 runtime/queries/sql/indents.scm create mode 100644 runtime/queries/sql/injections.scm create mode 100644 runtime/queries/squirrel/folds.scm create mode 100644 runtime/queries/squirrel/highlights.scm create mode 100644 runtime/queries/squirrel/indents.scm create mode 100644 runtime/queries/squirrel/injections.scm create mode 100644 runtime/queries/squirrel/locals.scm create mode 100644 runtime/queries/ssh_config/folds.scm create mode 100644 runtime/queries/ssh_config/highlights.scm create mode 100644 runtime/queries/ssh_config/indents.scm create mode 100644 runtime/queries/ssh_config/injections.scm create mode 100644 runtime/queries/ssh_config/locals.scm create mode 100644 runtime/queries/starlark/folds.scm create mode 100644 runtime/queries/starlark/highlights.scm create mode 100644 runtime/queries/starlark/indents.scm create mode 100644 runtime/queries/starlark/injections.scm create mode 100644 runtime/queries/starlark/locals.scm create mode 100644 runtime/queries/strace/highlights.scm create mode 100644 runtime/queries/strace/injections.scm create mode 100644 runtime/queries/styled/folds.scm create mode 100644 runtime/queries/styled/highlights.scm create mode 100644 runtime/queries/styled/indents.scm create mode 100644 runtime/queries/styled/injections.scm create mode 100644 runtime/queries/supercollider/folds.scm create mode 100644 runtime/queries/supercollider/highlights.scm create mode 100644 runtime/queries/supercollider/indents.scm create mode 100644 runtime/queries/supercollider/injections.scm create mode 100644 runtime/queries/supercollider/locals.scm create mode 100644 runtime/queries/superhtml/highlights.scm create mode 100644 runtime/queries/superhtml/injections.scm create mode 100644 runtime/queries/surface/folds.scm create mode 100644 runtime/queries/surface/highlights.scm create mode 100644 runtime/queries/surface/indents.scm create mode 100644 runtime/queries/surface/injections.scm create mode 100644 runtime/queries/svelte/folds.scm create mode 100644 runtime/queries/svelte/highlights.scm create mode 100644 runtime/queries/svelte/indents.scm create mode 100644 runtime/queries/svelte/injections.scm create mode 100644 runtime/queries/svelte/locals.scm create mode 100644 runtime/queries/sway/folds.scm create mode 100644 runtime/queries/sway/highlights.scm create mode 100644 runtime/queries/sway/indents.scm create mode 100644 runtime/queries/sway/injections.scm create mode 100644 runtime/queries/sway/locals.scm create mode 100644 runtime/queries/swift/folds.scm create mode 100644 runtime/queries/swift/highlights.scm create mode 100644 runtime/queries/swift/indents.scm create mode 100644 runtime/queries/swift/injections.scm create mode 100644 runtime/queries/swift/locals.scm create mode 100644 runtime/queries/sxhkdrc/folds.scm create mode 100644 runtime/queries/sxhkdrc/highlights.scm create mode 100644 runtime/queries/sxhkdrc/injections.scm create mode 100644 runtime/queries/systemtap/folds.scm create mode 100644 runtime/queries/systemtap/highlights.scm create mode 100644 runtime/queries/systemtap/injections.scm create mode 100644 runtime/queries/systemtap/locals.scm create mode 100644 runtime/queries/t32/folds.scm create mode 100644 runtime/queries/t32/highlights.scm create mode 100644 runtime/queries/t32/indents.scm create mode 100644 runtime/queries/t32/injections.scm create mode 100644 runtime/queries/t32/locals.scm create mode 100644 runtime/queries/tablegen/folds.scm create mode 100644 runtime/queries/tablegen/highlights.scm create mode 100644 runtime/queries/tablegen/indents.scm create mode 100644 runtime/queries/tablegen/injections.scm create mode 100644 runtime/queries/tablegen/locals.scm create mode 100644 runtime/queries/tact/folds.scm create mode 100644 runtime/queries/tact/highlights.scm create mode 100644 runtime/queries/tact/indents.scm create mode 100644 runtime/queries/tact/injections.scm create mode 100644 runtime/queries/tact/locals.scm create mode 100644 runtime/queries/tcl/folds.scm create mode 100644 runtime/queries/tcl/highlights.scm create mode 100644 runtime/queries/tcl/indents.scm create mode 100644 runtime/queries/tcl/injections.scm create mode 100644 runtime/queries/teal/folds.scm create mode 100644 runtime/queries/teal/highlights.scm create mode 100644 runtime/queries/teal/indents.scm create mode 100644 runtime/queries/teal/injections.scm create mode 100644 runtime/queries/teal/locals.scm create mode 100644 runtime/queries/templ/folds.scm create mode 100644 runtime/queries/templ/highlights.scm create mode 100644 runtime/queries/templ/injections.scm create mode 100644 runtime/queries/tera/highlights.scm create mode 100644 runtime/queries/tera/injections.scm create mode 100644 runtime/queries/terraform/folds.scm create mode 100644 runtime/queries/terraform/highlights.scm create mode 100644 runtime/queries/terraform/indents.scm create mode 100644 runtime/queries/terraform/injections.scm create mode 100644 runtime/queries/textproto/folds.scm create mode 100644 runtime/queries/textproto/highlights.scm create mode 100644 runtime/queries/textproto/indents.scm create mode 100644 runtime/queries/textproto/injections.scm create mode 100644 runtime/queries/thrift/folds.scm create mode 100644 runtime/queries/thrift/highlights.scm create mode 100644 runtime/queries/thrift/indents.scm create mode 100644 runtime/queries/thrift/injections.scm create mode 100644 runtime/queries/thrift/locals.scm create mode 100644 runtime/queries/tiger/folds.scm create mode 100644 runtime/queries/tiger/highlights.scm create mode 100644 runtime/queries/tiger/indents.scm create mode 100644 runtime/queries/tiger/injections.scm create mode 100644 runtime/queries/tiger/locals.scm create mode 100644 runtime/queries/tlaplus/folds.scm create mode 100644 runtime/queries/tlaplus/highlights.scm create mode 100644 runtime/queries/tlaplus/injections.scm create mode 100644 runtime/queries/tlaplus/locals.scm create mode 100644 runtime/queries/tmux/highlights.scm create mode 100644 runtime/queries/tmux/injections.scm create mode 100644 runtime/queries/todotxt/highlights.scm create mode 100644 runtime/queries/toml/folds.scm create mode 100644 runtime/queries/toml/highlights.scm create mode 100644 runtime/queries/toml/indents.scm create mode 100644 runtime/queries/toml/injections.scm create mode 100644 runtime/queries/toml/locals.scm create mode 100644 runtime/queries/tsv/highlights.scm create mode 100644 runtime/queries/tsx/folds.scm create mode 100644 runtime/queries/tsx/highlights.scm create mode 100644 runtime/queries/tsx/indents.scm create mode 100644 runtime/queries/tsx/injections.scm create mode 100644 runtime/queries/tsx/locals.scm create mode 100644 runtime/queries/turtle/folds.scm create mode 100644 runtime/queries/turtle/highlights.scm create mode 100644 runtime/queries/turtle/indents.scm create mode 100644 runtime/queries/turtle/injections.scm create mode 100644 runtime/queries/turtle/locals.scm create mode 100644 runtime/queries/twig/highlights.scm create mode 100644 runtime/queries/twig/injections.scm create mode 100644 runtime/queries/typescript/folds.scm create mode 100644 runtime/queries/typescript/highlights.scm create mode 100644 runtime/queries/typescript/indents.scm create mode 100644 runtime/queries/typescript/injections.scm create mode 100644 runtime/queries/typescript/locals.scm create mode 100644 runtime/queries/typespec/highlights.scm create mode 100644 runtime/queries/typespec/indents.scm create mode 100644 runtime/queries/typespec/injections.scm create mode 100644 runtime/queries/typoscript/folds.scm create mode 100644 runtime/queries/typoscript/highlights.scm create mode 100644 runtime/queries/typoscript/indents.scm create mode 100644 runtime/queries/typoscript/injections.scm create mode 100644 runtime/queries/typst/folds.scm create mode 100644 runtime/queries/typst/highlights.scm create mode 100644 runtime/queries/typst/indents.scm create mode 100644 runtime/queries/typst/injections.scm create mode 100644 runtime/queries/udev/highlights.scm create mode 100644 runtime/queries/udev/injections.scm create mode 100644 runtime/queries/udev/locals.scm create mode 100644 runtime/queries/ungrammar/folds.scm create mode 100644 runtime/queries/ungrammar/highlights.scm create mode 100644 runtime/queries/ungrammar/indents.scm create mode 100644 runtime/queries/ungrammar/injections.scm create mode 100644 runtime/queries/ungrammar/locals.scm create mode 100644 runtime/queries/unison/folds.scm create mode 100644 runtime/queries/unison/highlights.scm create mode 100644 runtime/queries/unison/injections.scm create mode 100644 runtime/queries/usd/folds.scm create mode 100644 runtime/queries/usd/highlights.scm create mode 100644 runtime/queries/usd/indents.scm create mode 100644 runtime/queries/usd/injections.scm create mode 100644 runtime/queries/usd/locals.scm create mode 100644 runtime/queries/uxntal/folds.scm create mode 100644 runtime/queries/uxntal/highlights.scm create mode 100644 runtime/queries/uxntal/indents.scm create mode 100644 runtime/queries/uxntal/injections.scm create mode 100644 runtime/queries/uxntal/locals.scm create mode 100644 runtime/queries/v/folds.scm create mode 100644 runtime/queries/v/highlights.scm create mode 100644 runtime/queries/v/indents.scm create mode 100644 runtime/queries/v/injections.scm create mode 100644 runtime/queries/v/locals.scm create mode 100644 runtime/queries/vala/folds.scm create mode 100644 runtime/queries/vala/highlights.scm create mode 100644 runtime/queries/vala/injections.scm create mode 100644 runtime/queries/vento/highlights.scm create mode 100644 runtime/queries/vento/injections.scm create mode 100644 runtime/queries/verilog/folds.scm create mode 100644 runtime/queries/verilog/highlights.scm create mode 100644 runtime/queries/verilog/injections.scm create mode 100644 runtime/queries/vhdl/folds.scm create mode 100644 runtime/queries/vhdl/highlights.scm create mode 100644 runtime/queries/vhdl/injections.scm create mode 100644 runtime/queries/vhs/highlights.scm create mode 100644 runtime/queries/vhs/injections.scm create mode 100644 runtime/queries/vim/folds.scm create mode 100644 runtime/queries/vim/highlights.scm create mode 100644 runtime/queries/vim/injections.scm create mode 100644 runtime/queries/vim/locals.scm create mode 100644 runtime/queries/vimdoc/highlights.scm create mode 100644 runtime/queries/vimdoc/injections.scm create mode 100644 runtime/queries/vrl/folds.scm create mode 100644 runtime/queries/vrl/highlights.scm create mode 100644 runtime/queries/vrl/indents.scm create mode 100644 runtime/queries/vrl/injections.scm create mode 100644 runtime/queries/vrl/locals.scm create mode 100644 runtime/queries/vue/folds.scm create mode 100644 runtime/queries/vue/highlights.scm create mode 100644 runtime/queries/vue/indents.scm create mode 100644 runtime/queries/vue/injections.scm create mode 100644 runtime/queries/wgsl/folds.scm create mode 100644 runtime/queries/wgsl/highlights.scm create mode 100644 runtime/queries/wgsl/indents.scm create mode 100644 runtime/queries/wgsl/injections.scm create mode 100644 runtime/queries/wgsl_bevy/folds.scm create mode 100644 runtime/queries/wgsl_bevy/highlights.scm create mode 100644 runtime/queries/wgsl_bevy/indents.scm create mode 100644 runtime/queries/wing/folds.scm create mode 100644 runtime/queries/wing/highlights.scm create mode 100644 runtime/queries/wing/injections.scm create mode 100644 runtime/queries/wing/locals.scm create mode 100644 runtime/queries/wit/folds.scm create mode 100644 runtime/queries/wit/highlights.scm create mode 100644 runtime/queries/wit/injections.scm create mode 100644 runtime/queries/xcompose/highlights.scm create mode 100644 runtime/queries/xcompose/injections.scm create mode 100644 runtime/queries/xcompose/locals.scm create mode 100644 runtime/queries/xml/folds.scm create mode 100644 runtime/queries/xml/highlights.scm create mode 100644 runtime/queries/xml/indents.scm create mode 100644 runtime/queries/xml/injections.scm create mode 100644 runtime/queries/xml/locals.scm create mode 100644 runtime/queries/xresources/folds.scm create mode 100644 runtime/queries/xresources/highlights.scm create mode 100644 runtime/queries/xresources/injections.scm create mode 100644 runtime/queries/xresources/locals.scm create mode 100644 runtime/queries/yaml/folds.scm create mode 100644 runtime/queries/yaml/highlights.scm create mode 100644 runtime/queries/yaml/indents.scm create mode 100644 runtime/queries/yaml/injections.scm create mode 100644 runtime/queries/yaml/locals.scm create mode 100644 runtime/queries/yang/folds.scm create mode 100644 runtime/queries/yang/highlights.scm create mode 100644 runtime/queries/yang/indents.scm create mode 100644 runtime/queries/yang/injections.scm create mode 100644 runtime/queries/yuck/folds.scm create mode 100644 runtime/queries/yuck/highlights.scm create mode 100644 runtime/queries/yuck/indents.scm create mode 100644 runtime/queries/yuck/injections.scm create mode 100644 runtime/queries/yuck/locals.scm create mode 100644 runtime/queries/zathurarc/highlights.scm create mode 100644 runtime/queries/zathurarc/injections.scm create mode 100644 runtime/queries/zig/folds.scm create mode 100644 runtime/queries/zig/highlights.scm create mode 100644 runtime/queries/zig/indents.scm create mode 100644 runtime/queries/zig/injections.scm create mode 100644 runtime/queries/zig/locals.scm create mode 100644 runtime/queries/ziggy/highlights.scm create mode 100644 runtime/queries/ziggy/indents.scm create mode 100644 runtime/queries/ziggy_schema/highlights.scm create mode 100644 runtime/queries/ziggy_schema/indents.scm (limited to 'runtime') diff --git a/runtime/queries/ada/folds.scm b/runtime/queries/ada/folds.scm new file mode 100644 index 000000000..8e3defac4 --- /dev/null +++ b/runtime/queries/ada/folds.scm @@ -0,0 +1,13 @@ +; 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/runtime/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm new file mode 100644 index 000000000..0d42b70f9 --- /dev/null +++ b/runtime/queries/ada/highlights.scm @@ -0,0 +1,286 @@ +; 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" + "body" + "declare" + "delay" + "delta" + "digits" + "do" + "end" + "entry" + "exit" + "generic" + "interface" + "is" + "limited" + "mod" + "new" + "null" + "of" + "others" + "out" + "overriding" + "package" + "pragma" + "private" + "protected" + "range" + "separate" + "subtype" + "synchronized" + "tagged" + "task" + "terminate" + "type" + "until" + "when" +] @keyword + +"record" @keyword.type + +[ + "aliased" + "constant" + "renames" +] @keyword.modifier + +[ + "with" + "use" +] @keyword.import + +[ + "function" + "procedure" +] @keyword.function + +[ + "and" + "in" + "not" + "or" + "xor" +] @keyword.operator + +[ + "while" + "loop" + "for" + "parallel" + "reverse" + "some" +] @keyword.repeat + +"return" @keyword.return + +[ + "case" + "if" + "else" + "then" + "elsif" + "select" +] @keyword.conditional + +[ + "exception" + "raise" +] @keyword.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" @keyword.import + "type" @keyword.import) + +(with_clause + "private" @keyword.import) + +(with_clause + "limited" @keyword.import) + +(use_clause + (_) @module) + +(with_clause + (_) @module) + +(loop_statement + "end" @keyword.repeat) + +(if_statement + "end" @keyword.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" @keyword.exception) + +(gnatprep_declarative_if_statement) @keyword.directive + +(gnatprep_if_statement) @keyword.directive + +(gnatprep_identifier) @keyword.directive + +(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) diff --git a/runtime/queries/ada/injections.scm b/runtime/queries/ada/injections.scm new file mode 100644 index 000000000..f9754504e --- /dev/null +++ b/runtime/queries/ada/injections.scm @@ -0,0 +1,5 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((doc_block) @injection.content + (#set! injection.language "markdown")) diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm new file mode 100644 index 000000000..bdfc38be8 --- /dev/null +++ b/runtime/queries/ada/locals.scm @@ -0,0 +1,91 @@ +; 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) @local.scope + +(package_declaration) @local.scope + +(package_body) @local.scope + +(subprogram_declaration) @local.scope + +(subprogram_body) @local.scope + +(block_statement) @local.scope + +(with_clause + (identifier) @local.definition.import) + +(procedure_specification + name: (_) @local.definition.function) + +(function_specification + name: (_) @local.definition.function) + +(package_declaration + name: (_) @local.definition.var) + +(package_body + name: (_) @local.definition.var) + +(generic_instantiation + . + name: (_) @local.definition.var) + +(component_declaration + . + (identifier) @local.definition.var) + +(exception_declaration + . + (identifier) @local.definition.var) + +(formal_object_declaration + . + (identifier) @local.definition.var) + +(object_declaration + . + (identifier) @local.definition.var) + +(parameter_specification + . + (identifier) @local.definition.var) + +(full_type_declaration + . + (identifier) @local.definition.type) + +(private_type_declaration + . + (identifier) @local.definition.type) + +(private_extension_declaration + . + (identifier) @local.definition.type) + +(incomplete_type_declaration + . + (identifier) @local.definition.type) + +(protected_type_declaration + . + (identifier) @local.definition.type) + +(formal_complete_type_declaration + . + (identifier) @local.definition.type) + +(formal_incomplete_type_declaration + . + (identifier) @local.definition.type) + +(task_type_declaration + . + (identifier) @local.definition.type) + +(subtype_declaration + . + (identifier) @local.definition.type) + +(identifier) @local.reference diff --git a/runtime/queries/agda/folds.scm b/runtime/queries/agda/folds.scm new file mode 100644 index 000000000..5e1051f8f --- /dev/null +++ b/runtime/queries/agda/folds.scm @@ -0,0 +1,4 @@ +[ + (record) + (module) +] @fold diff --git a/runtime/queries/agda/highlights.scm b/runtime/queries/agda/highlights.scm new file mode 100644 index 000000000..4626a8c12 --- /dev/null +++ b/runtime/queries/agda/highlights.scm @@ -0,0 +1,87 @@ +; 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" @keyword.import + +(module_name) @module + +; Pragmas and comments +(pragma) @keyword.directive + +(comment) @comment @spell + +; Keywords +[ + "where" + "data" + "rewrite" + "postulate" + "public" + "private" + "tactic" + "Prop" + "quote" + "renaming" + "open" + "in" + "hiding" + "constructor" + "abstract" + "let" + "field" + "mutual" + "module" + "infix" + "infixl" + "infixr" +] @keyword + +"record" @keyword.type + +;(expr +; f_name: (atom) @function) +; Brackets +[ + "(" + ")" + "{" + "}" +] @punctuation.bracket + +"=" @operator diff --git a/runtime/queries/agda/injections.scm b/runtime/queries/agda/injections.scm new file mode 100644 index 000000000..a772e0bd9 --- /dev/null +++ b/runtime/queries/agda/injections.scm @@ -0,0 +1,14 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((comment) @injection.content + (#lua-match? @injection.content "^///[^/]") + (#set! injection.language "doxygen")) + +((comment) @injection.content + (#lua-match? @injection.content "^///$") + (#set! injection.language "doxygen")) + +((comment) @injection.content + (#lua-match? @injection.content "^/[*][*][^*].*[*]/$") + (#set! injection.language "doxygen")) diff --git a/runtime/queries/angular/folds.scm b/runtime/queries/angular/folds.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/runtime/queries/angular/folds.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/runtime/queries/angular/highlights.scm b/runtime/queries/angular/highlights.scm new file mode 100644 index 000000000..271e352e5 --- /dev/null +++ b/runtime/queries/angular/highlights.scm @@ -0,0 +1,154 @@ +; inherits: html_tags + +(identifier) @variable + +(pipe_operator) @operator + +[ + (string) + (static_member_expression) +] @string + +(number) @number + +(pipe_call + name: (identifier) @function) + +(pipe_call + arguments: (pipe_arguments + (identifier) @variable.parameter)) + +(structural_directive + "*" @keyword + (identifier) @keyword) + +(attribute + (attribute_name) @variable.member + (#lua-match? @variable.member "#.*")) + +(binding_name + (identifier) @keyword) + +(event_binding + (binding_name + (identifier) @keyword)) + +(event_binding + "\"" @punctuation.delimiter) + +(property_binding + "\"" @punctuation.delimiter) + +(structural_assignment + operator: (identifier) @keyword) + +(member_expression + property: (identifier) @property) + +(call_expression + function: (identifier) @function) + +(call_expression + function: ((identifier) @function.builtin + (#eq? @function.builtin "$any"))) + +(pair + key: ((identifier) @variable.builtin + (#eq? @variable.builtin "$implicit"))) + +[ + (control_keyword) + (special_keyword) +] @keyword + +((control_keyword) @keyword.repeat + (#any-of? @keyword.repeat "for" "empty")) + +((control_keyword) @keyword.conditional + (#any-of? @keyword.conditional "if" "else" "switch" "case" "default")) + +((control_keyword) @keyword.coroutine + (#any-of? @keyword.coroutine "defer" "placeholder" "loading")) + +((control_keyword) @keyword.exception + (#eq? @keyword.exception "error")) + +((identifier) @boolean + (#any-of? @boolean "true" "false")) + +((identifier) @variable.builtin + (#any-of? @variable.builtin "this" "$event")) + +((identifier) @constant.builtin + (#eq? @constant.builtin "null")) + +[ + (ternary_operator) + (conditional_operator) +] @keyword.conditional.ternary + +[ + "(" + ")" + "[" + "]" + "{" + "}" + "@" +] @punctuation.bracket + +(two_way_binding + [ + "[(" + ")]" + ] @punctuation.bracket) + +[ + "{{" + "}}" +] @punctuation.special + +(template_substitution + [ + "${" + "}" + ] @punctuation.special) + +(template_chars) @string + +[ + ";" + "." + "," + "?." +] @punctuation.delimiter + +(nullish_coalescing_expression + (coalescing_operator) @operator) + +(concatenation_expression + "+" @operator) + +(icu_clause) @keyword.operator + +(icu_category) @keyword.conditional + +(binary_expression + [ + "-" + "&&" + "+" + "<" + "<=" + "=" + "==" + "===" + "!=" + "!==" + ">" + ">=" + "*" + "/" + "||" + "%" + ] @operator) diff --git a/runtime/queries/angular/indents.scm b/runtime/queries/angular/indents.scm new file mode 100644 index 000000000..2f46aa5bc --- /dev/null +++ b/runtime/queries/angular/indents.scm @@ -0,0 +1,16 @@ +; inherits: html_tags + +[ + (statement_block) + (switch_statement) +] @indent.begin + +(statement_block + "{" @indent.branch) + +(statement_block + "}" @indent.end) + +"}" @indent.branch + +"}" @indent.end diff --git a/runtime/queries/angular/injections.scm b/runtime/queries/angular/injections.scm new file mode 100644 index 000000000..448e94275 --- /dev/null +++ b/runtime/queries/angular/injections.scm @@ -0,0 +1 @@ +; inherits: html_tags diff --git a/runtime/queries/angular/locals.scm b/runtime/queries/angular/locals.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/runtime/queries/angular/locals.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/runtime/queries/apex/folds.scm b/runtime/queries/apex/folds.scm new file mode 100644 index 000000000..fdfc2a1ed --- /dev/null +++ b/runtime/queries/apex/folds.scm @@ -0,0 +1,6 @@ +[ + (class_body) + (constructor_declaration) + (argument_list) + (annotation_argument_list) +] @fold diff --git a/runtime/queries/apex/highlights.scm b/runtime/queries/apex/highlights.scm new file mode 100644 index 000000000..82ce23414 --- /dev/null +++ b/runtime/queries/apex/highlights.scm @@ -0,0 +1,257 @@ +; inherits: soql + +; Apex + SOQL +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +[ + "," + "." + ":" + "?" + ";" +] @punctuation.delimiter + +; Default general color definition +(identifier) @variable + +(type_identifier) @type + +; Methods +(method_declaration + name: (identifier) @function.method) + +(method_invocation + name: (identifier) @function.method.call) + +(super) @function.builtin + +; Annotations +(annotation + name: (identifier) @attribute) + +; Types +(interface_declaration + name: (identifier) @type) + +(class_declaration + name: (identifier) @type) + +(class_declaration + (superclass) @type) + +(enum_declaration + name: (identifier) @type) + +(enum_constant + name: (identifier) @constant) + +(type_arguments + "<" @punctuation.delimiter) + +(type_arguments + ">" @punctuation.delimiter) + +(field_access + object: (identifier) @type) + +(field_access + field: (identifier) @property) + +((scoped_identifier + scope: (identifier) @type) + (#match? @type "^[A-Z]")) + +((method_invocation + object: (identifier) @type) + (#match? @type "^[A-Z]")) + +(method_declaration + (formal_parameters + (formal_parameter + name: (identifier) @variable.parameter))) + +(constructor_declaration + name: (identifier) @constructor) + +(dml_type) @function.builtin + +(assignment_operator) @operator + +(update_operator) @operator + +(trigger_declaration + name: (identifier) @type + object: (identifier) @type + (trigger_event) @keyword + ("," + (trigger_event) @keyword)*) + +[ + "@" + "=" + "!=" + "<=" + ">=" +] @operator + +(binary_expression + operator: [ + ">" + "<" + "==" + "===" + "!==" + "&&" + "||" + "+" + "-" + "*" + "/" + "&" + "|" + "^" + "%" + "<<" + ">>" + ">>>" + ] @operator) + +(unary_expression + operator: [ + "+" + "-" + "!" + "~" + ]) @operator + +"=>" @operator + +[ + (boolean_type) + (void_type) +] @type.builtin + +; Fields +(field_declaration + declarator: (variable_declarator + name: (identifier) @variable.member)) + +(field_access + field: (identifier) @variable.member) + +; Variables +(variable_declarator + (identifier) @property) + +(field_declaration + (modifiers + (modifier + [ + (final) + (static) + ]) + (modifier + [ + (final) + (static) + ])) + (variable_declarator + name: (identifier) @constant)) + +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z0-9_]+$")) ; SCREAM SNAKE CASE + +(this) @variable.builtin + +; Literals +[ + (int) + (decimal) + (currency_literal) +] @number + +(string_literal) @string + +[ + (line_comment) + (block_comment) +] @comment + +(null_literal) @constant.builtin + +; ;; Keywords +[ + "abstract" + "final" + "private" + "protected" + "public" + "static" +] @keyword.modifier + +[ + "if" + "else" + "switch" +] @keyword.conditional + +[ + "for" + "while" + "do" + "break" +] @keyword.repeat + +"return" @keyword.return + +[ + "throw" + "finally" + "try" + "catch" +] @keyword.exception + +"new" @keyword.operator + +[ + (abstract) + (all_rows_clause) + "continue" + "extends" + (final) + "get" + (global) + "implements" + "instanceof" + "on" + (override) + (private) + (protected) + (public) + "set" + (static) + (testMethod) + (webservice) + (transient) + "trigger" + (virtual) + "when" + (with_sharing) + (without_sharing) + (inherited_sharing) +] @keyword + +[ + "interface" + "class" + "enum" +] @keyword.type + +"System.runAs" @function.builtin diff --git a/runtime/queries/apex/injections.scm b/runtime/queries/apex/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/runtime/queries/apex/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/apex/locals.scm b/runtime/queries/apex/locals.scm new file mode 100644 index 000000000..d758f14cf --- /dev/null +++ b/runtime/queries/apex/locals.scm @@ -0,0 +1,67 @@ +; declarations +(class_declaration) @local.scope + +(method_declaration) @local.scope + +(constructor_declaration) @local.scope + +(enum_declaration) @local.scope + +(enhanced_for_statement) @local.scope + +; if/else +(if_statement) @local.scope + +(if_statement + consequence: (_) @local.scope) ; if body in case there are no braces + +(if_statement + alternative: (_) @local.scope) ; else body in case there are no braces + +; try/catch +(try_statement) @local.scope ; covers try+catch, individual try and catch are covered by (block) + +(catch_clause) @local.scope ; needed because `Exception` variable + +; loops +(for_statement) @local.scope + +(for_statement ; "for" body in case there are no braces + body: (_) @local.scope) + +(do_statement + body: (_) @local.scope) + +(while_statement + body: (_) @local.scope) + +; Functions +(constructor_declaration) @local.scope + +(method_declaration) @local.scope + +; definitions +(enum_declaration + name: (identifier) @local.definition.enum) + +(method_declaration + name: (identifier) @local.definition.method) + +(local_variable_declaration + declarator: (variable_declarator + name: (identifier) @local.definition.var)) + +(enhanced_for_statement + name: (identifier) @local.definition.var) + +(formal_parameter + name: (identifier) @local.definition.parameter) + +(field_declaration + declarator: (variable_declarator + name: (identifier) @local.definition.field)) + +; REFERENCES +(identifier) @local.reference + +(type_identifier) @local.reference diff --git a/runtime/queries/arduino/folds.scm b/runtime/queries/arduino/folds.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/arduino/folds.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/arduino/highlights.scm b/runtime/queries/arduino/highlights.scm new file mode 100644 index 000000000..e6bf14784 --- /dev/null +++ b/runtime/queries/arduino/highlights.scm @@ -0,0 +1,53 @@ +; 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/runtime/queries/arduino/indents.scm b/runtime/queries/arduino/indents.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/arduino/indents.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/arduino/injections.scm b/runtime/queries/arduino/injections.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/arduino/injections.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/arduino/locals.scm b/runtime/queries/arduino/locals.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/arduino/locals.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/asm/highlights.scm b/runtime/queries/asm/highlights.scm new file mode 100644 index 000000000..eccf9c996 --- /dev/null +++ b/runtime/queries/asm/highlights.scm @@ -0,0 +1,66 @@ +; General +(label + [ + (ident) + (word) + ] @label) + +(reg) @variable.builtin + +(meta + kind: (_) @function.builtin) + +(instruction + kind: (_) @function.builtin) + +(const + name: (word) @constant) + +; Comments +[ + (line_comment) + (block_comment) +] @comment @spell + +; Literals +(int) @number + +(float) @number.float + +(string) @string + +; Keywords +[ + "byte" + "word" + "dword" + "qword" + "ptr" + "rel" + "label" + "const" +] @keyword + +; Operators & Punctuation +[ + "+" + "-" + "*" + "/" + "%" + "|" + "^" + "&" +] @operator + +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +[ + "," + ":" +] @punctuation.delimiter diff --git a/runtime/queries/asm/injections.scm b/runtime/queries/asm/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/runtime/queries/asm/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/astro/folds.scm b/runtime/queries/astro/folds.scm new file mode 100644 index 000000000..1f2129cf9 --- /dev/null +++ b/runtime/queries/astro/folds.scm @@ -0,0 +1 @@ +; inherits: html diff --git a/runtime/queries/astro/highlights.scm b/runtime/queries/astro/highlights.scm new file mode 100644 index 000000000..e2917ad4d --- /dev/null +++ b/runtime/queries/astro/highlights.scm @@ -0,0 +1,29 @@ +; inherits: html_tags + +(doctype) @constant + +"" + "<=" + ">=" + "==" + "!=" + "~" + "!~" + "in" + "&&" + "||" + ] @operator) + +(unary_exp + [ + "!" + "+" + "-" + ] @operator) + +(assignment_exp + [ + "=" + "+=" + "-=" + "*=" + "/=" + "%=" + "^=" + ] @operator) + +(ternary_exp + [ + "?" + ":" + ] @keyword.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/runtime/queries/awk/injections.scm b/runtime/queries/awk/injections.scm new file mode 100644 index 000000000..3e67da245 --- /dev/null +++ b/runtime/queries/awk/injections.scm @@ -0,0 +1,17 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((regex) @injection.content + (#set! injection.language "regex")) + +((print_statement + (exp_list + . + (string) @injection.content)) + (#set! injection.language "printf")) + +((printf_statement + (exp_list + . + (string) @injection.content)) + (#set! injection.language "printf")) diff --git a/runtime/queries/bash/folds.scm b/runtime/queries/bash/folds.scm new file mode 100644 index 000000000..766dbe598 --- /dev/null +++ b/runtime/queries/bash/folds.scm @@ -0,0 +1,9 @@ +[ + (function_definition) + (if_statement) + (case_statement) + (for_statement) + (while_statement) + (c_style_for_statement) + (heredoc_redirect) +] @fold diff --git a/runtime/queries/bash/highlights.scm b/runtime/queries/bash/highlights.scm new file mode 100644 index 000000000..58d57d9e5 --- /dev/null +++ b/runtime/queries/bash/highlights.scm @@ -0,0 +1,261 @@ +[ + "(" + ")" + "{" + "}" + "[" + "]" + "[[" + "]]" + "((" + "))" +] @punctuation.bracket + +[ + ";" + ";;" + ";&" + ";;&" + "&" +] @punctuation.delimiter + +[ + ">" + ">>" + "<" + "<<" + "&&" + "|" + "|&" + "||" + "=" + "+=" + "=~" + "==" + "!=" + "&>" + "&>>" + "<&" + ">&" + ">|" + "<&-" + ">&-" + "<<-" + "<<<" + ".." + "!" +] @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 + +[ + (heredoc_start) + (heredoc_end) +] @label + +(variable_assignment + (word) @string) + +(command + argument: "$" @string) ; bare dollar + +(concatenation + (word) @string) + +[ + "if" + "then" + "else" + "elif" + "fi" + "case" + "in" + "esac" +] @keyword.conditional + +[ + "for" + "do" + "done" + "select" + "until" + "while" +] @keyword.repeat + +[ + "declare" + "typeset" + "readonly" + "local" + "unset" + "unsetenv" +] @keyword + +"export" @keyword.import + +"function" @keyword.function + +(special_variable_name) @constant + +; trap -l +((word) @constant.builtin + (#any-of? @constant.builtin + "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT" "SIGBUS" "SIGFPE" "SIGKILL" "SIGUSR1" + "SIGSEGV" "SIGUSR2" "SIGPIPE" "SIGALRM" "SIGTERM" "SIGSTKFLT" "SIGCHLD" "SIGCONT" "SIGSTOP" + "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGURG" "SIGXCPU" "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" + "SIGIO" "SIGPWR" "SIGSYS" "SIGRTMIN" "SIGRTMIN+1" "SIGRTMIN+2" "SIGRTMIN+3" "SIGRTMIN+4" + "SIGRTMIN+5" "SIGRTMIN+6" "SIGRTMIN+7" "SIGRTMIN+8" "SIGRTMIN+9" "SIGRTMIN+10" "SIGRTMIN+11" + "SIGRTMIN+12" "SIGRTMIN+13" "SIGRTMIN+14" "SIGRTMIN+15" "SIGRTMAX-14" "SIGRTMAX-13" + "SIGRTMAX-12" "SIGRTMAX-11" "SIGRTMAX-10" "SIGRTMAX-9" "SIGRTMAX-8" "SIGRTMAX-7" "SIGRTMAX-6" + "SIGRTMAX-5" "SIGRTMAX-4" "SIGRTMAX-3" "SIGRTMAX-2" "SIGRTMAX-1" "SIGRTMAX")) + +((word) @boolean + (#any-of? @boolean "true" "false")) + +(comment) @comment @spell + +(test_operator) @operator + +(command_substitution + "$(" @punctuation.special + ")" @punctuation.special) + +(process_substitution + [ + "<(" + ">(" + ] @punctuation.special + ")" @punctuation.special) + +(arithmetic_expansion + [ + "$((" + "((" + ] @punctuation.special + "))" @punctuation.special) + +(arithmetic_expansion + "," @punctuation.delimiter) + +(ternary_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +(binary_expression + operator: _ @operator) + +(unary_expression + operator: _ @operator) + +(postfix_expression + operator: _ @operator) + +(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" "false" "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" "true" "type" "typeset" "ulimit" "umask" "unalias" "wait")) + +(command + argument: [ + (word) @variable.parameter + (concatenation + (word) @variable.parameter) + ]) + +(declaration_command + (word) @variable.parameter) + +(unset_command + (word) @variable.parameter) + +(number) @number + +((word) @number + (#lua-match? @number "^[0-9]+$")) + +(file_redirect + (word) @string.special.path) + +(herestring_redirect + (word) @string) + +(file_descriptor) @operator + +(simple_expansion + "$" @punctuation.special) @none + +(expansion + "${" @punctuation.special + "}" @punctuation.special) @none + +(expansion + operator: _ @punctuation.special) + +(expansion + "@" + . + operator: _ @character.special) + +((expansion + (subscript + index: (word) @character.special)) + (#any-of? @character.special "@" "*")) + +"``" @punctuation.special + +(variable_name) @variable + +((variable_name) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +((variable_name) @variable.builtin + (#any-of? @variable.builtin + ; https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Variables.html + "CDPATH" "HOME" "IFS" "MAIL" "MAILPATH" "OPTARG" "OPTIND" "PATH" "PS1" "PS2" + ; https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html + "_" "BASH" "BASHOPTS" "BASHPID" "BASH_ALIASES" "BASH_ARGC" "BASH_ARGV" "BASH_ARGV0" "BASH_CMDS" + "BASH_COMMAND" "BASH_COMPAT" "BASH_ENV" "BASH_EXECUTION_STRING" "BASH_LINENO" + "BASH_LOADABLES_PATH" "BASH_REMATCH" "BASH_SOURCE" "BASH_SUBSHELL" "BASH_VERSINFO" + "BASH_VERSION" "BASH_XTRACEFD" "CHILD_MAX" "COLUMNS" "COMP_CWORD" "COMP_LINE" "COMP_POINT" + "COMP_TYPE" "COMP_KEY" "COMP_WORDBREAKS" "COMP_WORDS" "COMPREPLY" "COPROC" "DIRSTACK" "EMACS" + "ENV" "EPOCHREALTIME" "EPOCHSECONDS" "EUID" "EXECIGNORE" "FCEDIT" "FIGNORE" "FUNCNAME" + "FUNCNEST" "GLOBIGNORE" "GROUPS" "histchars" "HISTCMD" "HISTCONTROL" "HISTFILE" "HISTFILESIZE" + "HISTIGNORE" "HISTSIZE" "HISTTIMEFORMAT" "HOSTFILE" "HOSTNAME" "HOSTTYPE" "IGNOREEOF" "INPUTRC" + "INSIDE_EMACS" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_NUMERIC" "LC_TIME" + "LINENO" "LINES" "MACHTYPE" "MAILCHECK" "MAPFILE" "OLDPWD" "OPTERR" "OSTYPE" "PIPESTATUS" + "POSIXLY_CORRECT" "PPID" "PROMPT_COMMAND" "PROMPT_DIRTRIM" "PS0" "PS3" "PS4" "PWD" "RANDOM" + "READLINE_ARGUMENT" "READLINE_LINE" "READLINE_MARK" "READLINE_POINT" "REPLY" "SECONDS" "SHELL" + "SHELLOPTS" "SHLVL" "SRANDOM" "TIMEFORMAT" "TMOUT" "TMPDIR" "UID")) + +(case_item + value: (word) @variable.parameter) + +[ + (regex) + (extglob_pattern) +] @string.regexp + +((program + . + (comment) @keyword.directive @nospell) + (#lua-match? @keyword.directive "^#!/")) diff --git a/runtime/queries/bash/injections.scm b/runtime/queries/bash/injections.scm new file mode 100644 index 000000000..9b86e351a --- /dev/null +++ b/runtime/queries/bash/injections.scm @@ -0,0 +1,79 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((regex) @injection.content + (#set! injection.language "regex")) + +((heredoc_redirect + (heredoc_body) @injection.content + (heredoc_end) @injection.language) + (#downcase! @injection.language)) + +; printf 'format' +((command + name: (command_name) @_command + . + argument: [ + (string) @injection.content + (concatenation + (string) @injection.content) + (raw_string) @injection.content + (concatenation + (raw_string) @injection.content) + ]) + (#eq? @_command "printf") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "printf")) + +; printf -v var 'format' +((command + name: (command_name) @_command + argument: (word) @_arg + . + (_) + . + argument: [ + (string) @injection.content + (concatenation + (string) @injection.content) + (raw_string) @injection.content + (concatenation + (raw_string) @injection.content) + ]) + (#eq? @_command "printf") + (#eq? @_arg "-v") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "printf")) + +; printf -- 'format' +((command + name: (command_name) @_command + argument: (word) @_arg + . + argument: [ + (string) @injection.content + (concatenation + (string) @injection.content) + (raw_string) @injection.content + (concatenation + (raw_string) @injection.content) + ]) + (#eq? @_command "printf") + (#eq? @_arg "--") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "printf")) + +((command + name: (command_name) @_command + . + argument: [ + (string) + (raw_string) + ] @injection.content) + (#eq? @_command "bind") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "readline")) diff --git a/runtime/queries/bash/locals.scm b/runtime/queries/bash/locals.scm new file mode 100644 index 000000000..347f51fa2 --- /dev/null +++ b/runtime/queries/bash/locals.scm @@ -0,0 +1,14 @@ +; Scopes +(function_definition) @local.scope + +; Definitions +(variable_assignment + name: (variable_name) @local.definition.var) + +(function_definition + name: (word) @local.definition.function) + +; References +(variable_name) @local.reference + +(word) @local.reference diff --git a/runtime/queries/bass/folds.scm b/runtime/queries/bass/folds.scm new file mode 100644 index 000000000..d99e0c1ac --- /dev/null +++ b/runtime/queries/bass/folds.scm @@ -0,0 +1,5 @@ +[ + (list) + (scope) + (cons) +] @fold diff --git a/runtime/queries/bass/highlights.scm b/runtime/queries/bass/highlights.scm new file mode 100644 index 000000000..f84993af1 --- /dev/null +++ b/runtime/queries/bass/highlights.scm @@ -0,0 +1,126 @@ +; 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) @module + . + (keyword)) + +; Includes +((symbol) @keyword.import + (#any-of? @keyword.import "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)? @variable.parameter) + (#any-of? @keyword.function "def" "defop" "defn" "fn")) + +((cons + . + (symbol) @keyword.function + . + (symbol) @function + (symbol)? @variable.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) @keyword.conditional + (#any-of? @keyword.conditional "if" "case" "cond" "when")) + +; Repeats +((symbol) @keyword.repeat + (#any-of? @keyword.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) @string.special.url + +(number) @number + +(boolean) @boolean + +[ + (ignore) + (null) +] @constant.builtin + +"^" @character.special + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/bass/indents.scm b/runtime/queries/bass/indents.scm new file mode 100644 index 000000000..27b976f21 --- /dev/null +++ b/runtime/queries/bass/indents.scm @@ -0,0 +1,31 @@ +[ + (list) + (scope) + (cons) +] @indent.begin + +[ + ")" + "}" + "]" +] @indent.end + +[ + "(" + ")" +] @indent.branch + +[ + "{" + "}" +] @indent.branch + +[ + "[" + "]" +] @indent.branch + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/runtime/queries/bass/injections.scm b/runtime/queries/bass/injections.scm new file mode 100644 index 000000000..1c2fe3cc9 --- /dev/null +++ b/runtime/queries/bass/injections.scm @@ -0,0 +1,5 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((block_comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bass/locals.scm b/runtime/queries/bass/locals.scm new file mode 100644 index 000000000..daed7e5e1 --- /dev/null +++ b/runtime/queries/bass/locals.scm @@ -0,0 +1,26 @@ +; Scopes +[ + (list) + (scope) + (cons) +] @local.scope + +; References +(symbol) @local.reference + +; Definitions +((list + . + (symbol) @_fnkw + . + (symbol) @local.definition.function + (symbol)? @local.definition.parameter) + (#any-of? @_fnkw "def" "defop" "defn" "fn")) + +((cons + . + (symbol) @_fnkw + . + (symbol) @local.definition.function + (symbol)? @local.definition.parameter) + (#any-of? @_fnkw "def" "defop" "defn" "fn")) diff --git a/runtime/queries/beancount/folds.scm b/runtime/queries/beancount/folds.scm new file mode 100644 index 000000000..9f1b6cbed --- /dev/null +++ b/runtime/queries/beancount/folds.scm @@ -0,0 +1,4 @@ +[ + (transaction) + (section) +] @fold diff --git a/runtime/queries/beancount/highlights.scm b/runtime/queries/beancount/highlights.scm new file mode 100644 index 000000000..1e23d28f4 --- /dev/null +++ b/runtime/queries/beancount/highlights.scm @@ -0,0 +1,57 @@ +(date) @variable.member + +(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/runtime/queries/beancount/injections.scm b/runtime/queries/beancount/injections.scm new file mode 100644 index 000000000..05aa24d8f --- /dev/null +++ b/runtime/queries/beancount/injections.scm @@ -0,0 +1,5 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((macro_text) @injection.content + (#set! injection.language "verilog")) diff --git a/runtime/queries/bibtex/folds.scm b/runtime/queries/bibtex/folds.scm new file mode 100644 index 000000000..321a045c9 --- /dev/null +++ b/runtime/queries/bibtex/folds.scm @@ -0,0 +1 @@ +(entry) @fold diff --git a/runtime/queries/bibtex/highlights.scm b/runtime/queries/bibtex/highlights.scm new file mode 100644 index 000000000..2231a17db --- /dev/null +++ b/runtime/queries/bibtex/highlights.scm @@ -0,0 +1,57 @@ +; CREDITS @pfoerster (adapted from https://github.com/latex-lsp/tree-sitter-bibtex) +[ + (string_type) + (preamble_type) + (entry_type) +] @keyword + +[ + (junk) + (comment) +] @comment + +(comment) @spell + +[ + "=" + "#" +] @operator + +(command) @function.builtin + +(number) @number + +(field + name: (identifier) @property) + +(token + (identifier) @variable.parameter) + +[ + (brace_word) + (quote_word) +] @string + +((field + name: (identifier) @_url + value: (value + (token + (brace_word) @string.special.url))) + (#any-of? @_url "url" "doi")) + +[ + (key_brace) + (key_paren) +] @markup.link.label + +(string + name: (identifier) @constant) + +[ + "{" + "}" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter diff --git a/runtime/queries/bibtex/indents.scm b/runtime/queries/bibtex/indents.scm new file mode 100644 index 000000000..764172a76 --- /dev/null +++ b/runtime/queries/bibtex/indents.scm @@ -0,0 +1,8 @@ +(entry) @indent.begin + +[ + "{" + "}" +] @indent.branch + +(comment) @indent.ignore diff --git a/runtime/queries/bibtex/injections.scm b/runtime/queries/bibtex/injections.scm new file mode 100644 index 000000000..98ad387d9 --- /dev/null +++ b/runtime/queries/bibtex/injections.scm @@ -0,0 +1,2 @@ +((junk) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bicep/folds.scm b/runtime/queries/bicep/folds.scm new file mode 100644 index 000000000..217a86d6a --- /dev/null +++ b/runtime/queries/bicep/folds.scm @@ -0,0 +1,19 @@ +[ + (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/runtime/queries/bicep/highlights.scm b/runtime/queries/bicep/highlights.scm new file mode 100644 index 000000000..35c9d6c17 --- /dev/null +++ b/runtime/queries/bicep/highlights.scm @@ -0,0 +1,234 @@ +; Includes +[ + "import" + "provider" + "with" + "as" + "from" +] @keyword.import + +; Namespaces +(module_declaration + (identifier) @module) + +; Builtins +(primitive_type) @type.builtin + +((member_expression + object: (identifier) @type.builtin) + (#eq? @type.builtin "sys")) + +; Functions +(call_expression + function: (identifier) @function.call) + +(user_defined_function + name: (identifier) @function) + +; 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 + (identifier) @type) + +(resource_declaration + (identifier) @type) + +(resource_expression + (identifier) @type) + +; Parameters +(parameter_declaration + (identifier) @variable.parameter + (_)) + +(call_expression + function: (_) + (arguments + (identifier) @variable.parameter)) + +(call_expression + function: (_) + (arguments + (member_expression + object: (identifier) @variable.parameter))) + +(parameter + . + (identifier) @variable.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" @keyword.conditional + +(ternary_expression + "?" @keyword.conditional.ternary + ":" @keyword.conditional.ternary) + +; Loops +(for_statement + "for" @keyword.repeat + "in" + ":" @punctuation.delimiter) + +; Keywords +[ + "module" + "metadata" + "output" + "param" + "resource" + "existing" + "targetScope" + "type" + "var" + "using" + "test" +] @keyword + +"func" @keyword.function + +"assert" @keyword.exception + +; Operators +[ + "+" + "-" + "*" + "/" + "%" + "||" + "&&" + "|" + "==" + "!=" + "=~" + "!~" + ">" + ">=" + "<=" + "<" + "??" + "=" + "!" + ".?" +] @operator + +(subscript_expression + "?" @operator) + +(nullable_type + "?" @operator) + +"in" @keyword.operator + +; Literals +(string) @string + +(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/runtime/queries/bicep/indents.scm b/runtime/queries/bicep/indents.scm new file mode 100644 index 000000000..055e51b23 --- /dev/null +++ b/runtime/queries/bicep/indents.scm @@ -0,0 +1,27 @@ +[ + (array) + (object) +] @indent.begin + +"}" @indent.end + +[ + "{" + "}" +] @indent.branch + +[ + "[" + "]" +] @indent.branch + +[ + "(" + ")" +] @indent.branch + +[ + (ERROR) + (comment) + (diagnostic_comment) +] @indent.auto diff --git a/runtime/queries/bicep/injections.scm b/runtime/queries/bicep/injections.scm new file mode 100644 index 000000000..5c2d4a57b --- /dev/null +++ b/runtime/queries/bicep/injections.scm @@ -0,0 +1,5 @@ +([ + (comment) + (diagnostic_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bicep/locals.scm b/runtime/queries/bicep/locals.scm new file mode 100644 index 000000000..cc9c3c2cf --- /dev/null +++ b/runtime/queries/bicep/locals.scm @@ -0,0 +1,73 @@ +; Scopes +[ + (infrastructure) + (call_expression) + (lambda_expression) + (subscript_expression) + (if_statement) + (for_statement) + (array) + (object) + (interpolation) +] @local.scope + +; References +(property_identifier) @local.reference + +(call_expression + (identifier) @local.reference) + +(object_property + (_) + ":" + (identifier) @local.reference) + +(resource_expression + (identifier) @local.reference) + +; Definitions +(type) @local.definition.associated + +(object_property + (identifier) @local.definition.field + (_)) + +(object_property + (compatible_identifier) @local.definition.field + (_)) + +(user_defined_function + name: (identifier) @local.definition.function) + +(module_declaration + (identifier) @local.definition.namespace) + +(parameter_declaration + (identifier) @local.definition.parameter + (_)) + +(parameter + . + (identifier) @local.definition.parameter) + +(type_declaration + (identifier) @local.definition.type + (_)) + +(variable_declaration + (identifier) @local.definition.var + (_)) + +(metadata_declaration + (identifier) @local.definition.var + (_)) + +(output_declaration + (identifier) @local.definition.var + (_)) + +(for_statement + "for" + (for_loop_parameters + (loop_variable) @local.definition.var + (loop_enumerator) @local.definition.var)) diff --git a/runtime/queries/bitbake/folds.scm b/runtime/queries/bitbake/folds.scm new file mode 100644 index 000000000..85d226348 --- /dev/null +++ b/runtime/queries/bitbake/folds.scm @@ -0,0 +1,24 @@ +[ + (function_definition) + (anonymous_python_function) + (python_function_definition) + (while_statement) + (for_statement) + (if_statement) + (with_statement) + (try_statement) + (import_from_statement) + (parameters) + (argument_list) + (parenthesized_expression) + (generator_expression) + (list_comprehension) + (set_comprehension) + (dictionary_comprehension) + (tuple) + (list) + (set) + (dictionary) + (string) + (python_string) +] @fold diff --git a/runtime/queries/bitbake/highlights.scm b/runtime/queries/bitbake/highlights.scm new file mode 100644 index 000000000..c7316de6e --- /dev/null +++ b/runtime/queries/bitbake/highlights.scm @@ -0,0 +1,406 @@ +; Includes +[ + "inherit" + "include" + "require" + "export" + "import" +] @keyword.import + +; Keywords +[ + "unset" + "EXPORT_FUNCTIONS" + "python" + "assert" + "exec" + "global" + "nonlocal" + "pass" + "print" + "with" + "as" +] @keyword + +[ + "async" + "await" +] @keyword.coroutine + +[ + "return" + "yield" +] @keyword.return + +(yield + "from" @keyword.return) + +(future_import_statement + "from" @keyword.import + "__future__" @constant.builtin) + +(import_from_statement + "from" @keyword.import) + +"import" @keyword.import + +(aliased_import + "as" @keyword.import) + +[ + "if" + "elif" + "else" +] @keyword.conditional + +[ + "for" + "while" + "break" + "continue" +] @keyword.repeat + +[ + "try" + "except" + "except*" + "raise" + "finally" +] @keyword.exception + +(raise_statement + "from" @keyword.exception) + +(try_statement + (else_clause + "else" @keyword.exception)) + +[ + "addtask" + "deltask" + "addhandler" + "def" + "lambda" +] @keyword.function + +[ + "before" + "after" +] @keyword.modifier + +[ + "append" + "prepend" + "remove" +] @keyword.modifier + +; Variables +[ + (identifier) + (python_identifier) +] @variable + +[ + "noexec" + "OVERRIDES" + "$BB_ENV_PASSTHROUGH" + "$BB_ENV_PASSTHROUGH_ADDITIONS" +] @variable.builtin + +; Reset highlighting in f-string interpolations +(interpolation) @none + +; Identifier naming conventions +((python_identifier) @type + (#lua-match? @type "^[A-Z].*[a-z]")) + +([ + (identifier) + (python_identifier) +] @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +((python_identifier) @constant.builtin + (#lua-match? @constant.builtin "^__[a-zA-Z0-9_]*__$")) + +((python_identifier) @constant.builtin + (#any-of? @constant.builtin + ; https://docs.python.org/3/library/constants.html + "NotImplemented" "Ellipsis" "quit" "exit" "copyright" "credits" "license")) + +((assignment + left: (python_identifier) @type.definition + (type + (python_identifier) @_annotation)) + (#eq? @_annotation "TypeAlias")) + +((assignment + left: (python_identifier) @type.definition + right: (call + function: (python_identifier) @_func)) + (#any-of? @_func "TypeVar" "NewType")) + +; Fields +(flag) @variable.member + +((attribute + attribute: (python_identifier) @variable.member) + (#lua-match? @variable.member "^[%l_].*$")) + +; Functions +(call + function: (python_identifier) @function.call) + +(call + function: (attribute + attribute: (python_identifier) @function.method.call)) + +((call + function: (python_identifier) @constructor) + (#lua-match? @constructor "^%u")) + +((call + function: (attribute + attribute: (python_identifier) @constructor)) + (#lua-match? @constructor "^%u")) + +((call + function: (python_identifier) @function.builtin) + (#any-of? @function.builtin + "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" + "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" + "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" + "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview" + "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed" + "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" + "vars" "zip" "__import__")) + +(python_function_definition + name: (python_identifier) @function) + +(type + (python_identifier) @type) + +(type + (subscript + (python_identifier) @type)) ; type subscript: Tuple[int] + +((call + function: (python_identifier) @_isinstance + arguments: (argument_list + (_) + (python_identifier) @type)) + (#eq? @_isinstance "isinstance")) + +(anonymous_python_function + (identifier) @function) + +(function_definition + (identifier) @function) + +(addtask_statement + (identifier) @function) + +(deltask_statement + (identifier) @function) + +(export_functions_statement + (identifier) @function) + +(addhandler_statement + (identifier) @function) + +(python_function_definition + body: (block + . + (expression_statement + (python_string) @string.documentation @spell))) + +; Namespace +(inherit_path) @module + +; Normal parameters +(parameters + (python_identifier) @variable.parameter) + +; Lambda parameters +(lambda_parameters + (python_identifier) @variable.parameter) + +(lambda_parameters + (tuple_pattern + (python_identifier) @variable.parameter)) + +; Default parameters +(keyword_argument + name: (python_identifier) @variable.parameter) + +; Naming parameters on call-site +(default_parameter + name: (python_identifier) @variable.parameter) + +(typed_parameter + (python_identifier) @variable.parameter) + +(typed_default_parameter + (python_identifier) @variable.parameter) + +; Variadic parameters *args, **kwargs +(parameters + (list_splat_pattern + ; *args + (python_identifier) @variable.parameter)) + +(parameters + (dictionary_splat_pattern + ; **kwargs + (python_identifier) @variable.parameter)) + +; Literals +(none) @constant.builtin + +[ + (true) + (false) +] @boolean + +((python_identifier) @variable.builtin + (#any-of? @variable.builtin "self" "cls")) + +(integer) @number + +(float) @number.float + +; Operators +[ + "?=" + "??=" + ":=" + "=+" + ".=" + "=." + "-" + "-=" + ":=" + "!=" + "*" + "**" + "**=" + "*=" + "/" + "//" + "//=" + "/=" + "&" + "&=" + "%" + "%=" + "^" + "^=" + "+" + "+=" + "<" + "<<" + "<<=" + "<=" + "<>" + "=" + "==" + ">" + ">=" + ">>" + ">>=" + "@" + "@=" + "|" + "|=" + "~" + "->" +] @operator + +[ + "and" + "in" + "is" + "not" + "or" + "is not" + "not in" + "del" +] @keyword.operator + +; Literals +[ + (string) + (python_string) + "\"" +] @string + +(include_path) @string.special.path + +[ + (escape_sequence) + (escape_interpolation) +] @string.escape + +; Punctuation +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + ":" + "->" + ";" + "." + "," + (ellipsis) +] @punctuation.delimiter + +(variable_expansion + [ + "${" + "}" + ] @punctuation.special) + +(inline_python + [ + "${@" + "}" + ] @punctuation.special) + +(interpolation + "{" @punctuation.special + "}" @punctuation.special) + +(type_conversion) @function.macro + +([ + (identifier) + (python_identifier) +] @type.builtin + (#any-of? @type.builtin + ; https://docs.python.org/3/library/exceptions.html + "BaseException" "Exception" "ArithmeticError" "BufferError" "LookupError" "AssertionError" + "AttributeError" "EOFError" "FloatingPointError" "GeneratorExit" "ImportError" + "ModuleNotFoundError" "IndexError" "KeyError" "KeyboardInterrupt" "MemoryError" "NameError" + "NotImplementedError" "OSError" "OverflowError" "RecursionError" "ReferenceError" "RuntimeError" + "StopIteration" "StopAsyncIteration" "SyntaxError" "IndentationError" "TabError" "SystemError" + "SystemExit" "TypeError" "UnboundLocalError" "UnicodeError" "UnicodeEncodeError" + "UnicodeDecodeError" "UnicodeTranslateError" "ValueError" "ZeroDivisionError" "EnvironmentError" + "IOError" "WindowsError" "BlockingIOError" "ChildProcessError" "ConnectionError" + "BrokenPipeError" "ConnectionAbortedError" "ConnectionRefusedError" "ConnectionResetError" + "FileExistsError" "FileNotFoundError" "InterruptedError" "IsADirectoryError" + "NotADirectoryError" "PermissionError" "ProcessLookupError" "TimeoutError" "Warning" + "UserWarning" "DeprecationWarning" "PendingDeprecationWarning" "SyntaxWarning" "RuntimeWarning" + "FutureWarning" "ImportWarning" "UnicodeWarning" "BytesWarning" "ResourceWarning" + ; https://docs.python.org/3/library/stdtypes.html + "bool" "int" "float" "complex" "list" "tuple" "range" "str" "bytes" "bytearray" "memoryview" + "set" "frozenset" "dict" "type" "object")) + +(comment) @comment @spell diff --git a/runtime/queries/bitbake/indents.scm b/runtime/queries/bitbake/indents.scm new file mode 100644 index 000000000..5f2081868 --- /dev/null +++ b/runtime/queries/bitbake/indents.scm @@ -0,0 +1,172 @@ +[ + (import_from_statement) + (parenthesized_expression) + (generator_expression) + (list_comprehension) + (set_comprehension) + (dictionary_comprehension) + (tuple_pattern) + (list_pattern) + (binary_operator) + (lambda) + (concatenated_string) +] @indent.begin + +((list) @indent.align + (#set! indent.open_delimiter "[") + (#set! indent.close_delimiter "]")) + +((dictionary) @indent.align + (#set! indent.open_delimiter "{") + (#set! indent.close_delimiter "}")) + +((set) @indent.align + (#set! indent.open_delimiter "{") + (#set! indent.close_delimiter "}")) + +((for_statement) @indent.begin + (#set! indent.immediate 1)) + +((if_statement) @indent.begin + (#set! indent.immediate 1)) + +((while_statement) @indent.begin + (#set! indent.immediate 1)) + +((try_statement) @indent.begin + (#set! indent.immediate 1)) + +(ERROR + "try" + ":" @indent.begin + (#set! indent.immediate 1)) + +((python_function_definition) @indent.begin + (#set! indent.immediate 1)) + +(function_definition) @indent.begin + +(anonymous_python_function) @indent.begin + +((with_statement) @indent.begin + (#set! indent.immediate 1)) + +(if_statement + condition: (parenthesized_expression) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")") + (#set! indent.avoid_last_matching_next 1)) + +(while_statement + condition: (parenthesized_expression) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")") + (#set! indent.avoid_last_matching_next 1)) + +(ERROR + "(" @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")") + . + (_)) + +((argument_list) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) + +((parameters) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")") + (#set! indent.avoid_last_matching_next 1)) + +((tuple) @indent.align + (#set! indent.open_delimiter "(") + (#set! indent.close_delimiter ")")) + +(ERROR + "[" @indent.align + (#set! indent.open_delimiter "[") + (#set! indent.close_delimiter "]") + . + (_)) + +(ERROR + "{" @indent.align + (#set! indent.open_delimiter "{") + (#set! indent.close_delimiter "}") + . + (_)) + +[ + (break_statement) + (continue_statement) +] @indent.dedent + +(ERROR + (_) @indent.branch + ":" + . + (#lua-match? @indent.branch "^else")) + +(ERROR + (_) @indent.branch @indent.dedent + ":" + . + (#lua-match? @indent.branch "^elif")) + +(parenthesized_expression + ")" @indent.end) + +(generator_expression + ")" @indent.end) + +(list_comprehension + "]" @indent.end) + +(set_comprehension + "}" @indent.end) + +(dictionary_comprehension + "}" @indent.end) + +(tuple_pattern + ")" @indent.end) + +(list_pattern + "]" @indent.end) + +(function_definition + "}" @indent.end) + +(anonymous_python_function + "}" @indent.end) + +(return_statement + [ + (_) @indent.end + (_ + [ + (_) + ")" + "}" + "]" + ] @indent.end .) + (attribute + attribute: (_) @indent.end) + (call + arguments: (_ + ")" @indent.end)) + "return" @indent.end + ] .) + +[ + ")" + "]" + "}" + (elif_clause) + (else_clause) + (except_clause) + (finally_clause) +] @indent.branch + +(string) @indent.auto diff --git a/runtime/queries/bitbake/injections.scm b/runtime/queries/bitbake/injections.scm new file mode 100644 index 000000000..35c984a5b --- /dev/null +++ b/runtime/queries/bitbake/injections.scm @@ -0,0 +1,15 @@ +(call + function: (attribute + object: (python_identifier) @_re) + arguments: (argument_list + (python_string + (string_content) @injection.content) @_string) + (#eq? @_re "re") + (#lua-match? @_string "^r.*") + (#set! injection.language "regex")) + +((shell_content) @injection.content + (#set! injection.language "bash")) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bitbake/locals.scm b/runtime/queries/bitbake/locals.scm new file mode 100644 index 000000000..e4726ec51 --- /dev/null +++ b/runtime/queries/bitbake/locals.scm @@ -0,0 +1,117 @@ +; References +[ + (python_identifier) + (identifier) +] @local.reference + +; Imports +(aliased_import + alias: (python_identifier) @local.definition.import) + +(import_statement + name: (dotted_name + (python_identifier) @local.definition.import)) + +(import_from_statement + name: (dotted_name + (python_identifier) @local.definition.import)) + +; Function with parameters, defines parameters +(parameters + (python_identifier) @local.definition.parameter) + +(default_parameter + (python_identifier) @local.definition.parameter) + +(typed_parameter + (python_identifier) @local.definition.parameter) + +(typed_default_parameter + (python_identifier) @local.definition.parameter) + +; *args parameter +(parameters + (list_splat_pattern + (python_identifier) @local.definition.parameter)) + +; **kwargs parameter +(parameters + (dictionary_splat_pattern + (python_identifier) @local.definition.parameter)) + +; Function defines function and scope +((python_function_definition + name: (python_identifier) @local.definition.function) @local.scope + (#set! definition.function.scope "parent")) + +(function_definition + (identifier) @local.definition.function) + +(anonymous_python_function + (identifier) @local.definition.function) + +; Loops +; not a scope! +(for_statement + left: (pattern_list + (python_identifier) @local.definition.var)) + +(for_statement + left: (tuple_pattern + (python_identifier) @local.definition.var)) + +(for_statement + left: (python_identifier) @local.definition.var) + +; not a scope! +;(while_statement) @local.scope +; for in list comprehension +(for_in_clause + left: (python_identifier) @local.definition.var) + +(for_in_clause + left: (tuple_pattern + (python_identifier) @local.definition.var)) + +(for_in_clause + left: (pattern_list + (python_identifier) @local.definition.var)) + +(dictionary_comprehension) @local.scope + +(list_comprehension) @local.scope + +(set_comprehension) @local.scope + +; Assignments +(assignment + left: (python_identifier) @local.definition.var) + +(assignment + left: (pattern_list + (python_identifier) @local.definition.var)) + +(assignment + left: (tuple_pattern + (python_identifier) @local.definition.var)) + +(assignment + left: (attribute + (python_identifier) + (python_identifier) @local.definition.field)) + +(variable_assignment + (identifier) + operator: [ + "=" + "?=" + "??=" + ":=" + ] @local.definition.var) + +; Walrus operator x := 1 +(named_expression + (python_identifier) @local.definition.var) + +(as_pattern + alias: (as_pattern_target) @local.definition.var) diff --git a/runtime/queries/blade/folds.scm b/runtime/queries/blade/folds.scm new file mode 100644 index 000000000..cc081a754 --- /dev/null +++ b/runtime/queries/blade/folds.scm @@ -0,0 +1,14 @@ +[ + (authorization) + (conditional) + (envoy) + (fragment) + (livewire) + (loop) + (once) + (php_statement) + (section) + (stack) + (switch) + (verbatim) +] @fold diff --git a/runtime/queries/blade/highlights.scm b/runtime/queries/blade/highlights.scm new file mode 100644 index 000000000..c05d2845f --- /dev/null +++ b/runtime/queries/blade/highlights.scm @@ -0,0 +1,15 @@ +([ + (directive) + (directive_start) + (directive_end) +] @tag + (#set! priority 101)) + +([ + (bracket_start) + (bracket_end) +] @tag.delimiter + (#set! priority 101)) + +((comment) @comment @spell + (#set! priority 101)) diff --git a/runtime/queries/blade/indents.scm b/runtime/queries/blade/indents.scm new file mode 100644 index 000000000..bd3e84d16 --- /dev/null +++ b/runtime/queries/blade/indents.scm @@ -0,0 +1,3 @@ +(directive_start) @indent.begin + +(directive_end) @indent.end diff --git a/runtime/queries/blade/injections.scm b/runtime/queries/blade/injections.scm new file mode 100644 index 000000000..12fa9f953 --- /dev/null +++ b/runtime/queries/blade/injections.scm @@ -0,0 +1,15 @@ +((text) @injection.content + (#set! injection.combined) + (#set! injection.language html)) + +((text) @injection.content + (#has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language bash)) + +((php_only) @injection.content + (#set! injection.combined) + (#set! injection.language php_only)) + +((parameter) @injection.content + (#set! injection.language php_only)) diff --git a/runtime/queries/blueprint/highlights.scm b/runtime/queries/blueprint/highlights.scm new file mode 100644 index 000000000..f3c39f232 --- /dev/null +++ b/runtime/queries/blueprint/highlights.scm @@ -0,0 +1,75 @@ +(object_id) @variable + +(string) @string + +(escape_sequence) @string.escape + +(comment) @comment @spell + +(constant) @constant.builtin + +(boolean) @boolean + +(using) @keyword.import + +(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) + +(import_statement + (gobject_library) @module) + +(import_statement + (version_number) @number.float) + +(float) @number.float + +(number) @number + +[ + ";" + "." + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket diff --git a/runtime/queries/blueprint/injections.scm b/runtime/queries/blueprint/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/blueprint/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bp/folds.scm b/runtime/queries/bp/folds.scm new file mode 100644 index 000000000..c40ea3df4 --- /dev/null +++ b/runtime/queries/bp/folds.scm @@ -0,0 +1,6 @@ +[ + (list_expression) + (map_expression) + (module) + (select_expression) +] @fold diff --git a/runtime/queries/bp/highlights.scm b/runtime/queries/bp/highlights.scm new file mode 100644 index 000000000..5f94f4c11 --- /dev/null +++ b/runtime/queries/bp/highlights.scm @@ -0,0 +1,56 @@ +(comment) @comment @spell + +(operator) @operator + +(integer_literal + "-" @operator) + +[ + "," + ":" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(boolean_literal) @boolean + +(integer_literal) @number + +[ + (raw_string_literal) + (interpreted_string_literal) +] @string + +(escape_sequence) @string.escape + +(identifier) @variable + +(module + type: (identifier) @function.call) + +(module + (property + field: (identifier) @variable.parameter)) + +[ + (unset) + (default) + (any) +] @variable.builtin + +(condition + name: (identifier) @function.builtin) + +(map_expression + (property + field: (identifier) @property)) + +(select_expression + "select" @keyword.conditional) diff --git a/runtime/queries/bp/indents.scm b/runtime/queries/bp/indents.scm new file mode 100644 index 000000000..8cf8adc83 --- /dev/null +++ b/runtime/queries/bp/indents.scm @@ -0,0 +1,38 @@ +(list_expression) @indent.begin + +(list_expression + "]" @indent.branch) + +(map_expression) @indent.begin + +(map_expression + "}" @indent.branch) + +(select_expression) @indent.begin + +(select_expression + ")" @indent.branch) + +(select_value) @indent.begin + +(select_value + ")" @indent.branch) + +(select_pattern + "(" @indent.begin) + +(select_pattern + ")" @indent.branch) + +(select_cases) @indent.begin + +(select_cases + "}" @indent.branch) + +(module) @indent.begin + +(module + ")" @indent.branch) + +(module + "}" @indent.branch) diff --git a/runtime/queries/bp/injections.scm b/runtime/queries/bp/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/bp/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/bp/locals.scm b/runtime/queries/bp/locals.scm new file mode 100644 index 000000000..c8a5a1719 --- /dev/null +++ b/runtime/queries/bp/locals.scm @@ -0,0 +1,15 @@ +(module + (property + field: (identifier) @local.definition.parameter)) + +(map_expression + (property + field: (identifier) @local.definition.field)) + +(assignment + left: (identifier) @local.definition.var) + +(pattern_binding + binding: (identifier) @local.definition.var) + +(identifier) @local.reference diff --git a/runtime/queries/brightscript/folds.scm b/runtime/queries/brightscript/folds.scm new file mode 100644 index 000000000..56b7d575b --- /dev/null +++ b/runtime/queries/brightscript/folds.scm @@ -0,0 +1,8 @@ +[ + (function_statement) + (sub_statement) + (while_statement) + (for_statement) + (if_statement) + (try_statement) +] @fold diff --git a/runtime/queries/brightscript/highlights.scm b/runtime/queries/brightscript/highlights.scm new file mode 100644 index 000000000..5758f565b --- /dev/null +++ b/runtime/queries/brightscript/highlights.scm @@ -0,0 +1,177 @@ +; Identifiers +(identifier) @variable + +; Function declaration +(function_statement + name: (identifier) @function) + +; Sub declaration +(sub_statement + name: (identifier) @function) + +[ + (sub_start) + (function_start) + (end_sub) + (end_function) +] @keyword.function + +; Parameters +(parameter + name: (identifier) @variable.parameter) + +; Types +(type_specifier) @type + +; Variables +; Base variable in variable declarator (immediate child of prefix_exp) +(variable_declarator + (prefix_exp + (identifier) @variable + (#not-has-ancestor? @variable prefix_exp))) + +; Properties in variable declarator +(variable_declarator + (prefix_exp) + (identifier) @property) + +(multiplicative_expression + operator: (_) @keyword.operator) + +(logical_not_expression + operator: (_) @keyword.operator) + +(logical_expression + operator: (_) @keyword.operator) + +; Property access +; First identifier in a chain (base variable) +(prefix_exp + . + (identifier) @variable + (#not-has-ancestor? @variable prefix_exp)) + +; All other identifiers in a chain (properties) +(prefix_exp + (prefix_exp) + (identifier) @property) + +; Function calls +(function_call + function: (prefix_exp + (identifier) @function.call)) + +; Statements +[ + (if_start) + (else) + (else_if) + (end_if) + (then) + (conditional_compl_end_if) +] @keyword.conditional + +[ + (for_start) + (while_start) + (for_each) + (for_in) + (for_to) + (for_step) + (end_for) + (end_while) + (exit_while_statement) + (exit_for_statement) +] @keyword.repeat + +; Statements +[ + (try_start) + (try_catch) + (throw) + (end_try) +] @keyword.exception + +(return) @keyword.return + +(print) @function.builtin + +(constant) @constant + +; Operators +[ + "=" + "<>" + "<" + "<=" + ">" + ">=" + "+" + "-" + "*" + "/" +] @operator + +; Literals +(boolean) @boolean + +(number) @number + +(string) @string + +(invalid) @constant.builtin + +; Comments +(comment) @comment @spell + +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" + "?[" +] @punctuation.bracket + +[ + "." + "," + "?." +] @punctuation.delimiter + +; Special highlights for library statements +(library_statement) @keyword.import + +(library_statement + path: (string) @module) + +; Array and associative array literals +(array) @constructor + +(assoc_array) @constructor + +(assoc_array_element + key: (identifier) @property) + +; Increment/decrement operators +[ + (prefix_increment_expression) + (prefix_decrement_expression) + (postfix_increment_expression) + (postfix_decrement_expression) +] @operator + +; Comparison operators +(comparison_expression + [ + "=" + "<>" + "<" + "<=" + ">" + ">=" + ] @operator) + +(as) @keyword.operator diff --git a/runtime/queries/brightscript/indents.scm b/runtime/queries/brightscript/indents.scm new file mode 100644 index 000000000..e54bf52c1 --- /dev/null +++ b/runtime/queries/brightscript/indents.scm @@ -0,0 +1,39 @@ +; Start indentation for block-level constructs +[ + (sub_statement) + (function_statement) + (annonymous_sub) + (annonymous_function) + (conditional_compl) + (multi_line_if) + (for_statement) + (while_statement) + (try_statement) + (array) + (assoc_array) +] @indent.begin + +; End indentation for all end statements +[ + (end_sub) + (end_function) + (end_if) + (end_for) + (end_while) + (end_try) + (conditional_compl_end_if) + "]" + "}" +] @indent.branch @indent.end + +; Handle branching constructs +[ + (else_if_clause) + (else_clause) + (conditional_compl_else_if_clause) + (conditional_compl_else_clause) + (catch_clause) +] @indent.branch + +; Ignore comments for indentation +(comment) @indent.ignore diff --git a/runtime/queries/brightscript/injections.scm b/runtime/queries/brightscript/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/brightscript/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/c/folds.scm b/runtime/queries/c/folds.scm new file mode 100644 index 000000000..bb26a62eb --- /dev/null +++ b/runtime/queries/c/folds.scm @@ -0,0 +1,23 @@ +[ + (for_statement) + (if_statement) + (while_statement) + (do_statement) + (switch_statement) + (case_statement) + (function_definition) + (struct_specifier) + (enum_specifier) + (comment) + (preproc_if) + (preproc_elif) + (preproc_else) + (preproc_ifdef) + (preproc_function_def) + (initializer_list) + (gnu_asm_expression) + (preproc_include)+ +] @fold + +(compound_statement + (compound_statement) @fold) diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm new file mode 100644 index 000000000..ea65075f2 --- /dev/null +++ b/runtime/queries/c/highlights.scm @@ -0,0 +1,341 @@ +; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration. +((identifier) @variable + (#set! priority 95)) + +(preproc_def + (preproc_arg) @variable) + +[ + "default" + "goto" + "asm" + "__asm__" +] @keyword + +[ + "enum" + "struct" + "union" + "typedef" +] @keyword.type + +[ + "sizeof" + "offsetof" +] @keyword.operator + +(alignof_expression + . + _ @keyword.operator) + +"return" @keyword.return + +[ + "while" + "for" + "do" + "continue" + "break" +] @keyword.repeat + +[ + "if" + "else" + "case" + "switch" +] @keyword.conditional + +[ + "#if" + "#ifdef" + "#ifndef" + "#else" + "#elif" + "#endif" + "#elifdef" + "#elifndef" + (preproc_directive) +] @keyword.directive + +"#define" @keyword.directive.define + +"#include" @keyword.import + +[ + ";" + ":" + "," + "." + "::" +] @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 + [ + "?" + ":" + ] @keyword.conditional.ternary) + +(string_literal) @string + +(system_lib_string) @string + +(escape_sequence) @string.escape + +(null) @constant.builtin + +(number_literal) @number + +(char_literal) @character + +(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 + +(declaration + type: (type_identifier) @_type + declarator: (identifier) @label + (#eq? @_type "__label__")) + +[ + (type_identifier) + (type_descriptor) +] @type + +(storage_class_specifier) @keyword.modifier + +[ + (type_qualifier) + (gnu_asm_qualifier) + "__extension__" +] @keyword.modifier + +(linkage_specification + "extern" @keyword.modifier) + +(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 + ; format-ignore + (#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 + ; format-ignore + (#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.macro) + +(preproc_call + directive: (preproc_directive) @_u + argument: (_) @constant.macro + (#eq? @_u "#undef")) + +(preproc_ifdef + name: (identifier) @constant.macro) + +(preproc_elifdef + name: (identifier) @constant.macro) + +(preproc_defined + (identifier) @constant.macro) + +(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) @variable.parameter) + +(parameter_declaration + declarator: (array_declarator) @variable.parameter) + +(parameter_declaration + declarator: (pointer_declarator) @variable.parameter) + +; K&R functions +; To enable support for K&R functions, +; add the following lines to your own query config and uncomment them. +; They are commented out as they'll conflict with C++ +; Note that you'll need to have `; extends` at the top of your query file. +; +; (parameter_list (identifier) @variable.parameter) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (identifier) @variable.parameter)) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (array_declarator) @variable.parameter)) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (pointer_declarator) @variable.parameter)) +(preproc_params + (identifier) @variable.parameter) + +[ + "__attribute__" + "__declspec" + "__based" + "__cdecl" + "__clrcall" + "__stdcall" + "__fastcall" + "__thiscall" + "__vectorcall" + (ms_pointer_modifier) + (attribute_declaration) +] @attribute diff --git a/runtime/queries/c/indents.scm b/runtime/queries/c/indents.scm new file mode 100644 index 000000000..1932ce8d6 --- /dev/null +++ b/runtime/queries/c/indents.scm @@ -0,0 +1,99 @@ +[ + (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-kind-eq? @_body "compound_statement")) + +(while_statement + condition: (_) @indent.begin) + +((while_statement + body: (_) @_body) @indent.begin + (#not-kind-eq? @_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-kind-eq? @_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/runtime/queries/c/injections.scm b/runtime/queries/c/injections.scm new file mode 100644 index 000000000..24634864e --- /dev/null +++ b/runtime/queries/c/injections.scm @@ -0,0 +1,128 @@ +((preproc_arg) @injection.content + (#set! injection.self)) + +((comment) @injection.content + (#set! injection.language "comment")) + +((comment) @injection.content + (#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c") + (#set! injection.language "re2c")) + +((comment) @injection.content + (#lua-match? @injection.content "/[*\/][!*\/]" + ">=" + "=" + "-=" + "+=" + "*=" + "/=" + "%=" + "^" + "^=" + "&=" + "|=" + "~" + ">>" + ">>>" + "<<" + "<<=" + ">>=" + ">>>=" + "=>" + "??" + "??=" + ".." +] @operator + +(list_pattern + ".." @character.special) + +(discard) @character.special + +[ + ";" + "." + "," + ":" +] @punctuation.delimiter + +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +(interpolation_brace) @punctuation.special + +(type_argument_list + [ + "<" + ">" + ] @punctuation.bracket) + +[ + "using" + "as" +] @keyword.import + +(alias_qualified_name + (identifier + "global") @keyword.import) + +[ + "with" + "new" + "typeof" + "sizeof" + "is" + "and" + "or" + "not" + "stackalloc" + "__makeref" + "__reftype" + "__refvalue" + "in" + "out" + "ref" +] @keyword.operator + +[ + "lock" + "params" + "operator" + "default" + "implicit" + "explicit" + "override" + "get" + "set" + "init" + "where" + "add" + "remove" + "checked" + "unchecked" + "fixed" + "alias" + "file" + "unsafe" +] @keyword + +(attribute_target_specifier + . + _ @keyword) + +[ + "enum" + "record" + "class" + "struct" + "interface" + "namespace" + "event" + "delegate" +] @keyword.type + +[ + "async" + "await" +] @keyword.coroutine + +[ + "const" + "extern" + "readonly" + "static" + "volatile" + "required" + "managed" + "unmanaged" + "notnull" + "abstract" + "private" + "protected" + "internal" + "public" + "partial" + "sealed" + "virtual" + "global" +] @keyword.modifier + +(scoped_type + "scoped" @keyword.modifier) + +(query_expression + (_ + [ + "from" + "orderby" + "select" + "group" + "by" + "ascending" + "descending" + "equals" + "let" + ] @keyword)) + +[ + "return" + "yield" +] @keyword.return diff --git a/runtime/queries/c_sharp/injections.scm b/runtime/queries/c_sharp/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/c_sharp/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/c_sharp/locals.scm b/runtime/queries/c_sharp/locals.scm new file mode 100644 index 000000000..bef094007 --- /dev/null +++ b/runtime/queries/c_sharp/locals.scm @@ -0,0 +1,42 @@ +; Definitions +(variable_declarator + . + (identifier) @local.definition.var) + +(variable_declarator + (tuple_pattern + (identifier) @local.definition.var)) + +(declaration_expression + name: (identifier) @local.definition.var) + +(foreach_statement + left: (identifier) @local.definition.var) + +(foreach_statement + left: (tuple_pattern + (identifier) @local.definition.var)) + +(parameter + (identifier) @local.definition.parameter) + +(method_declaration + name: (identifier) @local.definition.method) + +(local_function_statement + name: (identifier) @local.definition.method) + +(property_declaration + name: (identifier) @local.definition) + +(type_parameter + (identifier) @local.definition.type) + +(class_declaration + name: (identifier) @local.definition) + +; References +(identifier) @local.reference + +; Scope +(block) @local.scope diff --git a/runtime/queries/caddy/folds.scm b/runtime/queries/caddy/folds.scm new file mode 100644 index 000000000..fd7d23999 --- /dev/null +++ b/runtime/queries/caddy/folds.scm @@ -0,0 +1 @@ +(block) @fold diff --git a/runtime/queries/caddy/highlights.scm b/runtime/queries/caddy/highlights.scm new file mode 100644 index 000000000..47a170f76 --- /dev/null +++ b/runtime/queries/caddy/highlights.scm @@ -0,0 +1,55 @@ +(comment) @comment @spell + +[ + (env) + (argv) + (block_variable) + (placeholder) +] @constant + +(value) @variable + +(directive + (keyword) @attribute) + +(global_options + (option + (keyword) @attribute)) + +(keyword) @keyword + +(boolean) @boolean + +(placeholder + [ + "{" + "}" + ] @punctuation.special) + +(auto) @variable.builtin + +[ + (string_literal) + (quoted_string_literal) + (address) +] @string + +[ + (matcher) + (route) + (snippet_name) +] @string.special + +[ + (numeric_literal) + (time) + (size) + (ip_literal) +] @number + +[ + "{" + "}" +] @punctuation.bracket + +"," @punctuation.delimiter diff --git a/runtime/queries/caddy/indents.scm b/runtime/queries/caddy/indents.scm new file mode 100644 index 000000000..b746788ab --- /dev/null +++ b/runtime/queries/caddy/indents.scm @@ -0,0 +1,8 @@ +(block) @indent.begin + +(block + "}" @indent.branch) + +(comment) @indent.auto + +(ERROR) @indent.auto diff --git a/runtime/queries/caddy/injections.scm b/runtime/queries/caddy/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/caddy/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cairo/folds.scm b/runtime/queries/cairo/folds.scm new file mode 100644 index 000000000..9937da6f1 --- /dev/null +++ b/runtime/queries/cairo/folds.scm @@ -0,0 +1,26 @@ +[ + (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/runtime/queries/cairo/highlights.scm b/runtime/queries/cairo/highlights.scm new file mode 100644 index 000000000..1ea6245d3 --- /dev/null +++ b/runtime/queries/cairo/highlights.scm @@ -0,0 +1,414 @@ +; Preproc +[ + "%builtins" + "%lang" +] @keyword.directive + +; Includes +(import_statement + [ + "from" + "import" + ] @keyword.import + module_name: (dotted_name + (identifier) @module .)) + +[ + "as" + "use" + "mod" +] @keyword.import + +; Variables +(identifier) @variable + +; Namespaces +(namespace_definition + (identifier) @module) + +(mod_item + name: (identifier) @module) + +(use_list + (self) @module) + +(scoped_use_list + (self) @module) + +(scoped_identifier + path: (identifier) @module) + +(scoped_identifier + (scoped_identifier + name: (identifier) @module)) + +(scoped_type_identifier + path: (identifier) @module) + +((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) @module) + +(scoped_use_list + path: (scoped_identifier + (identifier) @module)) + +(use_list + (scoped_identifier + (identifier) @module + . + (_))) + +(use_list + (identifier) @type + (#lua-match? @type "^[A-Z]")) + +(use_as_clause + alias: (identifier) @type + (#lua-match? @type "^[A-Z]")) + +; Keywords +[ + ; 0.x + "using" + "let" + "const" + "local" + "rel" + "abs" + "dw" + "alloc_locals" + (inst_ret) + "with_attr" + "with" + "call" + "nondet" + ; 1.0 + "impl" + "implicits" + "of" + "ref" + "mut" +] @keyword + +[ + "struct" + "enum" + "namespace" + "type" + "trait" +] @keyword.type + +[ + "func" + "fn" + "end" +] @keyword.function + +"return" @keyword.return + +[ + "cast" + "new" + "and" +] @keyword.operator + +[ + "tempvar" + "extern" +] @keyword.modifier + +[ + "if" + "else" + "match" +] @keyword.conditional + +"loop" @keyword.repeat + +[ + "assert" + "static_assert" + "nopanic" +] @keyword.exception + +; Fields +(implicit_arguments + (typed_identifier + (identifier) @variable.member)) + +(member_expression + "." + (identifier) @variable.member) + +(call_expression + (assignment_expression + left: (identifier) @variable.member)) + +(tuple_expression + (assignment_expression + left: (identifier) @variable.member)) + +(field_identifier) @variable.member + +(shorthand_field_initializer + (identifier) @variable.member) + +; Parameters +(arguments + (typed_identifier + (identifier) @variable.parameter)) + +(call_expression + (tuple_expression + (assignment_expression + left: (identifier) @variable.parameter))) + +(return_type + (tuple_type + (named_type + . + (identifier) @variable.parameter))) + +(parameter + (identifier) @variable.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) @variable.member)?) + +(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 diff --git a/runtime/queries/cairo/indents.scm b/runtime/queries/cairo/indents.scm new file mode 100644 index 000000000..f63ef36fe --- /dev/null +++ b/runtime/queries/cairo/indents.scm @@ -0,0 +1,57 @@ +[ + (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/runtime/queries/cairo/injections.scm b/runtime/queries/cairo/injections.scm new file mode 100644 index 000000000..fbb66be38 --- /dev/null +++ b/runtime/queries/cairo/injections.scm @@ -0,0 +1,5 @@ +((python_code) @injection.content + (#set! injection.language "python")) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cairo/locals.scm b/runtime/queries/cairo/locals.scm new file mode 100644 index 000000000..0573cf6db --- /dev/null +++ b/runtime/queries/cairo/locals.scm @@ -0,0 +1,66 @@ +; References +(identifier) @local.reference + +((type_identifier) @local.reference + (#set! reference.kind "type")) + +((field_identifier) @local.reference + (#set! reference.kind "field")) + +; Scopes +[ + (program) + (block) + (function_definition) + (loop_expression) + (if_expression) + (match_expression) + (match_arm) + (struct_item) + (enum_item) + (impl_item) +] @local.scope + +(use_declaration + argument: (scoped_identifier + name: (identifier) @local.definition.import)) + +(use_as_clause + alias: (identifier) @local.definition.import) + +(use_list + (identifier) @local.definition.import) ; use std::process::{Child, Command, Stdio}; + +; Functions +(function_definition + (identifier) @local.definition.function) + +(function_definition + (identifier) @local.definition.method + (parameter + (self))) + +; Function with parameters, defines parameters +(parameter + [ + (identifier) + (self) + ] @local.definition.parameter) + +; Types +(struct_item + name: (type_identifier) @local.definition.type) + +(constrained_type_parameter + left: (type_identifier) @local.definition.type) ; the P in remove_file>(path: P) + +(enum_item + name: (type_identifier) @local.definition.type) + +; Module +(mod_item + name: (identifier) @local.definition.namespace) + +; Variables +(assignment_expression + left: (identifier) @local.definition.var) diff --git a/runtime/queries/capnp/folds.scm b/runtime/queries/capnp/folds.scm new file mode 100644 index 000000000..6e3f9c187 --- /dev/null +++ b/runtime/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/runtime/queries/capnp/highlights.scm b/runtime/queries/capnp/highlights.scm new file mode 100644 index 000000000..a48c007ed --- /dev/null +++ b/runtime/queries/capnp/highlights.scm @@ -0,0 +1,141 @@ +; Preproc +[ + (unique_id) + (top_level_annotation_body) +] @keyword.directive + +; Includes +[ + "import" + "$import" + "embed" + "using" +] @keyword.import + +(import_path) @string.special.path + +; Keywords +"extends" @keyword + +[ + "struct" + "interface" + "union" + "enum" + "annotation" + "group" + "namespace" +] @keyword.type + +; Builtins +"const" @keyword.modifier + +[ + (primitive_type) + "List" +] @type.builtin + +; Typedefs +(type_definition) @type.definition + +; Labels (@number, @number!) +(field_version) @label + +; Methods +[ + (annotation_definition_identifier) + (method_identifier) +] @function.method + +; Fields +(field_identifier) @variable.member + +; Properties +(property) @property + +; Parameters +[ + (param_identifier) + (return_identifier) +] @variable.parameter + +(annotation_target) @variable.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) @string.special + +(escape_sequence) @string.escape + +(data_string) @string.special + +(number) @number + +(float) @number.float + +(boolean) @boolean + +(data_hex) @string.special.symbol + +; Punctuation +[ + "*" + "$" + ":" +] @punctuation.special + +[ + "{" + "}" +] @punctuation.bracket + +[ + "(" + ")" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + "." + "," + ";" + "->" +] @punctuation.delimiter + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/capnp/indents.scm b/runtime/queries/capnp/indents.scm new file mode 100644 index 000000000..cc2f4d756 --- /dev/null +++ b/runtime/queries/capnp/indents.scm @@ -0,0 +1,40 @@ +[ + (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/runtime/queries/capnp/injections.scm b/runtime/queries/capnp/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/capnp/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/capnp/locals.scm b/runtime/queries/capnp/locals.scm new file mode 100644 index 000000000..d1f0ccacc --- /dev/null +++ b/runtime/queries/capnp/locals.scm @@ -0,0 +1,97 @@ +[ + (message) + (annotation_targets) + (const_list) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (struct_shorthand) + (union) +] @local.scope + +[ + (extend_type) + (field_type) +] @local.reference + +(custom_type + (type_identifier) @local.reference) + +(custom_type + (generics + (generic_parameters + (generic_identifier) @local.reference))) + +(annotation_definition_identifier) @local.definition + +(const_identifier) @local.definition.constant + +(enum + (enum_identifier) @local.definition.enum) + +[ + (enum_member) + (field_identifier) +] @local.definition.field + +(method_identifier) @local.definition.method + +(namespace) @local.definition.namespace + +[ + (param_identifier) + (return_identifier) +] @local.definition.parameter + +(group + (type_identifier) @local.definition.type) + +(struct + (type_identifier) @local.definition.type) + +(union + (type_identifier) @local.definition.type) + +(interface + (type_identifier) @local.definition.type) + +; Generics Related (don't know how to combine these) +(struct + (generics + (generic_parameters + (generic_identifier) @local.definition.parameter))) + +(interface + (generics + (generic_parameters + (generic_identifier) @local.definition.parameter))) + +(method + (implicit_generics + (implicit_generic_parameters + (generic_identifier) @local.definition.parameter))) + +(method + (generics + (generic_parameters + (generic_identifier) @local.definition.parameter))) + +(annotation + (generics + (generic_parameters + (generic_identifier) @local.definition.type))) + +(replace_using + (generics + (generic_parameters + (generic_identifier) @local.definition.type))) + +(return_type + (generics + (generic_parameters + (generic_identifier) @local.definition.type))) diff --git a/runtime/queries/chatito/folds.scm b/runtime/queries/chatito/folds.scm new file mode 100644 index 000000000..052dd2064 --- /dev/null +++ b/runtime/queries/chatito/folds.scm @@ -0,0 +1,5 @@ +[ + (intent_def) + (slot_def) + (alias_def) +] @fold diff --git a/runtime/queries/chatito/highlights.scm b/runtime/queries/chatito/highlights.scm new file mode 100644 index 000000000..47113f2cf --- /dev/null +++ b/runtime/queries/chatito/highlights.scm @@ -0,0 +1,54 @@ +; Punctuation +[ + "%[" + "@[" + "~[" + "*[" + "]" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter + +(eq) @operator + +([ + "\"" + "'" +] @punctuation.special + (#set! conceal "")) + +[ + "%" + "?" + "#" +] @character.special + +; Entities +(intent) @module + +(slot) @type + +(variation) @attribute + +(alias) @keyword.directive + +(number) @number + +(argument + key: (string) @property + value: (string) @string) + +(escape) @string.escape + +; Import +"import" @keyword.import + +(file) @string.special.path + +; Text +(word) @spell + +; Comment +(comment) @comment @spell diff --git a/runtime/queries/chatito/indents.scm b/runtime/queries/chatito/indents.scm new file mode 100644 index 000000000..dc9e13d78 --- /dev/null +++ b/runtime/queries/chatito/indents.scm @@ -0,0 +1,8 @@ +[ + (intent_def) + (slot_def) + (alias_def) +] @indent.begin + +(ERROR + "]") @indent.begin diff --git a/runtime/queries/chatito/injections.scm b/runtime/queries/chatito/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/chatito/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/chatito/locals.scm b/runtime/queries/chatito/locals.scm new file mode 100644 index 000000000..827447f57 --- /dev/null +++ b/runtime/queries/chatito/locals.scm @@ -0,0 +1,16 @@ +; Definitions +(intent_def + (intent) @local.definition) + +(slot_def + (slot) @local.definition) + +(alias_def + (alias) @local.definition) + +; References +(slot_ref + (slot) @local.reference) + +(alias_ref + (alias) @local.reference) diff --git a/runtime/queries/circom/folds.scm b/runtime/queries/circom/folds.scm new file mode 100644 index 000000000..47525b174 --- /dev/null +++ b/runtime/queries/circom/folds.scm @@ -0,0 +1,13 @@ +[ + (template_body) + (block_statement) + (if_statement) + (for_statement) + (while_statement) + (function_body) + (call_expression) + (array_expression) + (tuple_expression) + (comment) + (include_directive)+ +] @fold diff --git a/runtime/queries/circom/highlights.scm b/runtime/queries/circom/highlights.scm new file mode 100644 index 000000000..c61925e7a --- /dev/null +++ b/runtime/queries/circom/highlights.scm @@ -0,0 +1,137 @@ +; identifiers +; ----------- +(identifier) @variable + +; Pragma +; ----------- +[ + "pragma" + "circom" +] @keyword.directive + +(circom_version) @string.special + +; Include +; ----------- +[ + "public" + "signal" + "var" + "include" +] @keyword.import + +; Literals +; -------- +(string) @string + +(int_literal) @number + +; Definitions +; ----------- +(function_definition + name: (identifier) @function) + +(template_definition + name: (identifier) @function) + +; Use constructor coloring for special functions +"main" @constructor + +; Invocations +(call_expression + . + (identifier) @function.call) + +; Function parameters +(parameter + name: (identifier) @variable.parameter) + +; Members +(member_expression + property: (property_identifier) @property) + +; Tokens +; ------- +; Keywords +[ + "input" + "output" + "public" + "component" +] @keyword + +[ + "for" + "while" +] @keyword.repeat + +[ + "if" + "else" +] @keyword.conditional + +"return" @keyword.return + +[ + "function" + "template" +] @keyword.function + +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "." + "," + ";" +] @punctuation.delimiter + +; Operators +[ + "&&" + "||" + ">>" + "<<" + "&" + "^" + "|" + "+" + "-" + "*" + "/" + "%" + "**" + "<" + "<=" + "=" + "==" + "!=" + "+=" + "-=" + ">=" + ">" + "!" + "~" + "-" + "+" + "++" + "--" + "<==" + "==>" + "<--" + "-->" + "===" +] @operator + +; Comments +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) diff --git a/runtime/queries/circom/injections.scm b/runtime/queries/circom/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/circom/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/circom/locals.scm b/runtime/queries/circom/locals.scm new file mode 100644 index 000000000..4c3a75152 --- /dev/null +++ b/runtime/queries/circom/locals.scm @@ -0,0 +1,12 @@ +(function_definition) @local.scope + +(template_definition) @local.scope + +(main_component_definition) @local.scope + +(block_statement) @local.scope + +(parameter + name: (identifier) @local.definition) @local.definition + +(identifier) @local.reference diff --git a/runtime/queries/clojure/folds.scm b/runtime/queries/clojure/folds.scm new file mode 100644 index 000000000..eceb69712 --- /dev/null +++ b/runtime/queries/clojure/folds.scm @@ -0,0 +1,2 @@ +(source + (list_lit) @fold) diff --git a/runtime/queries/clojure/highlights.scm b/runtime/queries/clojure/highlights.scm new file mode 100644 index 000000000..264276634 --- /dev/null +++ b/runtime/queries/clojure/highlights.scm @@ -0,0 +1,347 @@ +; >> 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) @string.special.symbol + +(str_lit) @string + +(num_lit) @number + +(char_lit) @character + +(bool_lit) @boolean + +(nil_lit) @constant.builtin + +(comment) @comment @spell + +(regex_lit) @string.regexp + +[ + "'" + "`" +] @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) @string.special.symbol) + +(syn_quoting_lit + (sym_lit) @string.special.symbol) + +; Used in destructure pattern +((sym_lit) @variable.parameter + (#lua-match? @variable.parameter "^[&]")) + +; Inline function variables +((sym_lit) @variable.builtin + (#lua-match? @variable.builtin "^%%%d*$")) + +((sym_lit) @variable.builtin + (#eq? @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")) + +; Types +(sym_lit + name: (sym_name) @_name + (#lua-match? @_name "^[%u][^/%s]*$")) @type + +; Symbols with `.` but not `/` +(sym_lit + !namespace + name: (sym_name) @_name + (#lua-match? @_name "^[^.]+[.]")) @type + +; Interop +; (.instanceMember instance args*) +; (.instanceMember Classname args*) +((sym_lit + name: (sym_name) @_name) @function.method + (#lua-match? @_name "^%.[^-]")) + +; (.-instanceField instance) +((sym_name) @variable.member + (#lua-match? @variable.member "^%.%-%S*")) + +; Classname/staticField +(sym_lit + namespace: (sym_ns) @_namespace + (#lua-match? @_namespace "^[%u]%S*$")) @variable.member + +; (Classname/staticMethod args*) +(list_lit + . + (sym_lit + namespace: (sym_ns) @_namespace + (#lua-match? @_namespace "^%u")) @function.method) + +; 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 + name: (sym_name) @_keyword.function.name) @keyword.function + (#any-of? @_keyword.function.name "defn" "defn-" "fn" "fn*")) + +; Comment +((sym_lit) @comment + (#eq? @comment "comment")) + +; Conditionals +((sym_lit) @keyword.conditional + (#any-of? @keyword.conditional "case" "cond" "cond->" "cond->>" "condp")) + +((sym_lit) @keyword.conditional + (#any-of? @keyword.conditional "if" "if-let" "if-not" "if-some")) + +((sym_lit) @keyword.conditional + (#any-of? @keyword.conditional "when" "when-first" "when-let" "when-not" "when-some")) + +; Repeats +((sym_lit) @keyword.repeat + (#any-of? @keyword.repeat "doseq" "dotimes" "for" "loop" "recur" "while")) + +; Exception +((sym_lit) @keyword.exception + (#any-of? @keyword.exception "throw" "try" "catch" "finally")) + +; Includes +((sym_lit) @keyword.import + (#any-of? @keyword.import "ns" "import" "require" "use")) + +; Builtin macros +; TODO: Do all these items belong here? +((sym_lit + name: (sym_name) @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 + name: (sym_name) @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 + name: (sym_name) @_keyword.function.name) + (#any-of? @_keyword.function.name "defn" "defn-" "fn" "fn*")) + . + (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)* @variable.parameter) +; (list_lit +; (vec_lit +; (sym_lit)* @variable.parameter))]) +;[((list_lit +; (vec_lit +; (sym_lit) @variable.parameter) +; (_) +; + +; ((vec_lit +; (sym_lit) @variable.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) @module) diff --git a/runtime/queries/clojure/injections.scm b/runtime/queries/clojure/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/clojure/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/clojure/locals.scm b/runtime/queries/clojure/locals.scm new file mode 100644 index 000000000..e47adce45 --- /dev/null +++ b/runtime/queries/clojure/locals.scm @@ -0,0 +1 @@ +; placeholder file to get incremental selection to work diff --git a/runtime/queries/cmake/folds.scm b/runtime/queries/cmake/folds.scm new file mode 100644 index 000000000..ef153b911 --- /dev/null +++ b/runtime/queries/cmake/folds.scm @@ -0,0 +1,8 @@ +[ + (if_condition) + (foreach_loop) + (while_loop) + (function_def) + (macro_def) + (block_def) +] @fold diff --git a/runtime/queries/cmake/highlights.scm b/runtime/queries/cmake/highlights.scm new file mode 100644 index 000000000..fbbf0d542 --- /dev/null +++ b/runtime/queries/cmake/highlights.scm @@ -0,0 +1,221 @@ +(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" +] @module + +[ + "$" + "{" + "}" +] @punctuation.special + +[ + "(" + ")" +] @punctuation.bracket + +[ + (function) + (endfunction) + (macro) + (endmacro) +] @keyword.function + +[ + (if) + (elseif) + (else) + (endif) +] @keyword.conditional + +[ + (foreach) + (endforeach) + (while) + (endwhile) +] @keyword.repeat + +(normal_command + (identifier) @keyword.repeat + (#match? @keyword.repeat "\\c^(continue|break)$")) + +(normal_command + (identifier) @keyword.return + (#match? @keyword.return "\\c^return$")) + +(function_command + (function) + (argument_list + . + (argument) @function + (argument)* @variable.parameter)) + +(macro_command + (macro) + (argument_list + . + (argument) @function.macro + (argument)* @variable.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 @keyword.modifier + . + (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) @keyword.modifier + (#any-of? @keyword.modifier "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) @keyword.directive @nospell) + (#lua-match? @keyword.directive "^#!/")) diff --git a/runtime/queries/cmake/indents.scm b/runtime/queries/cmake/indents.scm new file mode 100644 index 000000000..cbd976c7a --- /dev/null +++ b/runtime/queries/cmake/indents.scm @@ -0,0 +1,26 @@ +[ + (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/runtime/queries/cmake/injections.scm b/runtime/queries/cmake/injections.scm new file mode 100644 index 000000000..eb8e21503 --- /dev/null +++ b/runtime/queries/cmake/injections.scm @@ -0,0 +1,5 @@ +([ + (bracket_comment) + (line_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm new file mode 100644 index 000000000..5d18b790a --- /dev/null +++ b/runtime/queries/comment/highlights.scm @@ -0,0 +1,49 @@ +((tag + (name) @comment.todo @nospell + ("(" @punctuation.bracket + (user) @constant + ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @comment.todo "TODO" "WIP")) + +("text" @comment.todo @nospell + (#any-of? @comment.todo "TODO" "WIP")) + +((tag + (name) @comment.note @nospell + ("(" @punctuation.bracket + (user) @constant + ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @comment.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) + +("text" @comment.note @nospell + (#any-of? @comment.note "NOTE" "XXX" "INFO" "DOCS" "PERF" "TEST")) + +((tag + (name) @comment.warning @nospell + ("(" @punctuation.bracket + (user) @constant + ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @comment.warning "HACK" "WARNING" "WARN" "FIX")) + +("text" @comment.warning @nospell + (#any-of? @comment.warning "HACK" "WARNING" "WARN" "FIX")) + +((tag + (name) @comment.error @nospell + ("(" @punctuation.bracket + (user) @constant + ")" @punctuation.bracket)? + ":" @punctuation.delimiter) + (#any-of? @comment.error "FIXME" "BUG" "ERROR")) + +("text" @comment.error @nospell + (#any-of? @comment.error "FIXME" "BUG" "ERROR")) + +; Issue number (#123) +("text" @number + (#lua-match? @number "^#[0-9]+$")) + +(uri) @string.special.url @nospell diff --git a/runtime/queries/commonlisp/folds.scm b/runtime/queries/commonlisp/folds.scm new file mode 100644 index 000000000..eceb69712 --- /dev/null +++ b/runtime/queries/commonlisp/folds.scm @@ -0,0 +1,2 @@ +(source + (list_lit) @fold) diff --git a/runtime/queries/commonlisp/highlights.scm b/runtime/queries/commonlisp/highlights.scm new file mode 100644 index 000000000..7236c84de --- /dev/null +++ b/runtime/queries/commonlisp/highlights.scm @@ -0,0 +1,315 @@ +(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) @variable.parameter)) + +(defun_header + keyword: (defun_keyword + "defmethod") + lambda_list: (list_lit + (list_lit + . + (sym_lit) + . + (sym_lit) @string.special.symbol))) + +(defun_header + lambda_list: (list_lit + (list_lit + . + (sym_lit) @variable.parameter + . + (_)))) + +(defun_header + specifier: (sym_lit) @string.special.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) @string.special.symbol + +[ + "#C" + "#c" +] @number + +[ + (kwd_lit) + (self_referential_reader_macro) +] @string.special.symbol + +(package_lit + package: (_) @module) + +"cl" @module + +(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 +(format_specifier) @string.escape + +(quoting_lit + "'" @string.escape) + +(syn_quoting_lit + "`" @string.escape) + +(unquoting_lit + "," @string.escape) + +(unquote_splicing_lit + ",@" @string.escape) + +[ + "(" + ")" +] @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: "#'" @string.special.symbol + value: (_) @string.special.symbol) + +[ + "#" + "#p" + "#P" +] @string.special.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) @string.special.symbol + (#lua-match? @string.special.symbol "^[&]")) + +[ + (array_dimension) + "#0A" + "#0a" +] @number + +(char_lit) @character diff --git a/runtime/queries/commonlisp/injections.scm b/runtime/queries/commonlisp/injections.scm new file mode 100644 index 000000000..dc8982053 --- /dev/null +++ b/runtime/queries/commonlisp/injections.scm @@ -0,0 +1,5 @@ +([ + (comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/commonlisp/locals.scm b/runtime/queries/commonlisp/locals.scm new file mode 100644 index 000000000..98036d322 --- /dev/null +++ b/runtime/queries/commonlisp/locals.scm @@ -0,0 +1,109 @@ +(defun_header + function_name: (sym_lit) @local.definition.function + (#set! definition.function.scope "parent")) + +(defun_header + lambda_list: (list_lit + (sym_lit) @local.definition.parameter)) + +(defun_header + keyword: (defun_keyword + "defmethod") + lambda_list: (list_lit + (list_lit + . + (sym_lit) + . + (sym_lit) @local.definition.type))) + +(defun_header + lambda_list: (list_lit + (list_lit + . + (sym_lit) @local.definition.parameter + . + (_)))) + +(sym_lit) @local.reference + +(defun) @local.scope + +((list_lit + . + (sym_lit) @_defvar + . + (sym_lit) @local.definition.var) + (#match? @_defvar "^(cl:)?(defvar|defparameter)$")) + +(list_lit + . + (sym_lit) @_deftest + . + (sym_lit) @local.definition.function + (#eq? @_deftest "deftest")) @local.scope + +(list_lit + . + (sym_lit) @_deftest + . + (sym_lit) @local.definition.function + (#eq? @_deftest "deftest")) @local.scope + +(for_clause + . + (sym_lit) @local.definition.var) + +(with_clause + . + (sym_lit) @local.definition.var) + +(loop_macro) @local.scope + +(list_lit + . + (sym_lit) @_let + (#match? @_let "(cl:|cffi:)?(with-accessors|with-foreign-objects|let[*]?)") + . + (list_lit + (list_lit + . + (sym_lit) @local.definition.var))) @local.scope + +(list_lit + . + (sym_lit) @_let + (#match? @_let "(cl:|alexandria:)?(with-gensyms|dotimes|with-foreign-object)") + . + (list_lit + . + (sym_lit) @local.definition.var)) @local.scope + +(list_lit + . + (kwd_lit) @_import_from + (#eq? @_import_from ":import-from") + . + (_) + (kwd_lit + (kwd_symbol) @local.definition.import)) + +(list_lit + . + (kwd_lit) @_import_from + (#eq? @_import_from ":import-from") + . + (_) + (sym_lit) @local.definition.import) + +(list_lit + . + (kwd_lit) @_use + (#eq? @_use ":use") + (kwd_lit + (kwd_symbol) @local.definition.import)) + +(list_lit + . + (kwd_lit) @_use + (#eq? @_use ":use") + (sym_lit) @local.definition.import) diff --git a/runtime/queries/cooklang/highlights.scm b/runtime/queries/cooklang/highlights.scm new file mode 100644 index 000000000..4ac391899 --- /dev/null +++ b/runtime/queries/cooklang/highlights.scm @@ -0,0 +1,31 @@ +(metadata) @comment + +(comment) @comment @spell + +[ + "{" + "}" +] @punctuation.bracket + +"%" @punctuation.special + +(ingredient + "@" @punctuation.delimiter + (name)? @string.special.symbol + (amount + (quantity)? @number + (units)? @constant)?) + +(timer + "~" @punctuation.delimiter + (name)? @string.special.symbol + (amount + (quantity)? @number + (units)? @constant)?) + +(cookware + "#" @punctuation.delimiter + (name)? @string.special.symbol + (amount + (quantity)? @number + (units)? @constant)?) diff --git a/runtime/queries/cooklang/injections.scm b/runtime/queries/cooklang/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/cooklang/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/corn/folds.scm b/runtime/queries/corn/folds.scm new file mode 100644 index 000000000..2ce5ddb31 --- /dev/null +++ b/runtime/queries/corn/folds.scm @@ -0,0 +1,5 @@ +[ + (object) + (array) + (assign_block) +] @fold diff --git a/runtime/queries/corn/highlights.scm b/runtime/queries/corn/highlights.scm new file mode 100644 index 000000000..8f394ed79 --- /dev/null +++ b/runtime/queries/corn/highlights.scm @@ -0,0 +1,37 @@ +[ + "let" + "in" +] @keyword + +[ + "{" + "}" + "[" + "]" +] @punctuation.bracket + +"." @punctuation.delimiter + +[ + ".." + "=" +] @operator + +(input) @constant + +(null) @constant.builtin + +(comment) @comment @spell + +(string) @string + +(integer) @number + +(float) @number.float + +(float + "." @number.float) + +(boolean) @boolean + +(path_seg) @property diff --git a/runtime/queries/corn/indents.scm b/runtime/queries/corn/indents.scm new file mode 100644 index 000000000..f1f5e04da --- /dev/null +++ b/runtime/queries/corn/indents.scm @@ -0,0 +1,24 @@ +[ + (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/runtime/queries/corn/injections.scm b/runtime/queries/corn/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/corn/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/corn/locals.scm b/runtime/queries/corn/locals.scm new file mode 100644 index 000000000..7e78c4d23 --- /dev/null +++ b/runtime/queries/corn/locals.scm @@ -0,0 +1,13 @@ +; scopes +[ + (object) + (array) +] @local.scope + +; definitions +(assign_block + (assignment + (input) @local.definition.constant)) + +(value + (input) @local.reference) diff --git a/runtime/queries/cpon/folds.scm b/runtime/queries/cpon/folds.scm new file mode 100644 index 000000000..02feec4e1 --- /dev/null +++ b/runtime/queries/cpon/folds.scm @@ -0,0 +1,5 @@ +[ + (meta_map) + (map) + (array) +] @fold diff --git a/runtime/queries/cpon/highlights.scm b/runtime/queries/cpon/highlights.scm new file mode 100644 index 000000000..9cc438ea5 --- /dev/null +++ b/runtime/queries/cpon/highlights.scm @@ -0,0 +1,54 @@ +; 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: (_) @property) + +(number) @number + +(float) @number.float + +(boolean) @boolean + +(null) @constant.builtin + +; Punctuation +[ + "," + ":" +] @punctuation.delimiter + +[ + "{" + "}" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + "<" + ">" +] @punctuation.bracket + +("\"" @string + (#set! conceal "")) + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/cpon/indents.scm b/runtime/queries/cpon/indents.scm new file mode 100644 index 000000000..8ec2ff57c --- /dev/null +++ b/runtime/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/runtime/queries/cpon/injections.scm b/runtime/queries/cpon/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/cpon/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cpon/locals.scm b/runtime/queries/cpon/locals.scm new file mode 100644 index 000000000..2a4ba4712 --- /dev/null +++ b/runtime/queries/cpon/locals.scm @@ -0,0 +1,6 @@ +[ + (document) + (meta_map) + (map) + (array) +] @local.scope diff --git a/runtime/queries/cpp/folds.scm b/runtime/queries/cpp/folds.scm new file mode 100644 index 000000000..f5f566480 --- /dev/null +++ b/runtime/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/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm new file mode 100644 index 000000000..85ff2dc40 --- /dev/null +++ b/runtime/queries/cpp/highlights.scm @@ -0,0 +1,268 @@ +; inherits: c + +((identifier) @variable.member + (#lua-match? @variable.member "^m_.*$")) + +(parameter_declaration + declarator: (reference_declarator) @variable.parameter) + +; function(Foo ...foo) +(variadic_parameter_declaration + declarator: (variadic_declarator + (_) @variable.parameter)) + +; int foo = 0 +(optional_parameter_declaration + declarator: (_) @variable.parameter) + +;(field_expression) @variable.parameter ;; How to highlight this? +((field_expression + (field_identifier) @function.method) @_parent + (#has-parent? @_parent template_method function_declarator)) + +(field_declaration + (field_identifier) @variable.member) + +(field_initializer + (field_identifier) @property) + +(function_declarator + declarator: (field_identifier) @function.method) + +(concept_definition + name: (identifier) @type.definition) + +(alias_declaration + name: (type_identifier) @type.definition) + +(auto) @type.builtin + +(namespace_identifier) @module + +((namespace_identifier) @type + (#lua-match? @type "^[%u]")) + +(case_statement + value: (qualified_identifier + (identifier) @constant)) + +(using_declaration + . + "using" + . + "namespace" + . + [ + (qualified_identifier) + (identifier) + ] @module) + +(destructor_name + (identifier) @function.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) @function.method)) + +(call_expression + (field_expression + (field_identifier) @function.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" +] @keyword.exception + +[ + "decltype" + "explicit" + "friend" + "override" + "using" + "requires" + "constexpr" +] @keyword + +[ + "class" + "namespace" + "template" + "typename" + "concept" +] @keyword.type + +[ + "co_await" + "co_yield" + "co_return" +] @keyword.coroutine + +[ + "public" + "private" + "protected" + "final" + "virtual" +] @keyword.modifier + +[ + "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/runtime/queries/cpp/indents.scm b/runtime/queries/cpp/indents.scm new file mode 100644 index 000000000..0782d226e --- /dev/null +++ b/runtime/queries/cpp/indents.scm @@ -0,0 +1,8 @@ +; inherits: c + +(condition_clause) @indent.begin + +((field_initializer_list) @indent.begin + (#set! indent.start_at_same_line 1)) + +(access_specifier) @indent.branch diff --git a/runtime/queries/cpp/injections.scm b/runtime/queries/cpp/injections.scm new file mode 100644 index 000000000..1fbc8e131 --- /dev/null +++ b/runtime/queries/cpp/injections.scm @@ -0,0 +1,9 @@ +; inherits: c + +((comment) @injection.content + (#lua-match? @injection.content "/[*\/][!*\/] +(type_parameter_declaration + (type_identifier) @local.definition.type) + +(template_declaration) @local.scope + +; Namespaces +(namespace_definition + name: (namespace_identifier) @local.definition.namespace + body: (_) @local.scope) + +(namespace_definition + name: (nested_namespace_specifier) @local.definition.namespace + body: (_) @local.scope) + +((namespace_identifier) @local.reference + (#set! reference.kind "namespace")) + +; Function definitions +(template_function + name: (identifier) @local.definition.function) @local.scope + +(template_method + name: (field_identifier) @local.definition.method) @local.scope + +(function_declarator + declarator: (qualified_identifier + name: (identifier) @local.definition.function)) @local.scope + +(field_declaration + declarator: (function_declarator + (field_identifier) @local.definition.method)) + +(lambda_expression) @local.scope + +; Control structures +(try_statement + body: (_) @local.scope) + +(catch_clause) @local.scope + +(requires_expression) @local.scope diff --git a/runtime/queries/css/folds.scm b/runtime/queries/css/folds.scm new file mode 100644 index 000000000..60d69a917 --- /dev/null +++ b/runtime/queries/css/folds.scm @@ -0,0 +1,10 @@ +[ + ; top-level block statements from https://github.com/tree-sitter/tree-sitter-css/blob/master/grammar.js + ; note: (block) is not used due to unideal behavior when node before block node spans multiple lines + (rule_set) + (at_rule) + (supports_statement) + (media_statement) + (keyframe_block) + (import_statement)+ +] @fold diff --git a/runtime/queries/css/highlights.scm b/runtime/queries/css/highlights.scm new file mode 100644 index 000000000..49471fdb2 --- /dev/null +++ b/runtime/queries/css/highlights.scm @@ -0,0 +1,109 @@ +[ + "@media" + "@charset" + "@namespace" + "@supports" + "@keyframes" + (at_keyword) +] @keyword.directive + +"@import" @keyword.import + +[ + (to) + (from) +] @keyword + +(comment) @comment @spell + +(tag_name) @tag + +(class_name) @type + +(id_name) @constant + +[ + (property_name) + (feature_name) +] @property + +[ + (nesting_selector) + (universal_selector) +] @character.special + +(function_name) @function + +[ + "~" + ">" + "+" + "-" + "*" + "/" + "=" + "^=" + "|=" + "~=" + "$=" + "*=" +] @operator + +[ + "and" + "or" + "not" + "only" +] @keyword.operator + +(important) @keyword.modifier + +(attribute_selector + (plain_value) @string) + +(pseudo_element_selector + "::" + (tag_name) @attribute) + +(pseudo_class_selector + (class_name) @attribute) + +(attribute_name) @tag.attribute + +(namespace_name) @module + +(keyframes_name) @variable + +((property_name) @variable + (#lua-match? @variable "^[-][-]")) + +((plain_value) @variable + (#lua-match? @variable "^[-][-]")) + +[ + (string_value) + (color_value) + (unit) +] @string + +(integer_value) @number + +(float_value) @number.float + +[ + "#" + "," + "." + ":" + "::" + ";" +] @punctuation.delimiter + +[ + "{" + ")" + "(" + "}" + "[" + "]" +] @punctuation.bracket diff --git a/runtime/queries/css/indents.scm b/runtime/queries/css/indents.scm new file mode 100644 index 000000000..75e4a63a9 --- /dev/null +++ b/runtime/queries/css/indents.scm @@ -0,0 +1,11 @@ +[ + (block) + (declaration) +] @indent.begin + +(block + "}" @indent.branch) + +"}" @indent.dedent + +(comment) @indent.ignore diff --git a/runtime/queries/css/injections.scm b/runtime/queries/css/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/css/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/csv/highlights.scm b/runtime/queries/csv/highlights.scm new file mode 100644 index 000000000..de2213aa1 --- /dev/null +++ b/runtime/queries/csv/highlights.scm @@ -0,0 +1,3 @@ +; inherits: tsv + +"," @punctuation.delimiter diff --git a/runtime/queries/cuda/folds.scm b/runtime/queries/cuda/folds.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/cuda/folds.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/cuda/highlights.scm b/runtime/queries/cuda/highlights.scm new file mode 100644 index 000000000..6605c5a72 --- /dev/null +++ b/runtime/queries/cuda/highlights.scm @@ -0,0 +1,17 @@ +; inherits: cpp + +[ + "<<<" + ">>>" +] @punctuation.bracket + +[ + "__host__" + "__device__" + "__global__" + "__managed__" + "__forceinline__" + "__noinline__" +] @keyword.modifier + +"__launch_bounds__" @keyword.modifier diff --git a/runtime/queries/cuda/indents.scm b/runtime/queries/cuda/indents.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/cuda/indents.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/cuda/injections.scm b/runtime/queries/cuda/injections.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/cuda/injections.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/cuda/locals.scm b/runtime/queries/cuda/locals.scm new file mode 100644 index 000000000..b617fdc56 --- /dev/null +++ b/runtime/queries/cuda/locals.scm @@ -0,0 +1 @@ +; inherits: cpp diff --git a/runtime/queries/cue/folds.scm b/runtime/queries/cue/folds.scm new file mode 100644 index 000000000..934b59e6f --- /dev/null +++ b/runtime/queries/cue/folds.scm @@ -0,0 +1,5 @@ +[ + (import_spec_list) + (field) + (string) +] @fold diff --git a/runtime/queries/cue/highlights.scm b/runtime/queries/cue/highlights.scm new file mode 100644 index 000000000..27d4daddc --- /dev/null +++ b/runtime/queries/cue/highlights.scm @@ -0,0 +1,164 @@ +; Includes +[ + "package" + "import" +] @keyword.import + +; Namespaces +(package_identifier) @module + +(import_spec + [ + "." + "_" + ] @punctuation.special) + +[ + (attr_path) + (package_path) +] @string.special.url ; In attributes + +; Attributes +(attribute) @attribute + +; Conditionals +"if" @keyword.conditional + +; Repeats +"for" @keyword.repeat + +(for_clause + "_" @punctuation.special) + +; Keywords +"let" @keyword + +"in" @keyword.operator + +; Operators +[ + "+" + "-" + "*" + "/" + "|" + "&" + "||" + "&&" + "==" + "!=" + "<" + "<=" + ">" + ">=" + "=~" + "!~" + "!" + "=" +] @operator + +; Fields & Properties +(field + (label + (identifier) @variable.member)) + +(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) @number.float + +(si_unit + (float) + (_) @string.special.symbol) + +(boolean) @boolean + +[ + (null) + (top) + (bottom) +] @constant.builtin + +; Interpolations +(interpolation + "\\(" @punctuation.special + (_) + ")" @punctuation.special) @none + +(interpolation + "\\(" + (identifier) @variable + ")") + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/cue/indents.scm b/runtime/queries/cue/indents.scm new file mode 100644 index 000000000..cef2345cc --- /dev/null +++ b/runtime/queries/cue/indents.scm @@ -0,0 +1,30 @@ +[ + (import_spec_list) + (field) +] @indent.begin + +[ + "}" + "]" + ")" +] @indent.end + +[ + "{" + "}" +] @indent.branch + +[ + "[" + "]" +] @indent.branch + +[ + "(" + ")" +] @indent.branch + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/runtime/queries/cue/injections.scm b/runtime/queries/cue/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/cue/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cue/locals.scm b/runtime/queries/cue/locals.scm new file mode 100644 index 000000000..b2a8972f7 --- /dev/null +++ b/runtime/queries/cue/locals.scm @@ -0,0 +1,31 @@ +; Scopes +[ + (source_file) + (field) + (for_clause) +] @local.scope + +; References +(identifier) @local.reference + +; Definitions +(import_spec + path: (string) @local.definition.import) + +(field + (label + (identifier) @local.definition.field)) + +(package_identifier) @local.definition.namespace + +(for_clause + (identifier) @local.definition.var + (expression)) + +(for_clause + (identifier) + (identifier) @local.definition.var + (expression)) + +(let_clause + (identifier) @local.definition.var) diff --git a/runtime/queries/cylc/folds.scm b/runtime/queries/cylc/folds.scm new file mode 100644 index 000000000..c8bd40703 --- /dev/null +++ b/runtime/queries/cylc/folds.scm @@ -0,0 +1,10 @@ +[ + (multiline_string) + (multiline_graph_string) + (top_section) + (sub_section_1) + (sub_section_2) + (runtime_section) + (task_section) + (graph_section) +] @fold diff --git a/runtime/queries/cylc/highlights.scm b/runtime/queries/cylc/highlights.scm new file mode 100644 index 000000000..a744caa52 --- /dev/null +++ b/runtime/queries/cylc/highlights.scm @@ -0,0 +1,72 @@ +(comment) @comment @spell + +(key) @property + +(boolean) @boolean + +(datetime) @string.special + +(task_name) @function + +(include_directive) @keyword.import + +[ + (section_name) + (namespace) +] @markup.heading + +[ + (integer) + (recurrence) +] @number + +[ + "[" + "]" + "[[" + "]]" + "[[[" + "]]]" + "<" + ">" + (graph_parenthesis) +] @punctuation.bracket + +[ + "\"" + "\"\"\"" + (unquoted_string) + (quoted_string) + (multiline_string) +] @string + +[ + (xtrigger_annotation) + (suicide_annotation) +] @attribute + +[ + "=" + (assignment_operator) + (graph_logical) + (graph_arrow) +] @operator + +(include_statement + path: (_)? @string.special.path) + +(task_parameter + name: (_)? @variable.parameter + selection: (_)? @variable.parameter) + +(task_output + ":" @tag + (nametag) @variable.builtin + "?"? @tag) + +[ + (jinja2_expression) + (jinja2_statement) + (jinja2_comment) + (jinja2_shebang) +] @keyword.directive diff --git a/runtime/queries/cylc/indents.scm b/runtime/queries/cylc/indents.scm new file mode 100644 index 000000000..0457e4580 --- /dev/null +++ b/runtime/queries/cylc/indents.scm @@ -0,0 +1,16 @@ +[ + (top_section) + (sub_section_1) + (sub_section_2) + (graph_section) + (runtime_section) + (task_section) +] @indent.begin + +(multiline_string + quotes_close: _ @indent.end) @indent.begin + +(multiline_graph_string + quotes_close: _ @indent.end) @indent.begin + +(line_continuation) @indent.zero diff --git a/runtime/queries/cylc/injections.scm b/runtime/queries/cylc/injections.scm new file mode 100644 index 000000000..41becd699 --- /dev/null +++ b/runtime/queries/cylc/injections.scm @@ -0,0 +1,11 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +; https://cylc.github.io/cylc-doc/latest/html/user-guide/task-implementation/job-scripts.html#jobscripts +((setting + key: (key) @_key + (#any-of? @_key + "script" "init-script" "env-script" "pre-script" "post-script" "err-script" "exit-script") + value: (_ + (string_content) @injection.content)) + (#set! injection.language "bash")) diff --git a/runtime/queries/d/folds.scm b/runtime/queries/d/folds.scm new file mode 100644 index 000000000..49d6256f6 --- /dev/null +++ b/runtime/queries/d/folds.scm @@ -0,0 +1,4 @@ +[ + (block_statement) + (aggregate_body) +] @fold diff --git a/runtime/queries/d/highlights.scm b/runtime/queries/d/highlights.scm new file mode 100644 index 000000000..11d08a1b7 --- /dev/null +++ b/runtime/queries/d/highlights.scm @@ -0,0 +1,374 @@ +; Keywords +[ + (directive) + (shebang) +] @keyword.directive + +[ + (import) + (module) +] @keyword.import + +[ + (alias) + (asm) + (class) + (delegate) + (delete) + (enum) + (interface) + (invariant) + (mixin) + (pragma) + (struct) + (template) + (union) + (unittest) + (version) + (with) + (traits) + (vector) + (parameters_) + (default) + (goto) +] @keyword + +(function) @keyword.function + +(synchronized) @keyword.coroutine + +[ + (if) + (else) + (switch) + (case) + (break) +] @keyword.conditional + +[ + (do) + (for) + (foreach) + (foreach_reverse) + (while) + (continue) +] @keyword.repeat + +(return) @keyword.return + +[ + (abstract) + (deprecated) + (private) + (protected) + (public) + (package) + (immutable) + (final) + (const) + (override) + (static) +] @keyword.modifier + +[ + (assert) + (try) + (catch) + (finally) + (throw) + (nothrow) +] @keyword.exception + +[ + (cast) + (new) + (in) + (is) + (not_in) + (not_is) + (typeid) + (typeof) +] @keyword.operator + +[ + (lazy) + (align) + (extern) + (scope) + (ref) + (pure) + (export) + (shared) + (gshared) + (out) + (inout) +] @keyword.modifier + +(parameter_attribute + (return) @keyword.modifier) + +(parameter_attribute + (in) @keyword.modifier) + +(parameter_attribute + (out) @keyword.modifier) + +(debug) @keyword.debug + +; Operators +[ + "/=" + "/" + ".." + "&" + "&=" + "&&" + "|" + "|=" + "||" + "-" + "-=" + "--" + "+" + "+=" + "++" + "<" + "<=" + "<<" + "<<=" + ">" + ">=" + ">>=" + ">>>=" + ">>" + ">>>" + "!" + "!=" + "$" + "=" + "==" + "*" + "*=" + "%" + "%=" + "^" + "^=" + "^^" + "^^=" + "~" + "~=" + "@" +] @operator + +; Variables +(identifier) @variable + +[ + "exit" + "success" + "failure" + (this) + (super) +] @variable.builtin + +(linkage_attribute + "(" + _ @variable.builtin + ")") + +; Modules +(module_fqn + (identifier) @module) + +; Attributes +(at_attribute + (identifier) @attribute) + +; Constants +(enum_member + (identifier) @constant) + +(manifest_declarator + . + (identifier) @constant) + +; Members +(aggregate_body + (variable_declaration + (declarator + (identifier) @variable.member))) + +(property_expression + "." + (identifier) @variable.member) + +(type + "." + (identifier) @variable.member) + +; Types +(class_declaration + (class) + . + (identifier) @type) + +(struct_declaration + (struct) + . + (identifier) @type) + +(union_declaration + (union) + . + (identifier) @type) + +(enum_declaration + (enum) + . + (identifier) @type) + +(alias_declaration + (alias) + . + (identifier) @type) + +((identifier) @type + (#lua-match? @type "^[A-Z].*")) + +(type + . + (identifier) @type .) + +[ + (auto) + (void) + (bool) + (byte) + (ubyte) + (char) + (short) + (ushort) + (wchar) + (dchar) + (int) + (uint) + (long) + (ulong) + (real) + (double) + (float) + (cent) + (ucent) + (ireal) + (idouble) + (ifloat) + (creal) + (double) + (cfloat) +] @type.builtin + +; Functions +(function_declaration + (identifier) @function) + +(call_expression + (identifier) @function) + +(call_expression + (type + (identifier) @function .)) + +(call_expression + (property_expression + (call_expression) + (identifier) @function .)) + +; Parameters +(parameter + (_) + (identifier) @variable.parameter) + +(function_literal + "(" + (type + (identifier) @variable.parameter)) + +; Constructors +(constructor + (this) @constructor) + +(destructor + (this) @constructor) + +(postblit + . + (this) @constructor) + +; Punctuation +[ + ";" + "." + ":" + "," + "=>" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +"..." @punctuation.special + +; Ternaries +(ternary_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +; Labels +(label + (identifier) @label) + +(goto_statement + (identifier) @label) + +; Literals +(string_literal) @string + +[ + (int_literal) + (float_literal) +] @number + +(char_literal) @character + +[ + (true) + (false) +] @boolean + +[ + (null) + (special_keyword) +] @constant.builtin + +; Comments +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[+][+][^+].*[+]/$")) diff --git a/runtime/queries/d/indents.scm b/runtime/queries/d/indents.scm new file mode 100644 index 000000000..c89b4e91d --- /dev/null +++ b/runtime/queries/d/indents.scm @@ -0,0 +1,24 @@ +[ + (parameters) + (template_parameters) + (expression_statement) + (aggregate_body) + (function_body) + (scope_statement) + (block_statement) + (case_statement) +] @indent.begin + +(comment) @indent.auto + +[ + (case) + (default) + "}" + "]" +] @indent.branch + +[ + (directive) + (shebang) +] @indent.zero diff --git a/runtime/queries/d/injections.scm b/runtime/queries/d/injections.scm new file mode 100644 index 000000000..cfc1bf986 --- /dev/null +++ b/runtime/queries/d/injections.scm @@ -0,0 +1,19 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((call_expression + (type) @_printf + (named_arguments + "(" + . + (named_argument + (expression + (string_literal) @injection.content)))) + (#eq? @_printf "printf") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "printf")) + +; TODO: uncomment when asm is added +; ((asm_inline) @injection.content +; (#set! injection.language "asm") +; (#set! injection.combined)) diff --git a/runtime/queries/d/locals.scm b/runtime/queries/d/locals.scm new file mode 100644 index 000000000..2cd7b9e89 --- /dev/null +++ b/runtime/queries/d/locals.scm @@ -0,0 +1,79 @@ +; Scopes +[ + (source_file) + (block_statement) + (aggregate_body) +] @local.scope + +; References +(identifier) @local.reference + +; Definitions +(module_def + (module_declaration + (module_fqn) @local.definition.namespace) + (#set! definition.namespace.scope "global")) + +(enum_declaration + (enum_member + . + (identifier) @local.definition.enum)) + +(class_declaration + (class) + . + (identifier) @local.definition.type) + +(struct_declaration + (struct) + . + (identifier) @local.definition.type) + +(union_declaration + (union) + . + (identifier) @local.definition.type) + +(enum_declaration + (enum) + . + (identifier) @local.definition.type) + +(alias_declaration + (alias_initializer + . + (identifier) @local.definition.type)) + +(constructor + (this) @local.definition.method) + +(destructor + (this) @local.definition.method) + +(postblit + (this) @local.definition.method) + +(aggregate_body + (function_declaration + (identifier) @local.definition.method)) + +(manifest_declarator + . + (identifier) @local.definition.constant) + +(anonymous_enum_declaration + (enum_member + . + (identifier) @local.definition.constant)) + +(variable_declaration + (declarator + (identifier) @local.definition.var)) + +(aggregate_body + (variable_declaration + (declarator + (identifier) @local.definition.field))) + +(function_declaration + (identifier) @local.definition.function) diff --git a/runtime/queries/dart/folds.scm b/runtime/queries/dart/folds.scm new file mode 100644 index 000000000..fc75ac219 --- /dev/null +++ b/runtime/queries/dart/folds.scm @@ -0,0 +1,13 @@ +[ + (class_definition) + (enum_declaration) + (extension_declaration) + (arguments) + (function_body) + (block) + (switch_block) + (list_literal) + (set_or_map_literal) + (string_literal) + (import_or_export)+ +] @fold diff --git a/runtime/queries/dart/highlights.scm b/runtime/queries/dart/highlights.scm new file mode 100644 index 000000000..072a10d26 --- /dev/null +++ b/runtime/queries/dart/highlights.scm @@ -0,0 +1,303 @@ +(identifier) @variable + +(dotted_identifier_list) @string + +; Methods +; -------------------- +; TODO: add method/call_expression to grammar and +; distinguish method call from variable access +(function_expression_body + (identifier) @function.call) + +; ((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.call + (#lua-match? @function.call "^_?[%l]")) + . + (selector + . + (argument_part))) @function.call + +; Annotations +; -------------------- +(annotation + "@" @attribute + 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 + +[ + "=>" + ".." + "??" + "==" + "!" + "?" + "&&" + "%" + "<" + ">" + "=" + ">=" + "<=" + "||" + ">>>=" + ">>=" + "<<=" + "&=" + "|=" + "??=" + "%=" + "+=" + "-=" + "*=" + "/=" + "^=" + "~/=" + (shift_operator) + (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) @function.method) + +(getter_signature + (identifier) @function.method) + +(setter_signature + name: (identifier) @function.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) + +(type_arguments + [ + "<" + ">" + ] @punctuation.bracket) + +; 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) + +(this) @variable.builtin + +; Parameters +; -------------------- +(formal_parameter + (identifier) @variable.parameter) + +(named_argument + (label + (identifier) @variable.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) @string.special.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" +] @keyword.import + +; 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" + "on" + "extends" + "in" + "is" + "new" + "super" + "with" +] @keyword + +[ + "class" + "enum" + "extension" +] @keyword.type + +"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" + "external" + "static" + "final" + "base" + "sealed" +] @keyword.modifier + +; 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" +] @keyword.conditional + +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +[ + "try" + "throw" + "catch" + "finally" + (break_statement) +] @keyword.exception + +[ + "do" + "while" + "continue" + "for" +] @keyword.repeat diff --git a/runtime/queries/dart/indents.scm b/runtime/queries/dart/indents.scm new file mode 100644 index 000000000..03d9464bc --- /dev/null +++ b/runtime/queries/dart/indents.scm @@ -0,0 +1,49 @@ +[ + (class_body) + (function_body) + (function_expression_body) + (declaration + (initializers)) + (switch_block) + (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) + +(comment) @indent.ignore + +; dedenting the else block is painfully slow; replace with simpler strategy +; (if_statement) @indent.begin +; (if_statement +; (block) @indent.branch) +(if_statement) @indent.auto diff --git a/runtime/queries/dart/injections.scm b/runtime/queries/dart/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/dart/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/dart/locals.scm b/runtime/queries/dart/locals.scm new file mode 100644 index 000000000..3e3beb58e --- /dev/null +++ b/runtime/queries/dart/locals.scm @@ -0,0 +1,32 @@ +; Definitions +(function_signature + name: (identifier) @local.definition.function) + +(formal_parameter + name: (identifier) @local.definition.parameter) + +(initialized_variable_definition + name: (identifier) @local.definition.var) + +(initialized_identifier + (identifier) @local.definition.var) + +(static_final_declaration + (identifier) @local.definition.var) + +; References +(identifier) @local.reference + +; Scopes +(class_definition + body: (_) @local.scope) + +[ + (block) + (if_statement) + (for_statement) + (while_statement) + (try_statement) + (catch_clause) + (finally_clause) +] @local.scope diff --git a/runtime/queries/desktop/folds.scm b/runtime/queries/desktop/folds.scm new file mode 100644 index 000000000..624ca8a86 --- /dev/null +++ b/runtime/queries/desktop/folds.scm @@ -0,0 +1 @@ +(group) @fold diff --git a/runtime/queries/desktop/highlights.scm b/runtime/queries/desktop/highlights.scm new file mode 100644 index 000000000..7a5ebf241 --- /dev/null +++ b/runtime/queries/desktop/highlights.scm @@ -0,0 +1,94 @@ +(comment) @comment @spell + +(group_name) @markup.heading + +(entry + key: (identifier) @property) + +(localized_key + name: (identifier) @property) + +[ + (language) + (country) + (encoding) + (modifier) +] @string.special + +(string) @string + +(escape_sequence) @string.escape + +(field_code) @character.special + +[ + (true) + (false) +] @boolean + +"=" @operator + +[ + ";" + "_" + "." + "@" +] @punctuation.delimiter + +[ + "[" + "]" +] @punctuation.bracket + +; Especial entries +((entry + key: (identifier) @_key + value: (string) @type) + (#eq? @_key "Type") + (#any-of? @type "Application" "Link" "Directory")) + +((entry + key: (identifier) @_key + value: (string) @number) + (#eq? @_key "Version")) + +((entry + key: (identifier) @_key + value: (string) @string.special.path) + (#any-of? @_key "TryExec" "Path")) + +((entry + key: (identifier) @_key + value: (string) @string.special.url) + (#eq? @_key "URL")) + +; https://specifications.freedesktop.org/menu-spec/latest/category-registry.html +((entry + key: (identifier) @_key + value: (list + (string) @constant.builtin)) + (#eq? @_key "Categories") + (#any-of? @constant.builtin + ; Main categories + "AudioVideo" "Audio" "Video" "Development" "Education" "Game" "Graphics" "Network" "Office" + "Science" "Settings" "System" "Utility" + ; Additional Categories + "Building" "Debugger" "IDE" "GUIDesigner" "Profiling" "RevisionControl" "Translation" "Calendar" + "ContactManagement" "Database" "Dictionary" "Chart" "Email" "Finance" "FlowChart" "PDA" + "ProjectManagement" "Presentation" "Spreadsheet" "WordProcessor" "2DGraphics" "VectorGraphics" + "RasterGraphics" "3DGraphics" "Scanning" "OCR" "Photography" "Publishing" "Viewer" "TextTools" + "DesktopSettings" "HardwareSettings" "Printing" "PackageManager" "Dialup" "InstantMessaging" + "Chat" "IRCClient" "Feed" "FileTransfer" "HamRadio" "News" "P2P" "RemoteAccess" "Telephony" + "TelephonyTools" "VideoConference" "WebBrowser" "WebDevelopment" "Midi" "Mixer" "Sequencer" + "Tuner" "TV" "AudioVideoEditing" "Player" "Recorder" "DiscBurning" "ActionGame" "AdventureGame" + "ArcadeGame" "BoardGame" "BlocksGame" "CardGame" "KidsGame" "LogicGame" "RolePlaying" "Shooter" + "Simulation" "SportsGame" "StrategyGame" "Art" "Construction" "Music" "Languages" + "ArtificialIntelligence" "Astronomy" "Biology" "Chemistry" "ComputerScience" "DataVisualization" + "Economy" "Electricity" "Geography" "Geology" "Geoscience" "History" "Humanities" + "ImageProcessing" "Literature" "Maps" "Math" "NumericalAnalysis" "MedicalSoftware" "Physics" + "Robotics" "Spirituality" "Sports" "ParallelComputing" "Amusement" "Archiving" "Compression" + "Electronics" "Emulator" "Engineering" "FileTools" "FileManager" "TerminalEmulator" "Filesystem" + "Monitor" "Security" "Accessibility" "Calculator" "Clock" "TextEditor" "Documentation" "Adult" + "Core" "KDE" "COSMIC" "GNOME" "XFCE" "DDE" "GTK" "Qt" "Motif" "Java" "ConsoleOnly" + ; Reserved + "Screensaver" "TrayIcon" "Applet" "Shell")) diff --git a/runtime/queries/desktop/injections.scm b/runtime/queries/desktop/injections.scm new file mode 100644 index 000000000..1666a0430 --- /dev/null +++ b/runtime/queries/desktop/injections.scm @@ -0,0 +1,8 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((entry + key: (identifier) @_exec + value: (string) @injection.content) + (#eq? @_exec "Exec") + (#set! injection.language "bash")) diff --git a/runtime/queries/devicetree/folds.scm b/runtime/queries/devicetree/folds.scm new file mode 100644 index 000000000..206c4bed8 --- /dev/null +++ b/runtime/queries/devicetree/folds.scm @@ -0,0 +1 @@ +(node) @fold diff --git a/runtime/queries/devicetree/highlights.scm b/runtime/queries/devicetree/highlights.scm new file mode 100644 index 000000000..74ec89af1 --- /dev/null +++ b/runtime/queries/devicetree/highlights.scm @@ -0,0 +1,61 @@ +(comment) @comment @spell + +[ + (preproc_include) + (dtsi_include) +] @keyword.import + +(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) @module) + +(property + (identifier) @property) + +(node + label: (_) @label) + +(call_expression + (identifier) @function.macro) + +(reference) @label ; referencing labeled_item.identifier + +(unit_address) @constant + +"=" @operator + +[ + "(" + ")" + "[" + "]" + "{" + "}" + "<" + ">" +] @punctuation.bracket + +[ + ";" + ":" + "," + "@" +] @punctuation.delimiter diff --git a/runtime/queries/devicetree/indents.scm b/runtime/queries/devicetree/indents.scm new file mode 100644 index 000000000..9740060ca --- /dev/null +++ b/runtime/queries/devicetree/indents.scm @@ -0,0 +1,12 @@ +[ + (node) + (property) + (integer_cells) +] @indent.begin + +[ + "}" + ">" +] @indent.branch + +(comment) @indent.ignore diff --git a/runtime/queries/devicetree/injections.scm b/runtime/queries/devicetree/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/devicetree/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/devicetree/locals.scm b/runtime/queries/devicetree/locals.scm new file mode 100644 index 000000000..e33a81dfd --- /dev/null +++ b/runtime/queries/devicetree/locals.scm @@ -0,0 +1,4 @@ +[ + (node) + (integer_cells) +] @local.scope diff --git a/runtime/queries/dhall/folds.scm b/runtime/queries/dhall/folds.scm new file mode 100644 index 000000000..bc92797b4 --- /dev/null +++ b/runtime/queries/dhall/folds.scm @@ -0,0 +1,10 @@ +[ + (let_binding) + (application_expression) + (lambda_expression) + (record_type) + (union_type) + (list_literal) + (record_literal) + (block_comment) +] @fold diff --git a/runtime/queries/dhall/highlights.scm b/runtime/queries/dhall/highlights.scm new file mode 100644 index 000000000..d7a5d0006 --- /dev/null +++ b/runtime/queries/dhall/highlights.scm @@ -0,0 +1,200 @@ +; Imports +(missing_import) @keyword.import + +(local_import) @string.special.path + +(http_import) @string.special.url + +[ + (env_variable) + (import_hash) +] @string.special + +[ + (import_as_bytes) + (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 + (#lua-match? @variable "^[A-Z][^.]*$")) + +; Parameters +(lambda_expression + label: (label) @variable.parameter) + +; Variables +(label) @variable + +(identifier + [ + (label) @variable + (de_bruijn_index) @operator + ]) + +(let_binding + label: (label) @variable) + +; Fields +(record_literal_entry + (label) @variable.member) + +(record_type_entry + (label) @variable.member) + +(selector + (selector_dot) + (_) @variable.member) + +; 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 + [ + "Bool" + "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" + "Date/show" + "Time" + "Time/show" + "TimeZone" + "TimeZone/show" + "Type" + "Kind" + "Sort" + ] @type.builtin) + +; Punctuation +[ + "," + "|" +] @punctuation.delimiter + +(selector_dot) @punctuation.delimiter + +[ + "{" + "}" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + "(" + ")" +] @punctuation.bracket + +[ + "<" + ">" +] @punctuation.bracket + +; Conditionals +[ + "if" + "then" + "else" +] @keyword.conditional + +; Literals +[ + (text_literal) + (bytes_literal) +] @string + +(interpolation + "}" @string) + +[ + (double_quote_escaped) + (single_quote_escaped) +] @string.escape + +[ + (integer_literal) + (natural_literal) +] @number + +(double_literal) @number.float + +(boolean_literal) @boolean + +(builtin + "None") @constant.builtin + +; Comments +[ + (line_comment) + (block_comment) +] @comment @spell diff --git a/runtime/queries/dhall/injections.scm b/runtime/queries/dhall/injections.scm new file mode 100644 index 000000000..3cd6aac8e --- /dev/null +++ b/runtime/queries/dhall/injections.scm @@ -0,0 +1,5 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/diff/folds.scm b/runtime/queries/diff/folds.scm new file mode 100644 index 000000000..3560abb3e --- /dev/null +++ b/runtime/queries/diff/folds.scm @@ -0,0 +1,5 @@ +[ + (block) + (hunks) + (hunk) +] @fold diff --git a/runtime/queries/diff/highlights.scm b/runtime/queries/diff/highlights.scm new file mode 100644 index 000000000..54c57a807 --- /dev/null +++ b/runtime/queries/diff/highlights.scm @@ -0,0 +1,49 @@ +(comment) @comment @spell + +[ + (addition) + (new_file) +] @diff.plus + +[ + (deletion) + (old_file) +] @diff.minus + +(commit) @constant + +(location) @attribute + +(command + "diff" @function + (argument) @variable.parameter) + +(filename) @string.special.path + +(mode) @number + +([ + ".." + "+" + "++" + "+++" + "++++" + "-" + "--" + "---" + "----" +] @punctuation.special + (#set! priority 95)) + +[ + (binary_change) + (similarity) + (file_change) +] @label + +(index + "index" @keyword) + +(similarity + (score) @number + "%" @number) diff --git a/runtime/queries/diff/injections.scm b/runtime/queries/diff/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/diff/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/disassembly/highlights.scm b/runtime/queries/disassembly/highlights.scm new file mode 100644 index 000000000..b1ece9ab6 --- /dev/null +++ b/runtime/queries/disassembly/highlights.scm @@ -0,0 +1,30 @@ +(byte) @constant + +[ + (address) + (hexadecimal) + (integer) +] @number + +(identifier) @variable + +(bad_instruction) @comment.warning + +(code_location + (identifier) @function.call) + +(comment) @comment + +(instruction) @function + +(memory_dump) @string + +[ + "<" + ">" +] @punctuation.special + +[ + "+" + ":" +] @punctuation.delimiter diff --git a/runtime/queries/disassembly/injections.scm b/runtime/queries/disassembly/injections.scm new file mode 100644 index 000000000..9fb52dafe --- /dev/null +++ b/runtime/queries/disassembly/injections.scm @@ -0,0 +1,6 @@ +; TODO: https://github.com/nvim-treesitter/nvim-treesitter/pull/5548#issuecomment-1773707396 +; +; To be added once a compatible Assembly parser is merged into nvim-treesitter +; +; ((instruction) @injection.content +; (#set! injection.language "asm")) diff --git a/runtime/queries/djot/folds.scm b/runtime/queries/djot/folds.scm new file mode 100644 index 000000000..94f3724eb --- /dev/null +++ b/runtime/queries/djot/folds.scm @@ -0,0 +1,7 @@ +[ + (section) + (code_block) + (raw_block) + (list) + (div) +] @fold diff --git a/runtime/queries/djot/highlights.scm b/runtime/queries/djot/highlights.scm new file mode 100644 index 000000000..73dd66057 --- /dev/null +++ b/runtime/queries/djot/highlights.scm @@ -0,0 +1,372 @@ +(heading) @markup.heading + +((heading + (marker) @_heading.marker) @markup.heading.1 + (#eq? @_heading.marker "# ")) + +((heading + (marker) @_heading.marker) @markup.heading.2 + (#eq? @_heading.marker "## ")) + +((heading + (marker) @_heading.marker) @markup.heading.3 + (#eq? @_heading.marker "### ")) + +((heading + (marker) @_heading.marker) @markup.heading.4 + (#eq? @_heading.marker "##### ")) + +((heading + (marker) @_heading.marker) @markup.heading.5 + (#eq? @_heading.marker "###### ")) + +((heading + (marker) @_heading.marker) @markup.heading.6 + (#eq? @_heading.marker "####### ")) + +(thematic_break) @string.special + +[ + (div_marker_begin) + (div_marker_end) +] @punctuation.delimiter + +([ + (code_block) + (raw_block) + (frontmatter) +] @markup.raw.block + (#set! priority 90)) + +; Remove @markup.raw for code with a language spec +(code_block + . + (code_block_marker_begin) + (language) + (code) @none + (#set! priority 90)) + +[ + (code_block_marker_begin) + (code_block_marker_end) + (raw_block_marker_begin) + (raw_block_marker_end) +] @punctuation.delimiter + +(language) @attribute + +(inline_attribute + _ @conceal + (#set! conceal "")) + +((language_marker) @punctuation.delimiter + (#set! conceal "")) + +(block_quote) @markup.quote + +(block_quote_marker) @punctuation.special + +(table_header) @markup.heading + +(table_header + "|" @punctuation.special) + +(table_row + "|" @punctuation.special) + +(table_separator) @punctuation.special + +(table_caption + (marker) @punctuation.special) + +(table_caption) @markup.italic + +[ + (list_marker_dash) + (list_marker_plus) + (list_marker_star) + (list_marker_definition) + (list_marker_decimal_period) + (list_marker_decimal_paren) + (list_marker_decimal_parens) + (list_marker_lower_alpha_period) + (list_marker_lower_alpha_paren) + (list_marker_lower_alpha_parens) + (list_marker_upper_alpha_period) + (list_marker_upper_alpha_paren) + (list_marker_upper_alpha_parens) + (list_marker_lower_roman_period) + (list_marker_lower_roman_paren) + (list_marker_lower_roman_parens) + (list_marker_upper_roman_period) + (list_marker_upper_roman_paren) + (list_marker_upper_roman_parens) +] @markup.list + +(list_marker_task + (unchecked)) @markup.list.unchecked + +(list_marker_task + (checked)) @markup.list.checked + +; Colorize `x` in `[x]` +((checked) @constant.builtin + (#offset! @constant.builtin 0 1 0 -1)) + +[ + (ellipsis) + (en_dash) + (em_dash) + (quotation_marks) +] @string.special + +(list_item + (term) @type.definition) + +; Conceal { and } but leave " and ' +((quotation_marks) @string.special + (#any-of? @string.special "\"}" "'}") + (#offset! @string.special 0 1 0 0) + (#set! conceal "")) + +((quotation_marks) @string.special + (#any-of? @string.special "\\\"" "\\'" "{'" "{\"") + (#offset! @string.special 0 0 0 -1) + (#set! conceal "")) + +[ + (hard_line_break) + (backslash_escape) +] @string.escape + +; Only conceal \ but leave escaped character. +((backslash_escape) @string.escape + (#offset! @string.escape 0 0 0 -1) + (#set! conceal "")) + +(frontmatter_marker) @punctuation.delimiter + +(emphasis) @markup.italic + +(strong) @markup.strong + +(symbol) @string.special.symbol + +(insert) @markup.underline + +(delete) @markup.strikethrough + +[ + (highlighted) + (superscript) + (subscript) +] @string.special + +([ + (emphasis_begin) + (emphasis_end) + (strong_begin) + (strong_end) + (superscript_begin) + (superscript_end) + (subscript_begin) + (subscript_end) + (highlighted_begin) + (highlighted_end) + (insert_begin) + (insert_end) + (delete_begin) + (delete_end) + (verbatim_marker_begin) + (verbatim_marker_end) + (math_marker) + (math_marker_begin) + (math_marker_end) + (raw_inline_attribute) + (raw_inline_marker_begin) + (raw_inline_marker_end) +] @punctuation.delimiter + (#set! conceal "")) + +((math) @markup.math + (#set! priority 90)) + +(verbatim) @markup.raw + +((raw_inline) @markup.raw + (#set! priority 90)) + +[ + (comment) + (inline_comment) +] @comment + +(span + [ + "[" + "]" + ] @punctuation.bracket) + +(inline_attribute + [ + "{" + "}" + ] @punctuation.bracket) + +(block_attribute + [ + "{" + "}" + ] @punctuation.bracket) + +[ + (class) + (class_name) +] @type + +(identifier) @tag + +(key_value + "=" @operator) + +(key_value + (key) @property) + +(key_value + (value) @string) + +(link_text + [ + "[" + "]" + ] @punctuation.bracket + (#set! conceal "")) + +(autolink + [ + "<" + ">" + ] @punctuation.bracket + (#set! conceal "")) + +(inline_link + (inline_link_destination) @markup.link.url + (#set! conceal "")) + +(link_reference_definition + ":" @punctuation.special) + +(full_reference_link + (link_text) @markup.link) + +(full_reference_link + (link_label) @markup.link.label + (#set! conceal "")) + +(collapsed_reference_link + "[]" @punctuation.bracket + (#set! conceal "")) + +(full_reference_link + [ + "[" + "]" + ] @punctuation.bracket + (#set! conceal "")) + +(collapsed_reference_link + (link_text) @markup.link) + +(collapsed_reference_link + (link_text) @markup.link.label) + +(inline_link + (link_text) @markup.link) + +(full_reference_image + (link_label) @markup.link.label) + +(full_reference_image + [ + "[" + "]" + ] @punctuation.bracket) + +(collapsed_reference_image + "[]" @punctuation.bracket) + +(image_description + [ + "![" + "]" + ] @punctuation.bracket) + +(image_description) @markup.italic + +(link_reference_definition + [ + "[" + "]" + ] @punctuation.bracket) + +(link_reference_definition + (link_label) @markup.link.label) + +(inline_link_destination + [ + "(" + ")" + ] @punctuation.bracket) + +[ + (autolink) + (inline_link_destination) + (link_destination) + (link_reference_definition) +] @markup.link.url + +(footnote + (reference_label) @markup.link.label) + +(footnote_reference + (reference_label) @markup.link.label) + +[ + (footnote_marker_begin) + (footnote_marker_end) +] @punctuation.bracket + +(todo) @comment.todo + +(note) @comment.note + +(fixme) @comment.error + +[ + (paragraph) + (comment) + (table_cell) +] @spell + +[ + (autolink) + (inline_link_destination) + (link_destination) + (code_block) + (raw_block) + (math) + (raw_inline) + (verbatim) + (reference_label) + (class) + (class_name) + (identifier) + (key_value) + (frontmatter) +] @nospell + +(full_reference_link + (link_label) @nospell) + +(full_reference_image + (link_label) @nospell) diff --git a/runtime/queries/djot/indents.scm b/runtime/queries/djot/indents.scm new file mode 100644 index 000000000..3b1a56ebd --- /dev/null +++ b/runtime/queries/djot/indents.scm @@ -0,0 +1,10 @@ +; The intention here is to rely on Neovims `autoindent` setting. +; This allows us to not indent after just a single list item +; so we can create narrow lists quickly, but indent blocks inside list items +; to the previous paragraph. +(list_item_content) @indent.auto + +(footnote_content) @indent.align + +((table_caption) @indent.begin + (#set! indent.immediate 1)) diff --git a/runtime/queries/djot/injections.scm b/runtime/queries/djot/injections.scm new file mode 100644 index 000000000..0e4141046 --- /dev/null +++ b/runtime/queries/djot/injections.scm @@ -0,0 +1,24 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +(math + (content) @injection.content + (#set! injection.language "latex")) + +(code_block + (language) @injection.language + (code) @injection.content) + +(raw_block + (raw_block_info + (language) @injection.language) + (content) @injection.content) + +(raw_inline + (content) @injection.content + (raw_inline_attribute + (language) @injection.language)) + +(frontmatter + (language) @injection.language + (frontmatter_content) @injection.content) diff --git a/runtime/queries/djot/locals.scm b/runtime/queries/djot/locals.scm new file mode 100644 index 000000000..1ac27529f --- /dev/null +++ b/runtime/queries/djot/locals.scm @@ -0,0 +1,17 @@ +(link_reference_definition + (link_label) @local.definition) + +(footnote + (reference_label) @local.definition) + +(collapsed_reference_link + (link_text) @local.reference) + +(full_reference_link + (link_label) @local.reference) + +(full_reference_image + (link_label) @local.reference) + +(footnote_reference + (reference_label) @local.reference) diff --git a/runtime/queries/dockerfile/highlights.scm b/runtime/queries/dockerfile/highlights.scm new file mode 100644 index 000000000..72893f8b0 --- /dev/null +++ b/runtime/queries/dockerfile/highlights.scm @@ -0,0 +1,68 @@ +[ + "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 + +[ + (heredoc_marker) + (heredoc_end) +] @label + +((heredoc_block + (heredoc_line) @string) + (#set! priority 90)) + +(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/runtime/queries/dockerfile/injections.scm b/runtime/queries/dockerfile/injections.scm new file mode 100644 index 000000000..5d3bbffb7 --- /dev/null +++ b/runtime/queries/dockerfile/injections.scm @@ -0,0 +1,12 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((shell_command + (shell_fragment) @injection.content) + (#set! injection.language "bash") + (#set! injection.combined)) + +((run_instruction + (heredoc_block) @injection.content) + (#set! injection.language "bash") + (#set! injection.include-children)) diff --git a/runtime/queries/dot/highlights.scm b/runtime/queries/dot/highlights.scm new file mode 100644 index 000000000..75ad92271 --- /dev/null +++ b/runtime/queries/dot/highlights.scm @@ -0,0 +1,49 @@ +(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) @module)) + +(attribute + name: (id + (identifier) @variable.member)) + +(attribute + value: (id + (identifier) @constant)) + +(comment) @comment @spell + +(preproc) @keyword.directive diff --git a/runtime/queries/dot/indents.scm b/runtime/queries/dot/indents.scm new file mode 100644 index 000000000..a951e5511 --- /dev/null +++ b/runtime/queries/dot/indents.scm @@ -0,0 +1,9 @@ +[ + (block) + (attr_list) +] @indent.begin + +[ + "}" + "]" +] @indent.branch @indent.end diff --git a/runtime/queries/dot/injections.scm b/runtime/queries/dot/injections.scm new file mode 100644 index 000000000..4fe39a8ba --- /dev/null +++ b/runtime/queries/dot/injections.scm @@ -0,0 +1,5 @@ +((html_internal) @injection.content + (#set! injection.language "html")) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/doxygen/highlights.scm b/runtime/queries/doxygen/highlights.scm new file mode 100644 index 000000000..454500d64 --- /dev/null +++ b/runtime/queries/doxygen/highlights.scm @@ -0,0 +1,61 @@ +((tag_name) @keyword + (#set! priority 105)) + +[ + "@code" + "@endcode" +] @keyword + +(identifier) @variable + +((tag + (tag_name) @_param + (identifier) @variable.parameter) + (#any-of? @_param "@param" "\\param")) + +(function + (identifier) @function) + +(function_link) @function + +(emphasis) @markup.italic + +[ + "\\a" + "\\c" +] @tag + +(code_block_language) @label + +[ + "in" + "out" + "inout" +] @keyword.modifier + +"~" @operator + +[ + "" + "" +] @tag + +[ + "." + "," + "::" + (code_block_start) + (code_block_end) +] @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +(code_block_content) @none diff --git a/runtime/queries/doxygen/indents.scm b/runtime/queries/doxygen/indents.scm new file mode 100644 index 000000000..ef30f1e76 --- /dev/null +++ b/runtime/queries/doxygen/indents.scm @@ -0,0 +1 @@ +(document) @indent.auto diff --git a/runtime/queries/doxygen/injections.scm b/runtime/queries/doxygen/injections.scm new file mode 100644 index 000000000..994f535ad --- /dev/null +++ b/runtime/queries/doxygen/injections.scm @@ -0,0 +1,15 @@ +((type) @injection.content + (#set! injection.parent)) + +([ + (function_link) + (code) +] @injection.content + (#set! injection.parent)) + +((link) @injection.content + (#set! injection.language "html")) + +(code_block + (code_block_language) @injection.language + (code_block_content) @injection.content) diff --git a/runtime/queries/dtd/folds.scm b/runtime/queries/dtd/folds.scm new file mode 100644 index 000000000..b1bce4ffb --- /dev/null +++ b/runtime/queries/dtd/folds.scm @@ -0,0 +1,4 @@ +[ + (conditionalSect) + (Comment) +] @fold diff --git a/runtime/queries/dtd/highlights.scm b/runtime/queries/dtd/highlights.scm new file mode 100644 index 000000000..9afd6e38b --- /dev/null +++ b/runtime/queries/dtd/highlights.scm @@ -0,0 +1,148 @@ +; Text declaration +(TextDecl + "xml" @keyword.directive) + +(TextDecl + [ + "version" + "encoding" + ] @tag.attribute) + +(TextDecl + (EncName) @string.special) + +(TextDecl + (VersionNum) @number) + +; Processing instructions +(PI) @keyword.directive + +; Element declaration +(elementdecl + "ELEMENT" @keyword.directive.define + (Name) @tag) + +(contentspec + (_ + (Name) @tag.attribute)) + +"#PCDATA" @type.builtin + +[ + "EMPTY" + "ANY" +] @keyword.modifier + +[ + "*" + "?" + "+" +] @character.special + +; Entity declaration +(GEDecl + "ENTITY" @keyword.directive.define + (Name) @constant) + +(GEDecl + (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +; Parsed entity declaration +(PEDecl + "ENTITY" @keyword.directive.define + "%" @operator + (Name) @function.macro) + +(PEDecl + (EntityValue) @string) + +; Notation declaration +(NotationDecl + "NOTATION" @keyword.directive + (Name) @label) + +; Attlist declaration +(AttlistDecl + "ATTLIST" @keyword.directive.define + (Name) @tag) + +(AttDef + (Name) @tag.attribute) + +(AttDef + (Enumeration + (Nmtoken) @string)) + +[ + (StringType) + (TokenizedType) +] @type.builtin + +(NotationType + "NOTATION" @type.builtin) + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" +] @attribute + +; Entities +(EntityRef) @constant + +((EntityRef) @constant.builtin + (#any-of? @constant.builtin "&" "<" ">" """ "'")) + +(CharRef) @character + +(PEReference) @function.macro + +; External references +[ + "PUBLIC" + "SYSTEM" +] @keyword + +(PubidLiteral) @string.special + +(SystemLiteral + (URI) @string.special.url) + +; Delimiters & punctuation +[ + "" + "" + "" +] @tag.delimiter + +[ + "(" + ")" + "[" +] @punctuation.bracket + +[ + "\"" + "'" +] @punctuation.delimiter + +[ + "," + "|" + "=" +] @operator + +; Misc +[ + "INCLUDE" + "IGNORE" +] @keyword.import + +(Comment) @comment @spell diff --git a/runtime/queries/dtd/injections.scm b/runtime/queries/dtd/injections.scm new file mode 100644 index 000000000..57fae5832 --- /dev/null +++ b/runtime/queries/dtd/injections.scm @@ -0,0 +1,2 @@ +((Comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/dtd/locals.scm b/runtime/queries/dtd/locals.scm new file mode 100644 index 000000000..88246c04a --- /dev/null +++ b/runtime/queries/dtd/locals.scm @@ -0,0 +1,11 @@ +(elementdecl + (Name) @local.definition.type) + +(elementdecl + (contentspec + (children + (Name) @local.reference))) + +(AttlistDecl + . + (Name) @local.reference) diff --git a/runtime/queries/earthfile/highlights.scm b/runtime/queries/earthfile/highlights.scm new file mode 100644 index 000000000..cc7dce298 --- /dev/null +++ b/runtime/queries/earthfile/highlights.scm @@ -0,0 +1,129 @@ +(string_array + "," @punctuation.delimiter) + +(string_array + [ + "[" + "]" + ] @punctuation.bracket) + +[ + "ARG" + "AS LOCAL" + "BUILD" + "CACHE" + "CMD" + "COPY" + "DO" + "ENTRYPOINT" + "ENV" + "EXPOSE" + "FROM DOCKERFILE" + "FROM" + "FUNCTION" + "GIT CLONE" + "HOST" + "IMPORT" + "LABEL" + "LET" + "PROJECT" + "RUN" + "SAVE ARTIFACT" + "SAVE IMAGE" + "SET" + "USER" + "VERSION" + "VOLUME" + "WORKDIR" +] @keyword + +(for_command + [ + "FOR" + "IN" + "END" + ] @keyword.repeat) + +(if_command + [ + "IF" + "END" + ] @keyword.conditional) + +(elif_block + "ELSE IF" @keyword.conditional) + +(else_block + "ELSE" @keyword.conditional) + +(import_command + [ + "IMPORT" + "AS" + ] @keyword.import) + +(try_command + [ + "TRY" + "FINALLY" + "END" + ] @keyword.exception) + +(wait_command + [ + "WAIT" + "END" + ] @keyword) + +(with_docker_command + [ + "WITH DOCKER" + "END" + ] @keyword) + +[ + (comment) + (line_continuation_comment) +] @comment @spell + +[ + (target_ref) + (target_artifact) + (function_ref) +] @function + +(target + (identifier) @function) + +[ + (double_quoted_string) + (single_quoted_string) +] @string + +(unquoted_string) @string.special + +(escape_sequence) @string.escape + +(variable) @variable + +(expansion + [ + "$" + "{" + "}" + "(" + ")" + ] @punctuation.special) + +(build_arg + [ + "--" + (variable) + ] @variable.parameter) + +(options + (_) @property) + +"=" @operator + +(line_continuation) @operator diff --git a/runtime/queries/earthfile/injections.scm b/runtime/queries/earthfile/injections.scm new file mode 100644 index 000000000..7435a400e --- /dev/null +++ b/runtime/queries/earthfile/injections.scm @@ -0,0 +1,9 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((line_continuation_comment) @injection.content + (#set! injection.language "comment")) + +((shell_fragment) @injection.content + (#set! injection.language "bash") + (#set! injection.include-children)) diff --git a/runtime/queries/ebnf/highlights.scm b/runtime/queries/ebnf/highlights.scm new file mode 100644 index 000000000..4254d04dd --- /dev/null +++ b/runtime/queries/ebnf/highlights.scm @@ -0,0 +1,42 @@ +; Simple tokens ;;;; +(terminal) @string + +(special_sequence) @string.special + +(integer) @number + +(comment) @comment @spell + +; Identifiers ;;;; +; Allow different highlighting for specific casings +((identifier) @type + (#lua-match? @type "^%u")) + +((identifier) @string.special.symbol + (#lua-match? @string.special.symbol "^%l")) + +((identifier) @constant + (#lua-match? @constant "^%u[%u%d_]+$")) + +; Punctuation ;;;; +[ + ";" + "," +] @punctuation.delimiter + +[ + "|" + "*" + "-" +] @operator + +"=" @keyword.operator + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket diff --git a/runtime/queries/ebnf/injections.scm b/runtime/queries/ebnf/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/ebnf/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/ecma/folds.scm b/runtime/queries/ecma/folds.scm new file mode 100644 index 000000000..a348f3444 --- /dev/null +++ b/runtime/queries/ecma/folds.scm @@ -0,0 +1,24 @@ +[ + (arguments) + (for_in_statement) + (for_statement) + (while_statement) + (arrow_function) + (function_expression) + (function_declaration) + (class_declaration) + (method_definition) + (do_statement) + (with_statement) + (switch_statement) + (switch_case) + (switch_default) + (import_statement)+ + (if_statement) + (try_statement) + (catch_clause) + (array) + (object) + (generator_function) + (generator_function_declaration) +] @fold diff --git a/runtime/queries/ecma/highlights.scm b/runtime/queries/ecma/highlights.scm new file mode 100644 index 000000000..cec2f4e3e --- /dev/null +++ b/runtime/queries/ecma/highlights.scm @@ -0,0 +1,392 @@ +; Types +; Javascript +; Variables +;----------- +(identifier) @variable + +; Properties +;----------- +(property_identifier) @variable.member + +(shorthand_property_identifier) @variable.member + +(private_property_identifier) @variable.member + +(object_pattern + (shorthand_property_identifier_pattern) @variable) + +(object_pattern + (object_assignment_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")) + +(statement_identifier) @label + +; Function and method definitions +;-------------------------------- +(function_expression + 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) + ] @function.method) + +(method_definition + name: (property_identifier) @constructor + (#eq? @constructor "constructor")) + +(pair + key: (property_identifier) @function.method + value: (function_expression)) + +(pair + key: (property_identifier) @function.method + value: (arrow_function)) + +(assignment_expression + left: (member_expression + property: (property_identifier) @function.method) + right: (arrow_function)) + +(assignment_expression + left: (member_expression + property: (property_identifier) @function.method) + right: (function_expression)) + +(variable_declarator + name: (identifier) @function + value: (arrow_function)) + +(variable_declarator + name: (identifier) @function + value: (function_expression)) + +(assignment_expression + left: (identifier) @function + right: (arrow_function)) + +(assignment_expression + left: (identifier) @function + right: (function_expression)) + +; Function and method calls +;-------------------------- +(call_expression + function: (identifier) @function.call) + +(call_expression + function: (member_expression + property: [ + (property_identifier) + (private_property_identifier) + ] @function.method.call)) + +(call_expression + function: (await_expression + (identifier) @function.call)) + +(call_expression + function: (await_expression + (member_expression + property: [ + (property_identifier) + (private_property_identifier) + ] @function.method.call))) + +; Builtins +;--------- +((identifier) @module.builtin + (#eq? @module.builtin "Intl")) + +((identifier) @function.builtin + (#any-of? @function.builtin + "eval" "isFinite" "isNaN" "parseFloat" "parseInt" "decodeURI" "decodeURIComponent" "encodeURI" + "encodeURIComponent" "require")) + +; Constructor +;------------ +(new_expression + constructor: (identifier) @constructor) + +; Decorators +;---------- +(decorator + "@" @attribute + (identifier) @attribute) + +(decorator + "@" @attribute + (call_expression + (identifier) @attribute)) + +(decorator + "@" @attribute + (member_expression + (property_identifier) @attribute)) + +(decorator + "@" @attribute + (call_expression + (member_expression + (property_identifier) @attribute))) + +; Literals +;--------- +[ + (this) + (super) +] @variable.builtin + +((identifier) @variable.builtin + (#eq? @variable.builtin "self")) + +[ + (true) + (false) +] @boolean + +[ + (null) + (undefined) +] @constant.builtin + +[ + (comment) + (html_comment) +] @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +(hash_bang_line) @keyword.directive + +((string_fragment) @keyword.directive + (#eq? @keyword.directive "use strict")) + +(string) @string + +(template_string) @string + +(escape_sequence) @string.escape + +(regex_pattern) @string.regexp + +(regex_flags) @character.special + +(regex + "/" @punctuation.bracket) ; Regex delimiters + +(number) @number + +((identifier) @number + (#any-of? @number "NaN" "Infinity")) + +; Punctuation +;------------ +[ + ";" + "." + "," + ":" +] @punctuation.delimiter + +[ + "--" + "-" + "-=" + "&&" + "+" + "++" + "+=" + "&=" + "/=" + "**=" + "<<=" + "<" + "<=" + "<<" + "=" + "==" + "===" + "!=" + "!==" + "=>" + ">" + ">=" + ">>" + "||" + "%" + "%=" + "*" + "**" + ">>>" + "&" + "|" + "^" + "??" + "*=" + ">>=" + ">>>=" + "^=" + "|=" + "&&=" + "||=" + "??=" + "..." +] @operator + +(binary_expression + "/" @operator) + +(ternary_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +(unary_expression + [ + "!" + "~" + "-" + "+" + ] @operator) + +(unary_expression + [ + "delete" + "void" + ] @keyword.operator) + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(template_substitution + [ + "${" + "}" + ] @punctuation.special) @none + +; Imports +;---------- +(namespace_import + "*" @character.special + (identifier) @module) + +(namespace_export + "*" @character.special + (identifier) @module) + +(export_statement + "*" @character.special) + +; Keywords +;---------- +[ + "if" + "else" + "switch" + "case" +] @keyword.conditional + +[ + "import" + "from" + "as" + "export" +] @keyword.import + +[ + "for" + "of" + "do" + "while" + "continue" +] @keyword.repeat + +[ + "break" + "const" + "debugger" + "extends" + "get" + "let" + "set" + "static" + "target" + "var" + "with" +] @keyword + +"class" @keyword.type + +[ + "async" + "await" +] @keyword.coroutine + +[ + "return" + "yield" +] @keyword.return + +"function" @keyword.function + +[ + "new" + "delete" + "in" + "instanceof" + "typeof" +] @keyword.operator + +[ + "throw" + "try" + "catch" + "finally" +] @keyword.exception + +(export_statement + "default" @keyword) + +(switch_default + "default" @keyword.conditional) diff --git a/runtime/queries/ecma/indents.scm b/runtime/queries/ecma/indents.scm new file mode 100644 index 000000000..d56741670 --- /dev/null +++ b/runtime/queries/ecma/indents.scm @@ -0,0 +1,82 @@ +[ + (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-kind-eq? @_body "statement_block")) @indent.begin + +(assignment_expression + right: (_) @_right + (#not-kind-eq? @_right "arrow_function" "function")) @indent.begin + +(variable_declarator + value: (_) @_value + (#not-kind-eq? @_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) @_outer + (#not-has-parent? @_outer if_statement)) + +[ + "}" + "]" +] @indent.end + +(template_string) @indent.ignore + +[ + (comment) + (ERROR) +] @indent.auto + +(if_statement + consequence: (_) @indent.dedent + (#not-kind-eq? @indent.dedent statement_block)) @indent.begin diff --git a/runtime/queries/ecma/injections.scm b/runtime/queries/ecma/injections.scm new file mode 100644 index 000000000..04abafcde --- /dev/null +++ b/runtime/queries/ecma/injections.scm @@ -0,0 +1,203 @@ +(((comment) @_jsdoc_comment + (#lua-match? @_jsdoc_comment "^/[*][*][^*].*[*]/$")) @injection.content + (#set! injection.language "jsdoc")) + +((comment) @injection.content + (#set! injection.language "comment")) + +; html(`...`), html`...`, sql(`...`), etc. +(call_expression + function: (identifier) @injection.language + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] + (#lua-match? @injection.language "^[a-zA-Z][a-zA-Z0-9]*$") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + ; Languages excluded from auto-injection due to special rules + ; - svg uses the html parser + ; - css uses the styled parser + (#not-any-of? @injection.language "svg" "css")) + +; svg`...` or svg(`...`) +(call_expression + function: (identifier) @_name + (#eq? @_name "svg") + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "html")) + +; Vercel PostgreSQL +; foo.sql`...` or foo.sql(`...`) +(call_expression + function: (member_expression + property: (property_identifier) @injection.language) + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] + (#eq? @injection.language "sql") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children)) + +(call_expression + function: (identifier) @_name + (#eq? @_name "gql") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "graphql")) + +(call_expression + function: (identifier) @_name + (#eq? @_name "hbs") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "glimmer")) + +; css``, keyframes`` +(call_expression + function: (identifier) @_name + (#any-of? @_name "css" "keyframes") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled")) + +; styled.div`` +(call_expression + function: (member_expression + object: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) + +; styled(Component)`` +(call_expression + function: (call_expression + function: (identifier) @_name + (#eq? @_name "styled")) + arguments: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) + +; 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) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) + +; 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) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled"))) + +((regex_pattern) @injection.content + (#set! injection.language "regex")) + +; ((comment) @_gql_comment +; (#eq? @_gql_comment "/* GraphQL */") +; (template_string) @injection.content +; (#set! injection.language "graphql")) +((template_string) @injection.content + (#lua-match? @injection.content "^`#graphql") + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "graphql")) + +; el.innerHTML = `` +(assignment_expression + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "outerHTML" "innerHTML")) + right: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "html")) + +; el.innerHTML = '' +(assignment_expression + left: (member_expression + property: (property_identifier) @_prop + (#any-of? @_prop "outerHTML" "innerHTML")) + right: (string + (string_fragment) @injection.content) + (#set! injection.language "html")) + +;---- Angular injections ----- +; @Component({ +; template: `` +; }) +(decorator + (call_expression + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "template")) + value: ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "angular"))))))) + +; @Component({ +; styles: [``] +; }) +(decorator + (call_expression + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "styles")) + value: (array + ((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "css")))))))) + +; @Component({ +; styles: `` +; }) +(decorator + (call_expression + function: ((identifier) @_name + (#eq? @_name "Component")) + arguments: (arguments + (object + (pair + key: ((property_identifier) @_prop + (#eq? @_prop "styles")) + value: ((template_string) @injection.content + (#set! injection.include-children) + (#offset! @injection.content 0 1 0 -1) + (#set! injection.language "css"))))))) diff --git a/runtime/queries/ecma/locals.scm b/runtime/queries/ecma/locals.scm new file mode 100644 index 000000000..24ea7c0a8 --- /dev/null +++ b/runtime/queries/ecma/locals.scm @@ -0,0 +1,42 @@ +; Scopes +;------- +(statement_block) @local.scope + +(function_expression) @local.scope + +(arrow_function) @local.scope + +(function_declaration) @local.scope + +(method_definition) @local.scope + +(for_statement) @local.scope + +(for_in_statement) @local.scope + +(catch_clause) @local.scope + +; Definitions +;------------ +(variable_declarator + name: (identifier) @local.definition.var) + +(import_specifier + (identifier) @local.definition.import) + +(namespace_import + (identifier) @local.definition.import) + +(function_declaration + (identifier) @local.definition.function + (#set! definition.var.scope parent)) + +(method_definition + (property_identifier) @local.definition.function + (#set! definition.var.scope parent)) + +; References +;------------ +(identifier) @local.reference + +(shorthand_property_identifier) @local.reference diff --git a/runtime/queries/editorconfig/folds.scm b/runtime/queries/editorconfig/folds.scm new file mode 100644 index 000000000..911798f5a --- /dev/null +++ b/runtime/queries/editorconfig/folds.scm @@ -0,0 +1 @@ +(section) @fold diff --git a/runtime/queries/editorconfig/highlights.scm b/runtime/queries/editorconfig/highlights.scm new file mode 100644 index 000000000..feb0a524c --- /dev/null +++ b/runtime/queries/editorconfig/highlights.scm @@ -0,0 +1,55 @@ +(comment) @comment @spell + +(section + (section_name) @string.special.path) + +(character_choice + (character) @constant) + +(character_range + start: (character) @constant + end: (character) @constant) + +[ + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + ".." + (path_separator) +] @punctuation.delimiter + +[ + "-" + "=" + (negation) +] @operator + +[ + (wildcard_characters) + (wildcard_any_characters) + (wildcard_single_character) +] @character.special + +(escaped_character) @string.escape + +(pair + key: (identifier) @property + value: (_) @string) + +(boolean) @boolean + +(integer) @number + +(unset) @constant.builtin + +[ + (spelling_language) + (indent_style) + (end_of_line) + (charset) +] @string.special diff --git a/runtime/queries/editorconfig/injections.scm b/runtime/queries/editorconfig/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/editorconfig/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/eds/folds.scm b/runtime/queries/eds/folds.scm new file mode 100644 index 000000000..911798f5a --- /dev/null +++ b/runtime/queries/eds/folds.scm @@ -0,0 +1 @@ +(section) @fold diff --git a/runtime/queries/eds/highlights.scm b/runtime/queries/eds/highlights.scm new file mode 100644 index 000000000..0e008c979 --- /dev/null +++ b/runtime/queries/eds/highlights.scm @@ -0,0 +1,45 @@ +"=" @punctuation.delimiter + +[ + "[" + "]" +] @punctuation.bracket + +((section_name) @variable.builtin + (#match? @variable.builtin + "\\c^(FileInfo|DeviceInfo|DummyUsage|MandatoryObjects|OptionalObjects)$")) + +((section_name) @variable.builtin + (#lua-match? @variable.builtin "^1")) + +(section + (section_name) @_name + (#match? @_name "\\c^Comments$")) @comment + +(section + (section_name) @_name + (statement + (key) @_key) @string + (#match? @_key "\\c^ParameterName$") + (#not-match? @_name "\\c^Comments$")) + +(section + (section_name) @_name + (statement + (key) @_key) @type + (#match? @_key "\\c^(ObjectType|DataType|AccessType)$") + (#not-match? @_name "\\c^Comments$")) + +(section + (section_name) @_name + (statement + (key) @_key) @attribute + (#match? @_key "\\c^PDOMapping$") + (#not-match? @_name "\\c^Comments$")) + +(section + (section_name) @_name + (statement + (key) @_key) @number + (#match? @_key "\\c^(DefaultValue|LowLimit|HighLimit|SubNumber)$") + (#not-match? @_name "\\c^Comments$")) diff --git a/runtime/queries/eex/highlights.scm b/runtime/queries/eex/highlights.scm new file mode 100644 index 000000000..d032a7486 --- /dev/null +++ b/runtime/queries/eex/highlights.scm @@ -0,0 +1,12 @@ +[ + "%>" + "--%>" + "<%!--" + "<%" + "<%#" + "<%%=" + "<%=" +] @tag.delimiter + +; EEx comments are highlighted as such +(comment) @comment @spell diff --git a/runtime/queries/eex/injections.scm b/runtime/queries/eex/injections.scm new file mode 100644 index 000000000..f13d3c14e --- /dev/null +++ b/runtime/queries/eex/injections.scm @@ -0,0 +1,8 @@ +; EEx expressions are Elixir +((expression) @injection.content + (#set! injection.language "elixir")) + +; EEx expressions can span multiple interpolated lines +((partial_expression) @injection.content + (#set! injection.language "elixir") + (#set! injection.combined)) diff --git a/runtime/queries/elixir/folds.scm b/runtime/queries/elixir/folds.scm new file mode 100644 index 000000000..7abfe6797 --- /dev/null +++ b/runtime/queries/elixir/folds.scm @@ -0,0 +1,10 @@ +[ + (anonymous_function) + (stab_clause) + (arguments) + (block) + (do_block) + (list) + (map) + (tuple) +] @fold diff --git a/runtime/queries/elixir/highlights.scm b/runtime/queries/elixir/highlights.scm new file mode 100644 index 000000000..cbdb40de5 --- /dev/null +++ b/runtime/queries/elixir/highlights.scm @@ -0,0 +1,217 @@ +; Punctuation +[ + "," + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "<<" + ">>" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +"%" @punctuation.special + +; Identifiers +(identifier) @variable + +; Unused Identifiers +((identifier) @comment + (#lua-match? @comment "^_")) + +; Comments +(comment) @comment @spell + +; Strings +(string) @string + +; Modules +(alias) @module + +; Atoms & Keywords +[ + (atom) + (quoted_atom) + (keyword) + (quoted_keyword) +] @string.special.symbol + +; Interpolation +(interpolation + [ + "#{" + "}" + ] @string.special) + +; Escape sequences +(escape_sequence) @string.escape + +; Integers +(integer) @number + +; Floats +(float) @number.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) + (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/runtime/queries/elixir/indents.scm b/runtime/queries/elixir/indents.scm new file mode 100644 index 000000000..5470b6422 --- /dev/null +++ b/runtime/queries/elixir/indents.scm @@ -0,0 +1,25 @@ +[ + (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/runtime/queries/elixir/injections.scm b/runtime/queries/elixir/injections.scm new file mode 100644 index 000000000..f70fd984c --- /dev/null +++ b/runtime/queries/elixir/injections.scm @@ -0,0 +1,59 @@ +; Comments +((comment) @injection.content + (#set! injection.language "comment")) + +; Documentation +(unary_operator + operator: "@" + operand: (call + target: ((identifier) @_identifier + (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) + (arguments + [ + (string + (quoted_content) @injection.content) + (sigil + (quoted_content) @injection.content) + ]) + (#set! injection.language "markdown"))) + +; HEEx +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#any-of? @_sigil_name "H" "LVN") + (#set! injection.language "heex")) + +; Surface +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#eq? @_sigil_name "F") + (#set! injection.language "surface")) + +; Zigler +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#any-of? @_sigil_name "E" "L") + (#set! injection.language "eex")) + +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#any-of? @_sigil_name "z" "Z") + (#set! injection.language "zig")) + +; Regex +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#any-of? @_sigil_name "r" "R") + (#set! injection.language "regex")) + +; Json +(sigil + (sigil_name) @_sigil_name + (quoted_content) @injection.content + (#any-of? @_sigil_name "j" "J") + (#set! injection.language "json")) diff --git a/runtime/queries/elixir/locals.scm b/runtime/queries/elixir/locals.scm new file mode 100644 index 000000000..ac9d86e36 --- /dev/null +++ b/runtime/queries/elixir/locals.scm @@ -0,0 +1,200 @@ +; References +(identifier) @local.reference + +(alias) @local.reference + +; Module Definitions +(call + target: ((identifier) @_identifier + (#eq? @_identifier "defmodule")) + (arguments + (alias) @local.definition.type)) + +; Pattern Match Definitions +(binary_operator + ; format-ignore + left: + [ + (identifier) @local.definition.var + (_ (identifier) @local.definition.var) + (_ (_ (identifier) @local.definition.var)) + (_ (_ (_ (identifier) @local.definition.var))) + (_ (_ (_ (_ (identifier) @local.definition.var)))) + (_ (_ (_ (_ (_ (identifier) @local.definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))) + ] + operator: "=") + +; Stab Clause Definitions +; format-ignore +(stab_clause + left: + [ + (arguments + [ + (identifier) @local.definition.var + (_ (identifier) @local.definition.var) + (_ (_ (identifier) @local.definition.var)) + (_ (_ (_ (identifier) @local.definition.var))) + (_ (_ (_ (_ (identifier) @local.definition.var)))) + (_ (_ (_ (_ (_ (identifier) @local.definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))) + ]) + + (binary_operator + left: + (arguments + ; format-ignore + [ + (identifier) @local.definition.var + (_ (identifier) @local.definition.var) + (_ (_ (identifier) @local.definition.var)) + (_ (_ (_ (identifier) @local.definition.var))) + (_ (_ (_ (_ (identifier) @local.definition.var)))) + (_ (_ (_ (_ (_ (identifier) @local.definition.var))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.var)))))))))))))))))))) + ]) + operator: "when") + ]) + +; Aliases +; format-ignore +(call + target: + ((identifier) @_identifier + (#any-of? @_identifier "require" "alias" "use" "import")) + (arguments + [ + (alias) @local.definition.import + (_ (alias) @local.definition.import) + (_ (_ (alias) @local.definition.import)) + (_ (_ (_ (alias) @local.definition.import))) + (_ (_ (_ (_ (alias) @local.definition.import)))) + ])) + +; Local Function Definitions & Scopes +; format-ignore +(call + target: + ((identifier) @_identifier + (#any-of? @_identifier "def" "defp" "defmacro" "defmacrop" "defguard" "defguardp" "defn" "defnp" "for")) + (arguments + [ + (identifier) @local.definition.function + (binary_operator + left: (identifier) @local.definition.function + operator: "when") + (binary_operator + (identifier) @local.definition.parameter) + (call + target: (identifier) @local.definition.function + (arguments + [ + (identifier) @local.definition.parameter + (_ (identifier) @local.definition.parameter) + (_ (_ (identifier) @local.definition.parameter)) + (_ (_ (_ (identifier) @local.definition.parameter))) + (_ (_ (_ (_ (identifier) @local.definition.parameter)))) + (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))))) + ])) + ]?) + (#set! definition.function.scope parent)(do_block)?) @local.scope + +; ExUnit Test Definitions & Scopes +; format-ignore +(call + target: + ((identifier) @_identifier + (#eq? @_identifier "test")) + (arguments + [ + (string) + ((string) + . + "," + . + [ + (identifier) @local.definition.parameter + (_ (identifier) @local.definition.parameter) + (_ (_ (identifier) @local.definition.parameter)) + (_ (_ (_ (identifier) @local.definition.parameter))) + (_ (_ (_ (_ (identifier) @local.definition.parameter)))) + (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))) + (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))) + (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter))))))))))))))))))) + (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (identifier) @local.definition.parameter)))))))))))))))))))) + ]) + ]) + (do_block)?) @local.scope + +; Stab Clause Scopes +(stab_clause) @local.scope diff --git a/runtime/queries/elm/folds.scm b/runtime/queries/elm/folds.scm new file mode 100644 index 000000000..56987d9f9 --- /dev/null +++ b/runtime/queries/elm/folds.scm @@ -0,0 +1,14 @@ +((function_call_expr) @_fn + (#not-has-parent? @_fn parenthesized_expr)) @fold + +[ + (case_of_branch) + (case_of_expr) + (value_declaration) + (type_declaration) + (type_alias_declaration) + (list_expr) + (record_expr) + (parenthesized_expr) + (import_clause)+ +] @fold diff --git a/runtime/queries/elm/highlights.scm b/runtime/queries/elm/highlights.scm new file mode 100644 index 000000000..cfa09caf1 --- /dev/null +++ b/runtime/queries/elm/highlights.scm @@ -0,0 +1,229 @@ +[ + (line_comment) + (block_comment) +] @comment @spell + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^{[-]|[^|]")) + +; Keywords +;--------- +[ + "if" + "then" + "else" + (case) + (of) +] @keyword.conditional + +[ + "let" + "in" + (as) + (port) + (alias) + (infix) + (module) + (type) +] @keyword + +[ + (import) + (exposing) +] @keyword.import + +; 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) @character.special) + +(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) @variable.member)) + +(field_access_expr + ((dot) + (lower_case_identifier) @variable.member)) + +(function_declaration_left + (anything_pattern + (underscore) @character.special)) + +(function_declaration_left + (lower_pattern + (lower_case_identifier) @variable.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) @module)) + +(import_clause + (upper_case_qid + (upper_case_identifier) @module)) + +(as_clause + (upper_case_identifier) @module) + +(value_expr + (value_qid + (upper_case_identifier) @module)) + +; 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/runtime/queries/elm/injections.scm b/runtime/queries/elm/injections.scm new file mode 100644 index 000000000..7ee6c7f03 --- /dev/null +++ b/runtime/queries/elm/injections.scm @@ -0,0 +1,8 @@ +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) + +((glsl_content) @injection.content + (#set! injection.language "glsl")) diff --git a/runtime/queries/elsa/folds.scm b/runtime/queries/elsa/folds.scm new file mode 100644 index 000000000..afdfec308 --- /dev/null +++ b/runtime/queries/elsa/folds.scm @@ -0,0 +1 @@ +(reduction) @fold diff --git a/runtime/queries/elsa/highlights.scm b/runtime/queries/elsa/highlights.scm new file mode 100644 index 000000000..1a974bda6 --- /dev/null +++ b/runtime/queries/elsa/highlights.scm @@ -0,0 +1,36 @@ +; Keywords +[ + "eval" + "let" +] @keyword + +; Function +(function) @function + +; Method +(method) @function.method + +; Parameter +(parameter) @variable.parameter + +; Variables +(identifier) @variable + +; Operators +[ + "\\" + "->" + "=" + (step) +] @operator + +; Punctuation +[ + "(" + ")" +] @punctuation.bracket + +":" @punctuation.delimiter + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/elsa/indents.scm b/runtime/queries/elsa/indents.scm new file mode 100644 index 000000000..6ddd1aa64 --- /dev/null +++ b/runtime/queries/elsa/indents.scm @@ -0,0 +1,6 @@ +(reduction) @indent.begin + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/runtime/queries/elsa/injections.scm b/runtime/queries/elsa/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/elsa/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/elsa/locals.scm b/runtime/queries/elsa/locals.scm new file mode 100644 index 000000000..3e8197ae7 --- /dev/null +++ b/runtime/queries/elsa/locals.scm @@ -0,0 +1,12 @@ +[ + (source_file) + (reduction) +] @local.scope + +(identifier) @local.reference + +(function) @local.definition.function + +(method) @local.definition.method + +(parameter) @local.definition.parameter diff --git a/runtime/queries/elvish/highlights.scm b/runtime/queries/elvish/highlights.scm new file mode 100644 index 000000000..9836a6c78 --- /dev/null +++ b/runtime/queries/elvish/highlights.scm @@ -0,0 +1,157 @@ +(comment) @comment @spell + +[ + "if" + "elif" +] @keyword.conditional + +(if + (else + "else" @keyword.conditional)) + +[ + "while" + "for" +] @keyword.repeat + +(while + (else + "else" @keyword.repeat)) + +(for + (else + "else" @keyword.repeat)) + +[ + "try" + "catch" + "finally" +] @keyword.exception + +(try + (else + "else" @keyword.exception)) + +"use" @keyword.import + +(import + (bareword) @string.special.path) + +(wildcard + [ + "*" + "**" + "?" + ] @character.special) + +(command + argument: (bareword) @variable.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) @variable.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) + (#lua-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/runtime/queries/elvish/injections.scm b/runtime/queries/elvish/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/elvish/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/embedded_template/highlights.scm b/runtime/queries/embedded_template/highlights.scm new file mode 100644 index 000000000..410983d65 --- /dev/null +++ b/runtime/queries/embedded_template/highlights.scm @@ -0,0 +1,12 @@ +(comment_directive) @comment @spell + +[ + "<%#" + "<%" + "<%=" + "<%_" + "<%-" + "%>" + "-%>" + "_%>" +] @keyword diff --git a/runtime/queries/embedded_template/injections.scm b/runtime/queries/embedded_template/injections.scm new file mode 100644 index 000000000..cdeb2cd4f --- /dev/null +++ b/runtime/queries/embedded_template/injections.scm @@ -0,0 +1,7 @@ +((content) @injection.content + (#set! injection.language "html") + (#set! injection.combined)) + +((code) @injection.content + (#set! injection.language "ruby") + (#set! injection.combined)) diff --git a/runtime/queries/enforce/folds.scm b/runtime/queries/enforce/folds.scm new file mode 100644 index 000000000..dd2b8622a --- /dev/null +++ b/runtime/queries/enforce/folds.scm @@ -0,0 +1,10 @@ +[ + (block) + (switch) + (formal_parameters) + (actual_parameters) + (decl_class) + (decl_enum) + (comment_block) + (doc_block) +] @fold diff --git a/runtime/queries/enforce/highlights.scm b/runtime/queries/enforce/highlights.scm new file mode 100644 index 000000000..aa8fb9b3e --- /dev/null +++ b/runtime/queries/enforce/highlights.scm @@ -0,0 +1,190 @@ +[ + (comment_line) + (comment_block) +] @comment @spell + +[ + (doc_line) + (doc_block) +] @comment.documentation @spell + +(literal_bool) @boolean + +(literal_int) @number + +(literal_float) @number.float + +(literal_string) @string + +(escape_sequence) @string.escape + +(identifier) @variable + +(formal_parameter + name: (identifier) @variable.parameter) + +((identifier) @constant + (#lua-match? @constant "^[A-Z_][A-Z%d_]+$")) + +; Preprocessor directives +[ + (include) + (define) + (ifdef) + (ifndef) + (else) + (endif) +] @keyword.directive + +(preproc_const) @constant.macro + +; Constant fields +(decl_field + ((field_modifier) @_modifier + (#eq? @_modifier "const")) + type: (_) + name: (identifier) @constant) + +(enum_member + name: (identifier) @constant) + +[ + "+" + "-" + "*" + "/" + "%" + "^" + "++" + "--" + "=" + "+=" + "-=" + "*=" + "/=" + "&=" + "^=" + "|=" + "<<=" + ">>=" + "<" + "<=" + ">=" + ">" + "==" + "!=" + "!" + "&&" + "||" + ">>" + "<<" + "&" + "|" + "^" + "~" +] @operator + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +; TODO: <> in decl_class +(types + [ + "<" + ">" + ] @punctuation.bracket) + +[ + "," + "." + ":" + ";" +] @punctuation.delimiter + +[ + "default" + "extends" +] @keyword + +[ + "new" + "delete" +] @keyword.operator + +"return" @keyword.return + +[ + "if" + "else" + "switch" + "case" +] @keyword.conditional + +[ + "while" + "for" + "foreach" + "continue" + "break" +] @keyword.repeat + +[ + "enum" + "class" + "typedef" +] @keyword.type + +[ + (variable_modifier) + (method_modifier) + (class_modifier) + (field_modifier) + (formal_parameter_modifier) +] @keyword.modifier + +"ref" @type + +(decl_class + typename: (identifier) @type) + +(decl_class + superclass: (superclass + typename: (identifier) @type)) + +(decl_enum + typename: (identifier) @type) + +(type_identifier + (identifier) @type) + +[ + "auto" + (type_primitive) +] @type.builtin + +[ + (super) + (this) +] @variable.builtin + +(literal_null) @constant.builtin + +(decl_method + name: (identifier) @function.method) + +(invokation + invoked: (identifier) @function.method.call) + +; Constructor and deconstructor (function with same name of the class) +(decl_class + typename: (identifier) @_classname + body: (class_body + (decl_method + name: (identifier) @constructor + (#eq? @constructor @_classname)))) diff --git a/runtime/queries/enforce/indents.scm b/runtime/queries/enforce/indents.scm new file mode 100644 index 000000000..b1dc79b2e --- /dev/null +++ b/runtime/queries/enforce/indents.scm @@ -0,0 +1,30 @@ +[ + (block) + (class_body) + (enum_body) + (switch_body) + (array_creation) + (formal_parameters) + (actual_parameters) +] @indent.begin + +[ + "(" + ")" + "[" + "]" + "}" +] @indent.branch + +[ + ")" + "]" + "}" +] @indent.end + +(comment_line) @indent.ignore + +[ + (ERROR) + (comment_block) +] @indent.auto diff --git a/runtime/queries/enforce/injections.scm b/runtime/queries/enforce/injections.scm new file mode 100644 index 000000000..9231a4429 --- /dev/null +++ b/runtime/queries/enforce/injections.scm @@ -0,0 +1,13 @@ +([ + (comment_block) + (comment_line) +] @injection.content + (#set! injection.language "comment")) + +([ + (doc_block) + (doc_line) +] @injection.content + (#set! injection.language "doxygen")) + +; TODO: string and print (numbered) format injection diff --git a/runtime/queries/enforce/locals.scm b/runtime/queries/enforce/locals.scm new file mode 100644 index 000000000..9f62f9d96 --- /dev/null +++ b/runtime/queries/enforce/locals.scm @@ -0,0 +1,40 @@ +; Scopes +(compilation_unit) @local.scope + +(decl_class + body: (_) @local.scope) + +(decl_enum + body: (_) @local.scope) + +(decl_method) @local.scope + +(block) @local.scope + +(if) @local.scope + +(for) @local.scope + +(foreach) @local.scope + +(while) @local.scope + +; Definitions +(decl_class + typename: (identifier) @local.definition.type) + +(decl_enum + typename: (identifier) @local.definition.enum) + +(decl_method + name: (identifier) @local.definition.method) + +(decl_variable + (_)* + (identifier) @local.definition.var) + +; References +(identifier) @local.reference + +(type_identifier + (identifier) @local.reference) diff --git a/runtime/queries/erlang/folds.scm b/runtime/queries/erlang/folds.scm new file mode 100644 index 000000000..65c2d8ed1 --- /dev/null +++ b/runtime/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/runtime/queries/erlang/highlights.scm b/runtime/queries/erlang/highlights.scm new file mode 100644 index 000000000..8bba348d9 --- /dev/null +++ b/runtime/queries/erlang/highlights.scm @@ -0,0 +1,184 @@ +((atom) @constant + (#set! priority "90")) + +(var) @variable + +(char) @character + +(integer) @number + +(float) @number.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" + "begin" + "end" + "maybe" + "else" +] @keyword.conditional + +[ + "catch" + "try" +] @keyword.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) @keyword.directive +(#set! priority 99) + +; Attributes +(pp_include) @keyword.import + +(pp_include_lib) @keyword.import + +(export_attribute) @keyword.import + +(export_type_attribute) @type.definition + +(export_type_attribute + types: (fa + fun: _ @type + (#set! priority 101))) + +(behaviour_attribute) @keyword.import + +(module_attribute + (atom) @module) @keyword.import + +(wild_attribute + name: (attr_name + name: _ @attribute)) @attribute + +; Records +(record_expr) @type + +(record_field_expr + _ @variable.member) @type + +(record_field_name + _ @variable.member) @type + +(record_name + "#" @type + name: _ @type) @type + +(record_decl + name: _ @type) @type.definition + +(record_field + name: _ @variable.member) + +(record_field + name: _ @variable.member + 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) @keyword.exception + (#any-of? @keyword.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/runtime/queries/erlang/injections.scm b/runtime/queries/erlang/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/erlang/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/facility/folds.scm b/runtime/queries/facility/folds.scm new file mode 100644 index 000000000..7d8bafc80 --- /dev/null +++ b/runtime/queries/facility/folds.scm @@ -0,0 +1,6 @@ +[ + (service) + (method) + (dto) + (enum) +] @fold diff --git a/runtime/queries/facility/highlights.scm b/runtime/queries/facility/highlights.scm new file mode 100644 index 000000000..592bf5311 --- /dev/null +++ b/runtime/queries/facility/highlights.scm @@ -0,0 +1,90 @@ +[ + ";" + "." + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(comment) @comment @spell + +(doc_comment) @comment.documentation @spell + +[ + "service" + "errors" +] @keyword + +[ + "method" + "event" +] @keyword.function + +[ + "enum" + "data" +] @keyword.type + +"extern" @keyword.modifier + +(type) @type.builtin + +(service + service_name: (identifier) @type) + +(error_set + (identifier) @variable.member) + +(error_set + name: (identifier) @type) + +(dto + name: (identifier) @type) + +(external_dto + name: (identifier) @type) + +(enum + (values_block + (identifier) @constant)) + +(enum + name: (identifier) @type) + +(external_enum + name: (identifier) @type) + +(type + name: (identifier) @type) + +[ + "map" + "nullable" + "result" + "required" + "http" + "csharp" + "js" + "info" + "obsolete" +] @attribute.builtin + +(parameter + name: (identifier) @variable.parameter) + +(field + name: (identifier) @variable.member) + +(method + name: (identifier) @function.method) + +(number_literal) @number + +(string_literal) @string diff --git a/runtime/queries/facility/indents.scm b/runtime/queries/facility/indents.scm new file mode 100644 index 000000000..247949ba1 --- /dev/null +++ b/runtime/queries/facility/indents.scm @@ -0,0 +1,7 @@ +[ + (service_block) + (values_block) + (field_list) +] @indent.begin + +"}" @indent.branch diff --git a/runtime/queries/facility/injections.scm b/runtime/queries/facility/injections.scm new file mode 100644 index 000000000..5d9b7836f --- /dev/null +++ b/runtime/queries/facility/injections.scm @@ -0,0 +1,8 @@ +((remarks) @injection.content + (#set! injection.language "markdown")) + +([ + (comment) + (doc_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/faust/highlights.scm b/runtime/queries/faust/highlights.scm new file mode 100644 index 000000000..6e7ef1d92 --- /dev/null +++ b/runtime/queries/faust/highlights.scm @@ -0,0 +1,219 @@ +; Identifiers +(identifier) @variable + +[ + "process" + "effect" +] @variable.builtin + +(parameters + (identifier)) @variable.parameter + +(access + definition: (identifier) @variable.member) + +(global_metadata + key: (identifier) @variable.member) + +(function_metadata + function_name: (identifier) @variable.member) + +; Literals +(_ + filename: (string)) @string.special.path + +(documentation) @string.documentation @spell + +[ + (string) + (fstring) +] @string + +(int) @number + +(real) @number.float + +; Types +(_ + type: [ + (int_type) + (float_type) + (any_type) + ]) @type.builtin + +[ + (single_precision) + (double_precision) + (quad_precision) + (fixed_point_precision) +] @attribute + +; Functions +(function_definition + name: (identifier) @function) + +(function_names) @function + +(function_call + (identifier) @function.call) + +(function_call + (access + definition: (identifier) @function.call)) + +[ + "exp" + "log" + "log10" + "sqrt" + "abs" + "floor" + "ceil" + "rint" + "round" + "acos" + "asin" + "atan" + "cos" + "sin" + "tan" + "atan2" + "int" + "float" + "pow" + "min" + "max" + "fmod" + "remainder" + "prefix" + "attach" + "enable" + "control" + "rdtable" + "rwtable" + "select2" + "select3" + "lowest" + "highest" + "assertbounds" + (par) + (seq) + (sum) + (prod) + (component) + (library) + (vslider_type) + (hslider_type) + (nentry_type) + (vbargraph_type) + (hbargraph_type) + (vgroup_type) + (hgroup_type) + (tgroup_type) + "button" + "checkbox" + "soundfile" + "inputs" + "outputs" + "route" +] @function.builtin + +; xor is a @keyword.operator +[ + (add) + (sub) + (mult) + (div) + (mod) + (pow) + (or) + (and) + (lshift) + (rshift) + (lt) + (le) + (gt) + (ge) + (eq) + (neq) + (delay) + (one_sample_delay) + "=" + "=>" + "->" +] @operator + +(recursive + "~" @operator) + +(sequential + ":" @operator) + +(split + "<:" @operator) + +(merge + ":>" @operator) + +(parallel + "," @operator) + +; Keywords +[ + (par) + (seq) + (sum) + (prod) +] @keyword.repeat + +(file_import + "import" @keyword.import) + +[ + (wire) + (cut) + (mem) + "declare" + "with" + "environment" + "case" + "ffunction" + "fconstant" + "fvariable" +] @keyword + +(xor) @keyword.operator + +; Punctuation +[ + "," + ";" + "." +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +; Comments +(comment) @comment @spell + +; Tags +[ + "" + "" + "" + "" + "" + "" + "" + "" + "" +] @tag diff --git a/runtime/queries/faust/injections.scm b/runtime/queries/faust/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/faust/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fennel/folds.scm b/runtime/queries/fennel/folds.scm new file mode 100644 index 000000000..0862e5926 --- /dev/null +++ b/runtime/queries/fennel/folds.scm @@ -0,0 +1,51 @@ +; compounds +[ + (list) + (table) + (sequence) +] @fold + +; sub-forms / special compounds +[ + (list_binding) + (table_binding) + (sequence_binding) + (table_metadata) + (sequence_arguments) + (let_vars) + (case_guard_or_special) + (case_guard) + (case_catch) +] @fold + +; forms +[ + (quote_form) + (unquote_form) + (local_form) + (var_form) + (set_form) + (global_form) + (let_form) + (fn_form) + (lambda_form) + (hashfn_form) + (each_form) + (collect_form) + (icollect_form) + (accumulate_form) + (for_form) + (fcollect_form) + (faccumulate_form) + (case_form) + (match_form) + (case_try_form) + (match_try_form) +] @fold + +; reader macros +(quote_reader_macro + expression: (_) @fold) + +(quasi_quote_reader_macro + expression: (_) @fold) diff --git a/runtime/queries/fennel/highlights.scm b/runtime/queries/fennel/highlights.scm new file mode 100644 index 000000000..2f0b5f738 --- /dev/null +++ b/runtime/queries/fennel/highlights.scm @@ -0,0 +1,193 @@ +; Most primitive nodes +(shebang) @keyword.directive + +(comment) @comment @spell + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +[ + (nil) + (nil_binding) +] @constant.builtin + +[ + (boolean) + (boolean_binding) +] @boolean + +[ + (number) + (number_binding) +] @number + +[ + (string) + (string_binding) +] @string + +[ + (symbol) + (symbol_binding) +] @variable + +(symbol_option) @keyword.directive + +(escape_sequence) @string.escape + +(multi_symbol + "." @punctuation.delimiter + member: (symbol_fragment) @variable.member) + +(list + call: (symbol) @function.call) + +(list + call: (multi_symbol + member: (symbol_fragment) @function.call .)) + +(multi_symbol_method + ":" @punctuation.delimiter + method: (symbol_fragment) @function.method.call) + +(quasi_quote_reader_macro + macro: _ @punctuation.special) + +(quote_reader_macro + macro: _ @punctuation.special) + +(unquote_reader_macro + macro: _ @punctuation.special) + +(hashfn_reader_macro + macro: _ @keyword.function) + +(sequence_arguments + (symbol_binding) @variable.parameter) + +(sequence_arguments + (rest_binding + rhs: (symbol_binding) @variable.parameter)) + +(docstring) @string.documentation + +(fn_form + name: [ + (symbol) @function + (multi_symbol + member: (symbol_fragment) @function .) + ]) + +(lambda_form + name: [ + (symbol) @function + (multi_symbol + member: (symbol_fragment) @function .) + ]) + +; NOTE: The macro name is highlighted as @variable because it +; gives a nicer contrast instead of everything being the same +; color. Rust queries use this workaround too for `macro_rules!`. +(macro_form + name: [ + (symbol) @variable + (multi_symbol + member: (symbol_fragment) @variable .) + ]) + +((symbol) @variable.parameter + (#any-of? @variable.parameter "$" "$...")) + +((symbol) @variable.parameter + (#lua-match? @variable.parameter "^%$[1-9]$")) + +((symbol) @operator + (#any-of? @operator + ; arithmetic + "+" "-" "*" "/" "//" "%" "^" + ; comparison + ">" "<" ">=" "<=" "=" "~=" + ; other + "#" "." "?." "..")) + +((symbol) @keyword.operator + (#any-of? @keyword.operator + ; comparison + "not=" + ; boolean + "and" "or" "not" + ; bitwise + "lshift" "rshift" "band" "bor" "bxor" "bnot" + ; other + "length")) + +(case_guard + call: (_) @keyword.conditional) + +(case_guard_or_special + call: (_) @keyword.conditional) + +((symbol) @keyword.function + (#any-of? @keyword.function "fn" "lambda" "λ" "hashfn")) + +((symbol) @keyword.repeat + (#any-of? @keyword.repeat "for" "each" "while")) + +((symbol) @keyword.conditional + (#any-of? @keyword.conditional "if" "when" "match" "case" "match-try" "case-try")) + +((symbol) @keyword + (#any-of? @keyword + "global" "local" "let" "set" "var" "comment" "do" "doc" "eval-compiler" "lua" "macros" "unquote" + "quote" "tset" "values" "tail!")) + +((symbol) @keyword.import + (#any-of? @keyword.import "require-macros" "import-macros" "include")) + +((symbol) @function.macro + (#any-of? @function.macro + "collect" "icollect" "fcollect" "accumulate" "faccumulate" "->" "->>" "-?>" "-?>>" "?." "doto" + "macro" "macrodebug" "partial" "pick-args" "pick-values" "with-open")) + +(case_catch + call: (symbol) @keyword) + +(import_macros_form + imports: (table_binding + (table_binding_pair + value: (symbol_binding) @function.macro))) + +; TODO: Highlight builtin methods (`table.unpack`, etc) as @function.builtin +([ + (symbol) @module.builtin + (multi_symbol + base: (symbol_fragment) @module.builtin) +] + (#any-of? @module.builtin + "vim" "_G" "debug" "io" "jit" "math" "os" "package" "string" "table" "utf8")) + +([ + (symbol) @variable.builtin + (multi_symbol + . + (symbol_fragment) @variable.builtin) +] + (#eq? @variable.builtin "arg")) + +((symbol) @variable.builtin + (#eq? @variable.builtin "...")) + +((symbol) @constant.builtin + (#eq? @constant.builtin "_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" "module" "setfenv" "loadstring" "unpack")) diff --git a/runtime/queries/fennel/injections.scm b/runtime/queries/fennel/injections.scm new file mode 100644 index 000000000..f6724d328 --- /dev/null +++ b/runtime/queries/fennel/injections.scm @@ -0,0 +1,134 @@ +((comment_body) @injection.content + (#set! injection.language "comment")) + +(list + call: (multi_symbol) @_vimcmd_identifier + (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec2") + . + item: (string + (string_content) @injection.content + (#set! injection.language "vim"))) + +; NOTE: Matches *exactly* `ffi.cdef` +(list + call: (multi_symbol) @_cdef_identifier + (#eq? @_cdef_identifier "ffi.cdef") + . + item: (string + (string_content) @injection.content + (#set! injection.language "c"))) + +(list + call: (multi_symbol) @_ts_query_identifier + (#any-of? @_ts_query_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse") + . + item: (_) + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "query"))) + +(list + call: (multi_symbol) @_vimcmd_identifier + (#eq? @_vimcmd_identifier "vim.api.nvim_create_autocmd") + . + item: (_) + . + item: (table + (table_pair + key: (string + (string_content) @_command + (#eq? @_command "command")) + value: (string + (string_content) @injection.content + (#set! injection.language "vim"))))) + +(list + call: (multi_symbol) @_user_cmd + (#eq? @_user_cmd "vim.api.nvim_create_user_command") + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "vim"))) + +(list + call: (multi_symbol) @_user_cmd + (#eq? @_user_cmd "vim.api.nvim_buf_create_user_command") + . + item: (_) + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "vim"))) + +(list + call: (multi_symbol) @_map + (#any-of? @_map "vim.api.nvim_set_keymap" "vim.keymap.set") + . + item: (_) + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "vim"))) + +(list + call: (multi_symbol) @_map + (#eq? @_map "vim.api.nvim_buf_set_keymap") + . + item: (_) + . + item: (_) + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "vim"))) + +; highlight string as query if starts with `; query` +(string + (string_content) @injection.content + (#lua-match? @injection.content "^%s*;+%s?query") + (#set! injection.language "query")) + +; (string.match "123" "%d+") +(list + call: (multi_symbol + member: (symbol_fragment) @_func + . + (#any-of? @_func "find" "match" "gmatch" "gsub")) + . + item: (_) + . + item: (string + (string_content) @injection.content + (#set! injection.language "luap") + (#set! injection.include-children))) + +; (my-string:match "%d+") +(list + call: (multi_symbol_method + method: (symbol_fragment) @_method + (#any-of? @_method "find" "match" "gmatch" "gsub")) + . + item: (string + (string_content) @injection.content + (#set! injection.language "luap") + (#set! injection.include-children))) + +; (string.format "pi = %.2f" 3.14159) +(list + call: (multi_symbol) @_func + (#eq? @_func "string.format") + . + item: (string + (string_content) @injection.content + (#set! injection.language "printf"))) diff --git a/runtime/queries/fennel/locals.scm b/runtime/queries/fennel/locals.scm new file mode 100644 index 000000000..be63e728f --- /dev/null +++ b/runtime/queries/fennel/locals.scm @@ -0,0 +1,56 @@ +(program) @local.scope + +(symbol) @local.reference + +[ + (let_form) + (fn_form) + (lambda_form) + (each_form) + (for_form) + (collect_form) + (icollect_form) + (accumulate_form) + (for_form) + (fcollect_form) + (faccumulate_form) + (case_form) + (match_form) + (case_try_form) + (match_try_form) + (if_form) +] @local.scope + +(list + call: (symbol) @_call + (#any-of? @_call "while" "when" "do")) @local.scope + +(fn_form + name: [ + (symbol) @local.definition.function + (multi_symbol + member: (symbol_fragment) @local.definition.function .) + ] + args: (sequence_arguments + (symbol_binding) @local.definition.parameter) + (#set! definition.function.scope "parent")) + +(lambda_form + name: [ + (symbol) @local.definition.function + (multi_symbol + member: (symbol_fragment) @local.definition.function .) + ] + args: (sequence_arguments + (symbol_binding) @local.definition.parameter) + (#set! definition.function.scope "parent")) + +(macro_form + name: [ + (symbol) @local.definition.function + (multi_symbol + member: (symbol_fragment) @local.definition.function .) + ] + args: (sequence_arguments + (symbol_binding) @local.definition.parameter) + (#set! definition.function.scope "parent")) diff --git a/runtime/queries/fidl/folds.scm b/runtime/queries/fidl/folds.scm new file mode 100644 index 000000000..f524c455b --- /dev/null +++ b/runtime/queries/fidl/folds.scm @@ -0,0 +1,6 @@ +[ + (layout_declaration) + (protocol_declaration) + (resource_declaration) + (service_declaration) +] @fold diff --git a/runtime/queries/fidl/highlights.scm b/runtime/queries/fidl/highlights.scm new file mode 100644 index 000000000..f1960c612 --- /dev/null +++ b/runtime/queries/fidl/highlights.scm @@ -0,0 +1,67 @@ +[ + "ajar" + "alias" + "as" + "bits" + "closed" + "compose" + "const" + "error" + "flexible" + "library" + "open" + ; "optional" we did not specify a node for optional yet + "overlay" + "protocol" + "reserved" + "strict" + "using" +] @keyword + +[ + "enum" + "struct" + "table" + "union" + "resource" + "service" + "type" +] @keyword.type + +(primitives_type) @type.builtin + +(builtin_complex_type) @type.builtin + +(const_declaration + (identifier) @constant) + +[ + "=" + "|" + "&" + "->" +] @operator + +(attribute + "@" @attribute + (identifier) @attribute) + +(string_literal) @string + +(numeric_literal) @number + +[ + (true) + (false) +] @boolean + +(comment) @comment + +[ + "(" + ")" + "<" + ">" + "{" + "}" +] @punctuation.bracket diff --git a/runtime/queries/fidl/injections.scm b/runtime/queries/fidl/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/fidl/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/firrtl/folds.scm b/runtime/queries/firrtl/folds.scm new file mode 100644 index 000000000..4c64e644f --- /dev/null +++ b/runtime/queries/firrtl/folds.scm @@ -0,0 +1,6 @@ +[ + (circuit) + (module) + (when) + (else) +] @fold diff --git a/runtime/queries/firrtl/highlights.scm b/runtime/queries/firrtl/highlights.scm new file mode 100644 index 000000000..0a90fa55b --- /dev/null +++ b/runtime/queries/firrtl/highlights.scm @@ -0,0 +1,198 @@ +; Namespaces +(circuit + (identifier) @module) + +(module + (identifier) @module) + +; 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) @keyword.modifier + +; Storageclasses +[ + "input" + "output" +] @keyword.modifier + +; Conditionals +[ + "when" + "else" +] @keyword.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" +] @variable.member + +((field_id) @variable.member + (#set! priority 105)) + +(port + (identifier) @variable.member) + +(wire + (identifier) @variable.member) + +(cmem + (identifier) @variable.member) + +(smem + (identifier) @variable.member) + +(memory + (identifier) @variable.member) + +(register + (identifier) @variable.member) + +; Parameters +(primitive_operation + (identifier) @variable.parameter) + +(mux + (identifier) @variable.parameter) + +(printf + (identifier) @variable.parameter) + +(reset + (identifier) @variable.parameter) + +(stop + (identifier) @variable.parameter) + +; Variables +(identifier) @variable + +; Operators +(primop) @keyword.operator + +[ + "+" + "-" + "=" + "=>" + "<=" + "<-" +] @operator + +; Literals +[ + (uint) + (number) +] @number + +(number_str) @string.special + +(double) @number.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 diff --git a/runtime/queries/firrtl/indents.scm b/runtime/queries/firrtl/indents.scm new file mode 100644 index 000000000..e172e1e81 --- /dev/null +++ b/runtime/queries/firrtl/indents.scm @@ -0,0 +1,12 @@ +[ + (circuit) + (module) + (memory) + (when) + (else) +] @indent.begin + +[ + (ERROR) + (comment) +] @indent.auto diff --git a/runtime/queries/firrtl/injections.scm b/runtime/queries/firrtl/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/firrtl/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/firrtl/locals.scm b/runtime/queries/firrtl/locals.scm new file mode 100644 index 000000000..97b7931bf --- /dev/null +++ b/runtime/queries/firrtl/locals.scm @@ -0,0 +1,45 @@ +; Scopes +[ + (source_file) + (circuit) + (module) + (else) + (when) +] @local.scope + +; References +(identifier) @local.reference + +; Definitions +(port + (identifier) @local.definition.field) + +(wire + (identifier) @local.definition.field) + +(cmem + (identifier) @local.definition.field) + +(smem + (identifier) @local.definition.field) + +(memory + (identifier) @local.definition.field) + +(register + (identifier) @local.definition.field) + +(circuit + (identifier) @local.definition.namespace) + +(module + (identifier) @local.definition.namespace) + +(parameter + (identifier) @local.definition.parameter) + +(rdwr + (identifier) @local.definition.var) + +(node + (identifier) @local.definition.var) diff --git a/runtime/queries/fish/folds.scm b/runtime/queries/fish/folds.scm new file mode 100644 index 000000000..06363e15e --- /dev/null +++ b/runtime/queries/fish/folds.scm @@ -0,0 +1,8 @@ +[ + (function_definition) + (if_statement) + (switch_statement) + (for_statement) + (while_statement) + (begin_statement) +] @fold diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm new file mode 100644 index 000000000..a7c451175 --- /dev/null +++ b/runtime/queries/fish/highlights.scm @@ -0,0 +1,204 @@ +; Fish highlighting +; Operators +[ + "&&" + "||" + "|" + "&|" + "2>|" + "&" + ".." + "!" + (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" + ] @keyword.conditional) + +(switch_statement + [ + "switch" + "end" + ] @keyword.conditional) + +(case_clause + "case" @keyword.conditional) + +(else_clause + "else" @keyword.conditional) + +(else_if_clause + [ + "else" + "if" + ] @keyword.conditional) + +; Loops/Blocks +(while_statement + [ + "while" + "end" + ] @keyword.repeat) + +(for_statement + [ + "for" + "end" + ] @keyword.repeat) + +(begin_statement + [ + "begin" + "end" + ] @keyword.repeat) + +; Keywords +[ + "in" + (break) + (continue) +] @keyword + +"return" @keyword.return + +; Punctuation +[ + "[" + "]" + "{" + "}" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter + +; Commands +(command + argument: [ + (word) @variable.parameter + (#lua-match? @variable.parameter "^[-]") + ]) + +(command_substitution + "$" @punctuation.special) + +; 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)) + ] @variable.parameter + (#lua-match? @variable.parameter "^[-]")) + +; Strings +[ + (double_quote_string) + (single_quote_string) +] @string + +(escape_sequence) @string.escape + +; Variables +(variable_name) @variable + +(variable_expansion) @constant + +(variable_expansion + "$" @punctuation.special) @none + +; Reference: https://fishshell.com/docs/current/language.html#special-variables +((variable_name) @variable.builtin + (#any-of? @variable.builtin + "PATH" "CDPATH" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC" + "LC_TIME" "fish_color_normal" "fish_color_command" "fish_color_keyword" "fish_color_keyword" + "fish_color_redirection" "fish_color_end" "fish_color_error" "fish_color_param" + "fish_color_valid_path" "fish_color_option" "fish_color_comment" "fish_color_selection" + "fish_color_operator" "fish_color_escape" "fish_color_autosuggestion" "fish_color_cwd" + "fish_color_cwd_root" "fish_color_user" "fish_color_host" "fish_color_host_remote" + "fish_color_status" "fish_color_cancel" "fish_color_search_match" "fish_color_history_current" + "fish_pager_color_progress" "fish_pager_color_background" "fish_pager_color_prefix" + "fish_pager_color_completion" "fish_pager_color_description" + "fish_pager_color_selected_background" "fish_pager_color_selected_prefix" + "fish_pager_color_selected_completion" "fish_pager_color_selected_description" + "fish_pager_color_secondary_background" "fish_pager_color_secondary_prefix" + "fish_pager_color_secondary_completion" "fish_pager_color_secondary_description" + "fish_term24bit" "fish_term256" "fish_ambiguous_width" "fish_emoji_width" + "fish_autosuggestion_enabled" "fish_handle_reflow" "fish_key_bindings" "fish_escape_delay_ms" + "fish_sequence_key_delay_ms" "fish_complete_path" "fish_cursor_selection_mode" + "fish_function_path" "fish_greeting" "fish_history" "fish_trace" "FISH_DEBUG" + "FISH_DEBUG_OUTPUT" "fish_user_paths" "umask" "BROWSER" "_" "argv" "CMD_DURATION" "COLUMNS" + "LINES" "fish_kill_signal" "fish_killring" "fish_read_limit" "fish_pid" "history" "HOME" + "hostname" "IFS" "last_pid" "PWD" "pipestatus" "SHLVL" "status" "status_generation" "TERM" + "USER" "EUID" "version" "FISH_VERSION")) + +; Nodes +[ + (integer) + (float) +] @number + +(comment) @comment + +(comment) @spell + +((word) @boolean + (#any-of? @boolean "true" "false")) + +((program + . + (comment) @keyword.directive @nospell) + (#lua-match? @keyword.directive "^#!/")) diff --git a/runtime/queries/fish/indents.scm b/runtime/queries/fish/indents.scm new file mode 100644 index 000000000..4984c4cb2 --- /dev/null +++ b/runtime/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/runtime/queries/fish/injections.scm b/runtime/queries/fish/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/fish/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fish/locals.scm b/runtime/queries/fish/locals.scm new file mode 100644 index 000000000..904d568f9 --- /dev/null +++ b/runtime/queries/fish/locals.scm @@ -0,0 +1,19 @@ +; Scopes +[ + (command) + (function_definition) + (if_statement) + (for_statement) + (begin_statement) + (while_statement) + (switch_statement) +] @local.scope + +; Definitions +(function_definition + name: (word) @local.definition.function) + +; References +(variable_name) @local.reference + +(word) @local.reference diff --git a/runtime/queries/foam/folds.scm b/runtime/queries/foam/folds.scm new file mode 100644 index 000000000..e05d0dbaa --- /dev/null +++ b/runtime/queries/foam/folds.scm @@ -0,0 +1,8 @@ +[ + (comment) + (list) + (dict_core) +] @fold + +(code + (code_body)* @fold) diff --git a/runtime/queries/foam/highlights.scm b/runtime/queries/foam/highlights.scm new file mode 100644 index 000000000..9c96f196e --- /dev/null +++ b/runtime/queries/foam/highlights.scm @@ -0,0 +1,64 @@ +; Comments +(comment) @comment @spell + +; Generic Key-value pairs and dictionary keywords +(key_value + keyword: (identifier) @function) + +(dict + key: (identifier) @type) + +; Macros +(macro + "$" @keyword.conditional + (prev_scope)* @keyword.conditional + (identifier)* @module) + +; Directives +"#" @keyword.conditional + +(preproc_call + directive: (identifier)* @keyword.conditional + argument: (identifier)* @module) + +((preproc_call + argument: (identifier)* @module) @keyword.conditional + (#eq? @keyword.conditional "ifeq")) + +((preproc_call) @keyword.conditional + (#any-of? @keyword.conditional "else" "endif")) + +; Literals +(number_literal) @number.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) @number.float) + +; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" + "#{" + "#}" + "|-" + "-|" + "" + "$$" +] @punctuation.bracket + +";" @punctuation.delimiter + +((identifier) @constant.builtin + (#any-of? @constant.builtin "uniform" "non-uniform" "and" "or")) diff --git a/runtime/queries/foam/indents.scm b/runtime/queries/foam/indents.scm new file mode 100644 index 000000000..be02b80ed --- /dev/null +++ b/runtime/queries/foam/indents.scm @@ -0,0 +1,11 @@ +[ + "{" + "}" +] @indent.branch + +[ + (dict) + (key_value) +] @indent.begin + +(comment) @indent.ignore diff --git a/runtime/queries/foam/injections.scm b/runtime/queries/foam/injections.scm new file mode 100644 index 000000000..b9f8f838f --- /dev/null +++ b/runtime/queries/foam/injections.scm @@ -0,0 +1,23 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +; Pass code blocks to Cpp highlighter +(code + (code_body) @injection.content + (#set! injection.language "cpp")) + +; Pass identifiers to Go highlighter (Cheating I know) +; ((identifier) @injection.content +; (#set! injection.language "lua") +; Highlight regex syntax inside literal strings +((string_literal) @injection.content + (#set! injection.language "regex")) + +; Highlight PyFoam syntax as Python statements +(pyfoam_variable + code_body: (_) @injection.content + (#set! injection.language "python")) + +(pyfoam_expression + code_body: (_) @injection.content + (#set! injection.language "python")) diff --git a/runtime/queries/foam/locals.scm b/runtime/queries/foam/locals.scm new file mode 100644 index 000000000..f3f689081 --- /dev/null +++ b/runtime/queries/foam/locals.scm @@ -0,0 +1,11 @@ +(dict) @local.scope + +(dict + key: (_) @local.definition.type) + +(key_value + keyword: (_) @local.definition.parameter) + +(key_value + value: (macro + (identifier)*)* @local.reference) diff --git a/runtime/queries/forth/folds.scm b/runtime/queries/forth/folds.scm new file mode 100644 index 000000000..443abb30d --- /dev/null +++ b/runtime/queries/forth/folds.scm @@ -0,0 +1 @@ +(word_definition) @fold diff --git a/runtime/queries/forth/highlights.scm b/runtime/queries/forth/highlights.scm new file mode 100644 index 000000000..1e7207597 --- /dev/null +++ b/runtime/queries/forth/highlights.scm @@ -0,0 +1,19 @@ +(core) @function + +(operator) @operator + +(word) @variable + +((word) @constant + (#lua-match? @constant "^[A-Z_]+$")) + +(number) @number + +(string) @string + +[ + (start_definition) + (end_definition) +] @punctuation.delimiter + +(comment) @comment @spell diff --git a/runtime/queries/forth/indents.scm b/runtime/queries/forth/indents.scm new file mode 100644 index 000000000..067755433 --- /dev/null +++ b/runtime/queries/forth/indents.scm @@ -0,0 +1,3 @@ +(word_definition) @indent.begin + +(end_definition) @indent.end @indent.branch diff --git a/runtime/queries/forth/injections.scm b/runtime/queries/forth/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/forth/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/forth/locals.scm b/runtime/queries/forth/locals.scm new file mode 100644 index 000000000..d91d3aa98 --- /dev/null +++ b/runtime/queries/forth/locals.scm @@ -0,0 +1,3 @@ +(word) @local.reference + +(word_definition) @local.scope diff --git a/runtime/queries/fortran/folds.scm b/runtime/queries/fortran/folds.scm new file mode 100644 index 000000000..cedbdb635 --- /dev/null +++ b/runtime/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/runtime/queries/fortran/highlights.scm b/runtime/queries/fortran/highlights.scm new file mode 100644 index 000000000..6a6dbba35 --- /dev/null +++ b/runtime/queries/fortran/highlights.scm @@ -0,0 +1,319 @@ +; Preprocs +(preproc_directive) @keyword.directive + +; Namespaces +(program_statement + (name) @module) + +(end_program_statement + (name) @module) + +(module_statement + (name) @module) + +(end_module_statement + (name) @module) + +(submodule_statement + (name) @module) + +(end_submodule_statement + (name) @module) + +; Includes +[ + "import" + "include" + "use" +] @keyword.import + +(import_statement + "," + [ + "all" + "none" + ] @keyword) + +; Attributes +[ + (none) + "implicit" + "intent" +] @attribute + +(implicit_statement + "type" @attribute) + +; Keywords +[ + "attributes" + "associate" + "block" + "classis" + "contains" + "default" + "dimension" + "endassociate" + "endselect" + "enumerator" + "equivalence" + "extends" + "goto" + "intrinsic" + "non_intrinsic" + "namelist" + "parameter" + "quiet" + "rank" + "save" + "selectcase" + "selectrank" + "selecttype" + "sequence" + "stop" + "target" + "typeis" +] @keyword + +[ + "class" + "enum" + "endenum" + "type" + "endtype" + "module" + "endmodule" + "submodule" + "endsubmodule" + "interface" + "endinterface" +] @keyword.type + +(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) +] @keyword.modifier + +[ + "common" + "in" + "inout" + "out" +] @keyword.modifier + +; 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" @keyword.exception + +; Conditionals +[ + "else" + "elseif" + "elsewhere" + "endif" + "endwhere" + "if" + "then" + "where" +] @keyword.conditional + +; Repeats +[ + "do" + "concurrent" + "enddo" + "endforall" + "forall" + "while" + "continue" + "cycle" + "exit" +] @keyword.repeat + +; Variables +(identifier) @variable + +; Parameters +(keyword_argument + name: (identifier) @variable.parameter) + +(parameters + (identifier) @variable.parameter) + +; Properties +(derived_type_member_expression + (type_member) @variable.member) + +; 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 "^!>")) diff --git a/runtime/queries/fortran/indents.scm b/runtime/queries/fortran/indents.scm new file mode 100644 index 000000000..86704c4f4 --- /dev/null +++ b/runtime/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/runtime/queries/fortran/injections.scm b/runtime/queries/fortran/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/fortran/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fsh/highlights.scm b/runtime/queries/fsh/highlights.scm new file mode 100644 index 000000000..2354a2037 --- /dev/null +++ b/runtime/queries/fsh/highlights.scm @@ -0,0 +1,97 @@ +[ + "(" + ")" +] @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) @boolean + +(flag) @constant + +; Special Params +(code_value) @variable.parameter + +; Extras +(fsh_comment) @comment @spell diff --git a/runtime/queries/fsh/injections.scm b/runtime/queries/fsh/injections.scm new file mode 100644 index 000000000..7bf6d006a --- /dev/null +++ b/runtime/queries/fsh/injections.scm @@ -0,0 +1,2 @@ +((fsh_comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fsharp/highlights.scm b/runtime/queries/fsharp/highlights.scm new file mode 100644 index 000000000..e400e3522 --- /dev/null +++ b/runtime/queries/fsharp/highlights.scm @@ -0,0 +1,411 @@ +[ + (line_comment) + (block_comment) +] @comment @spell + +((line_comment) @comment.documentation @spell + (#lua-match? @comment.documentation "^///")) + +(const + [ + (_) @constant + (unit) @constant.builtin + ]) + +(primary_constr_args + (_) @variable.parameter) + +(class_as_reference + (_) @variable.parameter.builtin) + +(type_name + type_name: (_) @type.definition) + +[ + (_type) + (atomic_type) +] @type + +(member_signature + . + (identifier) @function.method) + +(member_signature + (curried_spec + (arguments_spec + (argument_spec + (argument_name_spec + "?"? @character.special + name: (_) @variable.parameter))))) + +(union_type_case + (identifier) @constant) + +(rules + (rule + pattern: (_) @constant + block: (_))) + +(wildcard_pattern) @character.special + +(identifier_pattern + . + (_) @constant + . + (_) @variable) + +(optional_pattern + "?" @character.special) + +(fsi_directive_decl + . + (string) @module) + +(import_decl + . + (_) @module) + +(named_module + name: (_) @module) + +(namespace + name: (_) @module) + +(module_defn + (identifier) @module) + +(ce_expression + . + (_) @constant.macro) + +(field_initializer + field: (_) @property) + +(record_fields + (record_field + . + (identifier) @property)) + +(value_declaration_left + . + (_) @variable) + +(function_declaration_left + . + (_) @function) + +(argument_patterns + [ + (const) + (long_identifier) + (_pattern) + ] @variable.parameter) + +(argument_patterns + (typed_pattern + (_pattern) @variable.parameter + (_type) @type)) + +(argument_patterns + (record_pattern + (field_pattern + . + (long_identifier) @variable.parameter))) + +(argument_patterns + (array_pattern + (_pattern)? @variable.parameter)) + +(argument_patterns + (list_pattern + (_pattern)? @variable.parameter)) + +((argument_patterns + (long_identifier + (identifier) @character.special)) + (#lua-match? @character.special "^\_.*")) + +(member_defn + (method_or_prop_defn + [ + (property_or_ident) @function + (property_or_ident + instance: (identifier) @variable.parameter.builtin + method: (identifier) @function.method) + ] + args: (_)* @variable.parameter)) + +(dot_expression + . + (_) @variable.member + . + (_)) + +(application_expression + . + (_) @function.call + . + (_) @variable) + +((infix_expression + . + (_) + . + (infix_op) @operator + . + (_) @function.call) + (#eq? @operator "|>")) + +((infix_expression + . + (_) @function.call + . + (infix_op) @operator + . + (_)) + (#eq? @operator "<|")) + +[ + (xint) + (int) + (int16) + (uint16) + (int32) + (uint32) + (int64) + (uint64) + (nativeint) + (unativeint) +] @number + +[ + (ieee32) + (ieee64) + (float) + (decimal) +] @number.float + +(bool) @boolean + +[ + (string) + (triple_quoted_string) + (verbatim_string) + (char) +] @spell @string + +(compiler_directive_decl) @keyword.directive + +(preproc_line + "#line" @keyword.directive) + +(attribute + target: (identifier)? @keyword + (_type) @attribute) + +[ + "(" + ")" + "{" + "}" + ".[" + "[" + "]" + "[|" + "|]" + "{|" + "|}" +] @punctuation.bracket + +[ + "[<" + ">]" +] @punctuation.special + +(format_string_eval + [ + "{" + "}" + ] @punctuation.special) + +[ + "," + ";" + ":" + "." +] @punctuation.delimiter + +[ + "|" + "=" + ">" + "<" + "-" + "~" + "->" + "<-" + "&" + "&&" + "|" + "||" + ":>" + ":?>" + ".." + "*" + (infix_op) + (prefix_op) + (op_identifier) +] @operator + +(generic_type + [ + "<" + ">" + ] @punctuation.bracket) + +[ + "if" + "then" + "else" + "elif" + "when" + "match" + "match!" +] @keyword.conditional + +[ + "and" + "or" + "not" + "upcast" + "downcast" +] @keyword.operator + +[ + "return" + "return!" + "yield" + "yield!" +] @keyword.return + +[ + "for" + "while" + "downto" + "to" +] @keyword.repeat + +[ + "open" + "#r" + "#load" +] @keyword.import + +[ + "abstract" + "delegate" + "static" + "inline" + "mutable" + "override" + "rec" + "global" + (access_modifier) +] @keyword.modifier + +[ + "let" + "let!" + "use" + "use!" + "member" +] @keyword.function + +[ + "enum" + "type" + "inherit" + "interface" + "and" + "class" + "struct" +] @keyword.type + +((identifier) @keyword.exception + (#any-of? @keyword.exception "failwith" "failwithf" "raise" "reraise")) + +[ + "as" + "assert" + "begin" + "end" + "done" + "default" + "in" + "do" + "do!" + "fun" + "function" + "get" + "set" + "lazy" + "new" + "of" + "struct" + "val" + "module" + "namespace" + "with" +] @keyword + +[ + "null" + (unit) +] @constant.builtin + +(match_expression + "with" @keyword.conditional) + +(try_expression + [ + "try" + "with" + "finally" + ] @keyword.exception) + +(application_expression + (unit) @function.call) + +((_type + (long_identifier + (identifier) @type.builtin)) + (#any-of? @type.builtin + "bool" "byte" "sbyte" "int16" "uint16" "int" "uint" "int64" "uint64" "nativeint" "unativeint" + "decimal" "float" "double" "float32" "single" "char" "string" "unit")) + +(preproc_if + [ + "#if" @keyword.directive + "#endif" @keyword.directive + ] + condition: (_)? @keyword.directive) + +(preproc_else + "#else" @keyword.directive) + +((identifier) @module.builtin + (#any-of? @module.builtin + "Array" "Async" "Directory" "File" "List" "Option" "Path" "Map" "Set" "Lazy" "Seq" "Task" + "String" "Result")) + +((value_declaration + (attributes + (attribute + (_type + (long_identifier + (identifier) @attribute)))) + (function_or_value_defn + (value_declaration_left + . + (_) @constant))) + (#eq? @attribute "Literal")) diff --git a/runtime/queries/fsharp/injections.scm b/runtime/queries/fsharp/injections.scm new file mode 100644 index 000000000..211b263f3 --- /dev/null +++ b/runtime/queries/fsharp/injections.scm @@ -0,0 +1,11 @@ +([ + (line_comment) + (block_comment_content) +] @injection.content + (#set! injection.language "comment")) + +((line_comment) @injection.content + (#lua-match? @injection.content "^///") + (#offset! @injection.content 0 3 0 0) + (#set! injection.language "xml") + (#set! injection.combined)) diff --git a/runtime/queries/func/highlights.scm b/runtime/queries/func/highlights.scm new file mode 100644 index 000000000..9fd6dd82d --- /dev/null +++ b/runtime/queries/func/highlights.scm @@ -0,0 +1,167 @@ +; Include +"#include" @keyword.import + +(include_path) @string + +; Preproc +"#pragma" @keyword.directive + +(pragma_directive + [ + "version" + "not-version" + "test-version-set" + ] @keyword.directive) + +; Keywords +[ + "asm" + "impure" + "inline" + "inline_ref" + "method_id" + "type" +] @keyword + +"return" @keyword.return + +; Conditionals +[ + "if" + "ifnot" + "else" + "elseif" + "elseifnot" + "until" +] @keyword.conditional + +; Exceptions +[ + "try" + "catch" +] @keyword.exception + +; Repeats +[ + "do" + "forall" + "repeat" + "while" +] @keyword.repeat + +; Qualifiers +[ + "const" + "global" + (var) +] @keyword.modifier + +; 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) @function.method.call) + +; Parameters +(parameter) @variable.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/runtime/queries/func/injections.scm b/runtime/queries/func/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/func/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fusion/folds.scm b/runtime/queries/fusion/folds.scm new file mode 100644 index 000000000..179fc160b --- /dev/null +++ b/runtime/queries/fusion/folds.scm @@ -0,0 +1,6 @@ +[ + (comment) + (block) + (afx_comment) + (afx_element) +] @fold diff --git a/runtime/queries/fusion/highlights.scm b/runtime/queries/fusion/highlights.scm new file mode 100644 index 000000000..7108e5705 --- /dev/null +++ b/runtime/queries/fusion/highlights.scm @@ -0,0 +1,132 @@ +(comment) @comment @spell + +(afx_comment) @comment @spell + +; 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) @spell + +; 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" @keyword.import + (source_file) @string.special.url) + +(namespace_declaration + "namespace" @keyword.type + (alias_namespace) @module) + +(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) +] @module + +(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 + [ + "?" + ":" + ] @keyword.conditional.ternary) diff --git a/runtime/queries/fusion/indents.scm b/runtime/queries/fusion/indents.scm new file mode 100644 index 000000000..0ba6cf758 --- /dev/null +++ b/runtime/queries/fusion/indents.scm @@ -0,0 +1,24 @@ +[ + (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/runtime/queries/fusion/injections.scm b/runtime/queries/fusion/injections.scm new file mode 100644 index 000000000..085cdb458 --- /dev/null +++ b/runtime/queries/fusion/injections.scm @@ -0,0 +1,5 @@ +([ + (comment) + (afx_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/fusion/locals.scm b/runtime/queries/fusion/locals.scm new file mode 100644 index 000000000..d23e0ab46 --- /dev/null +++ b/runtime/queries/fusion/locals.scm @@ -0,0 +1,23 @@ +; Fusion base +(block) @local.scope + +(namespace_declaration + (alias_namespace) @local.definition.namespace) + +(property + (path + (path_part) @local.definition.field)) + +(type + namespace: (package_name)? @local.definition.namespace + name: (type_name) @local.definition.type) + +; Eel Expressions +(eel_arrow_function) @local.scope + +(eel_object) @local.scope + +(eel_parameter) @local.definition.parameter + +(eel_object_pair + key: (eel_property_name) @local.definition.field) diff --git a/runtime/queries/gap/folds.scm b/runtime/queries/gap/folds.scm new file mode 100644 index 000000000..7cf0888b6 --- /dev/null +++ b/runtime/queries/gap/folds.scm @@ -0,0 +1,12 @@ +[ + (if_statement) + (elif_clause) + (else_clause) + (while_statement) + (repeat_statement) + (for_statement) + (atomic_statement) + (lambda) + (function) + (atomic_function) +] @fold diff --git a/runtime/queries/gap/highlights.scm b/runtime/queries/gap/highlights.scm new file mode 100644 index 000000000..6c0c856c5 --- /dev/null +++ b/runtime/queries/gap/highlights.scm @@ -0,0 +1,208 @@ +(identifier) @variable + +; Functions +(assignment_statement + left: (identifier) @function + right: (function)) + +(assignment_statement + left: (identifier) @function + right: (atomic_function)) + +(assignment_statement + left: (identifier) @function + right: (lambda)) + +(call + function: (identifier) @function.call) + +((call + function: (identifier) @function.builtin) + (#any-of? @function.builtin "Assert" "Info" "IsBound" "Unbind" "TryNextMethod")) + +(parameters + (identifier) @variable.parameter) + +(qualified_parameters + (identifier) @variable.parameter) + +(qualified_parameters + (qualified_identifier + (identifier) @variable.parameter)) + +(lambda_parameters + (identifier) @variable.parameter) + +; arg is treated specially when it is the only parameter of a function +((parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (qualified_identifier + (identifier) @variable.parameter.builtin) .) + (#eq? @variable.parameter.builtin "arg")) + +((lambda_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +; Literals +(bool) @constant.builtin + +(integer) @number + +(float) @number.float + +(string) @string + +(char) @character + +(escape_sequence) @string.escape + +[ + (help_topic) + (help_book) +] @string.special + +(tilde) @variable.builtin + +; Record selectors +(record_entry + left: [ + (identifier) + (integer) + ] @variable.member) + +(record_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(component_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(function_call_option + [ + (identifier) + (record_entry ;Record entries specify global properties in function calls + left: [ + (identifier) + (integer) + ]) + ] @property) + +(help_statement + (help_selector) @property) + +; Operators +[ + "+" + "-" + "*" + "/" + "^" + "->" + ":=" + "<" + "<=" + "<>" + "=" + ">" + ">=" + ".." + (ellipsis) +] @operator + +(help_statement + (help_operator) @operator) + +; Keywords +[ + (break_statement) + (continue_statement) + "atomic" + (quit_statement) +] @keyword + +[ + "function" + "local" + "end" +] @keyword.function + +[ + "and" + "in" + "mod" + "not" + "or" +] @keyword.operator + +"rec" @keyword.type + +[ + "readonly" + "readwrite" +] @keyword.modifier + +(atomic_function + "atomic" @keyword.modifier) + +[ + "for" + "while" + "do" + "od" + "repeat" + "until" +] @keyword.repeat + +[ + "if" + "then" + "elif" + "else" + "fi" +] @keyword.conditional + +"return" @keyword.return + +(pragma) @keyword.directive + +;Punctuation +[ + "," + ";" + "." + "!." + ":" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "![" + "]" + "{" + "}" +] @punctuation.bracket + +(help_statement + "?" @punctuation.special) + +;Comments +(comment) @comment @spell diff --git a/runtime/queries/gap/injections.scm b/runtime/queries/gap/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gap/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gap/locals.scm b/runtime/queries/gap/locals.scm new file mode 100644 index 000000000..d695d1f2d --- /dev/null +++ b/runtime/queries/gap/locals.scm @@ -0,0 +1,43 @@ +[ + (lambda) + (function) + (atomic_function) +] @local.scope + +(parameters + (identifier) @local.definition.parameter) + +(qualified_parameters + (identifier) @local.definition.parameter) + +(qualified_parameters + (qualified_identifier + (identifier) @local.definition.parameter)) + +(lambda_parameters + (identifier) @local.definition.parameter) + +(locals + (identifier) @local.definition.var) + +(record_entry + left: [ + (identifier) + (integer) + ] @local.definition.field) + +(assignment_statement + left: (identifier) @local.definition.var) + +(for_statement + identifier: (identifier) @local.definition.var) + +(assignment_statement + left: (identifier) @local.definition.function + right: [ + (lambda) + (function) + (atomic_function) + ]) + +(identifier) @local.reference diff --git a/runtime/queries/gaptst/folds.scm b/runtime/queries/gaptst/folds.scm new file mode 100644 index 000000000..0ec72d135 --- /dev/null +++ b/runtime/queries/gaptst/folds.scm @@ -0,0 +1,7 @@ +[ + (if_statement) + (else_clause) + (local_statement) + (exec_statement) + (test_case) +] @fold diff --git a/runtime/queries/gaptst/highlights.scm b/runtime/queries/gaptst/highlights.scm new file mode 100644 index 000000000..22ab2d0a0 --- /dev/null +++ b/runtime/queries/gaptst/highlights.scm @@ -0,0 +1,19 @@ +(output_line) @markup.raw.block + +[ + "#@local" + "#@exec" +] @keyword + +[ + "gap> " + "> " +] @keyword.debug + +[ + "#@if" + "#@else" + "#@fi" +] @keyword.conditional + +(comment) @comment @spell diff --git a/runtime/queries/gaptst/injections.scm b/runtime/queries/gaptst/injections.scm new file mode 100644 index 000000000..bdcba35dc --- /dev/null +++ b/runtime/queries/gaptst/injections.scm @@ -0,0 +1,9 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((gap_expression) @injection.content + (#set! injection.language "gap")) + +((input_line) @injection.content + (#set! injection.language "gap") + (#set! injection.combined)) diff --git a/runtime/queries/gdscript/folds.scm b/runtime/queries/gdscript/folds.scm new file mode 100644 index 000000000..cda709077 --- /dev/null +++ b/runtime/queries/gdscript/folds.scm @@ -0,0 +1,26 @@ +[ + ; 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/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm new file mode 100644 index 000000000..cea9093c0 --- /dev/null +++ b/runtime/queries/gdscript/highlights.scm @@ -0,0 +1,422 @@ +; Basic +(identifier) @variable + +(name) @variable + +(type + (identifier) @type) + +(comment) @comment @spell + +(string_name) @string + +(string) @string + +(float) @number.float + +(integer) @number + +(null) @constant + +(setter) @function + +(getter) @function + +(set_body + "set" @keyword.function) + +(get_body + "get" @keyword.function) + +(static_keyword) @keyword.modifier + +(tool_statement) @keyword + +(breakpoint_statement) @keyword.debug + +(inferred_type) @operator + +[ + (true) + (false) +] @boolean + +[ + (get_node) + (node_path) +] @string.special.url + +(class_name_statement + (name) @type) @keyword + +(const_statement + "const" @keyword.modifier + (name) @constant) + +(expression_statement + (string) @comment @spell) + +; Functions +(constructor_definition + "_init" @constructor) + +(function_definition + (name) @function) + +(parameters + (identifier) @variable.parameter) + +(typed_parameter + (identifier) @variable.parameter) + +(default_parameter + (identifier) @variable.parameter) + +(typed_default_parameter + (identifier) @variable.parameter) + +(call + (identifier) @function.call) + +(call + (identifier) @keyword.import + (#any-of? @keyword.import "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) @function.method))) + +(attribute_call + (identifier) @function.method.call) + +(attribute_subscript + (identifier) @property) + +(attribute + (_) + (identifier) @property) + +; Identifier naming conventions +; - Make sure the following query is below the attribute queries so that it +; takes precedence on a `(type (attribute (identifier)))` +((identifier) @type + (#lua-match? @type "^[A-Z]")) + +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +; 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) + (pattern_open_ending) +] @character.special + +; Alternations +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + "." + ":" +] @punctuation.delimiter + +[ + "if" + "elif" + "else" + "match" +] @keyword.conditional + +(pattern_guard + "when" @keyword.conditional) + +[ + "for" + "while" + "break" + "continue" +] @keyword.repeat + +[ + "~" + "-" + "*" + "/" + "%" + "+" + "-" + "<<" + ">>" + "&" + "^" + "|" + "<" + ">" + "==" + "!=" + ">=" + "<=" + "!" + "&&" + "||" + "=" + "+=" + "-=" + "*=" + "/=" + "%=" + "&=" + "|=" + "->" +] @operator + +[ + "and" + "as" + "in" + "is" + "not" + "or" +] @keyword.operator + +[ + "pass" + "class_name" + "extends" + "signal" + "var" + "onready" + "setget" + "remote" + "master" + "puppet" + "remotesync" + "mastersync" + "puppetsync" +] @keyword + +"export" @keyword.import + +[ + "enum" + "class" +] @keyword.type + +"func" @keyword.function + +"return" @keyword.return + +"await" @keyword.coroutine + +(call + (identifier) @keyword.coroutine + (#eq? @keyword.coroutine "yield")) + +; Builtins +; generated from +; - godot commit: fb10e67fef +; - https://github.com/godotengine/godot/blob/fb10e67fef/doc/classes +; - https://github.com/godotengine/godot/blob/fb10e67fef/doc/classes/@GlobalScope.xml +; - https://github.com/godotengine/godot/blob/fb10e67fef/modules/gdscript/doc_classes/@GDScript.xml +; Built-in Annotations +((annotation + "@" @attribute + (identifier) @attribute) + (#any-of? @attribute + ; from modules/gdscript/doc_classes/@GDScript.xml + "export" "export_category" "export_color_no_alpha" "export_custom" "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_flags_avoidance" "export_global_dir" + "export_global_file" "export_group" "export_multiline" "export_node_path" "export_placeholder" + "export_range" "export_storage" "export_subgroup" "icon" "onready" "rpc" "static_unload" "tool" + "warning_ignore")) + +; Builtin Types +((identifier) @type.builtin + (#any-of? @type.builtin + ; from doc/classes/*.xml + "AABB" "Array" "Basis" "Callable" "Color" "Dictionary" "NodePath" "PackedByteArray" + "PackedColorArray" "PackedFloat32Array" "PackedFloat64Array" "PackedInt32Array" + "PackedInt64Array" "PackedStringArray" "PackedVector2Array" "PackedVector3Array" "Plane" + "Projection" "Quaternion" "RID" "Rect2" "Rect2i" "Signal" "String" "StringName" "Transform2D" + "Transform3D" "Vector2" "Vector2i" "Vector3" "Vector3i" "Vector4" "Vector4i" "bool" "float" + "int" + ; from doc/classes/@GlobalScope.xml + "AudioServer" "CameraServer" "ClassDB" "DisplayServer" "EditorInterface" "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 + ; from doc/classes/@GlobalScope.xml + "abs" "absf" "absi" "acos" "acosh" "angle_difference" "asin" "asinh" "atan" "atan2" "atanh" + "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" "rotate_toward" "round" "roundf" "roundi" "seed" "sign" "signf" "signi" "sin" + "sinh" "smoothstep" "snapped" "snappedf" "snappedi" "sqrt" "step_decimals" "str" "str_to_var" + "tan" "tanh" "type_convert" "type_string" "typeof" "var_to_bytes" "var_to_bytes_with_objects" + "var_to_str" "weakref" "wrap" "wrapf" "wrapi" + ; from modules/gdscript/doc_classes/@GDScript.xml + "Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict" "is_instance_of" + "len" "load" "preload" "print_debug" "print_stack" "range" "type_exists")) + +; Builtin Constants +((identifier) @constant.builtin + (#any-of? @constant.builtin + ; from modules/gdscript/doc_classes/@GDScript.xml + "INF" "NAN" "PI" "TAU" + ; from doc/classes/@GlobalScope.xml + "CLOCKWISE" "CORNER_BOTTOM_LEFT" "CORNER_BOTTOM_RIGHT" "CORNER_TOP_LEFT" "CORNER_TOP_RIGHT" + "COUNTERCLOCKWISE" "ERR_ALREADY_EXISTS" "ERR_ALREADY_IN_USE" "ERR_BUG" "ERR_BUSY" + "ERR_CANT_ACQUIRE_RESOURCE" "ERR_CANT_CONNECT" "ERR_CANT_CREATE" "ERR_CANT_FORK" "ERR_CANT_OPEN" + "ERR_CANT_RESOLVE" "ERR_COMPILATION_FAILED" "ERR_CONNECTION_ERROR" "ERR_CYCLIC_LINK" + "ERR_DATABASE_CANT_READ" "ERR_DATABASE_CANT_WRITE" "ERR_DOES_NOT_EXIST" "ERR_DUPLICATE_SYMBOL" + "ERR_FILE_ALREADY_IN_USE" "ERR_FILE_BAD_DRIVE" "ERR_FILE_BAD_PATH" "ERR_FILE_CANT_OPEN" + "ERR_FILE_CANT_READ" "ERR_FILE_CANT_WRITE" "ERR_FILE_CORRUPT" "ERR_FILE_EOF" + "ERR_FILE_MISSING_DEPENDENCIES" "ERR_FILE_NOT_FOUND" "ERR_FILE_NO_PERMISSION" + "ERR_FILE_UNRECOGNIZED" "ERR_HELP" "ERR_INVALID_DATA" "ERR_INVALID_DECLARATION" + "ERR_INVALID_PARAMETER" "ERR_LINK_FAILED" "ERR_LOCKED" "ERR_METHOD_NOT_FOUND" + "ERR_OUT_OF_MEMORY" "ERR_PARAMETER_RANGE_ERROR" "ERR_PARSE_ERROR" "ERR_PRINTER_ON_FIRE" + "ERR_QUERY_FAILED" "ERR_SCRIPT_FAILED" "ERR_SKIP" "ERR_TIMEOUT" "ERR_UNAUTHORIZED" + "ERR_UNAVAILABLE" "ERR_UNCONFIGURED" "EULER_ORDER_XYZ" "EULER_ORDER_XZY" "EULER_ORDER_YXZ" + "EULER_ORDER_YZX" "EULER_ORDER_ZXY" "EULER_ORDER_ZYX" "FAILED" "HORIZONTAL" + "HORIZONTAL_ALIGNMENT_CENTER" "HORIZONTAL_ALIGNMENT_FILL" "HORIZONTAL_ALIGNMENT_LEFT" + "HORIZONTAL_ALIGNMENT_RIGHT" "INLINE_ALIGNMENT_BASELINE_TO" "INLINE_ALIGNMENT_BOTTOM" + "INLINE_ALIGNMENT_BOTTOM_TO" "INLINE_ALIGNMENT_CENTER" "INLINE_ALIGNMENT_CENTER_TO" + "INLINE_ALIGNMENT_IMAGE_MASK" "INLINE_ALIGNMENT_TEXT_MASK" "INLINE_ALIGNMENT_TOP" + "INLINE_ALIGNMENT_TOP_TO" "INLINE_ALIGNMENT_TO_BASELINE" "INLINE_ALIGNMENT_TO_BOTTOM" + "INLINE_ALIGNMENT_TO_CENTER" "INLINE_ALIGNMENT_TO_TOP" "JOY_AXIS_INVALID" "JOY_AXIS_LEFT_X" + "JOY_AXIS_LEFT_Y" "JOY_AXIS_MAX" "JOY_AXIS_RIGHT_X" "JOY_AXIS_RIGHT_Y" "JOY_AXIS_SDL_MAX" + "JOY_AXIS_TRIGGER_LEFT" "JOY_AXIS_TRIGGER_RIGHT" "JOY_BUTTON_A" "JOY_BUTTON_B" "JOY_BUTTON_BACK" + "JOY_BUTTON_DPAD_DOWN" "JOY_BUTTON_DPAD_LEFT" "JOY_BUTTON_DPAD_RIGHT" "JOY_BUTTON_DPAD_UP" + "JOY_BUTTON_GUIDE" "JOY_BUTTON_INVALID" "JOY_BUTTON_LEFT_SHOULDER" "JOY_BUTTON_LEFT_STICK" + "JOY_BUTTON_MAX" "JOY_BUTTON_MISC1" "JOY_BUTTON_PADDLE1" "JOY_BUTTON_PADDLE2" + "JOY_BUTTON_PADDLE3" "JOY_BUTTON_PADDLE4" "JOY_BUTTON_RIGHT_SHOULDER" "JOY_BUTTON_RIGHT_STICK" + "JOY_BUTTON_SDL_MAX" "JOY_BUTTON_START" "JOY_BUTTON_TOUCHPAD" "JOY_BUTTON_X" "JOY_BUTTON_Y" + "KEY_0" "KEY_1" "KEY_2" "KEY_3" "KEY_4" "KEY_5" "KEY_6" "KEY_7" "KEY_8" "KEY_9" "KEY_A" + "KEY_ALT" "KEY_AMPERSAND" "KEY_APOSTROPHE" "KEY_ASCIICIRCUM" "KEY_ASCIITILDE" "KEY_ASTERISK" + "KEY_AT" "KEY_B" "KEY_BACK" "KEY_BACKSLASH" "KEY_BACKSPACE" "KEY_BACKTAB" "KEY_BAR" + "KEY_BRACELEFT" "KEY_BRACERIGHT" "KEY_BRACKETLEFT" "KEY_BRACKETRIGHT" "KEY_C" "KEY_CAPSLOCK" + "KEY_CLEAR" "KEY_CODE_MASK" "KEY_COLON" "KEY_COMMA" "KEY_CTRL" "KEY_D" "KEY_DELETE" "KEY_DOLLAR" + "KEY_DOWN" "KEY_E" "KEY_END" "KEY_ENTER" "KEY_EQUAL" "KEY_ESCAPE" "KEY_EXCLAM" "KEY_F" "KEY_F1" + "KEY_F10" "KEY_F11" "KEY_F12" "KEY_F13" "KEY_F14" "KEY_F15" "KEY_F16" "KEY_F17" "KEY_F18" + "KEY_F19" "KEY_F2" "KEY_F20" "KEY_F21" "KEY_F22" "KEY_F23" "KEY_F24" "KEY_F25" "KEY_F26" + "KEY_F27" "KEY_F28" "KEY_F29" "KEY_F3" "KEY_F30" "KEY_F31" "KEY_F32" "KEY_F33" "KEY_F34" + "KEY_F35" "KEY_F4" "KEY_F5" "KEY_F6" "KEY_F7" "KEY_F8" "KEY_F9" "KEY_FAVORITES" "KEY_FORWARD" + "KEY_G" "KEY_GLOBE" "KEY_GREATER" "KEY_H" "KEY_HELP" "KEY_HOME" "KEY_HOMEPAGE" "KEY_HYPER" + "KEY_I" "KEY_INSERT" "KEY_J" "KEY_JIS_EISU" "KEY_JIS_KANA" "KEY_K" "KEY_KEYBOARD" "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_KP_ADD" "KEY_KP_DIVIDE" "KEY_KP_ENTER" "KEY_KP_MULTIPLY" "KEY_KP_PERIOD" + "KEY_KP_SUBTRACT" "KEY_L" "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_LAUNCHMAIL" + "KEY_LAUNCHMEDIA" "KEY_LEFT" "KEY_LESS" "KEY_LOCATION_LEFT" "KEY_LOCATION_RIGHT" + "KEY_LOCATION_UNSPECIFIED" "KEY_M" "KEY_MASK_ALT" "KEY_MASK_CMD_OR_CTRL" "KEY_MASK_CTRL" + "KEY_MASK_GROUP_SWITCH" "KEY_MASK_KPAD" "KEY_MASK_META" "KEY_MASK_SHIFT" "KEY_MEDIANEXT" + "KEY_MEDIAPLAY" "KEY_MEDIAPREVIOUS" "KEY_MEDIARECORD" "KEY_MEDIASTOP" "KEY_MENU" "KEY_META" + "KEY_MINUS" "KEY_MODIFIER_MASK" "KEY_N" "KEY_NONE" "KEY_NUMBERSIGN" "KEY_NUMLOCK" "KEY_O" + "KEY_OPENURL" "KEY_P" "KEY_PAGEDOWN" "KEY_PAGEUP" "KEY_PARENLEFT" "KEY_PARENRIGHT" "KEY_PAUSE" + "KEY_PERCENT" "KEY_PERIOD" "KEY_PLUS" "KEY_PRINT" "KEY_Q" "KEY_QUESTION" "KEY_QUOTEDBL" + "KEY_QUOTELEFT" "KEY_R" "KEY_REFRESH" "KEY_RIGHT" "KEY_S" "KEY_SCROLLLOCK" "KEY_SEARCH" + "KEY_SECTION" "KEY_SEMICOLON" "KEY_SHIFT" "KEY_SLASH" "KEY_SPACE" "KEY_SPECIAL" "KEY_STANDBY" + "KEY_STOP" "KEY_SYSREQ" "KEY_T" "KEY_TAB" "KEY_U" "KEY_UNDERSCORE" "KEY_UNKNOWN" "KEY_UP" + "KEY_V" "KEY_VOLUMEDOWN" "KEY_VOLUMEMUTE" "KEY_VOLUMEUP" "KEY_W" "KEY_X" "KEY_Y" "KEY_YEN" + "KEY_Z" "METHOD_FLAGS_DEFAULT" "METHOD_FLAG_CONST" "METHOD_FLAG_EDITOR" "METHOD_FLAG_NORMAL" + "METHOD_FLAG_OBJECT_CORE" "METHOD_FLAG_STATIC" "METHOD_FLAG_VARARG" "METHOD_FLAG_VIRTUAL" + "MIDI_MESSAGE_ACTIVE_SENSING" "MIDI_MESSAGE_AFTERTOUCH" "MIDI_MESSAGE_CHANNEL_PRESSURE" + "MIDI_MESSAGE_CONTINUE" "MIDI_MESSAGE_CONTROL_CHANGE" "MIDI_MESSAGE_NONE" + "MIDI_MESSAGE_NOTE_OFF" "MIDI_MESSAGE_NOTE_ON" "MIDI_MESSAGE_PITCH_BEND" + "MIDI_MESSAGE_PROGRAM_CHANGE" "MIDI_MESSAGE_QUARTER_FRAME" "MIDI_MESSAGE_SONG_POSITION_POINTER" + "MIDI_MESSAGE_SONG_SELECT" "MIDI_MESSAGE_START" "MIDI_MESSAGE_STOP" + "MIDI_MESSAGE_SYSTEM_EXCLUSIVE" "MIDI_MESSAGE_SYSTEM_RESET" "MIDI_MESSAGE_TIMING_CLOCK" + "MIDI_MESSAGE_TUNE_REQUEST" "MOUSE_BUTTON_LEFT" "MOUSE_BUTTON_MASK_LEFT" + "MOUSE_BUTTON_MASK_MB_XBUTTON1" "MOUSE_BUTTON_MASK_MB_XBUTTON2" "MOUSE_BUTTON_MASK_MIDDLE" + "MOUSE_BUTTON_MASK_RIGHT" "MOUSE_BUTTON_MIDDLE" "MOUSE_BUTTON_NONE" "MOUSE_BUTTON_RIGHT" + "MOUSE_BUTTON_WHEEL_DOWN" "MOUSE_BUTTON_WHEEL_LEFT" "MOUSE_BUTTON_WHEEL_RIGHT" + "MOUSE_BUTTON_WHEEL_UP" "MOUSE_BUTTON_XBUTTON1" "MOUSE_BUTTON_XBUTTON2" "OK" "OP_ADD" "OP_AND" + "OP_BIT_AND" "OP_BIT_NEGATE" "OP_BIT_OR" "OP_BIT_XOR" "OP_DIVIDE" "OP_EQUAL" "OP_GREATER" + "OP_GREATER_EQUAL" "OP_IN" "OP_LESS" "OP_LESS_EQUAL" "OP_MAX" "OP_MODULE" "OP_MULTIPLY" + "OP_NEGATE" "OP_NOT" "OP_NOT_EQUAL" "OP_OR" "OP_POSITIVE" "OP_POWER" "OP_SHIFT_LEFT" + "OP_SHIFT_RIGHT" "OP_SUBTRACT" "OP_XOR" "PROPERTY_HINT_ARRAY_TYPE" + "PROPERTY_HINT_COLOR_NO_ALPHA" "PROPERTY_HINT_DIR" "PROPERTY_HINT_ENUM" + "PROPERTY_HINT_ENUM_SUGGESTION" "PROPERTY_HINT_EXPRESSION" "PROPERTY_HINT_EXP_EASING" + "PROPERTY_HINT_FILE" "PROPERTY_HINT_FLAGS" "PROPERTY_HINT_GLOBAL_DIR" + "PROPERTY_HINT_GLOBAL_FILE" "PROPERTY_HINT_GLOBAL_SAVE_FILE" + "PROPERTY_HINT_HIDE_QUATERNION_EDIT" "PROPERTY_HINT_INT_IS_OBJECTID" + "PROPERTY_HINT_INT_IS_POINTER" "PROPERTY_HINT_LAYERS_2D_NAVIGATION" + "PROPERTY_HINT_LAYERS_2D_PHYSICS" "PROPERTY_HINT_LAYERS_2D_RENDER" + "PROPERTY_HINT_LAYERS_3D_NAVIGATION" "PROPERTY_HINT_LAYERS_3D_PHYSICS" + "PROPERTY_HINT_LAYERS_3D_RENDER" "PROPERTY_HINT_LAYERS_AVOIDANCE" "PROPERTY_HINT_LINK" + "PROPERTY_HINT_LOCALE_ID" "PROPERTY_HINT_LOCALIZABLE_STRING" "PROPERTY_HINT_MAX" + "PROPERTY_HINT_MULTILINE_TEXT" "PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" + "PROPERTY_HINT_NODE_PATH_VALID_TYPES" "PROPERTY_HINT_NODE_TYPE" "PROPERTY_HINT_NONE" + "PROPERTY_HINT_OBJECT_ID" "PROPERTY_HINT_OBJECT_TOO_BIG" "PROPERTY_HINT_PASSWORD" + "PROPERTY_HINT_PLACEHOLDER_TEXT" "PROPERTY_HINT_RANGE" "PROPERTY_HINT_RESOURCE_TYPE" + "PROPERTY_HINT_SAVE_FILE" "PROPERTY_HINT_TYPE_STRING" "PROPERTY_USAGE_ALWAYS_DUPLICATE" + "PROPERTY_USAGE_ARRAY" "PROPERTY_USAGE_CATEGORY" "PROPERTY_USAGE_CHECKABLE" + "PROPERTY_USAGE_CHECKED" "PROPERTY_USAGE_CLASS_IS_BITFIELD" "PROPERTY_USAGE_CLASS_IS_ENUM" + "PROPERTY_USAGE_DEFAULT" "PROPERTY_USAGE_DEFERRED_SET_RESOURCE" "PROPERTY_USAGE_EDITOR" + "PROPERTY_USAGE_EDITOR_BASIC_SETTING" "PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" + "PROPERTY_USAGE_GROUP" "PROPERTY_USAGE_HIGH_END_GFX" "PROPERTY_USAGE_INTERNAL" + "PROPERTY_USAGE_KEYING_INCREMENTS" "PROPERTY_USAGE_NEVER_DUPLICATE" + "PROPERTY_USAGE_NIL_IS_VARIANT" "PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT" "PROPERTY_USAGE_NONE" + "PROPERTY_USAGE_NO_EDITOR" "PROPERTY_USAGE_NO_INSTANCE_STATE" "PROPERTY_USAGE_READ_ONLY" + "PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" "PROPERTY_USAGE_RESTART_IF_CHANGED" + "PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" "PROPERTY_USAGE_SCRIPT_VARIABLE" "PROPERTY_USAGE_SECRET" + "PROPERTY_USAGE_STORAGE" "PROPERTY_USAGE_STORE_IF_NULL" "PROPERTY_USAGE_SUBGROUP" + "PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" "SIDE_BOTTOM" "SIDE_LEFT" "SIDE_RIGHT" "SIDE_TOP" + "TYPE_AABB" "TYPE_ARRAY" "TYPE_BASIS" "TYPE_BOOL" "TYPE_CALLABLE" "TYPE_COLOR" "TYPE_DICTIONARY" + "TYPE_FLOAT" "TYPE_INT" "TYPE_MAX" "TYPE_NIL" "TYPE_NODE_PATH" "TYPE_OBJECT" + "TYPE_PACKED_BYTE_ARRAY" "TYPE_PACKED_COLOR_ARRAY" "TYPE_PACKED_FLOAT32_ARRAY" + "TYPE_PACKED_FLOAT64_ARRAY" "TYPE_PACKED_INT32_ARRAY" "TYPE_PACKED_INT64_ARRAY" + "TYPE_PACKED_STRING_ARRAY" "TYPE_PACKED_VECTOR2_ARRAY" "TYPE_PACKED_VECTOR3_ARRAY" "TYPE_PLANE" + "TYPE_PROJECTION" "TYPE_QUATERNION" "TYPE_RECT2" "TYPE_RECT2I" "TYPE_RID" "TYPE_SIGNAL" + "TYPE_STRING" "TYPE_STRING_NAME" "TYPE_TRANSFORM2D" "TYPE_TRANSFORM3D" "TYPE_VECTOR2" + "TYPE_VECTOR2I" "TYPE_VECTOR3" "TYPE_VECTOR3I" "TYPE_VECTOR4" "TYPE_VECTOR4I" "VERTICAL" + "VERTICAL_ALIGNMENT_BOTTOM" "VERTICAL_ALIGNMENT_CENTER" "VERTICAL_ALIGNMENT_FILL" + "VERTICAL_ALIGNMENT_TOP")) diff --git a/runtime/queries/gdscript/indents.scm b/runtime/queries/gdscript/indents.scm new file mode 100644 index 000000000..36b989f93 --- /dev/null +++ b/runtime/queries/gdscript/indents.scm @@ -0,0 +1,78 @@ +[ + (lambda) + (function_definition) + (constructor_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/runtime/queries/gdscript/injections.scm b/runtime/queries/gdscript/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gdscript/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gdscript/locals.scm b/runtime/queries/gdscript/locals.scm new file mode 100644 index 000000000..62166e6f0 --- /dev/null +++ b/runtime/queries/gdscript/locals.scm @@ -0,0 +1,121 @@ +; 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) +] @local.scope + +; Parameters +(parameters + (identifier) @local.definition.parameter) + +(default_parameter + (identifier) @local.definition.parameter) + +(typed_parameter + (identifier) @local.definition.parameter) + +(typed_default_parameter + (identifier) @local.definition.parameter) + +; Signals +; Can gdscript 2 signals be considered fields? +(signal_statement + (name) @local.definition.field) + +; Variable Definitions +(const_statement + (name) @local.definition.constant) + +; onready and export variations are only properties. +(variable_statement + (name) @local.definition.var) + +(setter) @local.reference + +(getter) @local.reference + +; Function Definition +((function_definition + (name) @local.definition.function) + (#set! definition.function.scope "parent")) + +; Lambda +; lambda names are not accessible and are only for debugging. +(lambda + (name) @local.definition.function) + +; Source +(class_name_statement + (name) @local.definition.type) + +(source + (variable_statement + (name) @local.definition.field)) + +(source + (onready_variable_statement + (name) @local.definition.field)) + +(source + (export_variable_statement + (name) @local.definition.field)) + +; Class +((class_definition + (name) @local.definition.type) + (#set! definition.type.scope "parent")) + +(class_definition + (body + (variable_statement + (name) @local.definition.field))) + +(class_definition + (body + (onready_variable_statement + (name) @local.definition.field))) + +(class_definition + (body + (export_variable_statement + (name) @local.definition.field))) + +(class_definition + (body + (signal_statement + (name) @local.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) @local.definition.method))) + (#set! definition.method.scope "parent")) + +; Enum +(enum_definition + (name) @local.definition.enum) + +; Repeat +(for_statement + . + (identifier) @local.definition.var) + +; Match Statement +(pattern_binding + (identifier) @local.definition.var) + +; References +(identifier) @local.reference diff --git a/runtime/queries/gdshader/highlights.scm b/runtime/queries/gdshader/highlights.scm new file mode 100644 index 000000000..c93fd4721 --- /dev/null +++ b/runtime/queries/gdshader/highlights.scm @@ -0,0 +1,142 @@ +[ + "render_mode" + "shader_type" + "group_uniforms" + "global" + "instance" + "const" + "varying" + "uniform" +] @keyword + +"struct" @keyword.type + +[ + (precision_qualifier) + (interpolation_qualifier) +] @keyword.modifier + +[ + "in" + "out" + "inout" +] @keyword.modifier + +[ + "while" + "for" +] @keyword.repeat + +[ + "continue" + "break" + "return" +] @keyword.return + +[ + "if" + "else" + "switch" + "case" + "default" +] @keyword.conditional + +[ + "#" + "include" +] @keyword.directive + +(string) @string + +[ + "=" + "+=" + "-=" + "!" + "~" + "+" + "-" + "*" + "/" + "%" + "||" + "&&" + "|" + "^" + "&" + "==" + "!=" + ">" + ">=" + "<=" + "<" + "<<" + ">>" + "++" + "--" +] @operator + +(boolean) @boolean + +(integer) @number + +(float) @number.float + +[ + "." + "," + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(builtin_type) @type.builtin + +(ident_type) @type.definition + +[ + (shader_type) + (render_mode) + (hint_name) +] @attribute + +(builtin_variable) @constant.builtin + +(builtin_function) @function.builtin + +(group_uniforms_declaration + group_name: (ident) @property + subgroup_name: (ident) @property) + +(struct_declaration + name: (ident) @type) + +(struct_member + name: (ident) @property) + +(function_declaration + name: (ident) @function) + +(parameter + name: (ident) @variable.parameter) + +(member_expr + member: (ident) @property) + +(call_expr + function: [ + (ident) + (builtin_type) + ] @function) + +(call_expr + function: (builtin_type) @function.call) + +(comment) @comment @spell diff --git a/runtime/queries/gdshader/injections.scm b/runtime/queries/gdshader/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gdshader/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/git_config/folds.scm b/runtime/queries/git_config/folds.scm new file mode 100644 index 000000000..cb376d5b5 --- /dev/null +++ b/runtime/queries/git_config/folds.scm @@ -0,0 +1,2 @@ +((section) @fold + (#trim! @fold)) diff --git a/runtime/queries/git_config/highlights.scm b/runtime/queries/git_config/highlights.scm new file mode 100644 index 000000000..6b37e9090 --- /dev/null +++ b/runtime/queries/git_config/highlights.scm @@ -0,0 +1,59 @@ +; Sections +(section_name) @markup.heading + +((section_name) @keyword.import + (#eq? @keyword.import "include")) + +((section_header + (section_name) @keyword.import + (subsection_name)) + (#eq? @keyword.import "includeIf")) + +(variable + (name) @property) + +; Operators +"=" @operator + +; Literals +(integer) @number + +[ + (true) + (false) +] @boolean + +(string) @string + +(escape_sequence) @string.escape + +((string) @string.special.path + (#lua-match? @string.special.path "^[.]?[.]?[/]")) + +((string) @string.special.path + (#lua-match? @string.special.path "^[~]")) + +(section_header + [ + "\"" + (subsection_name) + ] @string.special) + +((section_header + (section_name) @_name + (subsection_name) @string.special.url) + (#any-of? @_name "credential" "url")) + +((variable + (name) @_name + value: (string) @string.special.url) + (#eq? @_name "insteadOf")) + +; Punctuation +[ + "[" + "]" +] @punctuation.bracket + +; Comments +(comment) @comment @spell diff --git a/runtime/queries/git_config/injections.scm b/runtime/queries/git_config/injections.scm new file mode 100644 index 000000000..7bda6979c --- /dev/null +++ b/runtime/queries/git_config/injections.scm @@ -0,0 +1,69 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((variable + (name) @_name + value: (string) @injection.content) + (#any-of? @_name "cmd" "command" "textconv" "sendmailCmd") + (#set! injection.language "bash")) + +(section + (variable + (name) @_name + value: (string) @injection.content) + (#eq? @_name "tool") + (#set! injection.language "bash")) + +(section + (section_header + (section_name) @_pager) + (variable + value: (string) @injection.content) + (#eq? @_pager "pager") + (#set! injection.language "bash")) + +(section + (section_header + (section_name) @_interactive) + (variable + (name) @_name + value: (string) @injection.content) + (#eq? @_interactive "interactive") + (#eq? @_name "diffFilter") + (#set! injection.language "bash")) + +; https://github.com/git-lfs/git-lfs +; git lfs install +(section + (section_header + (section_name) @_filter + (subsection_name) @_lfs) + (variable + (name) @_name + value: (string) @injection.content) + (#eq? @_filter "filter") + (#eq? @_lfs "lfs") + (#any-of? @_name "smudge" "process" "clean") + (#set! injection.language "bash")) + +(section + (section_header + (section_name) @_alias) + (variable + value: (string) @injection.content) + (#eq? @_alias "alias") + (#lua-match? @injection.content "^!") + (#offset! @injection.content 0 1 0 0) + (#set! injection.language "bash")) + +(section + (section_header + (section_name) @_alias) + (variable + value: (string + "\"" + "\"") @injection.content) + (#eq? @_alias "alias") + (#lua-match? @injection.content "^\"!") + (#offset! @injection.content 0 2 0 -1) + (#set! injection.language "bash")) diff --git a/runtime/queries/git_rebase/highlights.scm b/runtime/queries/git_rebase/highlights.scm new file mode 100644 index 000000000..248366e24 --- /dev/null +++ b/runtime/queries/git_rebase/highlights.scm @@ -0,0 +1,7 @@ +((command) @keyword + (label)? @constant + (message)? @none @spell) + +(option) @operator + +(comment) @comment diff --git a/runtime/queries/git_rebase/injections.scm b/runtime/queries/git_rebase/injections.scm new file mode 100644 index 000000000..c831594bd --- /dev/null +++ b/runtime/queries/git_rebase/injections.scm @@ -0,0 +1,8 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((operation + (command) @_command + (message) @injection.content) + (#set! injection.language "bash") + (#any-of? @_command "exec" "x")) diff --git a/runtime/queries/gitattributes/highlights.scm b/runtime/queries/gitattributes/highlights.scm new file mode 100644 index 000000000..aec7750f6 --- /dev/null +++ b/runtime/queries/gitattributes/highlights.scm @@ -0,0 +1,55 @@ +(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) @variable.parameter) + +(attribute + (builtin_attr) @variable.builtin) + +[ + (attr_reset) + (attr_unset) + (attr_set) +] @operator + +(boolean_value) @boolean + +(string_value) @string + +(macro_tag) @keyword.directive + +(macro_def + macro_name: (_) @property) + +; we do not lint syntax errors +; [ +; (pattern_negation) +; (redundant_escape) +; (trailing_slash) +; ] @error +(comment) @comment @spell diff --git a/runtime/queries/gitattributes/injections.scm b/runtime/queries/gitattributes/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gitattributes/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gitattributes/locals.scm b/runtime/queries/gitattributes/locals.scm new file mode 100644 index 000000000..2471b8bc6 --- /dev/null +++ b/runtime/queries/gitattributes/locals.scm @@ -0,0 +1,8 @@ +(macro_def + (attr_name) @local.definition.macro) + +(attribute + (attr_name) @local.reference) + +(attribute + (builtin_attr) @local.reference) diff --git a/runtime/queries/gitcommit/highlights.scm b/runtime/queries/gitcommit/highlights.scm new file mode 100644 index 000000000..b096056cc --- /dev/null +++ b/runtime/queries/gitcommit/highlights.scm @@ -0,0 +1,49 @@ +(comment) @comment + +(generated_comment) @comment + +(title) @markup.heading + +; (text) @none +(branch) @markup.link + +(change) @keyword + +(filepath) @string.special.path + +(arrow) @punctuation.delimiter + +(subject) @markup.heading @spell + +(subject + (subject_prefix) @function @nospell) + +(prefix + (type) @keyword @nospell) + +(prefix + (scope) @variable.parameter @nospell) + +(prefix + [ + "(" + ")" + ":" + ] @punctuation.delimiter) + +(prefix + "!" @punctuation.special) + +(message) @spell + +(trailer + (token) @label) + +; (trailer (value) @none) +(breaking_change + (token) @comment.error) + +(breaking_change + (value) @none @spell) + +(scissor) @comment diff --git a/runtime/queries/gitcommit/injections.scm b/runtime/queries/gitcommit/injections.scm new file mode 100644 index 000000000..5613d7e8e --- /dev/null +++ b/runtime/queries/gitcommit/injections.scm @@ -0,0 +1,5 @@ +((diff) @injection.content + (#set! injection.language "diff")) + +((rebase_command) @injection.content + (#set! injection.language "git_rebase")) diff --git a/runtime/queries/gitignore/highlights.scm b/runtime/queries/gitignore/highlights.scm new file mode 100644 index 000000000..aafbe541e --- /dev/null +++ b/runtime/queries/gitignore/highlights.scm @@ -0,0 +1,36 @@ +(comment) @comment @spell + +(pattern_char) @string.special.path + +[ + (directory_separator) + (directory_separator_escaped) +] @punctuation.delimiter + +[ + (wildcard_char_single) + (wildcard_chars) + (wildcard_chars_allow_slash) +] @character.special + +[ + (pattern_char_escaped) + (bracket_char_escaped) +] @string.escape + +(negation) @punctuation.special + +(bracket_negation) @operator + +; bracket expressions +[ + "[" + "]" +] @punctuation.bracket + +(bracket_char) @constant + +(bracket_range + "-" @operator) + +(bracket_char_class) @constant.builtin diff --git a/runtime/queries/gitignore/injections.scm b/runtime/queries/gitignore/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/gitignore/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gleam/folds.scm b/runtime/queries/gleam/folds.scm new file mode 100644 index 000000000..b4cd225e7 --- /dev/null +++ b/runtime/queries/gleam/folds.scm @@ -0,0 +1,7 @@ +; Folds +[ + (case) + (function) + (anonymous_function) + (type_definition) +] @fold diff --git a/runtime/queries/gleam/highlights.scm b/runtime/queries/gleam/highlights.scm new file mode 100644 index 000000000..f80bda240 --- /dev/null +++ b/runtime/queries/gleam/highlights.scm @@ -0,0 +1,200 @@ +; Keywords +[ + "as" + "let" + "panic" + "todo" + "use" + "echo" +] @keyword + +"type" @keyword.type + +; Function Keywords +"fn" @keyword.function + +; Imports +"import" @keyword.import + +; Conditionals +[ + "case" + "if" +] @keyword.conditional + +; Exceptions +"assert" @keyword.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) @module + +(import + alias: ((identifier) @module)?) + +(remote_type_identifier + module: (identifier) @module) + +(unqualified_import + name: (identifier) @function) + +; Strings +(string) @string + +; Bit Strings +(bit_string_segment) @string.special + +; Numbers +(integer) @number + +(float) @number.float + +; Function Parameter Labels +(function_call + arguments: (arguments + (argument + label: (label) @label))) + +(function_parameter + label: (label)? @label + name: (identifier) @variable.parameter) + +; Records +(record + arguments: (arguments + (argument + label: (label) @variable.member)?)) + +(record_pattern_argument + label: (label) @variable.member) + +(record_update_argument + label: (label) @variable.member) + +(field_access + record: (identifier) @variable + field: (label) @variable.member) + +(data_constructor_argument + (label) @variable.member) + +; Types +[ + (type_identifier) + (type_parameter) + (type_var) +] @type + +; Type Qualifiers +[ + "const" + "external" + (opacity_modifier) + (visibility_modifier) +] @keyword.modifier + +; 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) @module + . + (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) diff --git a/runtime/queries/gleam/indents.scm b/runtime/queries/gleam/indents.scm new file mode 100644 index 000000000..3a44ea4c0 --- /dev/null +++ b/runtime/queries/gleam/indents.scm @@ -0,0 +1,30 @@ +; Gleam indents similar to Rust and JavaScript +[ + (anonymous_function) + (assert) + (case) + (case_clause) + (constant) + (external_function) + (function) + (let) + (list) + (constant) + (function) + (type_definition) + (type_alias) + (todo) + (tuple) + (unqualified_imports) +] @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/runtime/queries/gleam/injections.scm b/runtime/queries/gleam/injections.scm new file mode 100644 index 000000000..11d4f5d55 --- /dev/null +++ b/runtime/queries/gleam/injections.scm @@ -0,0 +1,7 @@ +; Comments +([ + (module_comment) + (statement_comment) + (comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/gleam/locals.scm b/runtime/queries/gleam/locals.scm new file mode 100644 index 000000000..0058b660e --- /dev/null +++ b/runtime/queries/gleam/locals.scm @@ -0,0 +1,31 @@ +; Let Binding Definition +(let + pattern: (identifier) @local.definition) + +; List Pattern Definitions +(list_pattern + (identifier) @local.definition) + +(list_pattern + assign: (identifier) @local.definition) + +; Tuple Pattern Definition +(tuple_pattern + (identifier) @local.definition) + +; Record Pattern Definition +(record_pattern_argument + pattern: (identifier) @local.definition) + +; Function Parameter Definition +(function_parameter + name: (identifier) @local.definition) + +; References +(identifier) @local.reference + +; Block Scope +(block) @local.scope + +; Case Scope +(case_clause) @local.scope diff --git a/runtime/queries/glimmer/folds.scm b/runtime/queries/glimmer/folds.scm new file mode 100644 index 000000000..6502455d8 --- /dev/null +++ b/runtime/queries/glimmer/folds.scm @@ -0,0 +1,5 @@ +[ + (element_node + (element_node_start)) + (block_statement) +] @fold diff --git a/runtime/queries/glimmer/highlights.scm b/runtime/queries/glimmer/highlights.scm new file mode 100644 index 000000000..9f11468d4 --- /dev/null +++ b/runtime/queries/glimmer/highlights.scm @@ -0,0 +1,117 @@ +; === 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) @attribute + +(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) @keyword.conditional) + +(block_statement_end + path: (identifier) @keyword.conditional) + +((mustache_statement + (identifier) @keyword.conditional) + (#lua-match? @keyword.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) @keyword.conditional) + (#eq? @keyword.conditional "if")) + +((helper_invocation + helper: (identifier) @keyword) + (#eq? @keyword "yield")) + +(hash_pair + key: (identifier) @property) + +(comment_statement) @comment @spell + +(attribute_node + "=" @operator) + +(block_params + "as" @keyword) + +(block_params + "|" @operator) + +[ + "<" + ">" + "" +] @tag.delimiter diff --git a/runtime/queries/glimmer/indents.scm b/runtime/queries/glimmer/indents.scm new file mode 100644 index 000000000..c1ef130c0 --- /dev/null +++ b/runtime/queries/glimmer/indents.scm @@ -0,0 +1,34 @@ +[ + (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) + +[ + ">" + "/>" + " tags +((element_node + (element_node_start + (tag_name) @_tag_name + (#eq? @_tag_name "style"))) @injection.content + (#offset! @injection.content 0 7 0 -8) + (#set! injection.language "css") + (#set! injection.include-children)) + +;