From 8c4a22fd503b963e3f1c40a4d298ee6733fdb28f Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Mon, 20 Feb 2023 08:10:43 -0500 Subject: [PATCH 0001/2730] feat(smali): improve queries --- README.md | 2 +- lockfile.json | 2 +- lua/nvim-treesitter/parsers.lua | 3 +- queries/smali/folds.scm | 12 +++ queries/smali/highlights.scm | 133 ++++++++++++++++++++++++-------- queries/smali/indents.scm | 32 ++++++++ queries/smali/locals.scm | 43 +++++++++++ 7 files changed, 191 insertions(+), 36 deletions(-) create mode 100644 queries/smali/folds.scm create mode 100644 queries/smali/indents.scm create mode 100644 queries/smali/locals.scm diff --git a/README.md b/README.md index c7ee98afa..364028178 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [scheme](https://github.com/6cdh/tree-sitter-scheme) (maintained by @6cdh) - [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva) - [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton) -- [x] [smali](https://github.com/amaanq/tree-sitter-smali) (experimental, maintained by @amaanq) +- [x] [smali](https://github.com/amaanq/tree-sitter-smali) (maintained by @amaanq) - [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol) - [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie) - [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis) diff --git a/lockfile.json b/lockfile.json index c8ff0ecd6..36ac8c53e 100644 --- a/lockfile.json +++ b/lockfile.json @@ -378,7 +378,7 @@ "revision": "07547525cdf4627343dca5891f1743ae45e879bb" }, "smali": { - "revision": "d7f535e176c928d33b0e202dd808ac247cacf2ff" + "revision": "5a742af7388864a3ff2ce8421328a33e7246a2d5" }, "smithy": { "revision": "cf8c7eb9faf7c7049839585eac19c94af231e6a0" diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 79f0c781e..cfdd584a0 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1193,11 +1193,10 @@ list.slint = { list.smali = { install_info = { - url = "https://github.com/amaanq/tree-sitter-smali", + url = "https://git.sr.ht/~yotam/tree-sitter-smali", files = { "src/parser.c" }, }, maintainers = { "@amaanq" }, - experimental = true, } list.smithy = { diff --git a/queries/smali/folds.scm b/queries/smali/folds.scm new file mode 100644 index 000000000..c2062e5ef --- /dev/null +++ b/queries/smali/folds.scm @@ -0,0 +1,12 @@ +[ + (annotation_directive) + (array_data_directive) + (field_definition) + (method_definition) + (packed_switch_directive) + (param_directive) + (parameter_directive) + (sparse_switch_directive) + (subannotation_directive) + (list) +] @fold diff --git a/queries/smali/highlights.scm b/queries/smali/highlights.scm index 82dd7d758..5f89cfa74 100644 --- a/queries/smali/highlights.scm +++ b/queries/smali/highlights.scm @@ -4,52 +4,97 @@ (primitive_type) @type.builtin -(array_type - "[" @punctuation.bracket) +((class_identifier) @type.builtin + (#vim-match? @type.builtin "^L(android|com/android|dalvik|java)/")) ; Methods -(method_declaration - (method_identifier) @method) +(method_definition + (method_signature (method_identifier) @method)) -(statement +(expression (opcode) @_invoke - (full_method_identifier - (method_identifier) @method.call) + (value + (body + (full_method_signature + (method_signature (method_identifier) @method.call)))) (#lua-match? @_invoke "^invoke")) -(method_identifier - "(" @constructor - ")" @constructor) +(method_handle + (full_method_signature + (method_signature (method_identifier) @method.call))) -(method_identifier - "(" @constructor - ")" @constructor) +(call_site) @method.call + +(custom_invoke + (method_signature (method_identifier) @method.call)) + +(annotation_value + (body + (method_signature (method_identifier) @method.call))) + +(annotation_value + (body + (full_method_signature + (method_signature (method_identifier) @method.call)))) + +(field_definition + (value + (body + (method_signature (method_identifier) @method.call)))) + +(field_definition + (value + (body + (full_method_signature + (method_signature (method_identifier) @method.call))))) + +((method_signature + (method_identifier) @constructor) + (#any-of? @constructor "" "")) ; Fields (field_identifier) @field -; Parameters - -(parameter) @parameter +(annotation_key) @field ; Variables -(variable) @variable +(variable) @variable.builtin + +(local_directive + (identifier) @variable) + +; Parameters + +(parameter) @parameter.builtin +(param_identifier) @parameter ; Labels -(label) @label +[ + (label) + (jmp_label) +] @label ; Operators (opcode) @keyword.operator ((opcode) @keyword.return - (#lua-match? @keyword.return "^return")) + (#lua-match? @keyword.return "^return")) -"=" @operator +((opcode) @conditional + (#vim-match? @conditional "^(if|cmp)")) + +((opcode) @exception + (#lua-match? @exception "^throw")) + +[ + "=" + ".." +] @operator ; Keywords @@ -59,11 +104,20 @@ ".source" ".implements" ".field" + ".end field" ".annotation" + ".end annotation" ".subannotation" + ".end subannotation" ".param" + ".end param" + ".parameter" + ".end parameter" ".line" ".locals" + ".local" + ".end local" + ".restart local" ".registers" ".catch" ".catchall" @@ -77,38 +131,53 @@ ] @keyword [ - (end_field) - (end_annotation) - (end_subannotation) - (end_param) + (prologue_directive) + (epilogue_directive) ] @keyword [ ".method" - (end_method) + ".end method" ] @keyword.function ; Literals -(string_literal) @string +(string) @string +(escape_sequence) @string.escape -(number_literal) @number +(character) @character -(boolean_literal) @boolean +(number) @number -(character_literal) @character +[ + (float) + (NaN) + (Infinity) +] @float -(null_literal) @constant.builtin +(boolean) @boolean + +(null) @constant.builtin ; Misc -(annotation_visibility) @attribute +(annotation_visibility) @storageclass (access_modifiers) @type.qualifier +(array_type + "[" @punctuation.special) + ["{" "}"] @punctuation.bracket -"->" @punctuation.delimiter +["(" ")"] @punctuation.bracket + +[ + "->" + ":" + "," + "@" +] @punctuation.delimiter ; Comments diff --git a/queries/smali/indents.scm b/queries/smali/indents.scm new file mode 100644 index 000000000..871362cbd --- /dev/null +++ b/queries/smali/indents.scm @@ -0,0 +1,32 @@ +[ + (annotation_directive) + (array_data_directive) + (field_definition) + (method_definition) + (packed_switch_directive) + (param_directive) + (parameter_directive) + (sparse_switch_directive) + (subannotation_directive) + (list) +] @indent + +[ + ".end annotation" + ".end array-data" + ".end field" + ".end method" + ".end packed-switch" + ".end param" + ".end parameter" + ".end sparse-switch" + ".end subannotation" + "}" +] @indent_end + +[ "{" "}" ] @branch + +[ + (ERROR) + (comment) +] @auto diff --git a/queries/smali/locals.scm b/queries/smali/locals.scm new file mode 100644 index 000000000..a91fec225 --- /dev/null +++ b/queries/smali/locals.scm @@ -0,0 +1,43 @@ +[ + (class_directive) + (expression) + (annotation_directive) + (array_data_directive) + (method_definition) + (packed_switch_directive) + (sparse_switch_directive) + (subannotation_directive) +] @scope + +[ + (identifier) + (class_identifier) + (call_site) + (label) + (jmp_label) +] @reference + +(enum_reference + (field_identifier) @definition.enum) + +((field_definition + modifiers: (access_modifiers) @_mod + (field_identifier) @definition.enum) + (#eq? @_mod "enum")) + +(field_definition + (field_identifier) @definition.field + (field_type) @definition.associated) + +(annotation_key) @definition.field + +(method_definition + (method_signature (method_identifier) @definition.method)) + +(param_identifier) @definition.parameter + +(annotation_directive + (class_identifier) @definition.type) + +(class_directive + (class_identifier) @definition.type) From 3044180ce0d27c2f85b86d6602f46244f0fdd8b2 Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 22 Feb 2023 06:40:57 +0000 Subject: [PATCH 0002/2730] Update parsers: dockerfile, elsa, fortran, gosum, kdl, ron, scala, swift, thrift, vhs --- lockfile.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lockfile.json b/lockfile.json index 36ac8c53e..6e35a7187 100644 --- a/lockfile.json +++ b/lockfile.json @@ -75,7 +75,7 @@ "revision": "f69bde8e56f431863eba2fe4bab23e7d9692855f" }, "dockerfile": { - "revision": "09e316dba307b869831e9399b11a83bbf0f2a24b" + "revision": "8ee3a0f7587b2bd8c45c8cb7d28bd414604aec62" }, "dot": { "revision": "9ab85550c896d8b294d9b9ca1e30698736f08cea" @@ -93,7 +93,7 @@ "revision": "28bb193640d916dfaf947912c1413cebb0484841" }, "elsa": { - "revision": "c83c21c1f8f6b38dfc5bd1392de03a7b05bb78f4" + "revision": "0a66b2b3f3c1915e67ad2ef9f7dbd2a84820d9d7" }, "elvish": { "revision": "f32711e31e987fd5c2c002f3daba02f25c68672f" @@ -114,7 +114,7 @@ "revision": "c238f4af9a5723a212cf1a4c9b31dd5c1d5270a2" }, "fortran": { - "revision": "dd35c67b1653963d3b4cca7bfbceb6ec2e6f006f" + "revision": "67cf1c96fd0dd92edd7812a95626c86c9be0781a" }, "fsh": { "revision": "fa3347712f7a59ed02ccf508284554689c6cde28" @@ -159,7 +159,7 @@ "revision": "4a65743dbc2bb3094114dd2b43da03c820aa5234" }, "gosum": { - "revision": "bd0ec1fe9d68a5d4713d907417a43d489fa1b62a" + "revision": "14da5c2a34861eb2d97ed89f39324156031e8878" }, "gowork": { "revision": "949a8a470559543857a62102c84700d291fc984c" @@ -231,7 +231,7 @@ "revision": "e2f449e2bcc95f1d07ceb62d67f986005f73a6be" }, "kdl": { - "revision": "b50d6c8b77d311639ecbf2b803ffb720c2b4cee2" + "revision": "c3c4856464842e05366b1f3ebc4434c9194cad43" }, "kotlin": { "revision": "e4637037a5fe6f25fe66c305669faa0855f35692" @@ -354,7 +354,7 @@ "revision": "502c1126dc6777f09af5bef16e72a42f75bd081e" }, "ron": { - "revision": "049a3ef4e271089107dd08e4aeb195abd1f77103" + "revision": "ce6086b2c9e8e71065b8129d6c2289c5f66d1879" }, "rst": { "revision": "25e6328872ac3a764ba8b926aea12719741103f1" @@ -366,7 +366,7 @@ "revision": "f7fb205c424b0962de59b26b931fe484e1262b35" }, "scala": { - "revision": "628e0aab6c2f7d31cf3b7d730f964d4fd9b340ee" + "revision": "2275b754360de8539e02e84106fa38f7cb6de275" }, "scheme": { "revision": "67b90a365bebf4406af4e5a546d6336de787e135" @@ -402,7 +402,7 @@ "revision": "52e122ae68b316d3aa960a0a422d3645ba717f42" }, "swift": { - "revision": "0fe0de56b528cbf24a654c734ca181b48be3831d" + "revision": "0c32d2948b79939b6464d9ced40fca43912cd486" }, "sxhkdrc": { "revision": "440d5f913d9465c9c776a1bd92334d32febcf065" @@ -417,7 +417,7 @@ "revision": "0ff887f2a60a147452d52db060de6b42f42f1441" }, "thrift": { - "revision": "c5a94547f01eb51b26446f9b94ee8644fa791223" + "revision": "e0c3e50e17846230e88becdce28fbb1b41dcabba" }, "tiger": { "revision": "a233ebe360a73a92c50978e5c4e9e471bc59ff42" @@ -453,7 +453,7 @@ "revision": "4457145e795b363f072463e697dfe2f6973c9a52" }, "vhs": { - "revision": "8a0df32b72a8cf8d3e3e84f16c19e9ba46d3dba5" + "revision": "54fe7c05dfa2b9e100572496531e15c9bec86343" }, "vim": { "revision": "e39a7bbcfdcfc7900629962b785c7e14503ae590" From 8b444f999759531470503d7e53c38365027b2e6e Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 22 Feb 2023 13:22:06 +0000 Subject: [PATCH 0003/2730] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 364028178..9dd0c4252 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [scheme](https://github.com/6cdh/tree-sitter-scheme) (maintained by @6cdh) - [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva) - [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton) -- [x] [smali](https://github.com/amaanq/tree-sitter-smali) (maintained by @amaanq) +- [x] [smali](https://git.sr.ht/~yotam/tree-sitter-smali) (maintained by @amaanq) - [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol) - [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie) - [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis) From 2277c0c2a7d1aca2979285621ac5c82787b25dd2 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Tue, 21 Feb 2023 03:05:56 -0500 Subject: [PATCH 0004/2730] feat(elsa): improve queries --- queries/elsa/folds.scm | 1 + queries/elsa/indents.scm | 6 ++++++ queries/elsa/injections.scm | 1 + queries/elsa/locals.scm | 12 ++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 queries/elsa/folds.scm create mode 100644 queries/elsa/indents.scm create mode 100644 queries/elsa/injections.scm create mode 100644 queries/elsa/locals.scm diff --git a/queries/elsa/folds.scm b/queries/elsa/folds.scm new file mode 100644 index 000000000..afdfec308 --- /dev/null +++ b/queries/elsa/folds.scm @@ -0,0 +1 @@ +(reduction) @fold diff --git a/queries/elsa/indents.scm b/queries/elsa/indents.scm new file mode 100644 index 000000000..fa51b1cf0 --- /dev/null +++ b/queries/elsa/indents.scm @@ -0,0 +1,6 @@ +(reduction) @indent + +[ + (ERROR) + (comment) +] @auto diff --git a/queries/elsa/injections.scm b/queries/elsa/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/queries/elsa/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/queries/elsa/locals.scm b/queries/elsa/locals.scm new file mode 100644 index 000000000..de7030796 --- /dev/null +++ b/queries/elsa/locals.scm @@ -0,0 +1,12 @@ +[ + (source_file) + (reduction) +] @scope + +(identifier) @reference + +(function) @definition.function + +(method) @definition.method + +(parameter) @definition.parameter From 94f3e8b069130e8f3cb8b5d48dae6de04c453d5e Mon Sep 17 00:00:00 2001 From: JosefLitos Date: Wed, 22 Feb 2023 13:59:27 +0100 Subject: [PATCH 0005/2730] feat(kotlin): improved highlight queries --- queries/kotlin/highlights.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 73d12768e..8cbf402a8 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -47,6 +47,9 @@ (type_identifier) @type +; '?' operator, replacement for Java @Nullable +(nullable_type) @attribute + (type_alias (type_identifier) @type.definition) @@ -405,7 +408,7 @@ ; NOTE: `interpolated_identifier`s can be highlighted in any way (line_string_literal "$" @punctuation.special - (interpolated_identifier) @none) + (interpolated_identifier) @variable) (line_string_literal "${" @punctuation.special (interpolated_expression) @none @@ -413,7 +416,7 @@ (multi_line_string_literal "$" @punctuation.special - (interpolated_identifier) @none) + (interpolated_identifier) @variable) (multi_line_string_literal "${" @punctuation.special (interpolated_expression) @none From 3f5ff9b43491bdd763a7a3c005e158b5422f2e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Lito=C5=A1?= <54900518+JosefLitos@users.noreply.github.com> Date: Wed, 22 Feb 2023 17:36:07 +0100 Subject: [PATCH 0006/2730] Update queries/kotlin/highlights.scm Co-authored-by: ObserverOfTime --- queries/kotlin/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 8cbf402a8..22f320032 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -48,7 +48,7 @@ (type_identifier) @type ; '?' operator, replacement for Java @Nullable -(nullable_type) @attribute +(nullable_type) @punctuation.special (type_alias (type_identifier) @type.definition) From a4b72d4f7f344d6c3620b682ca3a5053ec642dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Lito=C5=A1?= <54900518+JosefLitos@users.noreply.github.com> Date: Wed, 22 Feb 2023 18:03:42 +0100 Subject: [PATCH 0007/2730] Update highlights.scm --- queries/kotlin/highlights.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 22f320032..a3ec3c8b9 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -408,7 +408,7 @@ ; NOTE: `interpolated_identifier`s can be highlighted in any way (line_string_literal "$" @punctuation.special - (interpolated_identifier) @variable) + (interpolated_identifier) @none @variable) (line_string_literal "${" @punctuation.special (interpolated_expression) @none @@ -416,7 +416,7 @@ (multi_line_string_literal "$" @punctuation.special - (interpolated_identifier) @variable) + (interpolated_identifier) @none @variable) (multi_line_string_literal "${" @punctuation.special (interpolated_expression) @none From ba35d094c1dfffa652e9c20971c51bd5271c1d25 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Wed, 22 Feb 2023 19:15:43 +0100 Subject: [PATCH 0008/2730] ci: add release workflow for luarocks upload (#4109) --- .github/workflows/release.yml | 18 +++++++++++++ Makefile | 7 ++++++ contrib/nvim-treesitter-scm-1.rockspec | 32 ----------------------- nvim-treesitter-scm-1.rockspec | 35 ++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 Makefile delete mode 100644 contrib/nvim-treesitter-scm-1.rockspec create mode 100644 nvim-treesitter-scm-1.rockspec diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..865753c16 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +name: "release" +on: + push: + tags: + - '*' +jobs: + luarocks-upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + uses: nvim-neorocks/luarocks-tag-release@v1.0.2 + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} + with: + detailed_description: | + The goal of nvim-treesitter is both to provide a simple and easy way to use the interface for tree-sitter in Neovim + and to provide some basic functionality such as highlighting based on it. + build_type: "make" diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..139e6cb99 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +# https://github.com/luarocks/luarocks/wiki/Creating-a-Makefile-that-plays-nice-with-LuaRocks +build: + echo "Do nothing" + +install: + mkdir -p $(INST_LUADIR) + cp -r autoload plugin queries lua $(INST_LUADIR) diff --git a/contrib/nvim-treesitter-scm-1.rockspec b/contrib/nvim-treesitter-scm-1.rockspec deleted file mode 100644 index cacc9eb2e..000000000 --- a/contrib/nvim-treesitter-scm-1.rockspec +++ /dev/null @@ -1,32 +0,0 @@ -local MODREV, SPECREV = "scm", "-1" -rockspec_format = "3.0" -package = "nvim-treesitter" -version = MODREV .. SPECREV - -description = { - summary = "Nvim Treesitter configurations and abstraction layer", - labels = { "neovim"}, - homepage = "https://github.com/nvim-treesitter/nvim-treesitter", - license = "Apache-2.0", -} - -dependencies = { - "lua >= 5.1, < 5.4", -} - -source = { - url = "http://github.com/nvim-treesitter/nvim-treesitter/archive/v" .. MODREV .. ".zip", -} - -if MODREV == 'scm' then - source = { - url = 'git://github.com/nvim-treesitter/nvim-treesitter', - } -end - -build = { - type = "builtin", - copy_directories = { - 'plugin' - } -} diff --git a/nvim-treesitter-scm-1.rockspec b/nvim-treesitter-scm-1.rockspec new file mode 100644 index 000000000..7350ae47f --- /dev/null +++ b/nvim-treesitter-scm-1.rockspec @@ -0,0 +1,35 @@ +local MODREV, SPECREV = 'scm', '-1' +rockspec_format = '3.0' +package = 'nvim-treesitter' +version = MODREV .. SPECREV + +description = { + summary = 'Nvim Treesitter configurations and abstraction layer', + labels = { 'neovim' }, + homepage = 'https://github.com/nvim-treesitter/nvim-treesitter', + license = 'Apache-2.0', +} + +dependencies = { + 'lua >= 5.1', +} + +source = { + url = 'git://github.com/nvim-treesitter/nvim-treesitter', +} + +build = { + type = 'make', + install_variables = { + INST_PREFIX='$(PREFIX)', + INST_BINDIR='$(BINDIR)', + INST_LIBDIR='$(LIBDIR)', + INST_LUADIR='$(LUADIR)', + INST_CONFDIR='$(CONFDIR)', + }, + copy_directories = { + 'autoload', + 'plugin', + 'queries' + } +} From 454876fc6d25a699178cb66aeda4014dedb765f3 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Tue, 21 Feb 2023 02:13:55 -0500 Subject: [PATCH 0009/2730] feat(capnp): improve queries --- lockfile.json | 2 +- queries/capnp/highlights.scm | 44 ++++++++++-------- queries/capnp/indents.scm | 34 ++++++++++++++ queries/capnp/injections.scm | 1 + queries/capnp/locals.scm | 90 ++++++++++++++++++++++++++++++++++++ 5 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 queries/capnp/indents.scm create mode 100644 queries/capnp/injections.scm create mode 100644 queries/capnp/locals.scm diff --git a/lockfile.json b/lockfile.json index 6e35a7187..87af984c8 100644 --- a/lockfile.json +++ b/lockfile.json @@ -33,7 +33,7 @@ "revision": "5b6c4d0d19d79b05c69ad752e11829910e3b4610" }, "capnp": { - "revision": "cb85cddfdf398530110c807ba046822dbaee6afb" + "revision": "9ed3aa8c212cddc94dca087cfe2c30d43234c867" }, "chatito": { "revision": "3baf22e7e507cedf15d1dbc03df8afa50a625586" diff --git a/queries/capnp/highlights.scm b/queries/capnp/highlights.scm index 1fe814b50..8dfb2ba91 100644 --- a/queries/capnp/highlights.scm +++ b/queries/capnp/highlights.scm @@ -1,4 +1,4 @@ -; Preproc (?) +; Preproc (unique_id) @preproc (top_level_annotation_body) @preproc @@ -13,18 +13,12 @@ (import_path) @string -; Types - -(primitive_type) @type.builtin +; Builtins [ - "annotation" - "enum" - "group" - "interface" - "struct" - "union" -] @keyword + (primitive_type) + "List" +] @type.builtin ; Typedefs @@ -52,10 +46,6 @@ (param_identifier) @parameter (return_identifier) @parameter -; Variables - -(identifier) @variable - ; Constants (const_identifier) @constant @@ -68,8 +58,6 @@ (enum_identifier) @type (extend_type) @type -(field_type) @type -(generic_identifier) @type (type_identifier) @type ; Attributes @@ -86,6 +74,16 @@ ; Keywords + +[ + "annotation" + "enum" + "group" + "interface" + "struct" + "union" +] @keyword + [ "extends" "namespace" @@ -95,11 +93,16 @@ ; Literals -(string_literal) @string -(block_text) @string +[ + (string) + (concatenated_string) + (block_text) + (namespace) +] @string + +(escape_sequence) @string.escape (data_string) @string.special -(namespace) @string.special (number) @number @@ -116,6 +119,7 @@ [ "*" "$" + ":" ] @punctuation.special ["{" "}"] @punctuation.bracket diff --git a/queries/capnp/indents.scm b/queries/capnp/indents.scm new file mode 100644 index 000000000..362cc7da0 --- /dev/null +++ b/queries/capnp/indents.scm @@ -0,0 +1,34 @@ +[ + (annotation_targets) + (const_list) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (struct_shorthand) + (union) +] @indent + +((struct_shorthand (property)) @aligned_indent + (#set! "delimiter" "()")) + +((const_list (const_value)) @aligned_indent + (#set! "delimiter" "[]")) + +[ + "}" + ")" +] @indent_end + +[ "{" "}" ] @branch + +[ "(" ")" ] @branch + +[ + (ERROR) + (comment) +] @auto diff --git a/queries/capnp/injections.scm b/queries/capnp/injections.scm new file mode 100644 index 000000000..4bb7d675d --- /dev/null +++ b/queries/capnp/injections.scm @@ -0,0 +1 @@ +(comment) @comment diff --git a/queries/capnp/locals.scm b/queries/capnp/locals.scm new file mode 100644 index 000000000..fb436bf06 --- /dev/null +++ b/queries/capnp/locals.scm @@ -0,0 +1,90 @@ +[ + (message) + (annotation_targets) + (const_list) + (enum) + (interface) + (implicit_generics) + (generics) + (group) + (method_parameters) + (named_return_types) + (struct) + (struct_shorthand) + (union) +] @scope + +[ + (extend_type) + (field_type) +] @reference +(custom_type (type_identifier) @reference) +(custom_type + (generics + (generic_parameters + (generic_identifier) @reference))) + +(annotation_definition_identifier) @definition + +(const_identifier) @definition.constant + +(enum (enum_identifier) @definition.enum) + +[ + (enum_member) + (field_identifier) +] @definition.field + +(method_identifier) @definition.method + +(namespace) @definition.namespace + +[ + (param_identifier) + (return_identifier) +] @definition.parameter + +(group (type_identifier) @definition.type) + +(struct (type_identifier) @definition.type) + +(union (type_identifier) @definition.type) + +(interface (type_identifier) @definition.type) + +; Generics Related (don't know how to combine these) + +(struct + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(interface + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(method + (implicit_generics + (implicit_generic_parameters + (generic_identifier) @definition.parameter))) + +(method + (generics + (generic_parameters + (generic_identifier) @definition.parameter))) + +(annotation + (generics + (generic_parameters + (generic_identifier) @definition.type))) + +(replace_using + (generics + (generic_parameters + (generic_identifier) @definition.type))) + +(return_type + (generics + (generic_parameters + (generic_identifier) @definition.type))) From 598b878a2b44e7e7a981acc5fc99bf8273cd1d0f Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 23 Feb 2023 06:40:30 +0000 Subject: [PATCH 0010/2730] Update parsers: c, capnp, cpp, cuda, hlsl, javascript, rust, smali --- lockfile.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lockfile.json b/lockfile.json index 87af984c8..4da9585bb 100644 --- a/lockfile.json +++ b/lockfile.json @@ -27,13 +27,13 @@ "revision": "6ef91ca8270f0112b9c6d27ecb9966c741a5d103" }, "c": { - "revision": "7175a6dd5fc1cee660dce6fe23f6043d75af424a" + "revision": "f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2" }, "c_sharp": { "revision": "5b6c4d0d19d79b05c69ad752e11829910e3b4610" }, "capnp": { - "revision": "9ed3aa8c212cddc94dca087cfe2c30d43234c867" + "revision": "fc6e2addf103861b9b3dffb82c543eb6b71061aa" }, "chatito": { "revision": "3baf22e7e507cedf15d1dbc03df8afa50a625586" @@ -54,13 +54,13 @@ "revision": "5e113412aadb78955c27010daa4dbe1d202013cf" }, "cpp": { - "revision": "56cec4c2eb5d6af3d2942e69e35db15ae2433740" + "revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819" }, "css": { "revision": "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" }, "cuda": { - "revision": "a02c21408c592e6e6856eaabe4727faa97cf8d85" + "revision": "9b1f7481a151686fce8af66da147f40388f8ee4d" }, "d": { "revision": "c2fbf21bd3aa45495fe13247e040ad5815250032" @@ -186,7 +186,7 @@ "revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0" }, "hlsl": { - "revision": "8e2f0907e8d2e17a88a375025e70054bafdaa8b0" + "revision": "18f2dcb5f65075457638658c4763672e826dcddf" }, "hocon": { "revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc" @@ -207,7 +207,7 @@ "revision": "dd597f13eb9bab0c1bccc9aec390e8e6ebf9e0a6" }, "javascript": { - "revision": "15e85e80b851983fab6b12dce5a535f5a0df0f9c" + "revision": "266455e22fc54f0add4dd2404ebe307d4d65deae" }, "jq": { "revision": "13990f530e8e6709b7978503da9bc8701d366791" @@ -363,7 +363,7 @@ "revision": "206c7077164372c596ffa8eaadb9435c28941364" }, "rust": { - "revision": "f7fb205c424b0962de59b26b931fe484e1262b35" + "revision": "fbf9e507d09d8b3c0bb9dfc4d46c31039a47dc4a" }, "scala": { "revision": "2275b754360de8539e02e84106fa38f7cb6de275" @@ -378,7 +378,7 @@ "revision": "07547525cdf4627343dca5891f1743ae45e879bb" }, "smali": { - "revision": "5a742af7388864a3ff2ce8421328a33e7246a2d5" + "revision": "a67a429784dafa0ca4342d71e6530137ca803883" }, "smithy": { "revision": "cf8c7eb9faf7c7049839585eac19c94af231e6a0" From 4612212c72a3fe683cbca2f99977ad63b942f70e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 23 Feb 2023 20:30:36 +0100 Subject: [PATCH 0011/2730] docs: fix typos --- lua/nvim-treesitter/utils.lua | 4 ++-- queries/clojure/highlights.scm | 2 +- queries/dart/highlights.scm | 2 +- queries/fish/highlights.scm | 2 +- queries/html_tags/indents.scm | 2 +- queries/kotlin/highlights.scm | 2 +- queries/pascal/highlights.scm | 2 +- queries/solidity/highlights.scm | 2 +- queries/thrift/highlights.scm | 2 +- queries/v/highlights.scm | 2 +- queries/vala/highlights.scm | 2 +- queries/verilog/highlights.scm | 2 +- tests/indent/php_spec.lua | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index c738ee56e..9338be874 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -10,7 +10,7 @@ function M.notify(msg, log_level, opts) vim.notify(msg, log_level, vim.tbl_extend("force", default_opts, opts or {})) end --- Returns the system specific path seperator. +-- Returns the system specific path separator. ---@return string function M.get_path_sep() return (fn.has "win32" == 1 and not vim.opt.shellslash:get()) and "\\" or "/" @@ -37,7 +37,7 @@ M.join_space = M.generate_join " " --- - A table with name 'commands' should be defined in 'mod' which needs to be passed as --- the commands param of this function --- ----@param mod string, Name of the module that resides in the heirarchy - nvim-treesitter.module +---@param mod string, Name of the module that resides in the hierarchy - nvim-treesitter.module ---@param commands table, Command list for the module --- - {command_name} Name of the vim user defined command, Keys: --- - {run}: (function) callback function that needs to be executed diff --git a/queries/clojure/highlights.scm b/queries/clojure/highlights.scm index 3dc12d531..00a692521 100644 --- a/queries/clojure/highlights.scm +++ b/queries/clojure/highlights.scm @@ -6,7 +6,7 @@ ;; 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 -;; specialied captures. +;; specialized captures. ;; This can mean that sometimes things are highlighted weirdly because they ;; have multiple highlight groups applied to them. diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index 19991c66f..f5e391092 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -144,7 +144,7 @@ (hex_integer_literal) (decimal_integer_literal) (decimal_floating_point_literal) - ; TODO: inaccessbile nodes + ; TODO: inaccessible nodes ; (octal_integer_literal) ; (hex_floating_point_literal) ] @number diff --git a/queries/fish/highlights.scm b/queries/fish/highlights.scm index 9335ab4a2..91978e148 100644 --- a/queries/fish/highlights.scm +++ b/queries/fish/highlights.scm @@ -112,7 +112,7 @@ (command_substitution "$" @punctuation.bracket) -; non-bultin command names +; non-builtin command names (command name: (word) @function.call) ; derived from builtin -n (fish 3.2.2) diff --git a/queries/html_tags/indents.scm b/queries/html_tags/indents.scm index a9e0794f5..1e4d4707f 100644 --- a/queries/html_tags/indents.scm +++ b/queries/html_tags/indents.scm @@ -9,7 +9,7 @@ (element (self_closing_tag)) ] @indent -; These tags are usually written one-lined and doesnt use self-closing tags so special-cased them +; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them ; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined ( (start_tag diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index a3ec3c8b9..2fd2c089b 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -114,7 +114,7 @@ (type_identifier) @function)? (#lua-match? @_import "^[a-z]")) -; TODO: Seperate labeled returns/breaks/continue/super/this +; TODO: Separate labeled returns/breaks/continue/super/this ; Must be implemented in the parser first (label) @label diff --git a/queries/pascal/highlights.scm b/queries/pascal/highlights.scm index 7a92acdc7..3a1c484e0 100644 --- a/queries/pascal/highlights.scm +++ b/queries/pascal/highlights.scm @@ -370,7 +370,7 @@ (statement ((identifier) @repeat (#lua-match? @repeat "^[cC][oO][nN][tT][iI][nN][uU][eE]$"))) -; -- Identifier type inferrence +; -- Identifier type inference ; VERY QUESTIONABLE: Highlighting of identifiers based on spelling (exprBinary ((identifier) @constant diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 932c54f32..33c837d5c 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -51,7 +51,7 @@ name: (identifier) @function) (yul_evm_builtin) @function.builtin -; Use contructor coloring for special functions +; Use constructor coloring for special functions (constructor_definition "constructor" @constructor) (fallback_receive_definition "receive" @constructor) (fallback_receive_definition "fallback" @constructor) diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm index e544941c9..c6ff6464f 100644 --- a/queries/thrift/highlights.scm +++ b/queries/thrift/highlights.scm @@ -118,7 +118,7 @@ "xsd_optional" ] @keyword -; Extended Kewords +; Extended Keywords [ "client" "idempotent" diff --git a/queries/v/highlights.scm b/queries/v/highlights.scm index 3d2624e89..af2905239 100644 --- a/queries/v/highlights.scm +++ b/queries/v/highlights.scm @@ -8,7 +8,7 @@ (interpreted_string_literal) @string (string_interpolation) @none -; TODO: Have differnt highlight to make then standout + highlight }{$ as special +; TODO: Have different highlight to make then standout + highlight }{$ as special ; ((string_interpolation ; (identifier) @constant ; "$" @punctuation.special diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm index 9a8fd59cc..1c9732dff 100644 --- a/queries/vala/highlights.scm +++ b/queries/vala/highlights.scm @@ -1,6 +1,6 @@ ; highlights.scm -; higlight comments and symbols +; highlight comments and symbols (comment) @comment (symbol) @symbol (member_access_expression (_) (identifier) @symbol) diff --git a/queries/verilog/highlights.scm b/queries/verilog/highlights.scm index d3e014927..d4c9a24a5 100644 --- a/queries/verilog/highlights.scm +++ b/queries/verilog/highlights.scm @@ -1,7 +1,7 @@ ; Keywords [ - ; block delimeters + ; block delimiters (module_keyword) "endmodule" "program" diff --git a/tests/indent/php_spec.lua b/tests/indent/php_spec.lua index a826d0aa6..2d7a88742 100644 --- a/tests/indent/php_spec.lua +++ b/tests/indent/php_spec.lua @@ -18,7 +18,7 @@ describe("indent PHP:", function() run:new_line("example.php", { on_line = 11, text = "// new line starts 1 indentation to far", indent = 4 }) run:new_line( "example2.php", - { on_line = 5, text = "indendation with `enter` in insert mode is not correct", indent = 4 } + { on_line = 5, text = "indentation with `enter` in insert mode is not correct", indent = 4 } ) run:new_line("issue-2497.php", { on_line = 5, text = "$a =", indent = 4 }) run:new_line("unfinished-call.php", { on_line = 6, text = "$a =", indent = 0 }) From 83e2e22d9e25d739093c38f0663d547dfea00cf4 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 23 Feb 2023 20:37:58 +0100 Subject: [PATCH 0012/2730] ci: remove ready_for_review type It's only needed if a job is disabled for drafts. Otherwise it will just run the same workflow twice. --- .github/workflows/lint.yml | 1 - .github/workflows/test-queries.yml | 1 - .github/workflows/tests.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dd608d246..9f380e1c5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,6 @@ name: Linting and style checking on: push: pull_request: - types: [opened, synchronize, reopened, ready_for_review] jobs: luacheck: diff --git a/.github/workflows/test-queries.yml b/.github/workflows/test-queries.yml index fd1fdce8f..5c67d503a 100644 --- a/.github/workflows/test-queries.yml +++ b/.github/workflows/test-queries.yml @@ -5,7 +5,6 @@ on: branches: - "master" pull_request: - types: [opened, synchronize, reopened, ready_for_review] branches: - "master" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a628d4d7c..0a216d2ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,6 @@ on: branches: - "master" pull_request: - types: [opened, synchronize, reopened, ready_for_review] branches: - "master" From 1641c4f3b4128e900c836190df19923fbe4005fd Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 18 Feb 2023 15:00:37 -0500 Subject: [PATCH 0013/2730] feat: add starlark --- README.md | 1 + lockfile.json | 3 + lua/nvim-treesitter/parsers.lua | 9 + queries/starlark/folds.scm | 22 +++ queries/starlark/highlights.scm | 285 ++++++++++++++++++++++++++++++++ queries/starlark/indents.scm | 47 ++++++ queries/starlark/injections.scm | 1 + queries/starlark/locals.scm | 91 ++++++++++ 8 files changed, 459 insertions(+) create mode 100644 queries/starlark/folds.scm create mode 100644 queries/starlark/highlights.scm create mode 100644 queries/starlark/indents.scm create mode 100644 queries/starlark/injections.scm create mode 100644 queries/starlark/locals.scm diff --git a/README.md b/README.md index 9dd0c4252..f06919daf 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie) - [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis) - [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride) +- [x] [starlark](https://github.com/amaanq/tree-sitter-starlark) (maintained by @amaanq) - [x] [supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) (maintained by @madskjeldgaard) - [x] [surface](https://github.com/connorlay/tree-sitter-surface) (maintained by @connorlay) - [x] [svelte](https://github.com/Himujjal/tree-sitter-svelte) (maintained by @elianiva) diff --git a/lockfile.json b/lockfile.json index 4da9585bb..87d030bc5 100644 --- a/lockfile.json +++ b/lockfile.json @@ -392,6 +392,9 @@ "sql": { "revision": "3a3f92b29c880488a08bc2baaf1aca6432ec3380" }, + "starlark": { + "revision": "2e94347f71147c268a4c5c0ce188be8baf2fce5a" + }, "supercollider": { "revision": "90c6d9f777d2b8c4ce497c48b5f270a44bcf3ea0" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index cfdd584a0..7074cc363 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1234,6 +1234,15 @@ list.sql = { maintainers = { "@derekstride" }, } +list.starlark = { + install_info = { + url = "https://github.com/amaanq/tree-sitter-starlark", + files = { "src/parser.c", "src/scanner.cc" }, + }, + filetype = "bzl", + maintainers = { "@amaanq" }, +} + list.supercollider = { install_info = { url = "https://github.com/madskjeldgaard/tree-sitter-supercollider", diff --git a/queries/starlark/folds.scm b/queries/starlark/folds.scm new file mode 100644 index 000000000..b4756a908 --- /dev/null +++ b/queries/starlark/folds.scm @@ -0,0 +1,22 @@ +[ + (function_definition) + + (for_statement) + (if_statement) + (while_statement) + (with_statement) + (match_statement) + + (parameters) + (argument_list) + + (parenthesized_expression) + (list_comprehension) + (dictionary_comprehension) + + (tuple) + (list) + (dictionary) + + (string) +] @fold diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm new file mode 100644 index 000000000..8ce3d0f77 --- /dev/null +++ b/queries/starlark/highlights.scm @@ -0,0 +1,285 @@ +;; From tree-sitter-python licensed under MIT License +; Copyright (c) 2016 Max Brunsfeld + +; Variables +(identifier) @variable + +; Reset highlighting in f-string interpolations +(interpolation) @none + +;; Identifier naming conventions +((identifier) @type + (#lua-match? @type "^[A-Z].*[a-z]")) +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + +((identifier) @constant.builtin + (#lua-match? @constant.builtin "^__[a-zA-Z0-9_]*__$")) + +((identifier) @constant.builtin + (#any-of? @constant.builtin + ;; https://docs.python.org/3/library/constants.html + "NotImplemented" + "Ellipsis" + "quit" + "exit" + "copyright" + "credits" + "license")) + +((attribute + attribute: (identifier) @field) + (#match? @field "^([A-Z])@!.*$")) + +((identifier) @type.builtin + (#any-of? @type.builtin + ;; https://docs.python.org/3/library/exceptions.html + "ArithmeticError" "BufferError" "LookupError" "AssertionError" "AttributeError" + "EOFError" "FloatingPointError" "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" "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")) + +((assignment + left: (identifier) @type.definition + (type (identifier) @_annotation)) + (#eq? @_annotation "TypeAlias")) + +((assignment + left: (identifier) @type.definition + right: (call + function: (identifier) @_func)) + (#any-of? @_func "TypeVar" "NewType")) + +;; Decorators +((decorator "@" @attribute) + (#set! "priority" 101)) + +(decorator + (identifier) @attribute) +(decorator + (attribute + attribute: (identifier) @attribute)) +(decorator + (call (identifier) @attribute)) +(decorator + (call (attribute + attribute: (identifier) @attribute))) + +((decorator + (identifier) @attribute.builtin) + (#any-of? @attribute.builtin "classmethod" "property")) + +;; Builtin functions +((call + function: (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" "fail" "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" + "struct" "sum" "super" "tuple" "type" "vars" "zip" "__import__")) + +;; Function definitions +(function_definition + name: (identifier) @function) + +(type (identifier) @type) +(type + (subscript + (identifier) @type)) ; type subscript: Tuple[int] + +((call + function: (identifier) @_isinstance + arguments: (argument_list + (_) + (identifier) @type)) + (#eq? @_isinstance "isinstance")) + +;; Normal parameters +(parameters + (identifier) @parameter) +;; Lambda parameters +(lambda_parameters + (identifier) @parameter) +(lambda_parameters + (tuple_pattern + (identifier) @parameter)) +; Default parameters +(keyword_argument + name: (identifier) @parameter) +; Naming parameters on call-site +(default_parameter + name: (identifier) @parameter) +(typed_parameter + (identifier) @parameter) +(typed_default_parameter + (identifier) @parameter) +; Variadic parameters *args, **kwargs +(parameters + (list_splat_pattern ; *args + (identifier) @parameter)) +(parameters + (dictionary_splat_pattern ; **kwargs + (identifier) @parameter)) + + +;; Literals +(none) @constant.builtin +[(true) (false)] @boolean +((identifier) @variable.builtin + (#eq? @variable.builtin "self")) +((identifier) @variable.builtin + (#eq? @variable.builtin "cls")) + +(integer) @number +(float) @float + +(comment) @comment @spell + +((module . (comment) @preproc) + (#match? @preproc "^#!/")) + +(string) @string +[ + (escape_sequence) + "{{" + "}}" +] @string.escape + +; doc-strings +(expression_statement (string) @spell) + +; Tokens + +[ + "-" + "-=" + ":=" + "!=" + "*" + "**" + "**=" + "*=" + "/" + "//" + "//=" + "/=" + "&" + "&=" + "%" + "%=" + "^" + "^=" + "+" + "+=" + "<" + "<<" + "<<=" + "<=" + "<>" + "=" + "==" + ">" + ">=" + ">>" + ">>=" + "@" + "@=" + "|" + "|=" + "~" + "->" +] @operator + +; Keywords +[ + "and" + "in" + "not" + "or" + + "del" +] @keyword.operator + +[ + "def" + "lambda" +] @keyword.function + +[ + "assert" + "async" + "await" + "exec" + "nonlocal" + "pass" + "print" + "with" + "as" +] @keyword + +[ + "return" +] @keyword.return + +((call + function: (identifier) @include + arguments: (argument_list + (string) @conceal)) + (#eq? @include "load")) + +["if" "elif" "else" "match" "case"] @conditional + +["for" "while" "break" "continue"] @repeat + +["(" ")" "[" "]" "{" "}"] @punctuation.bracket + +(interpolation + "{" @punctuation.special + "}" @punctuation.special) + +["," "." ":" ";" (ellipsis)] @punctuation.delimiter + +;; Error +(ERROR) @error + +;; Starlark-specific + +;; Struct definitions +((call + function: (identifier) @_func + arguments: (argument_list + (keyword_argument + name: (identifier) @field))) + (#eq? @_func "struct")) + +;; Function calls + +(call + function: (identifier) @function.call) + +(call + function: (attribute + attribute: (identifier) @method.call)) + +((call + function: (identifier) @constructor) + (#lua-match? @constructor "^[A-Z]")) + +((call + function: (attribute + attribute: (identifier) @constructor)) + (#lua-match? @constructor "^[A-Z]")) + + diff --git a/queries/starlark/indents.scm b/queries/starlark/indents.scm new file mode 100644 index 000000000..94cc941ef --- /dev/null +++ b/queries/starlark/indents.scm @@ -0,0 +1,47 @@ +[ + (list) + (dictionary) + (set) + + (for_statement) + (if_statement) + (while_statement) + (with_statement) + + (parenthesized_expression) + (dictionary_comprehension) + (list_comprehension) + (set_comprehension) + + (tuple_pattern) + (list_pattern) + (binary_operator) + + (lambda) + (function_definition) +] @indent + +(if_statement + condition: (parenthesized_expression) @aligned_indent + (#set! "delimiter" "()") +) +((ERROR "(" . (_)) @aligned_indent + (#set! "delimiter" "()")) +((argument_list) @aligned_indent + (#set! "delimiter" "()")) +((argument_list) @aligned_indent + (#set! "delimiter" "()")) +((parameters) @aligned_indent + (#set! "delimiter" "()")) +((tuple) @aligned_indent + (#set! "delimiter" "()")) + +[ + ")" + "]" + "}" + (elif_clause) + (else_clause) +] @branch + +(string) @auto diff --git a/queries/starlark/injections.scm b/queries/starlark/injections.scm new file mode 100644 index 000000000..2b60646e2 --- /dev/null +++ b/queries/starlark/injections.scm @@ -0,0 +1 @@ +; inherits python diff --git a/queries/starlark/locals.scm b/queries/starlark/locals.scm new file mode 100644 index 000000000..ad7d89d2d --- /dev/null +++ b/queries/starlark/locals.scm @@ -0,0 +1,91 @@ +;;; Program structure +(module) @scope + +; Function with parameters, defines parameters +(parameters + (identifier) @definition.parameter) + +(default_parameter + (identifier) @definition.parameter) + +(typed_parameter + (identifier) @definition.parameter) + +(typed_default_parameter + (identifier) @definition.parameter) + +; *args parameter +(parameters + (list_splat_pattern + (identifier) @definition.parameter)) + +; **kwargs parameter +(parameters + (dictionary_splat_pattern + (identifier) @definition.parameter)) + +; Function defines function and scope +((function_definition + name: (identifier) @definition.function) @scope + (#set! definition.function.scope "parent")) + +;;; Loops +; not a scope! +(for_statement + left: (pattern_list + (identifier) @definition.var)) +(for_statement + left: (tuple_pattern + (identifier) @definition.var)) +(for_statement + left: (identifier) @definition.var) + +; for in list comprehension +(for_in_clause + left: (identifier) @definition.var) +(for_in_clause + left: (tuple_pattern + (identifier) @definition.var)) +(for_in_clause + left: (pattern_list + (identifier) @definition.var)) + +(dictionary_comprehension) @scope +(list_comprehension) @scope +(set_comprehension) @scope + +;;; Assignments + +(assignment + left: (identifier) @definition.var) + +(assignment + left: (pattern_list + (identifier) @definition.var)) +(assignment + left: (tuple_pattern + (identifier) @definition.var)) + +(assignment + left: (attribute + (identifier) + (identifier) @definition.field)) + +; Walrus operator x := 1 +(named_expression + (identifier) @definition.var) + +(as_pattern + alias: (as_pattern_target) @definition.var) + +;;; REFERENCES +(identifier) @reference + +;; Starlark-specific + +; Loads +((call + function: (identifier) @_fn + arguments: (argument_list + (string) @definition.import)) + (#eq? @_fn "load")) From 7dfaa60a8522abca292372ece20fd703a892bd64 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 23 Feb 2023 17:04:07 -0500 Subject: [PATCH 0014/2730] feat(java): distinguish escape sequences, move certain keywords to more appropriate places --- lockfile.json | 2 +- queries/java/highlights.scm | 258 ++++++++++++++++++------------------ queries/java/indents.scm | 4 +- queries/java/injections.scm | 5 +- 4 files changed, 137 insertions(+), 132 deletions(-) diff --git a/lockfile.json b/lockfile.json index 87d030bc5..ad0a4f7ba 100644 --- a/lockfile.json +++ b/lockfile.json @@ -204,7 +204,7 @@ "revision": "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44" }, "java": { - "revision": "dd597f13eb9bab0c1bccc9aec390e8e6ebf9e0a6" + "revision": "3c24aa9365985830421a3a7b6791b415961ea770" }, "javascript": { "revision": "266455e22fc54f0add4dd2404ebe307d4d65deae" diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index 625c2b5b7..717a13bad 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -14,8 +14,10 @@ (super) @function.builtin ; Parameters + (formal_parameter name: (identifier) @parameter) + (catch_formal_parameter name: (identifier) @parameter) @@ -24,59 +26,58 @@ name: (identifier) @parameter)) ; int... foo ;; Lambda parameter + (inferred_parameters (identifier) @parameter) ; (x,y) -> ... + (lambda_expression parameters: (identifier) @parameter) ; x -> ... - ; Annotations - (annotation name: (identifier) @attribute) (marker_annotation name: (identifier) @attribute) - ; Operators [ -"@" -"+" -":" -"++" -"-" -"--" -"&" -"&&" -"|" -"||" -"!" -"!=" -"==" -"*" -"/" -"%" -"<" -"<=" -">" -">=" -"=" -"-=" -"+=" -"*=" -"/=" -"%=" -"->" -"^" -"^=" -"&=" -"|=" -"~" -">>" -">>>" -"<<" -"::" + "@" + "+" + ":" + "++" + "-" + "--" + "&" + "&&" + "|" + "||" + "!" + "!=" + "==" + "*" + "/" + "%" + "<" + "<=" + ">" + ">=" + "=" + "-=" + "+=" + "*=" + "/=" + "%=" + "->" + "^" + "^=" + "&=" + "|=" + "~" + ">>" + ">>>" + "<<" + "::" ] @operator ; Types @@ -99,8 +100,6 @@ . (identifier) @type) (#lua-match? @type "^[A-Z]")) - - ((field_access object: (identifier) @type) (#lua-match? @type "^[A-Z]")) @@ -118,10 +117,10 @@ field: (identifier) @field) [ -(boolean_type) -(integral_type) -(floating_point_type) -(void_type) + (boolean_type) + (integral_type) + (floating_point_type) + (void_type) ] @type.builtin ; Variables @@ -133,145 +132,150 @@ ; Literals +(string_literal) @string + +(escape_sequence) @string.escape + +(character_literal) @character + [ -(hex_integer_literal) -(decimal_integer_literal) -(octal_integer_literal) -(binary_integer_literal) + (hex_integer_literal) + (decimal_integer_literal) + (octal_integer_literal) + (binary_integer_literal) ] @number [ -(decimal_floating_point_literal) -(hex_floating_point_literal) + (decimal_floating_point_literal) + (hex_floating_point_literal) ] @float -(character_literal) @character -[(string_literal) (text_block)] @string -(null_literal) @constant.builtin - [ - (line_comment) - (block_comment) -] @comment @spell - -[ -(true) -(false) + (true) + (false) ] @boolean +(null_literal) @constant.builtin + ; Keywords [ -"assert" -"break" -"class" -"record" -"continue" -"default" -"enum" -"exports" -"extends" -"implements" -"instanceof" -"interface" -"module" -"opens" -"package" -"permits" -"provides" -"requires" -"to" -"uses" -"with" + "assert" + "class" + "record" + "default" + "enum" + "extends" + "implements" + "instanceof" + "interface" + "permits" + "to" + "with" ] @keyword (synchronized_statement "synchronized" @keyword) [ -"abstract" -"final" -"native" -"non-sealed" -"open" -"private" -"protected" -"public" -"sealed" -"static" -"strictfp" -"transitive" + "abstract" + "final" + "native" + "non-sealed" + "open" + "private" + "protected" + "public" + "sealed" + "static" + "strictfp" + "transitive" ] @type.qualifier (modifiers "synchronized" @type.qualifier) [ -"transient" -"volatile" + "transient" + "volatile" ] @storageclass [ -"return" -"yield" + "return" + "yield" ] @keyword.return [ - "new" + "new" ] @keyword.operator ; Conditionals [ -"if" -"else" -"switch" -"case" + "if" + "else" + "switch" + "case" ] @conditional (ternary_expression ["?" ":"] @conditional.ternary) -; +; Loops [ -"for" -"while" -"do" + "for" + "while" + "do" + "continue" + "break" ] @repeat ; Includes -"import" @include -"package" @include +[ + "exports" + "import" + "module" + "opens" + "package" + "provides" + "requires" + "uses" +] @include ; Punctuation [ -";" -"." -"..." -"," + ";" + "." + "..." + "," ] @punctuation.delimiter -[ -"[" -"]" -"{" -"}" -"(" -")" -] @punctuation.bracket +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket ; Exceptions [ -"throw" -"throws" -"finally" -"try" -"catch" + "throw" + "throws" + "finally" + "try" + "catch" ] @exception ; Labels + (labeled_statement (identifier) @label) + +; Comments + +[ + (line_comment) + (block_comment) +] @comment @spell diff --git a/queries/java/indents.scm b/queries/java/indents.scm index 8e5375486..bd86cdbed 100644 --- a/queries/java/indents.scm +++ b/queries/java/indents.scm @@ -22,9 +22,7 @@ "]" ] @branch -[ - "}" -] @indent_end +"}" @indent_end (line_comment) @ignore diff --git a/queries/java/injections.scm b/queries/java/injections.scm index e4fd85f1c..0a63c9bfe 100644 --- a/queries/java/injections.scm +++ b/queries/java/injections.scm @@ -1 +1,4 @@ -[(block_comment) (line_comment)] @comment +[ + (block_comment) + (line_comment) +] @comment From f8595b13bff62d5c64d54840e16678b9ad843620 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 23 Feb 2023 17:04:34 -0500 Subject: [PATCH 0015/2730] feat(java): some instances of definition.var should be definition.parameter --- queries/java/locals.scm | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/queries/java/locals.scm b/queries/java/locals.scm index a7a624289..1d59fee90 100644 --- a/queries/java/locals.scm +++ b/queries/java/locals.scm @@ -1,5 +1,7 @@ -; SCOPES +;; SCOPES + ; declarations + (program) @scope (class_declaration body: (_) @scope) @@ -11,9 +13,11 @@ (enhanced_for_statement) @scope ; block + (block) @scope ; if/else + (if_statement) @scope ; if+else (if_statement consequence: (_) @scope) ; if body in case there are no braces @@ -21,10 +25,12 @@ alternative: (_) @scope) ; else body in case there are no braces ; try/catch + (try_statement) @scope ; covers try+catch, individual try and catch are covered by (block) (catch_clause) @scope ; needed because `Exception` variable ; loops + (for_statement) @scope ; whole for_statement because loop iterator variable (for_statement ; "for" body in case there are no braces body: (_) @scope) @@ -38,32 +44,36 @@ (constructor_declaration) @scope (method_declaration) @scope +;; DEFINITIONS -; DEFINITIONS (package_declaration (identifier) @definition.namespace) + (class_declaration name: (identifier) @definition.type) (record_declaration name: (identifier) @definition.type) + (enum_declaration name: (identifier) @definition.enum) + (method_declaration name: (identifier) @definition.method) (local_variable_declaration declarator: (variable_declarator name: (identifier) @definition.var)) -(formal_parameter - name: (identifier) @definition.var) -(catch_formal_parameter - name: (identifier) @definition.var) -(inferred_parameters (identifier) @definition.var) ; (x,y) -> ... -(lambda_expression - parameters: (identifier) @definition.var) ; x -> ... (enhanced_for_statement ; for (var item : items) { name: (identifier) @definition.var) +(formal_parameter + name: (identifier) @definition.parameter) +(catch_formal_parameter + name: (identifier) @definition.parameter) +(inferred_parameters (identifier) @definition.parameter) ; (x,y) -> ... +(lambda_expression + parameters: (identifier) @definition.parameter) ; x -> ... + ((scoped_identifier (identifier) @definition.import) (#has-ancestor? @definition.import import_declaration)) @@ -72,6 +82,8 @@ declarator: (variable_declarator name: (identifier) @definition.field)) -; REFERENCES +;; REFERENCES + (identifier) @reference + (type_identifier) @reference From 1e8ad621a5a60ed904c94688cd2183f20fd0799f Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 23 Feb 2023 22:15:56 +0100 Subject: [PATCH 0016/2730] Extend injections for Lua to use query parser --- queries/lua/injections.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm index baf1914a5..c11e3fb29 100644 --- a/queries/lua/injections.scm +++ b/queries/lua/injections.scm @@ -14,7 +14,7 @@ ((function_call name: (_) @_vimcmd_identifier arguments: (arguments (string content: _ @query) .)) - (#eq? @_vimcmd_identifier "vim.treesitter.query.set_query")) + (#any-of? @_vimcmd_identifier "vim.treesitter.query.set_query" "vim.treesitter.query.parse_query")) ;; highlight string as query if starts with `;; query` ((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query")) From fceb4ed0ecaf56bac750a39fb0d05a6aa9a749c0 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 23 Feb 2023 16:06:47 -0500 Subject: [PATCH 0017/2730] feat: add dhall --- lockfile.json | 3 + lua/nvim-treesitter/parsers.lua | 8 ++ queries/dhall/folds.scm | 14 +++ queries/dhall/highlights.scm | 171 ++++++++++++++++++++++++++++++++ queries/dhall/injections.scm | 4 + 5 files changed, 200 insertions(+) create mode 100644 queries/dhall/folds.scm create mode 100644 queries/dhall/highlights.scm create mode 100644 queries/dhall/injections.scm diff --git a/lockfile.json b/lockfile.json index ad0a4f7ba..1b9623cdb 100644 --- a/lockfile.json +++ b/lockfile.json @@ -71,6 +71,9 @@ "devicetree": { "revision": "ea30a05d0f0446a96d8b096ad11828ad4f8ad849" }, + "dhall": { + "revision": "affb6ee38d629c9296749767ab832d69bb0d9ea8" + }, "diff": { "revision": "f69bde8e56f431863eba2fe4bab23e7d9692855f" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 7074cc363..7cd8c1e24 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -275,6 +275,14 @@ list.devicetree = { maintainers = { "@jedrzejboczar" }, } +list.dhall = { + install_info = { + url = "https://github.com/jbellerb/tree-sitter-dhall", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@amaanq" }, +} + list.diff = { install_info = { url = "https://github.com/the-mikedavis/tree-sitter-diff", diff --git a/queries/dhall/folds.scm b/queries/dhall/folds.scm new file mode 100644 index 000000000..305079aa8 --- /dev/null +++ b/queries/dhall/folds.scm @@ -0,0 +1,14 @@ +[ + (let_binding) + + (application_expression) + (lambda_expression) + + (record_type) + (union_type) + + (list_literal) + (record_literal) + + (block_comment) +] @fold diff --git a/queries/dhall/highlights.scm b/queries/dhall/highlights.scm new file mode 100644 index 000000000..4bf79d090 --- /dev/null +++ b/queries/dhall/highlights.scm @@ -0,0 +1,171 @@ +;; Text + +;; Imports + +(missing_import) @include + +(local_import) @string.special.path + +(http_import) @string @text.uri + +[ + (env_variable) + (import_hash) +] @string.special + +[ (import_as_location) (import_as_text) ] @type + +;; Types + +([ + (let_binding (label) @type) + (union_type_entry (label) @type) +] (#match? @type "^[A-Z]")) + +((primitive_expression + (identifier (label) @type) + (selector (label) @type)) @variable + (#vim-match? @variable "^[A-Z][^.]*$")) + +;; Parameters + +(lambda_expression label: (label) @parameter) + +;; Variables + +(label) @variable + +(identifier [ + (label) @variable + (de_bruijn_index) @operator +]) + +(let_binding label: (label) @variable) + +; Fields + +(record_literal_entry (label) @field) + +(record_type_entry (label) @field) + +(selector + (selector_dot) + (_) @field) + +;; Keywords + +(env_import) @keyword + +[ + "let" + "in" + "assert" +] @keyword + +[ + "using" + "as" + "with" +] @keyword.operator + +;; Operators + +[ + (type_operator) + (assign_operator) + (lambda_operator) + (arrow_operator) + (infix_operator) + (completion_operator) + (assert_operator) + (forall_operator) + (empty_record_literal) +] @operator + +;; Builtins + +(builtin_function) @function.builtin +(builtin [ + "Natural" + "Natural/build" + "Natural/fold" + "Natural/isZero" + "Natural/even" + "Natural/odd" + "Natural/subtract" + "Natural/toInteger" + "Natural/show" + "Integer" + "Integer/toDouble" + "Integer/show" + "Integer/negate" + "Integer/clamp" + "Double" + "Double/show" + "List" + "List/build" + "List/fold" + "List/length" + "List/head" + "List/last" + "List/indexed" + "List/reverse" + "Text" + "Text/show" + "Text/replace" + "Optional" + "Date" + "Time" + "TimeZone" + "Type" + "Kind" + "Sort" +] @type.builtin) + +;; Punctuation + +[ "," "|" ] @punctuation.delimiter +(selector_dot) @punctuation.delimiter + +[ "{" "}" ] @punctuation.bracket + +[ "[" "]" ] @punctuation.bracket + +[ "(" ")" ] @punctuation.bracket + +[ "<" ">" ] @punctuation.bracket + +;; Conditionals + +[ + "if" + "then" + "else" +] @conditional + +;; Literals + +(text_literal) @string +(interpolation "}" @string) +[ + (double_quote_escaped) + (single_quote_escaped) +] @string.escape + +[ + (integer_literal) + (natural_literal) +] @number + +(double_literal) @float + +(boolean_literal) @boolean + +(builtin "None") @constant.builtin + +;; Comments + +[ + (line_comment) + (block_comment) +] @comment @spell diff --git a/queries/dhall/injections.scm b/queries/dhall/injections.scm new file mode 100644 index 000000000..e48ce9af3 --- /dev/null +++ b/queries/dhall/injections.scm @@ -0,0 +1,4 @@ +[ + (line_comment) + (block_comment) +] @comment From 853b1ab39ae80b2e0e4a2224ac49f1763f025385 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 24 Feb 2023 03:07:52 -0500 Subject: [PATCH 0018/2730] style: fill in missing code docs wherever applicable --- lua/nvim-treesitter/caching.lua | 21 ++++- lua/nvim-treesitter/configs.lua | 62 ++++++------- lua/nvim-treesitter/fold.lua | 10 ++- lua/nvim-treesitter/highlight.lua | 3 +- lua/nvim-treesitter/incremental_selection.lua | 26 ++++-- lua/nvim-treesitter/indent.lua | 20 ++++- lua/nvim-treesitter/info.lua | 11 +++ lua/nvim-treesitter/install.lua | 68 +++++++++++---- lua/nvim-treesitter/locals.lua | 76 +++++++++------- lua/nvim-treesitter/parsers.lua | 11 ++- lua/nvim-treesitter/query.lua | 86 ++++++++++++------- lua/nvim-treesitter/query_predicates.lua | 51 +++++++++-- .../shell_command_selectors.lua | 26 +++++- lua/nvim-treesitter/ts_utils.lua | 64 +++++++++----- lua/nvim-treesitter/utils.lua | 72 ++++++++++------ scripts/update-readme.lua | 10 ++- scripts/write-lockfile.lua | 5 ++ 17 files changed, 431 insertions(+), 191 deletions(-) diff --git a/lua/nvim-treesitter/caching.lua b/lua/nvim-treesitter/caching.lua index 723dbde55..810d3a408 100644 --- a/lua/nvim-treesitter/caching.lua +++ b/lua/nvim-treesitter/caching.lua @@ -2,20 +2,26 @@ local api = vim.api local M = {} ---- Creates a cache table for buffers keyed by a type name. ---- Cache entries attach to the buffer and cleanup entries ---- as buffers are detached. +-- Creates a cache table for buffers keyed by a type name. +-- Cache entries attach to the buffer and cleanup entries +-- as buffers are detached. function M.create_buffer_cache() local cache = {} + ---@type table> local items = setmetatable({}, { __index = function(tbl, key) rawset(tbl, key, {}) return rawget(tbl, key) end, }) + + ---@type table local loaded_buffers = {} + ---@param type_name string + ---@param bufnr integer + ---@param value any function cache.set(type_name, bufnr, value) if not loaded_buffers[bufnr] then loaded_buffers[bufnr] = true @@ -34,18 +40,27 @@ function M.create_buffer_cache() items[tostring(bufnr)][type_name] = value end + ---@param type_name string + ---@param bufnr integer + ---@return any function cache.get(type_name, bufnr) return items[tostring(bufnr)][type_name] end + ---@param type_name string + ---@param bufnr integer + ---@return boolean function cache.has(type_name, bufnr) return cache.get(type_name, bufnr) ~= nil end + ---@param type_name string + ---@param bufnr integer function cache.remove(type_name, bufnr) items[tostring(bufnr)][type_name] = nil end + ---@param bufnr integer function cache.clear_buffer(bufnr) items[tostring(bufnr)] = nil end diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua index 87f930b8f..4207384ef 100644 --- a/lua/nvim-treesitter/configs.lua +++ b/lua/nvim-treesitter/configs.lua @@ -27,7 +27,9 @@ local config = { update_strategy = "lockfile", parser_install_dir = nil, } + -- List of modules that need to be setup on initialization. +---@type TSModule[][] local queued_modules_defs = {} -- Whether we've initialized the plugin yet. local is_initialized = false @@ -36,10 +38,12 @@ local is_initialized = false ---@field module_path string ---@field enable boolean|string[]|function(string): boolean ---@field disable boolean|string[]|function(string): boolean +---@field keymaps table ---@field is_supported function(string): boolean ---@field attach function(string) ---@field detach function(string) ---@field enabled_buffers table +---@field additional_vim_regex_highlighting boolean|string[] ---@type {[string]: TSModule} local builtin_modules = { @@ -248,7 +252,7 @@ local function recurse_modules(accumulator, root, path) end end ----Shows current configuration of all nvim-treesitter modules +-- Shows current configuration of all nvim-treesitter modules ---@param process_function function used as the `process` parameter --- for vim.inspect (https://github.com/kikito/inspect.lua#optionsprocess) local function config_info(process_function) @@ -369,7 +373,7 @@ M.commands = { ---@param mod string module ---@param lang string the language of the buffer ----@param bufnr integer the bufnr +---@param bufnr integer the buffer function M.is_enabled(mod, lang, bufnr) if not parsers.has_parser(lang) then return false @@ -438,8 +442,8 @@ function M.setup(user_data) end, config.modules) end ----Defines a table of modules that can be attached/detached to buffers ----based on language support. A module consist of the following properties: +-- Defines a table of modules that can be attached/detached to buffers +-- based on language support. A module consist of the following properties: ---* @enable Whether the modules is enabled. Can be true or false. ---* @disable A list of languages to disable the module for. Only relevant if enable is true. ---* @keymaps A list of user mappings for a given module if relevant. @@ -451,9 +455,11 @@ end --- if a `module_path` is not specified. ---* @detach A detach function that is called for each buffer that the module is enabled for. This is required --- if a `module_path` is not specified. ----Modules are not setup until `init` is invoked by the plugin. This allows modules to be defined in any order ----and can be loaded lazily. ----@example +-- +-- Modules are not setup until `init` is invoked by the plugin. This allows modules to be defined in any order +-- and can be loaded lazily. +-- +---* @example ---require"nvim-treesitter".define_modules { --- my_cool_module = { --- attach = function() @@ -493,7 +499,7 @@ end ---Attaches a module to a buffer ---@param mod_name string the module name ----@param bufnr integer the bufnr +---@param bufnr integer the buffer ---@param lang string the language of the buffer function M.attach_module(mod_name, bufnr, lang) bufnr = bufnr or api.nvim_get_current_buf() @@ -506,9 +512,9 @@ function M.attach_module(mod_name, bufnr, lang) end end ----Detaches a module to a buffer +-- Detaches a module to a buffer ---@param mod_name string the module name ----@param bufnr integer the bufnr +---@param bufnr integer the buffer function M.detach_module(mod_name, bufnr) local resolved_mod = resolve_module(mod_name) bufnr = bufnr or api.nvim_get_current_buf() @@ -519,17 +525,18 @@ function M.detach_module(mod_name, bufnr) end end ----Same as attach_module, but if the module is already attached, detach it first. +-- Same as attach_module, but if the module is already attached, detach it first. ---@param mod_name string the module name ----@param bufnr integer the bufnr +---@param bufnr integer the buffer ---@param lang string the language of the buffer function M.reattach_module(mod_name, bufnr, lang) M.detach_module(mod_name, bufnr) M.attach_module(mod_name, bufnr, lang) end ----Gets available modules +-- Gets available modules ---@param root {[string]:TSModule}|nil table to find modules +---@return string[] modules list of module paths function M.available_modules(root) local modules = {} @@ -542,24 +549,24 @@ end ---Gets a module config by path ---@param mod_path string path to the module ----@return TSModule|nil the module or nil +---@return TSModule|nil: the module or nil function M.get_module(mod_path) local mod = utils.get_at_path(config.modules, mod_path) return M.is_module(mod) and mod or nil end ----Determines whether the provided table is a module. ----A module should contain an attach and detach function. ----@param mod table the module table +-- Determines whether the provided table is a module. +-- A module should contain an attach and detach function. +---@param mod table|nil the module table ---@return boolean function M.is_module(mod) return type(mod) == "table" and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(mod.module_path) == "string") end ----Initializes built-in modules and any queued modules ----registered by plugins or the user. +-- Initializes built-in modules and any queued modules +-- registered by plugins or the user. function M.init() is_initialized = true M.define_modules(builtin_modules) @@ -569,22 +576,17 @@ function M.init() end end ----If parser_install_dir is not nil is used or created. ----If parser_install_dir is nil try the package dir of the nvim-treesitter ----plugin first, followed by the "site" dir from "runtimepath". "site" dir will ----be created if it doesn't exist. Using only the package dir won't work when ----the plugin is installed with Nix, since the "/nix/store" is read-only. +-- If parser_install_dir is not nil is used or created. +-- If parser_install_dir is nil try the package dir of the nvim-treesitter +-- plugin first, followed by the "site" dir from "runtimepath". "site" dir will +-- be created if it doesn't exist. Using only the package dir won't work when +-- the plugin is installed with Nix, since the "/nix/store" is read-only. ---@param folder_name string|nil ---@return string|nil, string|nil function M.get_parser_install_dir(folder_name) folder_name = folder_name or "parser" - local install_dir - if config.parser_install_dir then - install_dir = config.parser_install_dir - else - install_dir = utils.get_package_path() - end + local install_dir = config.parser_install_dir or utils.get_package_path() local parser_dir = utils.join_path(install_dir, folder_name) return utils.create_or_reuse_writable_dir( diff --git a/lua/nvim-treesitter/fold.lua b/lua/nvim-treesitter/fold.lua index 50272622f..759599876 100644 --- a/lua/nvim-treesitter/fold.lua +++ b/lua/nvim-treesitter/fold.lua @@ -31,7 +31,10 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr) end) -- start..stop is an inclusive range + + ---@type table local start_counts = {} + ---@type table local stop_counts = {} local prev_start = -1 @@ -40,11 +43,11 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr) local min_fold_lines = api.nvim_win_get_option(0, "foldminlines") for _, match in ipairs(matches) do - local start, stop, stop_col + local start, stop, stop_col ---@type integer, integer, integer if match.metadata and match.metadata.range then - start, _, stop, stop_col = unpack(match.metadata.range) + start, _, stop, stop_col = unpack(match.metadata.range) ---@type integer, integer, integer, integer else - start, _, stop, stop_col = match.node:range() + start, _, stop, stop_col = match.node:range() ---@type integer, integer, integer, integer end if stop_col == 0 then @@ -65,6 +68,7 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr) end end + ---@type string[] local levels = {} local current_level = 0 diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua index 042d326f9..5a3cc2e86 100644 --- a/lua/nvim-treesitter/highlight.lua +++ b/lua/nvim-treesitter/highlight.lua @@ -2,13 +2,14 @@ local configs = require "nvim-treesitter.configs" local M = {} ----@param config table +---@param config TSModule ---@param lang string ---@return boolean local function should_enable_vim_regex(config, lang) local additional_hl = config.additional_vim_regex_highlighting local is_table = type(additional_hl) == "table" + ---@diagnostic disable-next-line: param-type-mismatch return additional_hl and (not is_table or vim.tbl_contains(additional_hl, lang)) end diff --git a/lua/nvim-treesitter/incremental_selection.lua b/lua/nvim-treesitter/incremental_selection.lua index 4d4f2aad6..b0fd7b65f 100644 --- a/lua/nvim-treesitter/incremental_selection.lua +++ b/lua/nvim-treesitter/incremental_selection.lua @@ -8,6 +8,7 @@ local queries = require "nvim-treesitter.query" local M = {} +---@type table> local selections = {} function M.init_selection() @@ -17,14 +18,15 @@ function M.init_selection() ts_utils.update_selection(buf, node) end ---- Get the range of the current visual selection. +-- Get the range of the current visual selection. -- --- The range start with 1 and the ending is inclusive. +-- The range starts with 1 and the ending is inclusive. +---@return integer, integer, integer, integer local function visual_selection_range() - local _, csrow, cscol, _ = unpack(vim.fn.getpos "'<") - local _, cerow, cecol, _ = unpack(vim.fn.getpos "'>") + local _, csrow, cscol, _ = unpack(vim.fn.getpos "'<") ---@type integer, integer, integer, integer + local _, cerow, cecol, _ = unpack(vim.fn.getpos "'>") ---@type integer, integer, integer, integer - local start_row, start_col, end_row, end_col + local start_row, start_col, end_row, end_col ---@type integer, integer, integer, integer if csrow < cerow or (csrow == cerow and cscol <= cecol) then start_row = csrow @@ -41,12 +43,16 @@ local function visual_selection_range() return start_row, start_col, end_row, end_col end +---@param node TSNode +---@return boolean local function range_matches(node) local csrow, cscol, cerow, cecol = visual_selection_range() local srow, scol, erow, ecol = ts_utils.get_vim_range { node:range() } return srow == csrow and scol == cscol and erow == cerow and ecol == cecol end +---@param get_parent fun(node: TSNode): TSNode|nil +---@return fun():nil local function select_incremental(get_parent) return function() local buf = api.nvim_get_current_buf() @@ -67,7 +73,7 @@ local function select_incremental(get_parent) end -- Find a node that changes the current selection. - local node = nodes[#nodes] + local node = nodes[#nodes] ---@type TSNode while true do local parent = get_parent(node) if not parent or parent == node then @@ -116,7 +122,7 @@ function M.node_decremental() end table.remove(selections[buf]) - local node = nodes[#nodes] + local node = nodes[#nodes] ---@type TSNode ts_utils.update_selection(buf, node) end @@ -127,14 +133,16 @@ local FUNCTION_DESCRIPTIONS = { node_decremental = "Shrink selection to previous named node", } +---@param bufnr integer function M.attach(bufnr) local config = configs.get_module "incremental_selection" for funcname, mapping in pairs(config.keymaps) do if mapping then - local mode - local rhs + ---@type string, string|function + local mode, rhs if funcname == "init_selection" then mode = "n" + ---@type function rhs = M[funcname] else mode = "x" diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index a53d38c8d..c3e4c0888 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -15,16 +15,27 @@ M.comment_parsers = { phpdoc = true, } +---@param root TSNode +---@param lnum integer +---@return TSNode local function get_first_node_at_line(root, lnum) local col = vim.fn.indent(lnum) return root:descendant_for_range(lnum - 1, col, lnum - 1, col) end +---@param root TSNode +---@param lnum integer +---@return TSNode local function get_last_node_at_line(root, lnum) local col = #vim.fn.getline(lnum) - 1 return root:descendant_for_range(lnum - 1, col, lnum - 1, col) end +---@param bufnr integer +---@param node TSNode +---@param delimiter string +---@return TSNode|nil child +---@return boolean|nil is_end local function find_delimiter(bufnr, node, delimiter) for child, _ in node:iter_children() do if child:type() == delimiter then @@ -77,7 +88,7 @@ function M.get_indent(lnum) end -- Get language tree with smallest range around node that's not a comment parser - local root, lang_tree + local root, lang_tree ---@type TSNode, LanguageTree parser:for_each_tree(function(tstree, tree) if not tstree or M.comment_parsers[tree:lang()] then return @@ -98,7 +109,7 @@ function M.get_indent(lnum) local q = get_indents(vim.api.nvim_get_current_buf(), root, lang_tree:lang()) local is_empty_line = string.match(vim.fn.getline(lnum), "^%s*$") ~= nil - local node + local node ---@type TSNode if is_empty_line then local prevlnum = vim.fn.prevnonblank(lnum) node = get_last_node_at_line(root, prevlnum) @@ -171,8 +182,9 @@ function M.get_indent(lnum) -- do not indent for nodes that starts-and-ends on same line and starts on target line (lnum) if q.aligned_indent[node:id()] and srow ~= erow and (srow ~= lnum - 1) then local metadata = q.aligned_indent[node:id()] - local o_delim_node, is_last_in_line + local o_delim_node, is_last_in_line ---@type TSNode|nil, boolean|nil if metadata.delimiter then + ---@type string local opening_delimiter = metadata.delimiter and metadata.delimiter:sub(1, 1) o_delim_node, is_last_in_line = find_delimiter(bufnr, node, opening_delimiter) else @@ -198,8 +210,10 @@ function M.get_indent(lnum) return indent end +---@type table local indent_funcs = {} +---@param bufnr integer function M.attach(bufnr) indent_funcs[bufnr] = vim.bo.indentexpr vim.bo.indentexpr = "nvim_treesitter#indent()" diff --git a/lua/nvim-treesitter/info.lua b/lua/nvim-treesitter/info.lua index eaeb9751c..6e94b357d 100644 --- a/lua/nvim-treesitter/info.lua +++ b/lua/nvim-treesitter/info.lua @@ -31,6 +31,8 @@ end -- {'mod1', 'mod2.sub1', 'mod2.sub2', 'mod3'} -- -> -- { default = {'mod1', 'mod3'}, mod2 = {'sub1', 'sub2'}} +---@param modulelist string[] +---@return table local function namespace_modules(modulelist) local modules = {} for _, module in ipairs(modulelist) do @@ -50,6 +52,8 @@ local function namespace_modules(modulelist) return modules end +---@param list string[] +---@return integer length local function longest_string_length(list) local length = 0 for _, value in ipairs(list) do @@ -60,6 +64,11 @@ local function longest_string_length(list) return length end +---@param curbuf integer +---@param origbuf integer +---@param parserlist string[] +---@param namespace string +---@param modulelist string[] local function append_module_table(curbuf, origbuf, parserlist, namespace, modulelist) local maxlen_parser = longest_string_length(parserlist) table.sort(modulelist) @@ -104,6 +113,7 @@ local function print_info_modules(parserlist, module) modules = namespace_modules(configs.available_modules()) end + ---@type string[] local namespaces = {} for k, _ in pairs(modules) do table.insert(namespaces, k) @@ -150,6 +160,7 @@ local function module_info(module) end end +---@return string[] function M.installed_parsers() local installed = {} for _, p in pairs(parsers.available_parsers()) do diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 53efff5fd..6a72c6cef 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -9,6 +9,11 @@ local configs = require "nvim-treesitter.configs" local shell = require "nvim-treesitter.shell_command_selectors" local M = {} + +---@class LockfileInfo +---@field revision string + +---@type table local lockfile = {} M.compilers = { vim.fn.getenv "CC", "cc", "gcc", "clang", "cl", "zig" } @@ -96,8 +101,8 @@ local function is_ignored_parser(lang) return vim.tbl_contains(configs.get_ignored_parser_installs(), lang) end ---- @param lang string ---- @return string|nil +---@param lang string +---@return string|nil local function get_revision(lang) if #lockfile == 0 then load_lockfile() @@ -123,8 +128,8 @@ local function get_installed_revision(lang) end -- Clean path for use in a prefix comparison --- @param input string --- @return string +---@param input string +---@return string local function clean_path(input) local pth = vim.fn.fnamemodify(input, ":p") if fn.has "win32" == 1 then @@ -133,7 +138,7 @@ local function clean_path(input) return pth end ----Checks if parser is installed with nvim-treesitter +-- Checks if parser is installed with nvim-treesitter ---@param lang string ---@return boolean local function is_installed(lang) @@ -159,9 +164,9 @@ local function needs_update(lang) return not revision or revision ~= get_installed_revision(lang) end ----@return table +---@return string[] local function outdated_parsers() - return vim.tbl_filter(function(lang) + return vim.tbl_filter(function(lang) ---@param lang string return is_installed(lang) and needs_update(lang) end, info.installed_parsers()) end @@ -252,6 +257,8 @@ function M.iter_cmd(cmd_list, i, lang, success_message) end end +---@param cmd Command +---@return string command local function get_command(cmd) local options = "" if cmd.opts and cmd.opts.args then @@ -263,13 +270,15 @@ local function get_command(cmd) end end - local final = string.format("%s %s", cmd.cmd, options) + local command = string.format("%s %s", cmd.cmd, options) if cmd.opts and cmd.opts.cwd then - final = shell.make_directory_change_for_command(cmd.opts.cwd, final) + command = shell.make_directory_change_for_command(cmd.opts.cwd, command) end - return final + return command end +---@param cmd_list Command[] +---@return boolean local function iter_cmd_sync(cmd_list) for _, cmd in ipairs(cmd_list) do if cmd.info then @@ -311,7 +320,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, repo.url = maybe_local_path end - -- compile_location only needed for typescript installs. + ---@type string compile_location only needed for typescript installs. local compile_location if from_local_path then compile_location = repo.url @@ -355,7 +364,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, local cc = shell.select_executable(M.compilers) if not cc then api.nvim_err_writeln('No C compiler found! "' .. table.concat( - vim.tbl_filter(function(c) + vim.tbl_filter(function(c) ---@param c string return type(c) == "string" end, M.compilers), '", "' @@ -368,6 +377,17 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, revision = get_revision(lang) end + ---@class Command + ---@field cmd string + ---@field info string + ---@field err string + ---@field opts CmdOpts + + ---@class CmdOpts + ---@field args string[] + ---@field cwd string + + ---@type Command[] local command_list = {} if not from_local_path then vim.list_extend(command_list, { shell.select_install_rm_cmd(cache_folder, project_name) }) @@ -411,7 +431,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, shell.select_mv_cmd("parser.so", parser_lib_name, compile_location), { cmd = function() - vim.fn.writefile({ revision or "" }, utils.join_path(configs.get_parser_info_dir(), lang .. ".revision")) + vim.fn.writefile({ revision or "" }, utils.join_path(configs.get_parser_info_dir() or "", lang .. ".revision")) end, }, { -- auto-attach modules after installation @@ -432,7 +452,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync, end ---@param lang string ----@param ask_reinstall boolean +---@param ask_reinstall boolean|string ---@param cache_folder string ---@param install_folder string ---@param with_sync boolean @@ -465,6 +485,14 @@ local function install_lang(lang, ask_reinstall, cache_folder, install_folder, w run_install(cache_folder, install_folder, lang, install_info, with_sync, generate_from_grammar) end +---@class InstallOptions +---@field with_sync boolean +---@field ask_reinstall boolean|string +---@field generate_from_grammar boolean +---@field exclude_configured_parsers boolean + +-- Install a parser +---@param options? InstallOptions ---@return function local function install(options) options = options or {} @@ -491,8 +519,8 @@ local function install(options) end assert(install_folder) - local languages - local ask + local languages ---@type string[] + local ask ---@type boolean|string if ... == "all" then languages = parsers.available_parsers() ask = false @@ -533,6 +561,7 @@ function M.update(options) M.lockfile = {} reset_progress_counter() if ... and ... ~= "all" then + ---@type string[] local languages = vim.tbl_flatten { ... } local installed = 0 for _, lang in ipairs(languages) do @@ -578,6 +607,7 @@ function M.uninstall(...) end ensure_installed_parsers = utils.difference(ensure_installed_parsers, configs.get_ignored_parser_installs()) + ---@type string[] local languages = vim.tbl_flatten { ... } for _, lang in ipairs(languages) do local install_dir, err = configs.get_parser_install_dir() @@ -634,7 +664,7 @@ function M.uninstall(...) end function M.write_lockfile(verbose, skip_langs) - local sorted_parsers = {} + local sorted_parsers = {} ---@type Parser[] -- Load previous lockfile load_lockfile() skip_langs = skip_langs or {} @@ -643,6 +673,8 @@ function M.write_lockfile(verbose, skip_langs) table.insert(sorted_parsers, { name = k, parser = v }) end + ---@param a Parser + ---@param b Parser table.sort(sorted_parsers, function(a, b) return a.name < b.name end) @@ -650,7 +682,7 @@ function M.write_lockfile(verbose, skip_langs) for _, v in ipairs(sorted_parsers) do if not vim.tbl_contains(skip_langs, v.name) then -- I'm sure this can be done in aync way with iter_cmd - local sha + local sha ---@type string if v.parser.install_info.branch then sha = vim.split( vim.fn.systemlist( diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index dcfba2683..75ae07237 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -20,15 +20,16 @@ function M.iter_locals(bufnr, root) return queries.iter_group_results(bufnr, "locals", root) end +---@param bufnr integer +---@return any function M.get_locals(bufnr) return queries.get_matches(bufnr, "locals") end ---- Creates unique id for a node based on text and range --- @param scope: the scope node of the definition --- @param bufnr: the buffer --- @param node_text: the node text to use --- @returns a string id +-- Creates unique id for a node based on text and range +---@param scope TSNode: the scope node of the definition +---@param node_text string: the node text to use +---@return string: a string id function M.get_definition_id(scope, node_text) -- Add a valid starting character in case node text doesn't start with a valid one. return table.concat({ "k", node_text or "", scope:range() }, "_") @@ -76,10 +77,13 @@ function M.get_references(bufnr) return refs end ---- Gets a table with all the scopes containing a node +-- Gets a table with all the scopes containing a node -- The order is from most specific to least (bottom up) +---@param node TSNode +---@param bufnr integer +---@return TSNode[] function M.get_scope_tree(node, bufnr) - local scopes = {} + local scopes = {} ---@type TSNode[] for scope in M.iter_scope_tree(node, bufnr) do table.insert(scopes, scope) @@ -88,7 +92,10 @@ function M.get_scope_tree(node, bufnr) return scopes end ---- Iterates over a nodes scopes moving from the bottom up +-- Iterates over a nodes scopes moving from the bottom up +---@param node TSNode +---@param bufnr integer +---@return fun(): TSNode|nil function M.iter_scope_tree(node, bufnr) local last_node = node return function() @@ -105,12 +112,12 @@ function M.iter_scope_tree(node, bufnr) end -- Gets a table of all nodes and their 'kinds' from a locals list --- @param local_def the local list result --- @returns a list of node entries +---@param local_def any: the local list result +---@return table: a list of node entries function M.get_local_nodes(local_def) local result = {} - M.recurse_local_nodes(local_def, function(def, node, kind) + M.recurse_local_nodes(local_def, function(def, _node, kind) table.insert(result, vim.tbl_extend("keep", { kind = kind }, def)) end) @@ -123,10 +130,10 @@ end -- * The node -- * The full definition match `@definition.var.something` -> 'var.something' -- * The last definition match `@definition.var.something` -> 'something' --- @param The locals result --- @param The accumulator function --- @param The full match path to append to --- @param The last match +---@param local_def any The locals result +---@param accumulator function The accumulator function +---@param full_match? string The full match path to append to +---@param last_match? string The last match function M.recurse_local_nodes(local_def, accumulator, full_match, last_match) if type(local_def) ~= "table" then return @@ -141,7 +148,7 @@ function M.recurse_local_nodes(local_def, accumulator, full_match, last_match) end end ---- Get a single dimension table to look definition nodes. +-- Get a single dimension table to look definition nodes. -- Keys are generated by using the range of the containing scope and the text of the definition node. -- This makes looking up a definition for a given scope a simple key lookup. -- @@ -152,8 +159,8 @@ end -- Usage lookups require finding the definition of the node, so `find_definition` -- is called very frequently, which is why this lookup must be fast as possible. -- --- @param bufnr: the buffer --- @returns a table for looking up definitions +---@param bufnr integer: the buffer +---@return table result: a table for looking up definitions M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr) local definitions = M.get_definitions(bufnr) local result = {} @@ -173,19 +180,19 @@ M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr) return result end) ---- Gets all the scopes of a definition based on the scope type +-- Gets all the scopes of a definition based on the scope type -- Scope types can be -- -- "parent": Uses the parent of the containing scope, basically, skipping a scope -- "global": Uses the top most scope -- "local": Uses the containing scope of the definition. This is the default -- --- @param node: the definition node --- @param bufnr: the buffer --- @param scope_type: the scope type +---@param node TSNode: the definition node +---@param bufnr integer: the buffer +---@param scope_type string: the scope type function M.get_definition_scopes(node, bufnr, scope_type) local scopes = {} - local scope_count = 1 + local scope_count = 1 ---@type integer|nil -- Definition is valid for the containing scope -- and the containing scope of that scope @@ -209,6 +216,11 @@ function M.get_definition_scopes(node, bufnr, scope_type) return scopes end +---@param node TSNode +---@param bufnr integer +---@return TSNode node +---@return TSNode scope +---@return string|nil kind function M.find_definition(node, bufnr) local def_lookup = M.get_definitions_lookup_table(bufnr) local node_text = ts_query.get_node_text(node, bufnr) @@ -227,11 +239,11 @@ function M.find_definition(node, bufnr) end -- Finds usages of a node in a given scope. --- @param node the node to find usages for --- @param scope_node the node to look within --- @returns a list of nodes +---@param node TSNode the node to find usages for +---@param scope_node TSNode the node to look within +---@return TSNode[]: a list of nodes function M.find_usages(node, scope_node, bufnr) - local bufnr = bufnr or api.nvim_get_current_buf() + bufnr = bufnr or api.nvim_get_current_buf() local node_text = ts_query.get_node_text(node, bufnr) if not node_text or #node_text < 1 then @@ -258,6 +270,10 @@ function M.find_usages(node, scope_node, bufnr) return usages end +---@param node TSNode +---@param bufnr? integer +---@param allow_scope? boolean +---@return TSNode|nil function M.containing_scope(node, bufnr, allow_scope) local bufnr = bufnr or api.nvim_get_current_buf() local allow_scope = allow_scope == nil or allow_scope == true @@ -284,8 +300,8 @@ function M.nested_scope(node, cursor_pos) return end - local row = cursor_pos.row - local col = cursor_pos.col + local row = cursor_pos.row ---@type integer + local col = cursor_pos.col ---@type integer local scope = M.containing_scope(node) for _, child in ipairs(ts_utils.get_named_children(scope)) do @@ -321,6 +337,8 @@ function M.next_scope(node) end end +---@param node TSNode +---@return TSNode|nil function M.previous_scope(node) local bufnr = api.nvim_get_current_buf() diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 7cd8c1e24..1813f08dd 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -36,6 +36,7 @@ local filetype_to_parsername = { ---@field filetype string ---@field maintainers string[] ---@field experimental boolean|nil +---@field readme_name string|nil ---@type ParserInfo[] local list = setmetatable({}, { @@ -1542,11 +1543,13 @@ function M.ft_to_lang(ft) end end +-- Get a list of all available parsers +---@return string[] function M.available_parsers() if vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 then return vim.tbl_keys(M.list) else - return vim.tbl_filter(function(p) + return vim.tbl_filter(function(p) ---@param p string return not M.list[p].install_info.requires_generate_from_grammar end, vim.tbl_keys(M.list)) end @@ -1598,9 +1601,9 @@ function M.get_tree_root(bufnr) return M.get_parser(bufnr):parse()[1]:root() end --- get language of given buffer --- @param optional buffer number or current buffer --- @returns language string of buffer +-- Gets the language of a given buffer +---@param bufnr number? or current buffer +---@return string function M.get_buf_lang(bufnr) bufnr = bufnr or api.nvim_get_current_buf() return M.ft_to_lang(api.nvim_buf_get_option(bufnr, "ft")) diff --git a/lua/nvim-treesitter/query.lua b/lua/nvim-treesitter/query.lua index bc80d51e6..c7f1f952e 100644 --- a/lua/nvim-treesitter/query.lua +++ b/lua/nvim-treesitter/query.lua @@ -11,10 +11,10 @@ local EMPTY_ITER = function() end M.built_in_query_groups = { "highlights", "locals", "folds", "indents", "injections" } ---- Creates a function that checks whether a given query exists ---- for a specific language. +-- Creates a function that checks whether a given query exists +-- for a specific language. ---@param query string ----@return function(string): boolean +---@return fun(string): boolean local function get_query_guard(query) return function(lang) return M.has_query_files(lang, query) @@ -49,6 +49,9 @@ do }) end + ---@param bufnr integer + ---@param query_group string + ---@return any function M.get_matches(bufnr, query_group) bufnr = bufnr or api.nvim_get_current_buf() local cached_local = query_cache.get(query_group, bufnr) @@ -94,9 +97,10 @@ do end -- cache will auto set the table for each lang if it is nil + ---@type table> local cache = setmetatable({}, mt) - --- Same as `vim.treesitter.query` except will return cached values + -- Same as `vim.treesitter.query` except will return cached values ---@param lang string ---@param query_name string function M.get_query(lang, query_name) @@ -107,12 +111,13 @@ do return cache[lang][query_name] end - --- Invalidates the query file cache. - --- If lang and query_name is both present, will reload for only the lang and query_name. - --- If only lang is present, will reload all query_names for that lang - --- If none are present, will reload everything - ---@param lang string - ---@param query_name string + -- Invalidates the query file cache. + -- + -- If lang and query_name is both present, will reload for only the lang and query_name. + -- If only lang is present, will reload all query_names for that lang + -- If none are present, will reload everything + ---@param lang? string + ---@param query_name? string function M.invalidate_query_cache(lang, query_name) if lang and query_name then cache[lang][query_name] = nil @@ -137,7 +142,7 @@ do end end ---- This function is meant for an autocommand and not to be used. Only use if file is a query file. +-- This function is meant for an autocommand and not to be used. Only use if file is a query file. ---@param fname string function M.invalidate_query_file(fname) local fnamemodify = vim.fn.fnamemodify @@ -145,14 +150,14 @@ function M.invalidate_query_file(fname) end ---@class QueryInfo ----@field root LanguageTree +---@field root TSNode ---@field source integer ---@field start integer ---@field stop integer ---@param bufnr integer ---@param query_name string ----@param root LanguageTree +---@param root TSNode ---@param root_lang string|nil ---@return Query|nil, QueryInfo|nil local function prepare_query(bufnr, query_name, root, root_lang) @@ -214,15 +219,21 @@ end ---@param end_row integer function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) -- A function that splits a string on '.' - local function split(string) + ---@param to_split string + ---@return string[] + local function split(to_split) local t = {} - for str in string.gmatch(string, "([^.]+)") do + for str in string.gmatch(to_split, "([^.]+)") do table.insert(t, str) end return t end + -- Given a path (i.e. a List(String)) this functions inserts value at path + ---@param object any + ---@param path string[] + ---@param value any local function insert_to_path(object, path, value) local curr_obj = object @@ -256,6 +267,7 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) end -- Add some predicates for testing + ---@type string[][] ( TODO: make pred type so this can be pred[]) local preds = query.info.patterns[pattern] if preds then for _, pred in pairs(preds) do @@ -279,22 +291,22 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) return iterator end ---- Return all nodes corresponding to a specific capture path (like @definition.var, @reference.type) ----Works like M.get_references or M.get_scopes except you can choose the capture ----Can also be a nested capture like @definition.function to get all nodes defining a function. ---- +-- Return all nodes corresponding to a specific capture path (like @definition.var, @reference.type) +-- Works like M.get_references or M.get_scopes except you can choose the capture +-- Can also be a nested capture like @definition.function to get all nodes defining a function. +-- ---@param bufnr integer the buffer ---@param captures string|string[] ---@param query_group string the name of query group (highlights or injections for example) ----@param root LanguageTree|nil node from where to start the search +---@param root TSNode|nil node from where to start the search ---@param lang string|nil the language from where to get the captures. ---- Root nodes can have several languages. +--- Root nodes can have several languages. ---@return table|nil function M.get_capture_matches(bufnr, captures, query_group, root, lang) if type(captures) == "string" then captures = { captures } end - local strip_captures = {} + local strip_captures = {} ---@type string[] for i, capture in ipairs(captures) do if capture:sub(1, 1) ~= "@" then error 'Captures must start with "@"' @@ -342,14 +354,21 @@ function M.iter_captures(bufnr, query_name, root, lang) return wrapped_iter end +---@param bufnr integer +---@param capture_string string +---@param query_group string +---@param filter_predicate fun(match: table): boolean +---@param scoring_function fun(match: table): number +---@param root TSNode +---@return table|unknown function M.find_best_match(bufnr, capture_string, query_group, filter_predicate, scoring_function, root) if string.sub(capture_string, 1, 1) == "@" then --remove leading "@" capture_string = string.sub(capture_string, 2) end - local best - local best_score + local best ---@type table|nil + local best_score ---@type number for maybe_match in M.iter_group_results(bufnr, query_group, root) do local match = utils.get_at_path(maybe_match, capture_string) @@ -372,8 +391,8 @@ end ---Iterates matches from a query file. ---@param bufnr integer the buffer ---@param query_group string the query file to use ----@param root LanguageTree the root node ----@param root_lang string|nil the root node lang, if known +---@param root TSNode the root node +---@param root_lang? string the root node lang, if known function M.iter_group_results(bufnr, query_group, root, root_lang) local query, params = prepare_query(bufnr, query_group, root, root_lang) if not query then @@ -396,13 +415,14 @@ end ---@alias CaptureResFn function(string, LanguageTree, LanguageTree): string, string ---- Same as get_capture_matches except this will recursively get matches for every language in the tree. ----@param bufnr integer The bufnr +-- Same as get_capture_matches except this will recursively get matches for every language in the tree. +---@param bufnr integer The buffer ---@param capture_or_fn string|CaptureResFn The capture to get. If a function is provided then that ---- function will be used to resolve both the capture and query argument. ---- The function can return `nil` to ignore that tree. ----@param query_type string The query to get the capture from. This is ignore if a function is provided ---- for the captuer argument. +--- function will be used to resolve both the capture and query argument. +--- The function can return `nil` to ignore that tree. +---@param query_type string? The query to get the capture from. This is ignored if a function is provided +--- for the capture argument. +---@return table[] function M.get_capture_matches_recursively(bufnr, capture_or_fn, query_type) ---@type CaptureResFn local type_fn @@ -422,7 +442,7 @@ function M.get_capture_matches_recursively(bufnr, capture_or_fn, query_type) local capture, type_ = type_fn(lang, tree, lang_tree) if capture then - vim.list_extend(matches, M.get_capture_matches(bufnr, capture, type_, tree:root(), lang)) + vim.list_extend(matches, M.get_capture_matches(bufnr, capture, type_, tree:root(), lang) or {}) end end) end diff --git a/lua/nvim-treesitter/query_predicates.lua b/lua/nvim-treesitter/query_predicates.lua index 0638b6e79..2509a677c 100644 --- a/lua/nvim-treesitter/query_predicates.lua +++ b/lua/nvim-treesitter/query_predicates.lua @@ -20,12 +20,17 @@ local function valid_args(name, pred, count, strict_count) return true end -query.add_predicate("nth?", function(match, pattern, bufnr, pred) +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_predicate("nth?", function(match, _pattern, _bufnr, pred) if not valid_args("nth?", pred, 2, true) then return end - local node = match[pred[2]] + local node = match[pred[2]] ---@type TSNode local n = tonumber(pred[3]) if node and node:parent() and node:parent():named_child_count() > n then return node:parent():named_child(n) == node @@ -34,7 +39,12 @@ query.add_predicate("nth?", function(match, pattern, bufnr, pred) return false end) -local function has_ancestor(match, pattern, bufnr, pred) +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@return boolean|nil +local function has_ancestor(match, _pattern, _bufnr, pred) if not valid_args(pred[1], pred, 2) then return end @@ -65,7 +75,12 @@ query.add_predicate("has-ancestor?", has_ancestor) query.add_predicate("has-parent?", has_ancestor) -query.add_predicate("is?", function(match, pattern, bufnr, pred) +---@param match (TSNode|nil)[] +---@param _pattern string +---@param bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_predicate("is?", function(match, _pattern, bufnr, pred) if not valid_args("is?", pred, 2) then return end @@ -84,7 +99,12 @@ query.add_predicate("is?", function(match, pattern, bufnr, pred) return vim.tbl_contains(types, kind) end) -query.add_predicate("has-type?", function(match, pattern, bufnr, pred) +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@return boolean|nil +query.add_predicate("has-type?", function(match, _pattern, _bufnr, pred) if not valid_args(pred[1], pred, 2) then return end @@ -102,8 +122,14 @@ end) -- Just avoid some annoying warnings for this directive query.add_directive("make-range!", function() end) +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@param metadata table +---@return boolean|nil query.add_directive("downcase!", function(match, _, bufnr, pred, metadata) - local text, key, value + local text, key, value ---@type string|string[], string, string|integer if #pred == 3 then -- (#downcase! @capture "key") @@ -129,13 +155,19 @@ query.add_directive("downcase!", function(match, _, bufnr, pred, metadata) end end) +---@param match (TSNode|nil)[] +---@param _pattern string +---@param _bufnr integer +---@param pred string[] +---@param metadata table +---@return boolean|nil query.add_directive("exclude_children!", function(match, _pattern, _bufnr, pred, metadata) local capture_id = pred[2] local node = match[capture_id] local start_row, start_col, end_row, end_col = node:range() local ranges = {} for i = 0, node:named_child_count() - 1 do - local child = node:named_child(i) + local child = node:named_child(i) ---@type TSNode local child_start_row, child_start_col, child_end_row, child_end_col = child:range() if child_start_row > start_row or child_start_col > start_col then table.insert(ranges, { @@ -156,6 +188,11 @@ end) -- Trim blank lines from end of the region -- Arguments are the captures to trim. +---@param match (TSNode|nil)[] +---@param _ string +---@param bufnr integer +---@param pred string[] +---@param metadata table query.add_directive("trim!", function(match, _, bufnr, pred, metadata) for _, id in ipairs { select(2, unpack(pred)) } do local node = match[id] diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index 9676beb5d..7a0610a98 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -3,6 +3,8 @@ local utils = require "nvim-treesitter.utils" -- Convert path for cmd.exe on Windows. -- This is needed when vim.opt.shellslash is in use. +---@param p string +---@return string local function cmdpath(p) if vim.opt.shellslash:get() then local r = p:gsub("/", "\\") @@ -14,6 +16,10 @@ end local M = {} +---@param directory string +---@param cwd string +---@param info_msg string +---@return table function M.select_mkdir_cmd(directory, cwd, info_msg) if fn.has "win32" == 1 then return { @@ -38,6 +44,9 @@ function M.select_mkdir_cmd(directory, cwd, info_msg) end end +---@param file string +---@param info_msg string +---@return table function M.select_rm_file_cmd(file, info_msg) if fn.has "win32" == 1 then return { @@ -60,13 +69,17 @@ function M.select_rm_file_cmd(file, info_msg) end end +---@param executables string[] ---@return string|nil function M.select_executable(executables) - return vim.tbl_filter(function(c) + return vim.tbl_filter(function(c) ---@param c string return c ~= vim.NIL and fn.executable(c) == 1 end, executables)[1] end +---@param repo InstallInfo +---@param compiler string +---@return string[] function M.select_compiler_args(repo, compiler) if string.match(compiler, "cl$") or string.match(compiler, "cl.exe$") then return { @@ -98,7 +111,7 @@ function M.select_compiler_args(repo, compiler) "-Os", } if - #vim.tbl_filter(function(file) + #vim.tbl_filter(function(file) ---@param file string local ext = vim.fn.fnamemodify(file, ":e") return ext == "cc" or ext == "cpp" or ext == "cxx" end, repo.files) > 0 @@ -186,6 +199,12 @@ function M.select_mv_cmd(from, to, cwd) end end +---@param repo InstallInfo +---@param project_name string +---@param cache_folder string +---@param revision string|nil +---@param prefer_git boolean +---@return table function M.select_download_commands(repo, project_name, cache_folder, revision, prefer_git) local can_use_tar = vim.fn.executable "tar" == 1 and vim.fn.executable "curl" == 1 local is_github = repo.url:find("github.com", 1, true) @@ -277,6 +296,9 @@ function M.select_download_commands(repo, project_name, cache_folder, revision, end end +---@param dir string +---@param command string +---@return string command function M.make_directory_change_for_command(dir, command) if fn.has "win32" == 1 then return string.format("pushd %s & %s & popd", cmdpath(dir), command) diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index 31dfbf048..6b330fda4 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -34,6 +34,11 @@ local function get_node_text(node, bufnr) end ---@private +---@param node TSNode +---@param type_patterns string[] +---@param transform_fn fun(line: string): string +---@param bufnr integer +---@return string function M._get_line_for_node(node, type_patterns, transform_fn, bufnr) local node_type = node:type() local is_valid = false @@ -51,7 +56,7 @@ function M._get_line_for_node(node, type_patterns, transform_fn, bufnr) return line:gsub("%%", "%%%%") end ---- Gets the actual text content of a node +-- Gets the actual text content of a node -- @deprecated Use vim.treesitter.query.get_node_text -- @param node the node to get the text from -- @param bufnr the buffer containing the node @@ -64,7 +69,7 @@ function M.get_node_text(node, bufnr) return get_node_text(node, bufnr) end ---- Determines whether a node is the parent of another +-- Determines whether a node is the parent of another -- @param dest the possible parent -- @param source the possible child node function M.is_parent(dest, source) @@ -84,12 +89,12 @@ function M.is_parent(dest, source) return false end ---- Get next node with same parent --- @param node node --- @param allow_switch_parents allow switching parents if last node --- @param allow_next_parent allow next parent if last node and next parent without children +-- Get next node with same parent +---@param node TSNode +---@param allow_switch_parents? boolean allow switching parents if last node +---@param allow_next_parent? boolean allow next parent if last node and next parent without children function M.get_next_node(node, allow_switch_parents, allow_next_parent) - local destination_node + local destination_node ---@type TSNode local parent = node:parent() if not parent then @@ -116,12 +121,12 @@ function M.get_next_node(node, allow_switch_parents, allow_next_parent) return destination_node end ---- Get previous node with same parent --- @param node node --- @param allow_switch_parents allow switching parents if first node --- @param allow_previous_parent allow previous parent if first node and previous parent without children +-- Get previous node with same parent +---@param node TSNode +---@param allow_switch_parents? boolean allow switching parents if first node +---@param allow_previous_parent? boolean allow previous parent if first node and previous parent without children function M.get_previous_node(node, allow_switch_parents, allow_previous_parent) - local destination_node + local destination_node ---@type TSNode local parent = node:parent() if not parent then return @@ -148,7 +153,7 @@ function M.get_previous_node(node, allow_switch_parents, allow_previous_parent) end function M.get_named_children(node) - local nodes = {} + local nodes = {} ---@type TSNode[] for i = 0, node:named_child_count() - 1, 1 do nodes[i + 1] = node:named_child(i) end @@ -166,7 +171,7 @@ function M.get_node_at_cursor(winnr, ignore_injected_langs) return end - local root + local root ---@type TSNode|nil if ignore_injected_langs then for _, tree in ipairs(root_lang_tree:trees()) do local tree_root = tree:root() @@ -209,6 +214,9 @@ function M.get_root_for_position(line, col, root_lang_tree) return nil, nil, lang_tree end +---comment +---@param node TSNode +---@return TSNode result function M.get_root_for_node(node) local parent = node local result = node @@ -228,12 +236,17 @@ function M.highlight_node(node, buf, hl_namespace, hl_group) M.highlight_range({ node:range() }, buf, hl_namespace, hl_group) end ---- Get a compatible vim range (1 index based) from a TS node range. +-- Get a compatible vim range (1 index based) from a TS node range. -- -- TS nodes start with 0 and the end col is ending exclusive. -- They also treat a EOF/EOL char as a char ending in the first -- col of the next row. +---comment +---@param range integer[] +---@param buf integer|nil +---@return integer, integer, integer, integer function M.get_vim_range(range, buf) + ---@type integer, integer, integer, integer local srow, scol, erow, ecol = unpack(range) srow = srow + 1 scol = scol + 1 @@ -253,7 +266,9 @@ function M.get_vim_range(range, buf) end function M.highlight_range(range, buf, hl_namespace, hl_group) + ---@type integer, integer, integer, integer local start_row, start_col, end_row, end_col = unpack(range) + ---@diagnostic disable-next-line: missing-parameter vim.highlight.range(buf, hl_namespace, hl_group, { start_row, start_col }, { end_row, end_col }) end @@ -288,13 +303,15 @@ function M.update_selection(buf, node, selection_mode) end -- Byte length of node range +---@param node TSNode +---@return number function M.node_length(node) local _, _, start_byte = node:start() local _, _, end_byte = node:end_() return end_byte - start_byte end ---- @deprecated Use `vim.treesitter.is_in_node_range()` instead +---@deprecated Use `vim.treesitter.is_in_node_range()` instead function M.is_in_node_range(node, line, col) vim.notify_once( "nvim-treesitter.ts_utils.is_in_node_range is deprecated: use vim.treesitter.is_in_node_range", @@ -303,7 +320,7 @@ function M.is_in_node_range(node, line, col) return ts.is_in_node_range(node, line, col) end ---- @deprecated Use `vim.treesitter.get_node_range()` instead +---@deprecated Use `vim.treesitter.get_node_range()` instead function M.get_node_range(node_or_range) vim.notify_once( "nvim-treesitter.ts_utils.get_node_range is deprecated: use vim.treesitter.get_node_range", @@ -312,6 +329,8 @@ function M.get_node_range(node_or_range) return ts.get_node_range(node_or_range) end +---@param node TSNode +---@return table function M.node_to_lsp_range(node) local start_line, start_col, end_line, end_col = ts.get_node_range(node) local rtn = {} @@ -320,16 +339,18 @@ function M.node_to_lsp_range(node) return rtn end ---- Memoizes a function based on the buffer tick of the provided bufnr. +-- Memoizes a function based on the buffer tick of the provided bufnr. -- The cache entry is cleared when the buffer is detached to avoid memory leaks. --- @param fn: the fn to memoize, taking the bufnr as first argument --- @param options: +-- The options argument is a table with two optional values: -- - bufnr: extracts a bufnr from the given arguments. -- - key: extracts the cache key from the given arguments. --- @returns a memoized function +---@param fn function the fn to memoize, taking the buffer as first argument +---@param options? {bufnr: integer?, key: string|fun(...): string?} the memoization options +---@return function: a memoized function function M.memoize_by_buf_tick(fn, options) options = options or {} + ---@type table local cache = {} local bufnr_fn = utils.to_func(options.bufnr or utils.identity) local key_fn = utils.to_func(options.key or utils.identity) @@ -424,6 +445,7 @@ function M.goto_node(node, goto_end, avoid_set_jump) utils.set_jump() end local range = { M.get_vim_range { node:range() } } + ---@type table local position if not goto_end then position = { range[1], range[2] } diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index 9338be874..4aa8e5984 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -5,12 +5,15 @@ local luv = vim.loop local M = {} -- Wrapper around vim.notify with common options set. +---@param msg string +---@param log_level number|nil +---@param opts table|nil function M.notify(msg, log_level, opts) local default_opts = { title = "nvim-treesitter" } vim.notify(msg, log_level, vim.tbl_extend("force", default_opts, opts or {})) end --- Returns the system specific path separator. +-- Returns the system-specific path separator. ---@return string function M.get_path_sep() return (fn.has "win32" == 1 and not vim.opt.shellslash:get()) and "\\" or "/" @@ -18,10 +21,13 @@ end -- Returns a function that joins the given arguments with separator. Arguments -- can't be nil. Example: +-- --[[ -print(M.generate_join(" ")("foo", "bar")) + print(M.generate_join(" ")("foo", "bar")) --]] --- prints "foo bar" +--prints "foo bar" +---@param separator string +---@return fun(...: string): string function M.generate_join(separator) return function(...) return table.concat({ ... }, separator) @@ -32,13 +38,18 @@ M.join_path = M.generate_join(M.get_path_sep()) M.join_space = M.generate_join " " ---- Define user defined vim command which calls nvim-treesitter module function ---- - If module name is 'mod', it should be defined in hierarchy 'nvim-treesitter.mod' ---- - A table with name 'commands' should be defined in 'mod' which needs to be passed as ---- the commands param of this function ---- ----@param mod string, Name of the module that resides in the hierarchy - nvim-treesitter.module ----@param commands table, Command list for the module +---@class Command +---@field run function +---@field f_args string +---@field args string + +-- Define user defined vim command which calls nvim-treesitter module function +-- - If module name is 'mod', it should be defined in hierarchy 'nvim-treesitter.mod' +-- - A table with name 'commands' should be defined in 'mod' which needs to be passed as +-- the commands param of this function +-- +---@param mod string Name of the module that resides in the hierarchy - nvim-treesitter.module +---@param commands table Command list for the module --- - {command_name} Name of the vim user defined command, Keys: --- - {run}: (function) callback function that needs to be executed --- - {f_args}: (string, default ) @@ -46,7 +57,7 @@ M.join_space = M.generate_join " " --- - {args}: (string, optional) --- - vim command attributes --- ----Example: +---* @example --- If module is nvim-treesitter.custom_mod ---
 ---  M.commands = {
@@ -136,18 +147,22 @@ function M.get_site_dir()
 end
 
 -- Gets a property at path
--- @param tbl the table to access
--- @param path the '.' separated path
--- @returns the value at path or nil
+---@param tbl table the table to access
+---@param path string the '.' separated path
+---@return table|nil result the value at path or nil
 function M.get_at_path(tbl, path)
   if path == "" then
     return tbl
   end
+
   local segments = vim.split(path, ".", true)
+  ---@type table[]|table
   local result = tbl
 
   for _, segment in ipairs(segments) do
     if type(result) == "table" then
+      ---@type table
+      -- TODO: figure out the actual type of tbl
       result = result[segment]
     end
   end
@@ -159,17 +174,9 @@ function M.set_jump()
   vim.cmd "normal! m'"
 end
 
-function M.index_of(tbl, obj)
-  for i, o in ipairs(tbl) do
-    if o == obj then
-      return i
-    end
-  end
-end
-
 -- Filters a list based on the given predicate
--- @param tbl The list to filter
--- @param predicate The predicate to filter with
+---@param tbl any[] The list to filter
+---@param predicate fun(v:any, i:number):boolean The predicate to filter with
 function M.filter(tbl, predicate)
   local result = {}
 
@@ -184,8 +191,9 @@ end
 
 -- Returns a list of all values from the first list
 -- that are not present in the second list.
--- @params tbl1 The first table
--- @params tbl2 The second table
+---@param tbl1 any[] The first table
+---@param tbl2 any[] The second table
+---@return table
 function M.difference(tbl1, tbl2)
   return M.filter(tbl1, function(v)
     return not vim.tbl_contains(tbl2, v)
@@ -196,12 +204,19 @@ function M.identity(a)
   return a
 end
 
+-- Returns a function returning the given value
+---@param a any
+---@return fun():any
 function M.constant(a)
   return function()
     return a
   end
 end
 
+-- Returns a function that returns the given value if it is a function,
+-- otherwise returns a function that returns the given value.
+---@param a any
+---@return fun(...):any
 function M.to_func(a)
   return type(a) == "function" and a or M.constant(a)
 end
@@ -209,7 +224,10 @@ end
 ---@return string|nil
 function M.ts_cli_version()
   if fn.executable "tree-sitter" == 1 then
-    local handle = io.popen "tree-sitter  -V"
+    local handle = io.popen "tree-sitter -V"
+    if not handle then
+      return
+    end
     local result = handle:read "*a"
     handle:close()
     return vim.split(result, "\n")[1]:match "[^tree%psitter ].*"
diff --git a/scripts/update-readme.lua b/scripts/update-readme.lua
index c2a1eac9f..d21628e2c 100755
--- a/scripts/update-readme.lua
+++ b/scripts/update-readme.lua
@@ -1,4 +1,9 @@
 -- Execute as `nvim --headless -c "luafile ./scripts/update-readme.lua"`
+
+---@class Parser
+---@field name string
+---@field parser ParserInfo
+
 local parsers = require("nvim-treesitter.parsers").get_parser_configs()
 local sorted_parsers = {}
 
@@ -6,12 +11,15 @@ for k, v in pairs(parsers) do
   table.insert(sorted_parsers, { name = k, parser = v })
 end
 
+---@param a Parser
+---@param b Parser
 table.sort(sorted_parsers, function(a, b)
   return a.name < b.name
 end)
 
 local generated_text = ""
 
+---@param v Parser
 for _, v in ipairs(sorted_parsers) do
   local link = "[" .. (v.parser.readme_name or v.name) .. "](" .. v.parser.install_info.url .. ")"
 
@@ -41,7 +49,7 @@ local new_readme_text = string.gsub(
 )
 vim.fn.writefile(vim.fn.split(new_readme_text, "\n"), "README.md")
 
-if string.find(readme_text, generated_text, 1, "plain") then
+if string.find(readme_text, generated_text, 1, true) then
   print "README.md is up-to-date!"
   vim.cmd "q"
 else
diff --git a/scripts/write-lockfile.lua b/scripts/write-lockfile.lua
index 6658c8859..b8833b91e 100644
--- a/scripts/write-lockfile.lua
+++ b/scripts/write-lockfile.lua
@@ -1,10 +1,15 @@
 -- Execute as `nvim --headless -c "luafile ./scripts/write-lockfile.lua"`
+
+---@type string|any[]
 local skip_langs = vim.fn.getenv "SKIP_LOCKFILE_UPDATE_FOR_LANGS"
+
 if skip_langs == vim.NIL then
   skip_langs = {}
 else
+  ---@diagnostic disable-next-line: param-type-mismatch
   skip_langs = vim.fn.split(skip_langs, ",")
 end
+
 print("Skipping languages: " .. vim.inspect(skip_langs))
 require("nvim-treesitter.install").write_lockfile("verbose", skip_langs)
 vim.cmd "q"

From c38646edf2bdfac157ca619697ecad9ea87fd469 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Thu, 23 Feb 2023 18:44:10 -0500
Subject: [PATCH 0019/2730] feat: add cpon

---
 README.md                       |  1 +
 lockfile.json                   |  3 +++
 lua/nvim-treesitter/parsers.lua |  8 ++++++
 queries/cpon/folds.scm          |  5 ++++
 queries/cpon/highlights.scm     | 45 +++++++++++++++++++++++++++++++++
 queries/cpon/indents.scm        | 23 +++++++++++++++++
 queries/cpon/injections.scm     |  1 +
 queries/cpon/locals.scm         |  7 +++++
 8 files changed, 93 insertions(+)
 create mode 100644 queries/cpon/folds.scm
 create mode 100644 queries/cpon/highlights.scm
 create mode 100644 queries/cpon/indents.scm
 create mode 100644 queries/cpon/injections.scm
 create mode 100644 queries/cpon/locals.scm

diff --git a/README.md b/README.md
index f06919daf..bd3e47ecf 100644
--- a/README.md
+++ b/README.md
@@ -191,6 +191,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [comment](https://github.com/stsewd/tree-sitter-comment) (maintained by @stsewd)
 - [x] [commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) (maintained by @theHamsta)
 - [x] [cooklang](https://github.com/addcninblue/tree-sitter-cooklang) (maintained by @addcninblue)
+- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq)
 - [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
 - [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
 - [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)
diff --git a/lockfile.json b/lockfile.json
index 1b9623cdb..f2815bff0 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -53,6 +53,9 @@
   "cooklang": {
     "revision": "5e113412aadb78955c27010daa4dbe1d202013cf"
   },
+  "cpon": {
+    "revision": "b894a70f883d2cb7505b87a9d84a189fe8cd1982"
+  },
   "cpp": {
     "revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 1813f08dd..7b18ce7c6 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -220,6 +220,14 @@ list.cooklang = {
   maintainers = { "@addcninblue" },
 }
 
+list.cpon = {
+  install_info = {
+    url = "https://github.com/amaanq/tree-sitter-cpon",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.cpp = {
   install_info = {
     url = "https://github.com/tree-sitter/tree-sitter-cpp",
diff --git a/queries/cpon/folds.scm b/queries/cpon/folds.scm
new file mode 100644
index 000000000..02feec4e1
--- /dev/null
+++ b/queries/cpon/folds.scm
@@ -0,0 +1,5 @@
+[
+  (meta_map)
+  (map)
+  (array)
+] @fold
diff --git a/queries/cpon/highlights.scm b/queries/cpon/highlights.scm
new file mode 100644
index 000000000..f08647293
--- /dev/null
+++ b/queries/cpon/highlights.scm
@@ -0,0 +1,45 @@
+; 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)
+
+(number) @number
+
+(float) @float
+
+(boolean) @boolean
+
+(null) @constant.builtin
+
+; Punctuation
+
+[
+  ","
+  ":"
+] @punctuation.delimiter
+
+[ "{" "}" ] @punctuation.bracket
+
+[ "[" "]" ] @punctuation.bracket
+
+[ "<" ">" ] @punctuation.bracket
+
+; Comments
+
+(comment) @comment @spell
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/cpon/indents.scm b/queries/cpon/indents.scm
new file mode 100644
index 000000000..477ea83b5
--- /dev/null
+++ b/queries/cpon/indents.scm
@@ -0,0 +1,23 @@
+[
+  (meta_map)
+  (map)
+  (imap)
+  (array)
+] @indent
+
+[
+  "]"
+  "}"
+  ">"
+] @indent_end
+
+[ "{" "}" ] @branch
+
+[ "[" "]" ] @branch
+
+[ "<" ">" ] @branch
+
+[
+  (ERROR)
+  (comment)
+] @auto
diff --git a/queries/cpon/injections.scm b/queries/cpon/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/cpon/injections.scm
@@ -0,0 +1 @@
+(comment) @comment
diff --git a/queries/cpon/locals.scm b/queries/cpon/locals.scm
new file mode 100644
index 000000000..c1854af91
--- /dev/null
+++ b/queries/cpon/locals.scm
@@ -0,0 +1,7 @@
+[
+  (document) 
+
+  (meta_map)
+  (map)
+  (array)
+] @scope

From 37e7af1619cc4b40effb16b2f8b8318e53a135f4 Mon Sep 17 00:00:00 2001
From: Github Actions 
Date: Fri, 24 Feb 2023 09:15:29 +0000
Subject: [PATCH 0020/2730] Update README

---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index bd3e47ecf..c5a36c4e2 100644
--- a/README.md
+++ b/README.md
@@ -198,6 +198,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar)
 - [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @akinsho)
 - [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar)
+- [x] [dhall](https://github.com/jbellerb/tree-sitter-dhall) (maintained by @amaanq)
 - [x] [diff](https://github.com/the-mikedavis/tree-sitter-diff) (maintained by @gbprod)
 - [x] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek)
 - [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun)

From a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 03:58:50 -0500
Subject: [PATCH 0021/2730] fix(go): apply indents in a communication case in a
 select statement

---
 queries/go/indents.scm    |  1 +
 tests/indent/go/select.go | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 tests/indent/go/select.go

diff --git a/queries/go/indents.scm b/queries/go/indents.scm
index c6ac18969..e21fc8771 100644
--- a/queries/go/indents.scm
+++ b/queries/go/indents.scm
@@ -6,6 +6,7 @@
   (func_literal)
   (literal_value)
   (expression_case)
+  (communication_case)
   (default_case)
   (block)
   (call_expression)
diff --git a/tests/indent/go/select.go b/tests/indent/go/select.go
new file mode 100644
index 000000000..e3610f8f1
--- /dev/null
+++ b/tests/indent/go/select.go
@@ -0,0 +1,16 @@
+// issue #4248
+package main
+
+import (
+	"context"
+	"fmt"
+)
+
+func test(ch byte) {
+	ctx := context.TODO()
+	select {
+	case <-ctx.Done():
+		fmt.Println("indentation")
+	default:
+	}
+}

From b33ddcea5f6ded82d1df4490ef9b29426c71b639 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Fri, 24 Feb 2023 06:40:37 +0000
Subject: [PATCH 0022/2730] Update parsers: c_sharp, sql, starlark

---
 lockfile.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index f2815bff0..0fe13282c 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -30,7 +30,7 @@
     "revision": "f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2"
   },
   "c_sharp": {
-    "revision": "5b6c4d0d19d79b05c69ad752e11829910e3b4610"
+    "revision": "3a5de1b38136add719c2e4dfba64359619745ae6"
   },
   "capnp": {
     "revision": "fc6e2addf103861b9b3dffb82c543eb6b71061aa"
@@ -396,10 +396,10 @@
     "revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
   },
   "sql": {
-    "revision": "3a3f92b29c880488a08bc2baaf1aca6432ec3380"
+    "revision": "672fe6b5180d20e9e84fd61749cc3e083e88d9d9"
   },
   "starlark": {
-    "revision": "2e94347f71147c268a4c5c0ce188be8baf2fce5a"
+    "revision": "2608deac514242c9e7e5609cbfab59095997b1da"
   },
   "supercollider": {
     "revision": "90c6d9f777d2b8c4ce497c48b5f270a44bcf3ea0"

From f15d3b0322e4b48b3146abed52151d5c9e5b4910 Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Fri, 24 Feb 2023 09:48:37 +0000
Subject: [PATCH 0023/2730] feat!: remove support for used_by in parser configs

---
 lua/nvim-treesitter/parsers.lua | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 7b18ce7c6..9881e12a9 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -41,24 +41,7 @@ local filetype_to_parsername = {
 ---@type ParserInfo[]
 local list = setmetatable({}, {
   __newindex = function(table, parsername, parserconfig)
-    rawset(
-      table,
-      parsername,
-      setmetatable(parserconfig, {
-        __newindex = function(parserconfigtable, key, value)
-          if key == "used_by" then
-            require("nvim-treesitter.utils").notify(
-              "used_by is deprecated, please use 'filetype_to_parsername'",
-              vim.log.levels.WARN
-            )
-            filetype_to_parsername[value] = parsername
-          else
-            rawset(parserconfigtable, key, value)
-          end
-        end,
-      })
-    )
-
+    rawset(table, parsername, parserconfig)
     filetype_to_parsername[parserconfig.filetype or parsername] = parsername
   end,
 })

From 801ef85f931e903192463c03d919a63b6d4023f9 Mon Sep 17 00:00:00 2001
From: Lewis Russell 
Date: Fri, 24 Feb 2023 09:49:16 +0000
Subject: [PATCH 0024/2730] feat: use
 vim.treesitter.language.get_lang/add/register()

---
 README.md                       |  7 +++---
 lua/nvim-treesitter/install.lua |  8 +++++-
 lua/nvim-treesitter/parsers.lua | 43 +++++++++++++++++++++++++++++----
 3 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index c5a36c4e2..2a6ebf5e5 100644
--- a/README.md
+++ b/README.md
@@ -481,13 +481,14 @@ parser_config.zimbu = {
 }
 ```
 
-If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table:
+If you wish to set a specific parser for a filetype, you should use `vim.treesitter.language.register()`:
 
 ```lua
-local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
-ft_to_parser.someft = "python" -- the someft filetype will use the python parser and queries.
+vim.treesitter.language.register('python', 'someft')  -- the someft filetype will use the python parser and queries.
 ```
 
+Note this requires Nvim v0.9.
+
 4. Start `nvim` and `:TSInstall zimbu`.
 
 You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`.
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 6a72c6cef..a82da7885 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -54,7 +54,13 @@ local function reattach_if_possible_fn(lang, error_on_fail)
     for _, buf in ipairs(vim.api.nvim_list_bufs()) do
       if parsers.get_buf_lang(buf) == lang then
         vim._ts_remove_language(lang)
-        local ok, err = pcall(vim.treesitter.language.require_language, lang)
+        local ok, err
+        if vim.treesitter.language.add then
+          local ft = vim.bo[buf].filetype
+          ok, err = pcall(vim.treesitter.language.add, lang, { filetype = ft })
+        else
+          ok, err = pcall(vim.treesitter.language.require_language, lang)
+        end
         if not ok and error_on_fail then
           vim.notify("Could not load parser for " .. lang .. ": " .. vim.inspect(err))
         end
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 9881e12a9..4769c95f0 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1,7 +1,31 @@
 local api = vim.api
 local ts = vim.treesitter
 
-local filetype_to_parsername = {
+local new_lang_api = ts.language.register ~= nil
+
+local filetype_to_parsername = {}
+
+if new_lang_api then
+  filetype_to_parsername = setmetatable({}, {
+    __newindex = function(_, k, v)
+      require("nvim-treesitter.utils").notify(
+        "filetype_to_parsername is deprecated, please use 'vim.treesitter.language.register'",
+        vim.log.levels.WARN
+      )
+      ts.language.register(v, k)
+    end,
+  })
+end
+
+local function register_lang(lang, ft)
+  if new_lang_api then
+    ts.language.register(lang, ft)
+    return
+  end
+  filetype_to_parsername[ft] = lang
+end
+
+for ft, lang in pairs {
   javascriptreact = "javascript",
   ecma = "javascript",
   jsx = "javascript",
@@ -20,7 +44,9 @@ local filetype_to_parsername = {
   tape = "vhs",
   dosini = "ini",
   confini = "ini",
-}
+} do
+  register_lang(lang, ft)
+end
 
 ---@class InstallInfo
 ---@field url string
@@ -42,7 +68,7 @@ local filetype_to_parsername = {
 local list = setmetatable({}, {
   __newindex = function(table, parsername, parserconfig)
     rawset(table, parsername, parserconfig)
-    filetype_to_parsername[parserconfig.filetype or parsername] = parsername
+    register_lang(parsername, parserconfig.filetype or parsername)
   end,
 })
 
@@ -1524,13 +1550,20 @@ local M = {
   filetype_to_parsername = filetype_to_parsername,
 }
 
+local function get_lang(ft)
+  if new_lang_api then
+    return ts.language.get_lang(ft)
+  end
+  return filetype_to_parsername[ft]
+end
+
 function M.ft_to_lang(ft)
-  local result = filetype_to_parsername[ft]
+  local result = get_lang(ft)
   if result then
     return result
   else
     ft = vim.split(ft, ".", { plain = true })[1]
-    return filetype_to_parsername[ft] or ft
+    return get_lang(ft) or ft
   end
 end
 

From 84b047e4242d68c29117b677cdf1b4574f8e5137 Mon Sep 17 00:00:00 2001
From: Matthieu Coudron 
Date: Fri, 24 Feb 2023 11:02:45 +0100
Subject: [PATCH 0025/2730] fix(ci): remove double 'uses'

which invalidates the action
---
 .github/workflows/release.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 865753c16..c1491f0fa 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -7,8 +7,7 @@ jobs:
   luarocks-upload:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
-        uses: nvim-neorocks/luarocks-tag-release@v1.0.2
+      - uses: nvim-neorocks/luarocks-tag-release@v1.0.2
         env:
           LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
         with:

From b401b7423d18c78371c5ff1a5f8d3c14292b2047 Mon Sep 17 00:00:00 2001
From: Matthieu Coudron 
Date: Fri, 24 Feb 2023 14:00:22 +0100
Subject: [PATCH 0026/2730] ci: bump release workflow

new version adds 'make' support and should fix the release job
---
 .github/workflows/release.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c1491f0fa..03b4d4e35 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -7,7 +7,7 @@ jobs:
   luarocks-upload:
     runs-on: ubuntu-latest
     steps:
-      - uses: nvim-neorocks/luarocks-tag-release@v1.0.2
+      - uses: nvim-neorocks/luarocks-tag-release@v2.2.0
         env:
           LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
         with:

From 5c511dd1244fc8eeccf8920a5a4754ae01da296e Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 07:42:04 -0500
Subject: [PATCH 0027/2730] feat(solidity): use maintained parser and update
 highlights accordingly

---
 README.md                                |   2 +-
 lockfile.json                            |   2 +-
 lua/nvim-treesitter/parsers.lua          |   6 +-
 queries/solidity/highlights.scm          | 218 ++++++++++++++---------
 tests/query/highlights/solidity/test.sol |   8 +-
 5 files changed, 138 insertions(+), 98 deletions(-)

diff --git a/README.md b/README.md
index 2a6ebf5e5..091a47e90 100644
--- a/README.md
+++ b/README.md
@@ -303,7 +303,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton)
 - [x] [smali](https://git.sr.ht/~yotam/tree-sitter-smali) (maintained by @amaanq)
 - [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol)
-- [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie)
+- [x] [solidity](https://github.com/JoranHonig/tree-sitter-solidity) (maintained by @amaanq)
 - [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis)
 - [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride)
 - [x] [starlark](https://github.com/amaanq/tree-sitter-starlark) (maintained by @amaanq)
diff --git a/lockfile.json b/lockfile.json
index 0fe13282c..ca9770ad7 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -390,7 +390,7 @@
     "revision": "cf8c7eb9faf7c7049839585eac19c94af231e6a0"
   },
   "solidity": {
-    "revision": "52ed0880c0126df2f2c7693f215fe6f38e4a2e0a"
+    "revision": "168020304759ad5d8b4a88a541a699134e3730c5"
   },
   "sparql": {
     "revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 4769c95f0..de31f4196 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1235,11 +1235,11 @@ list.smithy = {
 
 list.solidity = {
   install_info = {
-    url = "https://github.com/YongJieYongJie/tree-sitter-solidity",
-    branch = "with-generated-c-code",
+    url = "https://github.com/JoranHonig/tree-sitter-solidity",
+    branch = "master",
     files = { "src/parser.c" },
   },
-  maintainers = { "@YongJieYongJie" },
+  maintainers = { "@amaanq" },
 }
 
 list.sparql = {
diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm
index 33c837d5c..5afebb990 100644
--- a/queries/solidity/highlights.scm
+++ b/queries/solidity/highlights.scm
@@ -1,73 +1,75 @@
-(comment) @comment
-;; Handles natspec comments
-((comment) @preproc
- (#match? @preproc "^/// .*"))
-
 ; Pragma
-(pragma_directive) @attribute
 
+[
+  "pragma" 
+  "solidity"
+] @preproc
+
+(solidity_pragma_token
+  "||" @symbol)
+(solidity_pragma_token
+  "-" @symbol)
+
+(solidity_version_comparison_operator) @operator
 
 ; Literals
+
 [
  (string)
- (hex_string_literal)
- (unicode_string_literal)
  (yul_string_literal)
 ] @string
+
+(hex_string_literal
+  "hex" @symbol
+  (_) @string)
+
+(unicode_string_literal
+  "unicode" @symbol
+  (_) @string)
+
 [
  (number_literal)
  (yul_decimal_number)
  (yul_hex_number)
 ] @number
-[
- (true)
- (false)
-] @constant.builtin
 
+(yul_boolean) @boolean
 
 ; Type
 (type_name (identifier) @type)
-(type_name "mapping" @type)
-(primitive_type) @type
+(type_name "mapping" @function.builtin)
+
+[
+  (primitive_type)
+  (number_unit)
+] @type.builtin
+
 (contract_declaration name: (identifier) @type)
-(struct_declaration struct_name: (identifier) @type)
+(struct_declaration name: (identifier) @type)
 (struct_member name: (identifier) @field)
-(enum_declaration enum_type_name: (identifier) @type)
+(enum_declaration name: (identifier) @type)
 (emit_statement . (identifier) @type)
 ; Handles ContractA, ContractB in function foo() override(ContractA, contractB) {}
-(override_specifier (identifier) @type)
-; Ensures that delimiters in mapping( ... => .. ) are not colored like types
-(type_name
-  "(" @punctuation.bracket
-  "=>" @punctuation.delimiter
-  ")" @punctuation.bracket)
-
+(override_specifier (user_defined_type) @type)
 
 ; Functions and parameters
 
 (function_definition
-  function_name:  (identifier) @function)
+  name:  (identifier) @function)
 (modifier_definition
   name:  (identifier) @function)
 (yul_evm_builtin) @function.builtin
 
 ; Use constructor coloring for special functions
 (constructor_definition "constructor" @constructor)
-(fallback_receive_definition "receive" @constructor)
-(fallback_receive_definition "fallback" @constructor)
 
 (modifier_invocation (identifier) @function)
 
 ; Handles expressions like structVariable.g();
-(call_expression . (member_expression (property_identifier) @method.call))
+(call_expression . (member_expression (identifier) @method.call))
 
 ; Handles expressions like g();
 (call_expression . (identifier) @function.call)
-(function_definition
- function_name: (identifier) @function)
-
-; Handles the field in struct literals like MyStruct({MyField: MyVar * 2})
-(call_expression (identifier) @field . ":")
 
 ; Function parameters
 (event_paramater name: (identifier) @parameter)
@@ -81,100 +83,123 @@
 
 (meta_type_expression "type" @keyword)
 
-(member_expression (property_identifier) @field)
-(property_identifier) @field
-(struct_expression ((identifier) @field . ":"))
+(member_expression property: (identifier) @field)
+(call_struct_argument name: (identifier) @field)
+(struct_field_assignment name: (identifier) @field)
 (enum_value) @constant
 
 
 ; Keywords
 [
- "contract"
- "interface"
- "library"
- "is"
- "struct"
- "enum"
- "event"
- "assembly"
- "emit"
- "modifier"
- "var"
- (virtual)
- (override_specifier)
+  "contract"
+  "interface"
+  "library"
+  "is"
+  "struct"
+  "enum"
+  "event"
+  "assembly"
+  "emit"
+  "override"
+  "modifier"
+  "var"
+  "let"
+  "emit"
+  "fallback"
+  "receive"
+  (virtual)
 ] @keyword
 
+; FIXME: update grammar
+; (block_statement "unchecked" @keyword)
+
+(event_paramater "indexed" @keyword)
+
 [
- "public"
- "internal"
- "private"
- "external"
- "pure"
- "view"
- "payable"
+  "public"
+  "internal"
+  "private"
+  "external"
+  "pure"
+  "view"
+  "payable"
+  (immutable)
 ] @type.qualifier
 
 [
- "memory"
- "storage"
- "calldata"
- (constant)
+  "memory"
+  "storage"
+  "calldata"
+  "constant"
 ] @storageclass
 
 [
- "for"
- "while"
- "do"
+  "for"
+  "while"
+  "do"
+  "break"
+  "continue"
 ] @repeat
 
 [
- "break"
- "continue"
- "if"
- "else"
- "switch"
- "case"
- "default"
+  "if"
+  "else"
+  "switch"
+  "case"
+  "default"
 ] @conditional
 
+(ternary_expression
+  "?" @conditional.ternary
+  ":" @conditional.ternary)
+
 [
- "try"
- "catch"
+  "try"
+  "catch"
+  "revert"
 ] @exception
 
 [
- "return"
- "returns"
- (yul_leave)
+  "return"
+  "returns"
+  (yul_leave)
 ] @keyword.return
 
 "function" @keyword.function
 
-"pragma" @preproc
-
-["import" "using"] @include
+[
+  "import" 
+  "using"
+] @include
 (import_directive "as" @include)
 (import_directive "from" @include)
-
-(event_paramater "indexed" @keyword)
+(import_directive "*" @character.special)
 
 ; Punctuation
 
-[
-  "("
-  ")"
-  "["
-  "]"
-  "{"
-  "}"
-] @punctuation.bracket
+[ "{" "}" ] @punctuation.bracket
 
+[ "[" "]" ] @punctuation.bracket
+
+[ "(" ")" ] @punctuation.bracket
 
 [
   "."
   ","
+  ; FIXME: update grammar
+  ; (semicolon)
+  "->"
+  "=>"
 ] @punctuation.delimiter
 
+(call_struct_argument
+  ":" @punctuation.delimiter)
+(slice_access
+  ":" @punctuation.delimiter)
+(struct_field_assignment
+  ":" @punctuation.delimiter)
+(yul_label 
+  ":" @punctuation.delimiter)
 
 ; Operators
 
@@ -206,12 +231,27 @@
   "+"
   "++"
   "--"
+  ":="
 ] @operator
 
+(yul_assignment
+  ":" @operator
+  "=" @operator)
+
 [
   "delete"
   "new"
 ] @keyword.operator
 
-(identifier) @variable
-(yul_identifier) @variable
+[
+  (identifier)
+  (yul_identifier)
+] @variable
+
+; Comments
+
+(comment) @comment @spell
+
+; Errors
+
+(ERROR) @error
diff --git a/tests/query/highlights/solidity/test.sol b/tests/query/highlights/solidity/test.sol
index a4b642ee6..062970fdd 100644
--- a/tests/query/highlights/solidity/test.sol
+++ b/tests/query/highlights/solidity/test.sol
@@ -4,13 +4,13 @@
 // ^ comment
 pragma solidity >=0.7.0 <0.9.0;
 // ^ preproc
-//     ^ attribute
+//     ^ preproc
 
 import * as something from "anotherFile";
 // ^     ^            ^ include
 
 /// @title Voting with delegation.
-//  ^ preproc
+// <- comment
 contract Ballot {
 // ^keyword
 //       ^ type
@@ -20,7 +20,7 @@ contract Ballot {
     struct Voter {
 //         ^ type
         uint weight; // weight is accumulated by delegation
-//      ^ type
+//      ^ type.builtin
 //           ^ field
         bool voted;  // if true, that person already voted
         address delegate; // person delegated to
@@ -34,7 +34,7 @@ contract Ballot {
     }
 
     address public chairperson;
-//  ^ type
+//  ^ type.builtin
 
     // This declares a state variable that
     // stores a `Voter` struct for each possible address.

From 68ab44277cd3eca7c5f1d227f153bd4e56d6303f Mon Sep 17 00:00:00 2001
From: SzeLamC 
Date: Sat, 25 Feb 2023 05:06:31 +0800
Subject: [PATCH 0028/2730] fix(dart): add `@indent_end` to  } (#4167)

* fix dart indentation after }

* add some simple test case
---
 queries/dart/indents.scm     |  4 ++++
 tests/indent/dart/class.dart |  4 ++++
 tests/indent/dart_spec.lua   | 20 ++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/indent/dart/class.dart
 create mode 100644 tests/indent/dart_spec.lua

diff --git a/queries/dart/indents.scm b/queries/dart/indents.scm
index e01cc238d..ad0ba389e 100644
--- a/queries/dart/indents.scm
+++ b/queries/dart/indents.scm
@@ -21,6 +21,10 @@
   "]"
 ] @branch
 
+[
+ "}"
+] @indent_end
+
 ; this one is for dedenting the else block
 (if_statement (block) @branch)
 
diff --git a/tests/indent/dart/class.dart b/tests/indent/dart/class.dart
new file mode 100644
index 000000000..0402cc677
--- /dev/null
+++ b/tests/indent/dart/class.dart
@@ -0,0 +1,4 @@
+void main() {
+}
+class Test {
+}
diff --git a/tests/indent/dart_spec.lua b/tests/indent/dart_spec.lua
new file mode 100644
index 000000000..8b05cc753
--- /dev/null
+++ b/tests/indent/dart_spec.lua
@@ -0,0 +1,20 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/dart", {
+  tabstop = 4,
+  shiftwidth = 2,
+  softtabstop = 0,
+  expandtab = true,
+})
+
+describe("indent Lua:", function()
+  describe("whole file:", function()
+    run:whole_file(".", {
+      expected_failures = {},
+    })
+  end)
+end)
+
+describe("new line:", function()
+  run:new_line("class.dart", { on_line = 2, text = "var x;", indent = 0 })
+end)

From 2ad12932a26a429750b3343199afd60b93c97b72 Mon Sep 17 00:00:00 2001
From: ExpandingMan 
Date: Fri, 24 Feb 2023 16:19:46 -0500
Subject: [PATCH 0029/2730] docs: add small note in README clarifying custom
 parser installation (#3625)

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 091a47e90..fdc603100 100644
--- a/README.md
+++ b/README.md
@@ -471,7 +471,7 @@ local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
 parser_config.zimbu = {
   install_info = {
     url = "~/projects/tree-sitter-zimbu", -- local path or git repo
-    files = {"src/parser.c"},
+    files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
     -- optional entries:
     branch = "main", -- default branch in case of git repo if different from master
     generate_requires_npm = false, -- if stand-alone parser without npm dependencies

From e138c066f7e33464655bd064341483867c43d1fe Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Thu, 23 Feb 2023 23:50:55 -0500
Subject: [PATCH 0030/2730] feat(health): sort parser list for clarity

---
 lua/nvim-treesitter/parsers.lua | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index de31f4196..0eec2f116 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1570,12 +1570,14 @@ end
 -- Get a list of all available parsers
 ---@return string[]
 function M.available_parsers()
+  local parsers = vim.tbl_keys(M.list)
+  table.sort(parsers)
   if vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 then
-    return vim.tbl_keys(M.list)
+    return parsers
   else
     return vim.tbl_filter(function(p) ---@param p string
       return not M.list[p].install_info.requires_generate_from_grammar
-    end, vim.tbl_keys(M.list))
+    end, parsers)
   end
 end
 

From 06e8a91ce2aac663023d40cf57965ffade72c792 Mon Sep 17 00:00:00 2001
From: Tomas Sandven 
Date: Thu, 7 Apr 2022 10:39:46 +0200
Subject: [PATCH 0031/2730] Add YANG indentation tests

---
 tests/indent/yang/module.yang | 58 +++++++++++++++++++++++++++++++++++
 tests/indent/yang_spec.lua    | 23 ++++++++++++++
 2 files changed, 81 insertions(+)
 create mode 100644 tests/indent/yang/module.yang
 create mode 100644 tests/indent/yang_spec.lua

diff --git a/tests/indent/yang/module.yang b/tests/indent/yang/module.yang
new file mode 100644
index 000000000..29c911fa0
--- /dev/null
+++ b/tests/indent/yang/module.yang
@@ -0,0 +1,58 @@
+module test-module {
+  yang-version 1.1;
+  namespace "http://example.com";
+  prefix test;
+
+  import ietf-inet-types { prefix inet; }
+  import tailf-ncs {
+    prefix ncs;
+  }
+
+  description "Multi-line strings has indentation
+               aligned with the first line.";
+
+  typedef foo {
+    type enumeration {
+      enum "foo";
+      enum "bar";
+    }
+  }
+
+  ncs:plan-outline test-nano-service {
+    description "Testing indentation of extension statements.";
+
+    ncs:component-type "ncs:self" {
+      ncs:state "ncs:init" {
+        ncs:create {
+          ncs:nano-callback;
+        }
+      }
+      ncs:state "ncs:ready";
+    }
+
+    ncs:component-type "alloc:resource-allocator" {
+      ncs:state "ncs:init";
+      ncs:state "alloc:resources-allocated";
+      ncs:state "ncs:ready";
+    }
+  }
+
+  container test {
+  }
+
+  augment /alloc:resource-allocator {
+    description "Augmentation for the resource allocator mock services.";
+
+    list test-nano-service {
+      key "id";
+
+      leaf id {
+        type string;
+        description
+          "I'm a multi-line string
+
+           Starting on the next line from the statement.";
+      }
+    }
+  }
+}
diff --git a/tests/indent/yang_spec.lua b/tests/indent/yang_spec.lua
new file mode 100644
index 000000000..c5ff2c886
--- /dev/null
+++ b/tests/indent/yang_spec.lua
@@ -0,0 +1,23 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/yang", {
+  tabstop = 2,
+  shiftwidth = 2,
+  softtabstop = 0,
+  expandtab = true,
+})
+
+describe("indent YANG:", function()
+  describe("whole file:", function()
+    run:whole_file(".", {
+      expected_failures = {},
+    })
+  end)
+
+  describe("new line:", function()
+    run:new_line("module.yang", { on_line = 12, text = "# Aligned indentation ended", indent = 2 })
+    run:new_line("module.yang", { on_line = 37, text = "# Test", indent = 2 })
+    run:new_line("module.yang", { on_line = 40, text = "# Test", indent = 4 })
+    run:new_line("module.yang", { on_line = 52, text = "Aligned string!", indent = 4 })
+  end)
+end)

From 061ee1b98f928a928771f35bba5deb6ad74a15b1 Mon Sep 17 00:00:00 2001
From: Tomas Sandven 
Date: Sat, 17 Dec 2022 22:58:02 +0100
Subject: [PATCH 0032/2730] Fix broken YANG indent tests

---
 tests/indent/yang_spec.lua | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/indent/yang_spec.lua b/tests/indent/yang_spec.lua
index c5ff2c886..618d260c6 100644
--- a/tests/indent/yang_spec.lua
+++ b/tests/indent/yang_spec.lua
@@ -15,9 +15,9 @@ describe("indent YANG:", function()
   end)
 
   describe("new line:", function()
-    run:new_line("module.yang", { on_line = 12, text = "# Aligned indentation ended", indent = 2 })
-    run:new_line("module.yang", { on_line = 37, text = "# Test", indent = 2 })
-    run:new_line("module.yang", { on_line = 40, text = "# Test", indent = 4 })
-    run:new_line("module.yang", { on_line = 52, text = "Aligned string!", indent = 4 })
+    run:new_line("module.yang", { on_line = 12, text = "// Aligned indentation ended", indent = 2 })
+    run:new_line("module.yang", { on_line = 37, text = "// Test", indent = 4 })
+    run:new_line("module.yang", { on_line = 40, text = "// Test", indent = 4 })
+    run:new_line("module.yang", { on_line = 52, text = "Aligned string!", indent = 11 })
   end)
 end)

From 028b7dfbddffdd4738a25a76b280d9b26f38ce42 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Thu, 23 Feb 2023 04:42:37 -0500
Subject: [PATCH 0033/2730] feat: add bicep

---
 README.md                       |   1 +
 lockfile.json                   |   3 +
 lua/nvim-treesitter/parsers.lua |   8 ++
 queries/bicep/folds.scm         |  25 ++++
 queries/bicep/highlights.scm    | 230 ++++++++++++++++++++++++++++++++
 queries/bicep/indents.scm       |  18 +++
 queries/bicep/injections.scm    |   4 +
 queries/bicep/locals.scm        |  74 ++++++++++
 8 files changed, 363 insertions(+)
 create mode 100644 queries/bicep/folds.scm
 create mode 100644 queries/bicep/highlights.scm
 create mode 100644 queries/bicep/indents.scm
 create mode 100644 queries/bicep/injections.scm
 create mode 100644 queries/bicep/locals.scm

diff --git a/README.md b/README.md
index fdc603100..7510dfc07 100644
--- a/README.md
+++ b/README.md
@@ -181,6 +181,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [bash](https://github.com/tree-sitter/tree-sitter-bash) (maintained by @TravonteD)
 - [x] [beancount](https://github.com/polarmutex/tree-sitter-beancount) (maintained by @polarmutex)
 - [x] [bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) (maintained by @theHamsta, @clason)
+- [x] [bicep](https://github.com/amaanq/tree-sitter-bicep) (maintained by @amaanq)
 - [x] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus)
 - [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @vigoux)
 - [x] [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) (maintained by @Luxed)
diff --git a/lockfile.json b/lockfile.json
index ca9770ad7..4e685055d 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -23,6 +23,9 @@
   "bibtex": {
     "revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34"
   },
+  "bicep": {
+    "revision": "b94a0983b69ebb75e9129329a188199ad6ebcec0"
+  },
   "blueprint": {
     "revision": "6ef91ca8270f0112b9c6d27ecb9966c741a5d103"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 0eec2f116..4d7f9baf4 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -144,6 +144,14 @@ list.bibtex = {
   maintainers = { "@theHamsta", "@clason" },
 }
 
+list.bicep = {
+  install_info = {
+    url = "https://github.com/amaanq/tree-sitter-bicep",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.blueprint = {
   install_info = {
     url = "https://gitlab.com/gabmus/tree-sitter-blueprint.git",
diff --git a/queries/bicep/folds.scm b/queries/bicep/folds.scm
new file mode 100644
index 000000000..8ec5ba200
--- /dev/null
+++ b/queries/bicep/folds.scm
@@ -0,0 +1,25 @@
+[
+  (module_declaration)
+  (metadata_declaration)
+  (output_declaration)
+  (parameter_declaration)
+  (resource_declaration)
+  (type_declaration)
+  (variable_declaration)
+
+  (parenthesized_expression)
+
+  (decorators)
+  (array)
+  (object)
+
+  (if_statement)
+  (for_statement)
+
+  (subscript_expression)
+  (ternary_expression)
+
+  (string)
+
+  (comment)
+] @fold
diff --git a/queries/bicep/highlights.scm b/queries/bicep/highlights.scm
new file mode 100644
index 000000000..07c2c4efa
--- /dev/null
+++ b/queries/bicep/highlights.scm
@@ -0,0 +1,230 @@
+; Includes
+
+(import_statement
+  "import" @include)
+
+(import_with_statement
+  "import" @include
+  "with" @include)
+
+; Namespaces
+
+(module_declaration
+  (identifier) @namespace)
+
+; Builtins
+
+(primitive_type) @type.builtin
+
+((member_expression
+  object: (identifier) @type.builtin)
+  (#match? @type.builtin "^sys$"))
+
+; Functions
+
+(call_expression
+  function: (identifier) @function.call)
+
+; Properties
+
+(object_property
+  (identifier) @property
+  ":" @punctuation.delimiter
+  (_))
+
+(object_property
+  (compatible_identifier) @property
+  ":" @punctuation.delimiter
+  (_))
+
+(property_identifier) @property
+
+; Attributes
+
+(decorator
+  "@" @attribute)
+
+(decorator
+  (call_expression (identifier) @attribute))
+
+(decorator
+  (call_expression
+    (member_expression
+	  object: (identifier) @attribute
+	  property: (property_identifier) @attribute)))
+
+; Types
+
+(type_declaration
+  (identifier) @type)
+
+(type_declaration
+  (identifier)
+  "="
+  (identifier) @type)
+
+(type_declaration
+  (identifier)
+  "="
+  (array_type (identifier) @type))
+
+(type
+  (identifier) @type)
+
+(resource_declaration
+  (identifier) @type)
+
+(resource_expression
+  (identifier) @type)
+
+; Parameters
+
+(parameter_declaration
+  (identifier) @parameter
+  (_))
+
+(call_expression
+  function: (_) 
+  (arguments (identifier) @parameter))
+
+(call_expression
+  function: (_) 
+  (arguments (member_expression object: (identifier) @parameter)))
+
+; Variables
+
+(variable_declaration
+  (identifier) @variable
+  (_))
+
+(metadata_declaration
+  (identifier) @variable
+  (_))
+
+(output_declaration
+  (identifier) @variable
+  (_))
+
+(object_property
+  (_)
+  ":"
+  (identifier) @variable)
+
+(for_statement
+  "for"
+  (for_loop_parameters
+    (loop_variable) @variable
+    (loop_enumerator) @variable))
+
+; Conditionals
+
+"if" @conditional
+
+(ternary_expression
+  "?" @conditional.ternary
+  ":" @conditional.ternary)
+
+; Loops
+
+(for_statement
+  "for" @repeat
+  "in"
+  ":" @punctuation.delimiter)
+
+; Keywords
+
+[
+  "module"
+  "metadata"
+  "output"
+  "param"
+  "resource"
+  "existing"
+  "targetScope"
+  "type"
+  "var"
+] @keyword
+
+; Operators
+
+[
+  "+"
+  "-"
+  "*"
+  "/"
+  "%"
+  "||"
+  "&&"
+  "|"
+  "=="
+  "!="
+  "=~"
+  "!~"
+  ">"
+  ">="
+  "<="
+  "<"
+  "??"
+  "="
+  "!"
+] @operator
+
+[
+  "in"
+] @keyword.operator
+
+
+; Literals
+
+(string) @string
+(import_string
+  "'" @string
+  (import_name) @namespace
+  "@" @symbol
+  (import_version) @string.special)
+
+(escape_sequence) @string.escape
+
+(number) @number
+
+(boolean) @boolean
+
+(null) @constant.builtin
+
+; Misc
+
+(compatible_identifier
+  "?" @punctuation.special)
+
+(nullable_return_type) @punctuation.special
+
+["{" "}"] @punctuation.bracket
+
+["[" "]"] @punctuation.bracket
+
+["(" ")"] @punctuation.bracket
+
+[
+  "."
+  "::"
+  "=>"
+] @punctuation.delimiter
+
+
+; Interpolation
+
+(interpolation) @none
+
+(interpolation
+  "${" @punctuation.special
+  "}" @punctuation.special)
+
+(interpolation
+  (identifier) @variable)
+
+; Comments
+
+[
+  (comment)
+  (diagnostic_comment)
+] @comment @spell
diff --git a/queries/bicep/indents.scm b/queries/bicep/indents.scm
new file mode 100644
index 000000000..7fcf7ffb9
--- /dev/null
+++ b/queries/bicep/indents.scm
@@ -0,0 +1,18 @@
+[
+  (array)
+  (object)
+] @indent
+
+"}" @indent_end
+
+[ "{" "}" ] @branch
+
+[ "[" "]" ] @branch
+
+[ "(" ")" ] @branch
+
+[
+  (ERROR)
+  (comment)
+  (diagnostic_comment)
+] @auto
diff --git a/queries/bicep/injections.scm b/queries/bicep/injections.scm
new file mode 100644
index 000000000..c85cfe3b6
--- /dev/null
+++ b/queries/bicep/injections.scm
@@ -0,0 +1,4 @@
+[
+ (comment)
+ (diagnostic_comment)
+] @comment
diff --git a/queries/bicep/locals.scm b/queries/bicep/locals.scm
new file mode 100644
index 000000000..361be94fb
--- /dev/null
+++ b/queries/bicep/locals.scm
@@ -0,0 +1,74 @@
+; Scopes
+
+[
+  (infrastructure)
+  (call_expression)
+
+  (lambda_expression)
+  (subscript_expression)
+
+  (if_statement)
+  (for_statement)
+
+  (array)
+  (object)
+  (interpolation)
+] @scope
+
+; References
+
+(property_identifier) @reference
+
+(call_expression
+  (identifier) @reference)
+
+(object_property
+  (_)
+  ":"
+  (identifier) @reference)
+
+(resource_expression
+  (identifier) @reference)
+
+; Definitions
+
+(type) @definition.associated
+
+(object_property
+  (identifier) @definition.field
+  (_))
+
+(object_property
+  (compatible_identifier) @definition.field
+  (_))
+
+(import_name) @definition.import
+
+(module_declaration
+  (identifier) @definition.namespace)
+
+(parameter_declaration
+  (identifier) @definition.parameter
+  (_))
+
+(type_declaration
+  (identifier) @definition.type
+  (_))
+
+(variable_declaration
+  (identifier) @definition.var
+  (_))
+
+(metadata_declaration
+  (identifier) @definition.var
+  (_))
+
+(output_declaration
+  (identifier) @definition.var
+  (_))
+
+(for_statement
+  "for"
+  (for_loop_parameters
+    (loop_variable) @definition.var
+    (loop_enumerator) @definition.var))

From a744ed1b274b586a00dcb39dc0da7ba264758efb Mon Sep 17 00:00:00 2001
From: Stephen Bolton 
Date: Sun, 5 Feb 2023 15:56:46 -0500
Subject: [PATCH 0034/2730] Fix elixir `@function` captures

When viewing the previous rule in the `TSPlayground` the `@function`
captures were not actually matching. This led all functions to get the
`@function.call` group applied to them. This change makes it so that the
capture now works and where functions are defined will get the
`@function` group.
---
 queries/elixir/highlights.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm
index c3aee40c7..d87afcf1b 100644
--- a/queries/elixir/highlights.scm
+++ b/queries/elixir/highlights.scm
@@ -111,9 +111,10 @@
   "defp"
   "defprotocol"
   "defstruct"
-)) (arguments [
-  (identifier) @function
-  (binary_operator left: (identifier) @function operator: "when")])?)
+  ))
+  (arguments [
+    (call (identifier) @function)
+    (binary_operator left: (call target: (identifier) @function) operator: "when")])?)
 
 ; Kernel Keywords & Special Forms
 (call target: ((identifier) @keyword (#any-of? @keyword

From 22de3532cc0a8d8f3bf70962723f5c9a4058852c Mon Sep 17 00:00:00 2001
From: Nat Williams 
Date: Thu, 2 Feb 2023 09:31:22 -0600
Subject: [PATCH 0035/2730] also pass the node to the statusline transform fn

---
 lua/nvim-treesitter/ts_utils.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua
index 6b330fda4..f0cccc2cc 100644
--- a/lua/nvim-treesitter/ts_utils.lua
+++ b/lua/nvim-treesitter/ts_utils.lua
@@ -51,7 +51,7 @@ function M._get_line_for_node(node, type_patterns, transform_fn, bufnr)
   if not is_valid then
     return ""
   end
-  local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""))
+  local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""), node)
   -- Escape % to avoid statusline to evaluate content as expression
   return line:gsub("%%", "%%%%")
 end

From 34adfe8e95d31ba21c274ad11c6e16472ba5ef65 Mon Sep 17 00:00:00 2001
From: Nat Williams 
Date: Thu, 2 Feb 2023 09:42:18 -0600
Subject: [PATCH 0036/2730] update docs for transform_fn

to reflect additional node argument
---
 doc/nvim-treesitter.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index 61507cb58..f2da04203 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -445,7 +445,7 @@ Default options (lua syntax):
   {
     indicator_size = 100,
     type_patterns = {'class', 'function', 'method'},
-    transform_fn = function(line) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
+    transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
     separator = ' -> '
   }
 <
@@ -453,7 +453,8 @@ Default options (lua syntax):
   the beginning.
 - `type_patterns` - Which node type patterns to match.
 - `transform_fn` - Function used to transform the single item in line. By
-  default removes opening brackets and spaces from end.
+  default removes opening brackets and spaces from end. Takes two arguments:
+  the text of the line in question, and the corresponding treesitter node.
 - `separator` - Separator between nodes.
 
 						  *nvim_treesitter#foldexpr()*

From 3fab7abf6f653eb92eee74c19ce5e655536ced87 Mon Sep 17 00:00:00 2001
From: Nat Williams 
Date: Thu, 2 Feb 2023 13:16:44 -0600
Subject: [PATCH 0037/2730] add statusline option to dedupe or not

---
 doc/nvim-treesitter.txt            |  4 +++-
 lua/nvim-treesitter/statusline.lua | 10 ++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index f2da04203..f8ac369bd 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -446,7 +446,8 @@ Default options (lua syntax):
     indicator_size = 100,
     type_patterns = {'class', 'function', 'method'},
     transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
-    separator = ' -> '
+    separator = ' -> ',
+    dedupe = true
   }
 <
 - `indicator_size` - How long should the string be. If longer, it is cut from
@@ -456,6 +457,7 @@ Default options (lua syntax):
   default removes opening brackets and spaces from end. Takes two arguments:
   the text of the line in question, and the corresponding treesitter node.
 - `separator` - Separator between nodes.
+- `dedupe` - Whether or not to remove duplicate components.
 
 						  *nvim_treesitter#foldexpr()*
 nvim_treesitter#foldexpr()~
diff --git a/lua/nvim-treesitter/statusline.lua b/lua/nvim-treesitter/statusline.lua
index cd75fcb00..fde7def2b 100644
--- a/lua/nvim-treesitter/statusline.lua
+++ b/lua/nvim-treesitter/statusline.lua
@@ -21,6 +21,10 @@ function M.statusline(opts)
   local type_patterns = options.type_patterns or { "class", "function", "method" }
   local transform_fn = options.transform_fn or transform_line
   local separator = options.separator or " -> "
+  local dedupe = options.dedupe
+  if dedupe == nil then
+    dedupe = true
+  end
 
   local current_node = ts_utils.get_node_at_cursor()
   if not current_node then
@@ -32,8 +36,10 @@ function M.statusline(opts)
 
   while expr do
     local line = ts_utils._get_line_for_node(expr, type_patterns, transform_fn, bufnr)
-    if line ~= "" and not vim.tbl_contains(lines, line) then
-      table.insert(lines, 1, line)
+    if line ~= "" then
+      if not dedupe or not vim.tbl_contains(lines, line) then
+        table.insert(lines, 1, line)
+      end
     end
     expr = expr:parent()
   end

From 20a8f30ace9fa9209b1c345311a36e91ab2f6d1d Mon Sep 17 00:00:00 2001
From: Nat Williams 
Date: Thu, 2 Feb 2023 13:26:20 -0600
Subject: [PATCH 0038/2730] use positive option "allow_duplicates" instead of
 negative "dedupe"

---
 doc/nvim-treesitter.txt            | 4 ++--
 lua/nvim-treesitter/statusline.lua | 7 ++-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index f8ac369bd..884f334eb 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -447,7 +447,7 @@ Default options (lua syntax):
     type_patterns = {'class', 'function', 'method'},
     transform_fn = function(line, _node) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
     separator = ' -> ',
-    dedupe = true
+    allow_duplicates = false
   }
 <
 - `indicator_size` - How long should the string be. If longer, it is cut from
@@ -457,7 +457,7 @@ Default options (lua syntax):
   default removes opening brackets and spaces from end. Takes two arguments:
   the text of the line in question, and the corresponding treesitter node.
 - `separator` - Separator between nodes.
-- `dedupe` - Whether or not to remove duplicate components.
+- `allow_duplicates` - Whether or not to remove duplicate components.
 
 						  *nvim_treesitter#foldexpr()*
 nvim_treesitter#foldexpr()~
diff --git a/lua/nvim-treesitter/statusline.lua b/lua/nvim-treesitter/statusline.lua
index fde7def2b..68ba41aca 100644
--- a/lua/nvim-treesitter/statusline.lua
+++ b/lua/nvim-treesitter/statusline.lua
@@ -21,10 +21,7 @@ function M.statusline(opts)
   local type_patterns = options.type_patterns or { "class", "function", "method" }
   local transform_fn = options.transform_fn or transform_line
   local separator = options.separator or " -> "
-  local dedupe = options.dedupe
-  if dedupe == nil then
-    dedupe = true
-  end
+  local allow_duplicates = options.allow_duplicates or false
 
   local current_node = ts_utils.get_node_at_cursor()
   if not current_node then
@@ -37,7 +34,7 @@ function M.statusline(opts)
   while expr do
     local line = ts_utils._get_line_for_node(expr, type_patterns, transform_fn, bufnr)
     if line ~= "" then
-      if not dedupe or not vim.tbl_contains(lines, line) then
+      if allow_duplicates or not vim.tbl_contains(lines, line) then
         table.insert(lines, 1, line)
       end
     end

From fe80f7c2bbd216f5a26fe28c91bb335ef9ad8ec2 Mon Sep 17 00:00:00 2001
From: Philipp Mildenberger 
Date: Mon, 20 Feb 2023 18:05:10 +0100
Subject: [PATCH 0039/2730] feat: add ungrammar

---
 README.md                        |  1 +
 lockfile.json                    |  3 +++
 lua/nvim-treesitter/parsers.lua  |  8 ++++++++
 queries/ungrammar/folds.scm      |  1 +
 queries/ungrammar/highlights.scm | 30 ++++++++++++++++++++++++++++++
 queries/ungrammar/indents.scm    |  6 ++++++
 queries/ungrammar/injections.scm |  2 ++
 queries/ungrammar/locals.scm     |  7 +++++++
 8 files changed, 58 insertions(+)
 create mode 100644 queries/ungrammar/folds.scm
 create mode 100644 queries/ungrammar/highlights.scm
 create mode 100644 queries/ungrammar/indents.scm
 create mode 100644 queries/ungrammar/injections.scm
 create mode 100644 queries/ungrammar/locals.scm

diff --git a/README.md b/README.md
index 7510dfc07..74de9992b 100644
--- a/README.md
+++ b/README.md
@@ -325,6 +325,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @BonaBeavis)
 - [x] [twig](https://github.com/gbprod/tree-sitter-twig) (maintained by @gbprod)
 - [x] [typescript](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
+- [x] [ungrammar](https://github.com/Philipp-M/tree-sitter-ungrammar) (maintained by @Philipp-M, @amaanq)
 - [x] [v](https://github.com/vlang/vls) (maintained by @kkharji)
 - [x] [vala](https://github.com/vala-lang/tree-sitter-vala) (maintained by @Prince781)
 - [x] [verilog](https://github.com/tree-sitter/tree-sitter-verilog) (maintained by @zegervdv)
diff --git a/lockfile.json b/lockfile.json
index 4e685055d..6c6516d4f 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -455,6 +455,9 @@
   "typescript": {
     "revision": "5d20856f34315b068c41edaee2ac8a100081d259"
   },
+  "ungrammar": {
+    "revision": "5275e45d1edb16aab4f0d63a3aa15b61ef033a9c"
+  },
   "v": {
     "revision": "136f3a0ad91ab8a781c2d4eb419df0a981839f69"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 4d7f9baf4..c570343bd 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1451,6 +1451,14 @@ list.typescript = {
   maintainers = { "@steelsojka" },
 }
 
+list.ungrammar = {
+  install_info = {
+    url = "https://github.com/Philipp-M/tree-sitter-ungrammar",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@Philipp-M", "@amaanq" },
+}
+
 list.v = {
   install_info = {
     url = "https://github.com/vlang/vls",
diff --git a/queries/ungrammar/folds.scm b/queries/ungrammar/folds.scm
new file mode 100644
index 000000000..206c4bed8
--- /dev/null
+++ b/queries/ungrammar/folds.scm
@@ -0,0 +1 @@
+(node) @fold
diff --git a/queries/ungrammar/highlights.scm b/queries/ungrammar/highlights.scm
new file mode 100644
index 000000000..027c6e008
--- /dev/null
+++ b/queries/ungrammar/highlights.scm
@@ -0,0 +1,30 @@
+(comment) @comment
+
+(definition) @keyword
+
+(identifier) @variable
+
+(label_name) @label
+
+(token) @string
+
+[
+  "="
+  "|"
+] @operator
+
+[
+  "*"
+  "?"
+] @repeat
+
+[
+  ":"
+] @punctuation.delimiter
+
+[
+  "("
+  ")"
+] @punctuation.bracket
+
+(ERROR) @error
diff --git a/queries/ungrammar/indents.scm b/queries/ungrammar/indents.scm
new file mode 100644
index 000000000..d4b7c085d
--- /dev/null
+++ b/queries/ungrammar/indents.scm
@@ -0,0 +1,6 @@
+(node) @indent
+
+[
+  (ERROR)
+  (comment)
+] @auto
diff --git a/queries/ungrammar/injections.scm b/queries/ungrammar/injections.scm
new file mode 100644
index 000000000..35c0af746
--- /dev/null
+++ b/queries/ungrammar/injections.scm
@@ -0,0 +1,2 @@
+(comment) @comment
+
diff --git a/queries/ungrammar/locals.scm b/queries/ungrammar/locals.scm
new file mode 100644
index 000000000..9fd87e637
--- /dev/null
+++ b/queries/ungrammar/locals.scm
@@ -0,0 +1,7 @@
+(grammar) @scope
+
+(definition) @definition
+
+(label_name) @definition.label
+
+(identifier) @reference

From 53695580e38d9ab5f858e8966275f1992bd2e2ec Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Thu, 23 Feb 2023 23:19:59 -0500
Subject: [PATCH 0040/2730] feat(dart): add folds

---
 queries/dart/folds.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 queries/dart/folds.scm

diff --git a/queries/dart/folds.scm b/queries/dart/folds.scm
new file mode 100644
index 000000000..ea398a4b3
--- /dev/null
+++ b/queries/dart/folds.scm
@@ -0,0 +1,15 @@
+[
+  (class_definition)
+  (enum_declaration)
+  (extension_declaration)
+
+  (arguments)
+  (function_body)
+
+  (block)
+  (switch_block)
+
+  (list_literal)
+  (set_or_map_literal)
+  (string_literal)
+] @fold

From df968afd9dd444990c0e7844c92aa20603e9ced1 Mon Sep 17 00:00:00 2001
From: Kiyoon Kim 
Date: Tue, 7 Feb 2023 06:25:27 +0000
Subject: [PATCH 0041/2730] goto_node select last character when in
 operator-pending mode

---
 lua/nvim-treesitter/ts_utils.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua
index f0cccc2cc..373bae340 100644
--- a/lua/nvim-treesitter/ts_utils.lua
+++ b/lua/nvim-treesitter/ts_utils.lua
@@ -452,6 +452,14 @@ function M.goto_node(node, goto_end, avoid_set_jump)
   else
     position = { range[3], range[4] }
   end
+
+  -- Enter visual mode if we are in operator pending mode
+  -- If we don't do this, it will miss the last character.
+  local mode = vim.api.nvim_get_mode()
+  if mode.mode == "no" then
+    vim.cmd "normal! v"
+  end
+
   -- Position is 1, 0 indexed.
   api.nvim_win_set_cursor(0, { position[1], position[2] - 1 })
 end

From ad8798795c71a00e796e1919c905a6bf815e9359 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Sat, 25 Feb 2023 06:39:20 +0000
Subject: [PATCH 0042/2730] Update parsers: cpon, javascript, perl, tsx,
 typescript

---
 lockfile.json | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 6c6516d4f..2d4359501 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -57,7 +57,7 @@
     "revision": "5e113412aadb78955c27010daa4dbe1d202013cf"
   },
   "cpon": {
-    "revision": "b894a70f883d2cb7505b87a9d84a189fe8cd1982"
+    "revision": "eedb93bf9e22e82ed6a67e6c57fd78731b44f591"
   },
   "cpp": {
     "revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819"
@@ -216,7 +216,7 @@
     "revision": "3c24aa9365985830421a3a7b6791b415961ea770"
   },
   "javascript": {
-    "revision": "266455e22fc54f0add4dd2404ebe307d4d65deae"
+    "revision": "5720b249490b3c17245ba772f6be4a43edb4e3b7"
   },
   "jq": {
     "revision": "13990f530e8e6709b7978503da9bc8701d366791"
@@ -309,7 +309,7 @@
     "revision": "9e995404ddff8319631d72d4b46552e737206912"
   },
   "perl": {
-    "revision": "749d26fe13fb131b92e6515416096e572575b981"
+    "revision": "3e4b9cad82a3e7e45390b751528dce581eb092b7"
   },
   "php": {
     "revision": "f860e598194f4a71747f91789bf536b393ad4a56"
@@ -444,7 +444,7 @@
     "revision": "8bd2056818b21860e3d756b5a58c4f6e05fb744e"
   },
   "tsx": {
-    "revision": "5d20856f34315b068c41edaee2ac8a100081d259"
+    "revision": "c6e56d44c686a67c89e29e773e662567285d610f"
   },
   "turtle": {
     "revision": "085437f5cb117703b7f520dd92161140a684f092"
@@ -453,7 +453,7 @@
     "revision": "2457993b13a06dec2706e6a6c3d5b65bb23024b8"
   },
   "typescript": {
-    "revision": "5d20856f34315b068c41edaee2ac8a100081d259"
+    "revision": "c6e56d44c686a67c89e29e773e662567285d610f"
   },
   "ungrammar": {
     "revision": "5275e45d1edb16aab4f0d63a3aa15b61ef033a9c"

From 248a87ef6587b7ccfaaf4b6b405cec50849b0f8c Mon Sep 17 00:00:00 2001
From: Benny Powers 
Date: Thu, 13 Oct 2022 18:04:04 +0300
Subject: [PATCH 0043/2730] feat(ecma): add innerHTML injection

---
 queries/ecma/injections.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm
index 6bd5da862..a901f34b3 100644
--- a/queries/ecma/injections.scm
+++ b/queries/ecma/injections.scm
@@ -67,3 +67,18 @@
 
 (((template_string) @_template_string
  (#match? @_template_string "^`#graphql")) @graphql)
+
+; el.innerHTML = ``
+(assignment_expression
+  left: (member_expression
+          property: (property_identifier) @_prop
+          (#eq? @_prop "innerHTML"))
+  right: (template_string) @html
+    (#offset! @html 0 1 0 -1))
+; el.innerHTML = ''
+(assignment_expression
+   left: (member_expression
+           property: (property_identifier) @_prop
+           (#eq? @_prop "innerHTML"))
+   right: (string) @html
+            (#offset! @html 0 1 0 -1))

From 8d2f9903f11542c3363353a65a8e08adfcca9d29 Mon Sep 17 00:00:00 2001
From: Benny Powers 
Date: Thu, 13 Oct 2022 18:08:56 +0300
Subject: [PATCH 0044/2730] feat(ecma): include outerHTML and innerHTML

---
 queries/ecma/injections.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/queries/ecma/injections.scm b/queries/ecma/injections.scm
index a901f34b3..43596ecb2 100644
--- a/queries/ecma/injections.scm
+++ b/queries/ecma/injections.scm
@@ -72,13 +72,14 @@
 (assignment_expression
   left: (member_expression
           property: (property_identifier) @_prop
-          (#eq? @_prop "innerHTML"))
+          (#match? @_prop "(out|inn)erHTML"))
   right: (template_string) @html
     (#offset! @html 0 1 0 -1))
+
 ; el.innerHTML = ''
 (assignment_expression
    left: (member_expression
            property: (property_identifier) @_prop
-           (#eq? @_prop "innerHTML"))
+           (#match? @_prop "(out|inn)erHTML"))
    right: (string) @html
             (#offset! @html 0 1 0 -1))

From 4f8f4fe4c13939093e070da077698796a034fd7f Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sun, 26 Feb 2023 00:21:41 +0100
Subject: [PATCH 0045/2730] fix: do not recommend removing bundled parsers

---
 lua/nvim-treesitter/install.lua | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index a82da7885..ba8cada87 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -643,8 +643,7 @@ function M.uninstall(...)
                 vim.notify(
                   "Tried to uninstall parser for "
                     .. lang
-                    .. "! But the parser is still installed (not by nvim-treesitter)."
-                    .. " Please delete the following files manually: "
+                    .. "! But the parser is still installed (not by nvim-treesitter):"
                     .. table.concat(all_parsers_after_deletion, ", "),
                   vim.log.levels.ERROR
                 )

From b4d8b7e5a374b800838a13aa6829ac4d542c6f1c Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Sun, 26 Feb 2023 06:39:18 +0000
Subject: [PATCH 0046/2730] Update parsers: clojure, latex, perl

---
 lockfile.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 2d4359501..b038fc74e 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -42,7 +42,7 @@
     "revision": "3baf22e7e507cedf15d1dbc03df8afa50a625586"
   },
   "clojure": {
-    "revision": "262d6d60f39f0f77b3dd08da8ec895bd5a044416"
+    "revision": "421546c2547c74d1d9a0d8c296c412071d37e7ca"
   },
   "cmake": {
     "revision": "399605a02bcd5daa309ce63a6459c600dce3473f"
@@ -249,7 +249,7 @@
     "revision": "7744b56f03ac1e5643fad23c9dd90837fe97291e"
   },
   "latex": {
-    "revision": "6b7ea839307670e6bda011f888717d3a882ecc09"
+    "revision": "376f64097b7a26691a2ca60dc94e4dfa417be932"
   },
   "ledger": {
     "revision": "f787ae635ca79589faa25477b94291a87e2d3e23"
@@ -309,7 +309,7 @@
     "revision": "9e995404ddff8319631d72d4b46552e737206912"
   },
   "perl": {
-    "revision": "3e4b9cad82a3e7e45390b751528dce581eb092b7"
+    "revision": "c43bae0090cfcfc62d9904312599ded1b645a66d"
   },
   "php": {
     "revision": "f860e598194f4a71747f91789bf536b393ad4a56"

From 50709361378fa37d455b21fb716169416888314f Mon Sep 17 00:00:00 2001
From: Benny Powers 
Date: Mon, 17 Oct 2022 21:13:17 +0300
Subject: [PATCH 0047/2730] feat(html): lit attr binding interpolation

---
 queries/html_tags/injections.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/queries/html_tags/injections.scm b/queries/html_tags/injections.scm
index 1c8cdf6ab..c29619281 100644
--- a/queries/html_tags/injections.scm
+++ b/queries/html_tags/injections.scm
@@ -63,4 +63,14 @@
    (quoted_attribute_value (attribute_value) @css))
  (#eq? @_attr "style"))
 
+; lit-html style template interpolation
+((attribute
+  (quoted_attribute_value (attribute_value) @javascript))
+  (#match? @javascript "\\$\\{")
+  (#offset! @javascript 0 2 0 -1))
+((attribute
+  (attribute_value) @javascript)
+  (#match? @javascript "\\$\\{")
+  (#offset! @javascript 0 2 0 -2))
+
 (comment) @comment

From a9f0b1c2ba1d70de9189e1ade0e65346ad08849b Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Mon, 27 Feb 2023 06:41:13 +0000
Subject: [PATCH 0048/2730] Update parsers: c_sharp, fortran, swift

---
 lockfile.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index b038fc74e..a3e3f471e 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -33,7 +33,7 @@
     "revision": "f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2"
   },
   "c_sharp": {
-    "revision": "3a5de1b38136add719c2e4dfba64359619745ae6"
+    "revision": "fc6be5ae61c8788e0c028e757f132d67bfc538f5"
   },
   "capnp": {
     "revision": "fc6e2addf103861b9b3dffb82c543eb6b71061aa"
@@ -123,7 +123,7 @@
     "revision": "c238f4af9a5723a212cf1a4c9b31dd5c1d5270a2"
   },
   "fortran": {
-    "revision": "67cf1c96fd0dd92edd7812a95626c86c9be0781a"
+    "revision": "31552ac43ecaffa443a12ebea68cc526d334892f"
   },
   "fsh": {
     "revision": "fa3347712f7a59ed02ccf508284554689c6cde28"
@@ -414,7 +414,7 @@
     "revision": "52e122ae68b316d3aa960a0a422d3645ba717f42"
   },
   "swift": {
-    "revision": "0c32d2948b79939b6464d9ced40fca43912cd486"
+    "revision": "c249318113629435c75c7eedfd5d5bfcb4b6d12a"
   },
   "sxhkdrc": {
     "revision": "440d5f913d9465c9c776a1bd92334d32febcf065"

From cf718048ca2a43701931ccba445cf17502641d53 Mon Sep 17 00:00:00 2001
From: Uy Ha 
Date: Mon, 27 Feb 2023 15:26:11 +0000
Subject: [PATCH 0049/2730] simplify cmake highlight queries

---
 queries/cmake/highlights.scm | 138 +----------------------------------
 1 file changed, 2 insertions(+), 136 deletions(-)

diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index 0e846507d..b96323420 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -97,143 +97,9 @@
 )
 
 (normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^set$")
-  (
-    (argument) @constant
-    (#any-of? @constant "PARENT_SCOPE")
-  ) .
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^set$")
-  . (argument)
-  (
-    (argument) @_cache @storageclass
-    .
-    (argument) @_type @type
-    (#any-of? @_cache "CACHE")
-    (#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL")
-  )
-)
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^set$")
-  . (argument)
-  (argument) @_cache
-  (#any-of? @_cache "CACHE")
-  (
-    (argument) @_force @constant
-    (#any-of? @_force "FORCE")
-  ) .
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^unset$")
-  . (argument) @variable
-)
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^unset$")
-  . (argument)
-  (argument) @storageclass
-  (#any-of? @storageclass "CACHE" "PARENT_SCOPE")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^list$")
-  . (argument) @constant
-  (#any-of? @constant "LENGTH" "GET" "JOIN" "SUBLIST" "FIND")
-  . (argument) @variable
-  (argument) @variable . 
-)
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^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) @_transform @constant
-  . (argument) @variable
-  . (argument) @_action @constant
-  (#match? @_transform "TRANSFORM")
-  (#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE")
-)
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^list$")
-  . (argument) @_transform @constant
-  . (argument) @variable
-  . (argument) @_action @constant
-  . (argument)? @_selector @constant
-  (#match? @_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) @_transform @constant
-  (argument) @constant .
-  (argument) @variable
-  (#match? @_transform "TRANSFORM")
-  (#match? @constant "OUTPUT_VARIABLE")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^add_custom_target$")
-  . (argument)
+  (identifier)
   (argument) @constant
-  (#any-of? @constant "ALL" "COMMAND" "DEPENDS" "BYPRODUCTS" "WORKING_DIRECTORY" "COMMENT"
-                   "JOB_POOL" "VERBATIM" "USES_TERMINAL" "COMMAND_EXPAND_LISTS" "SOURCES")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^add_custom_command$")
-  (argument) @constant
-  (#any-of? @constant "OUTPUT" "COMMAND" "MAIN_DEPENDENCY" "DEPENDS" "BYPRODUCTS" "IMPLICIT_DEPENDS" "WORKING_DIRECTORY"
-                      "COMMENT" "DEPFILE" "JOB_POOL" "VERBATIM" "APPEND" "USES_TERMINAL" "COMMAND_EXPAND_LISTS")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^include$")
-  (argument) @constant
-  (#any-of? @constant "OPTIONAL" "NO_POLICY_SCOPE")
-)
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^include$")
-  (argument) @constant
-  .
-  (argument) @variable
-  (#match? @constant "RESULT_VARIABLE")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^project$")
-  (argument) @constant
-  (#any-of? @constant "VERSION" "DESCRIPTION" "HOMEPAGE_URL" "LANGUAGES")
-)
-
-(normal_command
-  (identifier) @_function
-  (#match? @_function "\\c^cmake_minimum_required$")
-  (argument) @constant
-  (#any-of? @constant "VERSION" "FATAL_ERROR")
+  (#match? @constant "^[A-Z][A-Z_]+$")
 )
 
 (escape_sequence) @string.escape

From a5a6590f157608f2c90c3bb674c2fe019931a020 Mon Sep 17 00:00:00 2001
From: Uy Ha 
Date: Mon, 27 Feb 2023 15:31:47 +0000
Subject: [PATCH 0050/2730] only match unquoted arguments

---
 queries/cmake/highlights.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index b96323420..576e19cd8 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -91,15 +91,15 @@
 )
 
 (normal_command
-  (identifier) @_function
-  . (argument) @variable
-  (#match? @_function "\\c^set$")
+  (identifier)
+  (argument (unquoted_argument)) @constant
+  (#match? @constant "^[A-Z][A-Z_]+$")
 )
 
 (normal_command
-  (identifier)
-  (argument) @constant
-  (#match? @constant "^[A-Z][A-Z_]+$")
+  (identifier) @_function
+  . (argument) @variable
+  (#match? @_function "\\c^set$")
 )
 
 (escape_sequence) @string.escape

From 28475d5676c478c55ecc293c75b10bcb782467df Mon Sep 17 00:00:00 2001
From: Uy Ha 
Date: Mon, 27 Feb 2023 16:55:01 +0000
Subject: [PATCH 0051/2730] add highlighting for elseif

---
 queries/cmake/highlights.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index 576e19cd8..f528a04dc 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -84,6 +84,18 @@
                               "VERSION_LESS" "VERSION_GREATER" "VERSION_EQUAL" "VERSION_LESS_EQUAL" "VERSION_GREATER_EQUAL"
   )
 )
+(elseif_command
+  (elseif)
+  (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

From 04b87c7b6e9a4cb81e5f21aba689811c8bed85dc Mon Sep 17 00:00:00 2001
From: Uy Ha 
Date: Mon, 27 Feb 2023 20:21:40 +0100
Subject: [PATCH 0052/2730] move the catch uppercase query to the top to make
 it overridable, add back the more useful queries

---
 queries/cmake/highlights.scm | 77 ++++++++++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 4 deletions(-)

diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index f528a04dc..8a471fd1c 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -1,3 +1,9 @@
+(normal_command
+  (identifier)
+  (argument (unquoted_argument)) @constant
+  (#match? @constant "^[A-Z][A-Z_]+$")
+)
+
 [
  (quoted_argument)
  (bracket_argument)
@@ -103,15 +109,78 @@
 )
 
 (normal_command
-  (identifier)
-  (argument (unquoted_argument)) @constant
-  (#match? @constant "^[A-Z][A-Z_]+$")
+  (identifier) @_function
+  . (argument) @variable
+  (#match? @_function "\\c^set$")
 )
 
 (normal_command
   (identifier) @_function
-  . (argument) @variable
   (#match? @_function "\\c^set$")
+  . (argument)
+  (
+    (argument) @_cache @storageclass
+    .
+    (argument) @_type @type
+    (#any-of? @_cache "CACHE")
+    (#any-of? @_type "BOOL" "FILEPATH" "PATH" "STRING" "INTERNAL")
+  )
+)
+
+(normal_command
+  (identifier) @_function
+  (#match? @_function "\\c^unset$")
+  . (argument)
+  (argument) @storageclass
+  (#any-of? @storageclass "CACHE" "PARENT_SCOPE")
+)
+
+(normal_command
+  (identifier) @_function
+  (#match? @_function "\\c^list$")
+  . (argument) @constant
+  (#any-of? @constant "LENGTH" "GET" "JOIN" "SUBLIST" "FIND")
+  . (argument) @variable
+  (argument) @variable . 
+)
+(normal_command
+  (identifier) @_function
+  (#match? @_function "\\c^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) @_transform @constant
+  . (argument) @variable
+  . (argument) @_action @constant
+  (#match? @_transform "TRANSFORM")
+  (#any-of? @_action "APPEND" "PREPEND" "TOUPPER" "TOLOWER" "STRIP" "GENEX_STRIP" "REPLACE")
+)
+(normal_command
+  (identifier) @_function
+  (#match? @_function "\\c^list$")
+  . (argument) @_transform @constant
+  . (argument) @variable
+  . (argument) @_action @constant
+  . (argument)? @_selector @constant
+  (#match? @_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) @_transform @constant
+  (argument) @constant .
+  (argument) @variable
+  (#match? @_transform "TRANSFORM")
+  (#match? @constant "OUTPUT_VARIABLE")
 )
 
 (escape_sequence) @string.escape

From b9a7591b6c23c983256d034bedd5f509edc6351d Mon Sep 17 00:00:00 2001
From: Philipp Mildenberger 
Date: Mon, 20 Feb 2023 17:55:06 +0100
Subject: [PATCH 0053/2730] feat: add yuck

---
 README.md                       |   1 +
 lockfile.json                   |   3 +
 lua/nvim-treesitter/parsers.lua |   9 ++
 queries/yuck/folds.scm          |   9 ++
 queries/yuck/highlights.scm     | 209 ++++++++++++++++++++++++++++++++
 queries/yuck/indents.scm        |  25 ++++
 queries/yuck/injections.scm     |   1 +
 queries/yuck/locals.scm         |  21 ++++
 8 files changed, 278 insertions(+)
 create mode 100644 queries/yuck/folds.scm
 create mode 100644 queries/yuck/highlights.scm
 create mode 100644 queries/yuck/indents.scm
 create mode 100644 queries/yuck/injections.scm
 create mode 100644 queries/yuck/locals.scm

diff --git a/README.md b/README.md
index 74de9992b..9ba980f97 100644
--- a/README.md
+++ b/README.md
@@ -336,6 +336,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) (maintained by @theHamsta)
 - [x] [yaml](https://github.com/ikatyang/tree-sitter-yaml) (maintained by @stsewd)
 - [x] [yang](https://github.com/Hubro/tree-sitter-yang) (maintained by @Hubro)
+- [x] [yuck](https://github.com/Philipp-M/tree-sitter-yuck) (maintained by @Philipp-M, @amaanq)
 - [x] [zig](https://github.com/maxxnino/tree-sitter-zig) (maintained by @maxxnino)
 
 
diff --git a/lockfile.json b/lockfile.json
index a3e3f471e..410e06557 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -488,6 +488,9 @@
   "yang": {
     "revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502"
   },
+  "yuck": {
+    "revision": "607bf03cc78912cbaa85a3d373af21ddeaef5b41"
+  },
   "zig": {
     "revision": "6b3f5788f38be900b45f5af5a753bf6a37d614b8"
   }
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index c570343bd..75efd7fca 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1551,6 +1551,15 @@ list.yang = {
   filetype = "yang",
 }
 
+list.yuck = {
+  install_info = {
+    url = "https://github.com/Philipp-M/tree-sitter-yuck",
+    files = { "src/parser.c", "src/scanner.c" },
+  },
+  maintainers = { "@Philipp-M", "@amaanq" },
+  filetype = "yuck",
+}
+
 list.zig = {
   install_info = {
     url = "https://github.com/maxxnino/tree-sitter-zig",
diff --git a/queries/yuck/folds.scm b/queries/yuck/folds.scm
new file mode 100644
index 000000000..bad5a07c9
--- /dev/null
+++ b/queries/yuck/folds.scm
@@ -0,0 +1,9 @@
+[
+  (ast_block)
+  (list)
+  (array)
+  (expr)
+  (json_array)
+  (json_object)
+  (parenthesized_expression)
+] @fold
diff --git a/queries/yuck/highlights.scm b/queries/yuck/highlights.scm
new file mode 100644
index 000000000..8b2ca5814
--- /dev/null
+++ b/queries/yuck/highlights.scm
@@ -0,0 +1,209 @@
+; Tags
+
+(list
+  (symbol) @tag)
+
+; Includes
+
+((symbol) @include
+  (#match? @include "include"))
+
+; Keywords
+
+((symbol) @keyword
+  (#any-of? @keyword "defwindow" "defwidget" "defvar" "defpoll" "deflisten" "for" "geometry" "children" "struts"))
+
+; Functions
+
+(function_call
+  name: (ident) @function.call)
+
+; Variables
+
+(array
+  (symbol) @variable)
+
+(binary_expression
+	(simplexpr
+    (ident) @variable))
+
+(unary_expression
+	(simplexpr
+    (ident) @variable))
+
+(ternary_expression
+	(simplexpr
+		(ident) @variable))
+
+(array
+  (symbol) @variable)
+
+(json_access
+	(simplexpr
+		(ident) @variable))
+
+(json_safe_access
+	(simplexpr
+		(ident) @variable))
+
+(json_array
+	(simplexpr
+    (ident) @variable))
+
+(json_dot_access
+	(simplexpr
+		(ident) @variable))
+
+(json_safe_dot_access
+	(simplexpr
+		(ident) @variable))
+
+(json_object
+  (_)
+  ":"
+	(simplexpr
+		(ident) @variable))
+
+; Properties & Fields
+
+(keyword) @property
+
+(json_access
+  (_)
+  "["
+	(simplexpr
+		(ident) @property))
+
+(json_safe_access
+  (_)
+  "?."
+  "["
+	(simplexpr
+		(ident) @property))
+
+(json_dot_access
+  (index) @property)
+
+(json_safe_dot_access
+  (index) @property)
+
+(json_object
+	(simplexpr
+		(ident) @field))
+
+; Operators
+
+[
+  "+"
+  "-"
+  "*"
+  "/"
+  "%"
+	"&&"
+  "||"
+  "=="
+  "!="
+  "=~"
+	">="
+	"<="
+  ">"
+  "<"
+	"?:"
+	"?."
+  "!"
+] @operator
+
+(ternary_expression
+  ["?" ":"] @conditional.ternary)
+
+; Properties & Fields
+
+(keyword) @property
+
+(json_access
+  (_)
+  "["
+	(simplexpr
+		(ident) @property))
+
+(json_safe_access
+  (_)
+  "?."
+  "["
+	(simplexpr
+		(ident) @property))
+
+(json_dot_access
+  (index) @property)
+
+(json_safe_dot_access
+  (index) @property)
+
+(json_object
+	(simplexpr
+		(ident) @field))
+
+; Operators
+
+[
+  "+"
+  "-"
+  "*"
+  "/"
+  "%"
+  "||"
+  "&&"
+  "=="
+  "!="
+  "=~"
+  ">"
+  "<"
+  ">="
+  "<="
+  "!"
+  "?."
+] @operator
+
+(ternary_expression
+  ["?" ":"] @conditional.ternary)
+
+; Punctuation
+
+[
+  ":"
+  "."
+  ","
+] @punctuation.delimiter
+
+["{" "}" "[" "]" "(" ")"] @punctuation.bracket
+
+; Literals
+
+(number) @number
+
+(float) @float
+
+(boolean) @boolean
+
+; Strings
+
+[ (string_fragment) "\"" "'" "`" ] @string
+
+(string_interpolation
+  "${" @punctuation.special
+  "}" @punctuation.special)
+
+(escape_sequence) @string.escape
+
+; Comments
+
+(comment) @comment @spell
+
+; Other stuff that has not been catched by the previous queries yet
+
+(ident) @variable
+(index) @property
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/yuck/indents.scm b/queries/yuck/indents.scm
new file mode 100644
index 000000000..b53ba75dd
--- /dev/null
+++ b/queries/yuck/indents.scm
@@ -0,0 +1,25 @@
+[
+  (ast_block)
+  (array)
+  (expr)
+  (json_array)
+  (json_object)
+  (parenthesized_expression)
+] @indent
+
+; TODO: can't get this to work, goal is to indent at the property ":" prefix
+; ((list (identifier) (property)) @aligned_indent
+;   (#set! "delimiter" ":"))
+
+[")" "}" "]"] @indent_end
+
+[ "{" "}" ] @branch
+
+[ "(" ")" ] @branch
+
+[ "[" "]" ] @branch
+
+[
+ (ERROR)
+ (comment)
+] @auto
diff --git a/queries/yuck/injections.scm b/queries/yuck/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/yuck/injections.scm
@@ -0,0 +1 @@
+(comment) @comment
diff --git a/queries/yuck/locals.scm b/queries/yuck/locals.scm
new file mode 100644
index 000000000..677281b0b
--- /dev/null
+++ b/queries/yuck/locals.scm
@@ -0,0 +1,21 @@
+[
+  (ast_block)
+  (list)
+  (array)
+  (expr)
+  (json_array)
+  (json_object)
+  (parenthesized_expression)
+] @scope
+
+(symbol) @reference
+
+(keyword) @definition.field
+
+(json_object
+	(simplexpr
+    (ident) @definition.field))
+
+(ast_block
+  (symbol)
+  (ident) @definition.type)

From e2a9fc8e5c15e1be1b9ce1210d2b2667707d1ae5 Mon Sep 17 00:00:00 2001
From: Uy Ha 
Date: Tue, 28 Feb 2023 02:11:09 +0100
Subject: [PATCH 0054/2730] use lua-match where possible

---
 queries/cmake/highlights.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/queries/cmake/highlights.scm b/queries/cmake/highlights.scm
index 8a471fd1c..055319978 100644
--- a/queries/cmake/highlights.scm
+++ b/queries/cmake/highlights.scm
@@ -1,7 +1,7 @@
 (normal_command
   (identifier)
   (argument (unquoted_argument)) @constant
-  (#match? @constant "^[A-Z][A-Z_]+$")
+  (#lua-match? @constant "^%u[%u_]+$")
 )
 
 [
@@ -186,4 +186,4 @@
 (escape_sequence) @string.escape
 
 ((source_file . (line_comment) @preproc)
-  (#match? @preproc "^#!/"))
+  (#lua-match? @preproc "^#!/"))

From 5cfb5d776812296a7b77d0d74d63a5f77df22327 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Sat, 25 Feb 2023 19:40:08 -0500
Subject: [PATCH 0055/2730] feat(fortran): update highlight queries

---
 README.md                       |   2 +-
 lua/nvim-treesitter/parsers.lua |   1 +
 queries/fortran/highlights.scm  | 382 ++++++++++++++++++++++----------
 3 files changed, 265 insertions(+), 120 deletions(-)

diff --git a/README.md b/README.md
index 9ba980f97..ce129942b 100644
--- a/README.md
+++ b/README.md
@@ -214,7 +214,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [fennel](https://github.com/travonted/tree-sitter-fennel) (maintained by @TravonteD)
 - [x] [fish](https://github.com/ram02z/tree-sitter-fish) (maintained by @ram02z)
 - [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience)
-- [ ] [fortran](https://github.com/stadelmanma/tree-sitter-fortran)
+- [x] [fortran](https://github.com/stadelmanma/tree-sitter-fortran) (maintained by @amaanq)
 - [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
 - [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)
 - [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 75efd7fca..fa5795335 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -443,6 +443,7 @@ list.fortran = {
     url = "https://github.com/stadelmanma/tree-sitter-fortran",
     files = { "src/parser.c", "src/scanner.cc" },
   },
+  maintainers = { "@amaanq" },
 }
 
 list.fsh = {
diff --git a/queries/fortran/highlights.scm b/queries/fortran/highlights.scm
index 95839184a..4604e9a92 100644
--- a/queries/fortran/highlights.scm
+++ b/queries/fortran/highlights.scm
@@ -1,96 +1,224 @@
-(identifier) @variable
-(string_literal) @string
-(number_literal) @number
-(boolean_literal) @boolean
-(comment) @comment
+; Preprocs
+
+(preproc_file_line) @preproc
+
+; Namespaces
+
+(program_statement
+  (name) @namespace)
+
+(end_program_statement
+  (name) @namespace)
+
+(module_statement
+  (name) @namespace)
+
+(end_module_statement
+  (name) @namespace)
+
+(submodule_statement
+  (name) @namespace)
+
+(end_submodule_statement
+  (name) @namespace)
+
+; Includes
 
 [
-  (intrinsic_type)
-  "pointer"
-] @type
-
-[
-  "allocatable"
-  "attributes"
-  "device"
-  "dimension"
-  "global"
-  "grid_global"
-  "host"
-  "optional"
-  "private"
-  "public"
-  "value"
-] @type.qualifier
-
-[
-  "endtype"
-  "type"
-] @type.definition
-
-[
-  "in"
-  "inout"
-  "out"
-] @storageclass
-
-[
-  "contains"
   "import"
+  "include"
+  "use"
 ] @include
 
+(import_statement
+  ","
+  ["all" "none"] @keyword)
+
+; Attributes
+
 [
   (none)
   "implicit"
   "intent"
 ] @attribute
 
+(implicit_statement
+  "type" @attribute)
+
+; Keywords
+
 [
+  "attributes"
+  "associate"
+  "block"
+  "class"
+  "classis"
+  "contains"
+  "default"
+  "dimension"
+  "endassociate"
+  "endenum"
+  "endinterface"
+  "endmodule"
+  "endselect"
+  "endsubmodule"
+  "endtype"
+  "enum"
+  "enumerator"
+  "equivalence"
+  "extends"
+  "goto"
+  "interface"
+  "intrinsic"
+  "non_intrinsic"
+  "module"
+  "submodule"
+  "namelist"
+  "parameter"
+  "quiet"
+  "rank"
+  "save"
+  "selectcase"
+  "selectrank"
+  "selecttype"
+  "sequence"
+  "stop"
+  "target"
+  "type"
+  "typeis"
+] @keyword
+
+[
+  (default)
+] @keyword
+
+; Types
+
+[
+  (type_name)
+] @type
+
+[
+  (intrinsic_type)
+] @type.builtin
+
+; Qualifiers
+
+[
+  "abstract"
+  "allocatable"
+  "automatic"
+  "constant"
+  "contiguous"
+  "data"
+  "deferred"
+  "device"
+  "external"
+  "family"
+  "final"
+  "generic"
+  "global"
+  "grid_global"
+  "host"
+  "initial"
+  "local"
+  "local_init"
+  "managed"
+  "nopass"
+  "non_overridable"
+  "optional"
+  "pass"
+  "pinned"
+  "pointer"
+  "private"
+  "property"
+  "protected"
+  "public"
+  "shared"
+  "static"
+  "texture"
+  "value"
+  "volatile"
+  (procedure_qualifier)
+] @type.qualifier
+
+[
+  "common"
+  "in"
+  "inout"
+  "out"
+] @storageclass
+
+; Labels
+
+[
+  (statement_label)
+  (statement_label_reference)
+] @label
+
+[
+  "call"
   "endfunction"
   "endprogram"
+  "endprocedure"
   "endsubroutine"
   "function"
   "procedure"
+  "program"
   "subroutine"
 ] @keyword.function
 
 [
-  "bind"
-  "call"
-  "class"
-  "continue"
-  "cycle"
-  "endenum"
-  "endinterface"
-  "endmodule"
-  "endprogram"
-  "enum"
-  "enumerator"
-  "equivalence"
-  "exit"
-  "format"
-  "goto"
-  "include"
-  "interface"
-  "module"
-  "namelist"
-  "only"
-  "parameter"
-  "print"
-  "program"
-  "read"
-  "stop"
-  "use"
-  "write"
-  (default)
-  (procedure_qualifier)
-] @keyword
+  "result"
+  "return"
+] @keyword.return
 
-"return" @keyword.return
+; Functions
+
+(function_statement
+  (name) @function)
+
+(end_function_statement
+  (name) @function)
+
+(subroutine_statement
+  (name) @function)
+
+(end_subroutine_statement
+  (name) @function)
+
+(module_procedure_statement
+  (name) @function)
+
+(end_module_procedure_statement
+  (name) @function)
+
+(subroutine_call
+  (identifier) @function.call)
+
+[
+  "character"
+  "close"
+  "bind"
+  "format"
+  "open"
+  "print"
+  "read"
+  "write"
+] @function.builtin
+
+; Exceptions
+
+[
+  "error"
+] @exception
+
+; Conditionals
 
 [
   "else"
   "elseif"
+  "elsewhere"
   "endif"
   "endwhere"
   "if"
@@ -98,17 +226,44 @@
   "where"
 ] @conditional
 
-[
-  "do"
-  "enddo"
-  "forall"
-  "while"
-] @repeat
+; Repeats
+
+[
+  "do"
+  "concurrent"
+  "enddo"
+  "endforall"
+  "forall"
+  "while"
+  "continue"
+  "cycle"
+  "exit"
+] @repeat
+
+; Variables
+
+(identifier) @variable
+
+; Parameters
+
+(keyword_argument
+  name: (identifier) @parameter)
+
+(parameters
+  (identifier) @parameter)
+
+; Properties
+
+(derived_type_member_expression
+  (type_member) @property)
+
+; Operators
 
 [
-  "*"
   "+"
   "-"
+  "*"
+  "**"
   "/"
   "="
   "<"
@@ -117,69 +272,58 @@
   ">="
   "=="
   "/="
+  "//"
+  (assumed_rank)
 ] @operator
 
 [
   "\\.and\\."
   "\\.or\\."
-  "\\.lt\\."
-  "\\.gt\\."
-  "\\.ge\\."
-  "\\.le\\."
-  "\\.eq\\."
   "\\.eqv\\."
   "\\.neqv\\."
+  "\\.lt\\."
+  "\\.gt\\."
+  "\\.le\\."
+  "\\.ge\\."
+  "\\.eq\\."
+  "\\.ne\\."
+  "\\.not\\."
 ] @keyword.operator
 
- ;; Brackets
- [
-  "("
-  ")"
-  "["
-  "]"
-  "<<<"
-  ">>>"
- ] @punctuation.bracket
+; Punctuation
 
- ;; Delimiter
- [
-  "::"
+[ "[" "]" ] @punctuation.bracket
+
+[ "(" ")" ] @punctuation.bracket
+
+[ "<<<" ">>>" ] @punctuation.bracket
+
+(array_literal
+  ["(/" "/)"] @punctuation.bracket)
+
+[
+  ":"
   ","
+  "/"
   "%"
- ] @punctuation.delimiter
+  "::"
+  "=>"
+] @punctuation.delimiter
 
-(parameters
-  (identifier) @parameter)
+; Literals
 
-(program_statement
-  (name) @namespace)
+(string_literal) @string
 
-(module_statement
-  (name) @namespace)
+(number_literal) @number
 
-(function_statement
-  (name) @function)
+(boolean_literal) @boolean
 
-(subroutine_statement
-  (name) @function)
+(null_literal) @constant.builtin
 
-(end_program_statement
-  (name) @namespace)
+; Comments
 
-(end_module_statement
-  (name) @namespace)
+(comment) @comment @spell
 
-(end_function_statement
-  (name) @function)
+; Errors
 
-(end_subroutine_statement
-  (name) @function)
-
-(subroutine_call
-  (identifier) @function.call)
-
-(keyword_argument
-  name: (identifier) @keyword)
-
-(derived_type_member_expression
-  (type_member) @property)
+(ERROR) @error

From f0617c31f4bb52050f03707ec29c1d2830250dad Mon Sep 17 00:00:00 2001
From: Mitchell Hanberg 
Date: Mon, 27 Feb 2023 23:19:27 -0500
Subject: [PATCH 0056/2730] fix(eex): map eelixir filetype to the eex parser

---
 lua/nvim-treesitter/parsers.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index fa5795335..b5bdeb820 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -354,7 +354,7 @@ list.eex = {
     files = { "src/parser.c" },
     branch = "main",
   },
-  filetype = "eex",
+  filetype = "eelixir",
   maintainers = { "@connorlay" },
 }
 

From 316200f77d4261ebd4957b29fc6958f988e0964d Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Tue, 28 Feb 2023 00:16:21 -0500
Subject: [PATCH 0057/2730] feat: add matlab

---
 README.md                       |   1 +
 lockfile.json                   |   3 +
 lua/nvim-treesitter/parsers.lua |   8 +++
 queries/matlab/folds.scm        |  16 +++++
 queries/matlab/highlights.scm   | 107 ++++++++++++++++++++++++++++++++
 queries/matlab/injections.scm   |   1 +
 6 files changed, 136 insertions(+)
 create mode 100644 queries/matlab/folds.scm
 create mode 100644 queries/matlab/highlights.scm
 create mode 100644 queries/matlab/injections.scm

diff --git a/README.md b/README.md
index ce129942b..c677cc261 100644
--- a/README.md
+++ b/README.md
@@ -264,6 +264,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991)
 - [x] [markdown](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
 - [x] [markdown_inline](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
+- [x] [matlab](https://github.com/mstanciu552/tree-sitter-matlab) (maintained by @amaanq)
 - [x] [menhir](https://github.com/Kerl13/tree-sitter-menhir) (maintained by @Kerl13)
 - [ ] [mermaid](https://github.com/monaqa/tree-sitter-mermaid) (experimental)
 - [x] [meson](https://github.com/Decodetalkers/tree-sitter-meson) (maintained by @Decodetalkers)
diff --git a/lockfile.json b/lockfile.json
index 410e06557..52002c5e8 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -272,6 +272,9 @@
   "markdown_inline": {
     "revision": "7e7aa9a25ca9729db9fe22912f8f47bdb403a979"
   },
+  "matlab": {
+    "revision": "2d5d3d5193718a86477d4335aba5b34e79147326"
+  },
   "menhir": {
     "revision": "db7953acb0d5551f207373c81fa07a57d7b085cb"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index b5bdeb820..2719194bc 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -888,6 +888,14 @@ list.markdown_inline = {
   experimental = true,
 }
 
+list.matlab = {
+  install_info = {
+    url = "https://github.com/mstanciu552/tree-sitter-matlab",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.menhir = {
   install_info = {
     url = "https://github.com/Kerl13/tree-sitter-menhir",
diff --git a/queries/matlab/folds.scm b/queries/matlab/folds.scm
new file mode 100644
index 000000000..063a99b5a
--- /dev/null
+++ b/queries/matlab/folds.scm
@@ -0,0 +1,16 @@
+[
+  (function_definition)
+
+  (if_statement)
+
+  (for_statement)
+  (while_statement)
+
+  (switch_statement)
+  (case_statement)
+
+  (otherwise_statement)
+
+  (try_statement)
+  (catch_statement)
+] @fold
diff --git a/queries/matlab/highlights.scm b/queries/matlab/highlights.scm
new file mode 100644
index 000000000..bad9dbdf4
--- /dev/null
+++ b/queries/matlab/highlights.scm
@@ -0,0 +1,107 @@
+; Functions
+
+(function_definition
+  function_name: (identifier) @function
+  (end) @keyword.function)
+
+(parameter_list (identifier) @parameter)
+
+; Keywords
+
+((identifier) @keyword
+  (#eq? @keyword "end"))
+
+(function_keyword) @keyword.function
+
+[
+  "return"
+] @keyword.return
+
+; Conditionals
+
+[
+  "if"
+  "elseif"
+  "else"
+  "switch"
+  "case"
+  "otherwise"
+] @conditional
+
+(if_statement (end) @conditional)
+(switch_statement (end) @conditional)
+
+; Repeats
+
+[
+  "for" 
+  "while"
+  "break"
+  "continue"
+] @repeat
+
+(for_statement (end) @repeat)
+(while_statement (end) @repeat)
+
+; Exceptions
+
+[
+  "try"
+  "catch"
+] @exception
+
+(try_statement (end) @exception)
+
+; Punctuation
+
+[
+  ","
+  ";"
+  ":"
+] @punctuation.delimiter
+
+[ "{" "}" ] @punctuation.bracket
+
+[ "[" "]" ] @punctuation.bracket
+
+[ "(" ")" ] @punctuation.bracket
+
+; Operators
+
+[ 
+  ">"
+  "<"
+  "=="
+  "<="
+  ">="
+  "=<"
+  "=>"
+  "~="
+  "*"
+  ".*"
+  "/"
+  "\\"
+  "./"
+  "^"
+  ".^"
+  "+"
+  "="
+  "&&"
+  "||"
+] @operator
+
+; Literals
+
+(number) @number
+
+(string) @string
+
+[ "true" "false" ] @boolean
+
+; Comments
+
+(comment) @comment @spell
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/matlab/injections.scm b/queries/matlab/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/matlab/injections.scm
@@ -0,0 +1 @@
+(comment) @comment

From 418caac89dab5a37ccaf403b3829e4eeb4124d67 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Tue, 28 Feb 2023 00:53:13 -0500
Subject: [PATCH 0058/2730] feat(starlark): improve assertion parsing

---
 lockfile.json                   | 2 +-
 queries/starlark/highlights.scm | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 52002c5e8..a87b65752 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -405,7 +405,7 @@
     "revision": "672fe6b5180d20e9e84fd61749cc3e083e88d9d9"
   },
   "starlark": {
-    "revision": "2608deac514242c9e7e5609cbfab59095997b1da"
+    "revision": "8ad93a74c2a880bc16325affba3cc66c14bb2bde"
   },
   "supercollider": {
     "revision": "90c6d9f777d2b8c4ce497c48b5f270a44bcf3ea0"
diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm
index 8ce3d0f77..401b985d7 100644
--- a/queries/starlark/highlights.scm
+++ b/queries/starlark/highlights.scm
@@ -218,7 +218,6 @@
 ] @keyword.function
 
 [
-  "assert"
   "async"
   "await"
   "exec"
@@ -256,6 +255,11 @@
 
 ;; Starlark-specific
 
+;; Assertion calls
+(assert_keyword) @keyword
+
+(assert_builtin) @function.builtin
+
 ;; Struct definitions
 ((call
   function: (identifier) @_func

From 934113c913c773d8b60225c0f570f5f8ce88eb68 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Tue, 28 Feb 2023 08:35:10 +0000
Subject: [PATCH 0059/2730] Update parsers: ungrammar

---
 lockfile.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lockfile.json b/lockfile.json
index a87b65752..e5ba870b7 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -459,7 +459,7 @@
     "revision": "c6e56d44c686a67c89e29e773e662567285d610f"
   },
   "ungrammar": {
-    "revision": "5275e45d1edb16aab4f0d63a3aa15b61ef033a9c"
+    "revision": "debd26fed283d80456ebafa33a06957b0c52e451"
   },
   "v": {
     "revision": "136f3a0ad91ab8a781c2d4eb419df0a981839f69"

From bae59318b3f80e25d8b9c548315a842dc9f5bf88 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Tue, 28 Feb 2023 14:11:22 +0000
Subject: [PATCH 0060/2730] Update parsers: markdown, markdown_inline

---
 lockfile.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index e5ba870b7..f3d9d69a8 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -267,10 +267,10 @@
     "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
   },
   "markdown": {
-    "revision": "7e7aa9a25ca9729db9fe22912f8f47bdb403a979"
+    "revision": "ca85c6db7088ce98f59e2fbc31b966f5834ea6d7"
   },
   "markdown_inline": {
-    "revision": "7e7aa9a25ca9729db9fe22912f8f47bdb403a979"
+    "revision": "ca85c6db7088ce98f59e2fbc31b966f5834ea6d7"
   },
   "matlab": {
     "revision": "2d5d3d5193718a86477d4335aba5b34e79147326"

From b1b2e9b6d3cb1b18732246a3429686aa2df23ff6 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Tue, 28 Feb 2023 18:48:45 +0000
Subject: [PATCH 0061/2730] Update parsers: markdown, markdown_inline, python,
 zig

---
 lockfile.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index f3d9d69a8..f2e36d625 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -267,10 +267,10 @@
     "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
   },
   "markdown": {
-    "revision": "ca85c6db7088ce98f59e2fbc31b966f5834ea6d7"
+    "revision": "6138ee0c0d0ddafc4bf0e25728b73f902bbf2c98"
   },
   "markdown_inline": {
-    "revision": "ca85c6db7088ce98f59e2fbc31b966f5834ea6d7"
+    "revision": "6138ee0c0d0ddafc4bf0e25728b73f902bbf2c98"
   },
   "matlab": {
     "revision": "2d5d3d5193718a86477d4335aba5b34e79147326"
@@ -336,7 +336,7 @@
     "revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
   },
   "python": {
-    "revision": "528855eee2665210e1bf5556de48b8d8dacb8932"
+    "revision": "62827156d01c74dc1538266344e788da74536b8a"
   },
   "ql": {
     "revision": "bd087020f0d8c183080ca615d38de0ec827aeeaf"
@@ -495,6 +495,6 @@
     "revision": "607bf03cc78912cbaa85a3d373af21ddeaef5b41"
   },
   "zig": {
-    "revision": "6b3f5788f38be900b45f5af5a753bf6a37d614b8"
+    "revision": "1cd5f339b146b764f39b36bb7be98ca631a2e02a"
   }
 }

From f95ffd09ed35880c3a46ad2b968df361fa592a76 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 28 Feb 2023 20:14:55 +0100
Subject: [PATCH 0062/2730] python(highlights): adapt query to parser change

---
 queries/python/highlights.scm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 976528c48..b8b8b7b94 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -173,11 +173,7 @@
   (#match? @preproc "^#!/"))
 
 (string) @string
-[
-  (escape_sequence)
-  "{{"
-  "}}"
-] @string.escape
+(escape_sequence) @string.escape
 
 ; doc-strings
 (expression_statement (string) @spell)

From 3fe80dbecdf1fa88cf81a4d7b30ab0714f8c443a Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Mon, 27 Feb 2023 21:18:00 -0500
Subject: [PATCH 0063/2730] feat: add passwd

---
 README.md                       |  1 +
 lockfile.json                   |  3 +++
 lua/nvim-treesitter/parsers.lua |  8 ++++++++
 queries/passwd/highlights.scm   | 16 ++++++++++++++++
 4 files changed, 28 insertions(+)
 create mode 100644 queries/passwd/highlights.scm

diff --git a/README.md b/README.md
index c677cc261..bb93e4d9f 100644
--- a/README.md
+++ b/README.md
@@ -277,6 +277,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) (maintained by @undu)
 - [ ] [org](https://github.com/milisims/tree-sitter-org)
 - [x] [pascal](https://github.com/Isopod/tree-sitter-pascal.git) (maintained by @Isopod)
+- [x] [passwd](https://github.com/ath3/tree-sitter-passwd) (maintained by @amaanq)
 - [x] [perl](https://github.com/ganezdragon/tree-sitter-perl) (maintained by @lcrownover)
 - [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
 - [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
diff --git a/lockfile.json b/lockfile.json
index f2e36d625..d8736f659 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -311,6 +311,9 @@
   "pascal": {
     "revision": "9e995404ddff8319631d72d4b46552e737206912"
   },
+  "passwd": {
+    "revision": "20239395eacdc2e0923a7e5683ad3605aee7b716"
+  },
   "perl": {
     "revision": "c43bae0090cfcfc62d9904312599ded1b645a66d"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 2719194bc..2c8956f67 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1003,6 +1003,14 @@ list.pascal = {
   maintainers = { "@Isopod" },
 }
 
+list.passwd = {
+  install_info = {
+    url = "https://github.com/ath3/tree-sitter-passwd",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.perl = {
   install_info = {
     url = "https://github.com/ganezdragon/tree-sitter-perl",
diff --git a/queries/passwd/highlights.scm b/queries/passwd/highlights.scm
new file mode 100644
index 000000000..3e078a123
--- /dev/null
+++ b/queries/passwd/highlights.scm
@@ -0,0 +1,16 @@
+(user) @namespace
+
+(auth) @symbol
+
+(gecos) @string
+
+(home) @text.uri @constant
+
+(shell) @text.uri @string.special
+
+[
+  (gid)
+  (uid)
+] @number
+
+(separator) @punctuation.delimiter

From ba4ecfe471e0ee1e8a7b0710ce6f74acf0946609 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Wed, 1 Mar 2023 01:23:52 -0500
Subject: [PATCH 0064/2730] feat: add qmldir

---
 README.md                     |  1 +
 lockfile.json                 |  3 +++
 queries/qmldir/highlights.scm | 24 ++++++++++++++++++++++++
 queries/qmldir/injections.scm |  1 +
 4 files changed, 29 insertions(+)
 create mode 100644 queries/qmldir/highlights.scm
 create mode 100644 queries/qmldir/injections.scm

diff --git a/README.md b/README.md
index bb93e4d9f..558927a50 100644
--- a/README.md
+++ b/README.md
@@ -288,6 +288,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
 - [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta)
 - [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester)
+- [x] [qmldir](https://github.com/Decodetalkers/tree-sitter-qmldir) (maintained by @amaanq)
 - [x] [qmljs](https://github.com/yuja/tree-sitter-qmljs) (maintained by @Decodetalkers)
 - [x] [Tree-sitter query language](https://github.com/nvim-treesitter/tree-sitter-query) (maintained by @steelsojka)
 - [x] [r](https://github.com/r-lib/tree-sitter-r) (maintained by @echasnovski)
diff --git a/lockfile.json b/lockfile.json
index d8736f659..41616f172 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -344,6 +344,9 @@
   "ql": {
     "revision": "bd087020f0d8c183080ca615d38de0ec827aeeaf"
   },
+  "qmldir": {
+    "revision": "ce42c9abb9b86a563f117d733b3bc0dd7e2e6e76"
+  },
   "qmljs": {
     "revision": "ab75be9750e6f2f804638824d1790034286a830c"
   },
diff --git a/queries/qmldir/highlights.scm b/queries/qmldir/highlights.scm
new file mode 100644
index 000000000..1fd174708
--- /dev/null
+++ b/queries/qmldir/highlights.scm
@@ -0,0 +1,24 @@
+; Preproc
+
+(command (identifier) @preproc)
+
+; Keywords
+
+(keyword) @keyword
+
+; Literals
+
+(number) @number
+
+(float) @float
+
+; Variables
+
+[
+  (identifier)
+  (unit)
+] @variable
+
+; Comments
+
+(comment) @comment @spell
diff --git a/queries/qmldir/injections.scm b/queries/qmldir/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/qmldir/injections.scm
@@ -0,0 +1 @@
+(comment) @comment

From d80c99cab0a05ad4263783a59ad2286892c14fa0 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Wed, 1 Mar 2023 02:42:30 -0500
Subject: [PATCH 0065/2730] fix(qmldir): add to parsers.lua

---
 lua/nvim-treesitter/parsers.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 2c8956f67..a06c1baea 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1104,6 +1104,14 @@ list.ql = {
   maintainers = { "@pwntester" },
 }
 
+list.qmldir = {
+  install_info = {
+    url = "https://github.com/Decodetalkers/tree-sitter-qmldir",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.qmljs = {
   install_info = {
     url = "https://github.com/yuja/tree-sitter-qmljs",

From 5b9339f6f48acd7482a24884807c608fef401249 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Tue, 28 Feb 2023 00:14:08 -0500
Subject: [PATCH 0066/2730] feat: add PO

---
 README.md                       |  1 +
 lockfile.json                   |  3 +++
 lua/nvim-treesitter/parsers.lua |  8 ++++++++
 queries/po/folds.scm            |  9 +++++++++
 queries/po/highlights.scm       | 33 +++++++++++++++++++++++++++++++++
 queries/po/injections.scm       |  1 +
 6 files changed, 55 insertions(+)
 create mode 100644 queries/po/folds.scm
 create mode 100644 queries/po/highlights.scm
 create mode 100644 queries/po/injections.scm

diff --git a/README.md b/README.md
index 558927a50..45edb3612 100644
--- a/README.md
+++ b/README.md
@@ -282,6 +282,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
 - [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
 - [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228)
+- [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq)
 - [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
 - [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
 - [x] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)
diff --git a/lockfile.json b/lockfile.json
index 41616f172..375ea2ab2 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -326,6 +326,9 @@
   "pioasm": {
     "revision": "924aadaf5dea2a6074d72027b064f939acf32e20"
   },
+  "po": {
+    "revision": "d6aed225290bc71a15ab6f06305cb11419360c56"
+  },
   "poe_filter": {
     "revision": "80dc10195e26c72598ed1ab02cdf2d8e4c792e7b"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index a06c1baea..743f0f3e5 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1048,6 +1048,14 @@ list.pioasm = {
   maintainers = { "@leo60228" },
 }
 
+list.po = {
+  install_info = {
+    url = "https://github.com/erasin/tree-sitter-po",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.poe_filter = {
   install_info = {
     url = "https://github.com/ObserverOfTime/tree-sitter-poe-filter",
diff --git a/queries/po/folds.scm b/queries/po/folds.scm
new file mode 100644
index 000000000..589696477
--- /dev/null
+++ b/queries/po/folds.scm
@@ -0,0 +1,9 @@
+[
+  (msgctxt)
+  (msgid)
+  (msgid_plural)
+  (msgstr)
+  (msgstr_plural)
+
+  (message)
+] @fold
diff --git a/queries/po/highlights.scm b/queries/po/highlights.scm
new file mode 100644
index 000000000..bddeb5ba9
--- /dev/null
+++ b/queries/po/highlights.scm
@@ -0,0 +1,33 @@
+; Keywords
+
+[
+  "msgctxt"
+  "msgid"
+  "msgid_plural"
+  "msgstr"
+  "msgstr_plural"
+] @keyword
+
+; Punctuation
+
+[ "[" "]" ] @punctuation.bracket
+
+; Literals
+
+(string) @string
+
+(escape_sequence) @string.escape
+
+(number) @number
+
+; Comments
+
+(comment) @comment @spell
+
+(comment (reference (text) @string.special.path))
+
+(comment (flag (text) @preproc))
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/po/injections.scm b/queries/po/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/po/injections.scm
@@ -0,0 +1 @@
+(comment) @comment

From 75d98eaac424661812cc18de11f3d8037be8e8f4 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Tue, 28 Feb 2023 20:26:51 -0500
Subject: [PATCH 0067/2730] feat(kdl): update parser & queries fixing the
 comment bug

---
 lockfile.json              | 2 +-
 queries/kdl/highlights.scm | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 375ea2ab2..3c6888222 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -240,7 +240,7 @@
     "revision": "e2f449e2bcc95f1d07ceb62d67f986005f73a6be"
   },
   "kdl": {
-    "revision": "c3c4856464842e05366b1f3ebc4434c9194cad43"
+    "revision": "e36f054a60c4d9e5ae29567d439fdb8790b53b30"
   },
   "kotlin": {
     "revision": "e4637037a5fe6f25fe66c305669faa0855f35692"
diff --git a/queries/kdl/highlights.scm b/queries/kdl/highlights.scm
index 35da6ec63..d903128a8 100644
--- a/queries/kdl/highlights.scm
+++ b/queries/kdl/highlights.scm
@@ -31,18 +31,21 @@
 
 (number (decimal) @float)
 (number (exponent) @float)
-(number (decimal) (exponent) @float)
 
 (boolean) @boolean
 
-; Misc
-
 "null" @constant.builtin
 
+; Punctuation
+
 ["{" "}"] @punctuation.bracket
 
 ["(" ")"] @punctuation.bracket
 
+[
+  ";"
+] @punctuation.delimiter
+
 ; Comments
 
 [

From 9dd1b9c09707bf1cdd565b999c79ac6461602591 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Wed, 1 Mar 2023 06:42:40 +0000
Subject: [PATCH 0068/2730] Update parsers: gdscript, kdl, meson, yuck

---
 lockfile.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 3c6888222..ee0f5de10 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -135,7 +135,7 @@
     "revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
   },
   "gdscript": {
-    "revision": "31ebb7cd0b880ea53a152eaf9d4df73f737181cc"
+    "revision": "a4b57cc3bcbfc24550e858159647e9238e7ad1ac"
   },
   "git_rebase": {
     "revision": "d8a4207ebbc47bd78bacdf48f883db58283f9fd8"
@@ -282,7 +282,7 @@
     "revision": "d787c66276e7e95899230539f556e8b83ee16f6d"
   },
   "meson": {
-    "revision": "5f3138d555aceef976ec9a1d4a3f78e13b31e45f"
+    "revision": "3d6dfbdb2432603bc84ca7dc009bb39ed9a8a7b1"
   },
   "nickel": {
     "revision": "d6c7eeb751038f934b5b1aa7ff236376d0235c56"
@@ -501,7 +501,7 @@
     "revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502"
   },
   "yuck": {
-    "revision": "607bf03cc78912cbaa85a3d373af21ddeaef5b41"
+    "revision": "1e1a7e10053b910f3864fe8d97ca1741d2df66b2"
   },
   "zig": {
     "revision": "1cd5f339b146b764f39b36bb7be98ca631a2e02a"

From 0572657d4dba9b5c1108adfd4ecacc52a04917b5 Mon Sep 17 00:00:00 2001
From: Matthias Q <35303817+matthias-Q@users.noreply.github.com>
Date: Wed, 1 Mar 2023 21:21:11 +0100
Subject: [PATCH 0069/2730] feat: add prql (#4393)

* feat: add prql

* highlights(prql): null as constant.builtin

* highlights(prql): add missing kwd, update queries

* highlights(prql): remove redundant queries

* highlights(prql): make `->` a delimiter

* highlights(prql): instructions to `@method.call`
---
 README.md                       |   1 +
 lockfile.json                   |   3 +
 lua/nvim-treesitter/parsers.lua |  10 +++
 queries/prql/highlights.scm     | 141 ++++++++++++++++++++++++++++++++
 queries/prql/injections.scm     |  13 +++
 5 files changed, 168 insertions(+)
 create mode 100644 queries/prql/highlights.scm
 create mode 100644 queries/prql/injections.scm

diff --git a/README.md b/README.md
index 45edb3612..666d264b6 100644
--- a/README.md
+++ b/README.md
@@ -286,6 +286,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
 - [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
 - [x] [proto](https://github.com/mitchellh/tree-sitter-proto) (maintained by @fsouza)
+- [x] [prql](https://github.com/PRQL/tree-sitter-prql) (maintained by @matthias-Q)
 - [x] [pug](https://github.com/zealot128/tree-sitter-pug) (experimental, maintained by @zealot128)
 - [x] [python](https://github.com/tree-sitter/tree-sitter-python) (maintained by @stsewd, @theHamsta)
 - [x] [ql](https://github.com/tree-sitter/tree-sitter-ql) (maintained by @pwntester)
diff --git a/lockfile.json b/lockfile.json
index ee0f5de10..437e104a3 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -338,6 +338,9 @@
   "proto": {
     "revision": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f"
   },
+  "prql": {
+    "revision": "3f27cac466f030ee7d985d91eba5470e01dd21ea"
+  },
   "pug": {
     "revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 743f0f3e5..d0b933779 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -1086,6 +1086,16 @@ list.proto = {
   filetype = "proto",
 }
 
+list.prql = {
+  install_info = {
+    url = "https://github.com/PRQL/tree-sitter-prql",
+    branch = "main",
+    files = { "src/parser.c" },
+  },
+  maintainers = { "@matthias-Q" },
+  filetype = "prql",
+}
+
 list.pug = {
   install_info = {
     url = "https://github.com/zealot128/tree-sitter-pug",
diff --git a/queries/prql/highlights.scm b/queries/prql/highlights.scm
new file mode 100644
index 000000000..3810bdda4
--- /dev/null
+++ b/queries/prql/highlights.scm
@@ -0,0 +1,141 @@
+[
+  (keyword_from)
+  (keyword_filter)
+  (keyword_derive)
+  (keyword_group)
+  (keyword_aggregate)
+  (keyword_sort)
+  (keyword_take)
+  (keyword_window)
+  (keyword_join)
+  (keyword_select)
+  (keyword_switch)
+  (keyword_append)
+  (keyword_remove)
+  (keyword_intersect)
+  (keyword_rolling)
+  (keyword_rows)
+  (keyword_expanding)
+  (keyword_let)
+  (keyword_prql)
+  (keyword_from_text)
+] @keyword
+
+[
+ (literal)
+ (f_string)
+ (s_string)
+] @string
+
+(assignment
+  alias: (field) @field)
+
+alias: (identifier) @field
+
+
+
+(comment) @comment @spell
+
+(keyword_func) @keyword.function
+
+(function_call
+  (identifier) @function.call)
+
+[
+  "+"
+  "-"
+  "*"
+  "/"
+  "="
+  "=="
+  "<"
+  "<="
+  "!="
+  ">="
+  ">"
+  (bang)
+] @operator
+
+[
+  "("
+  ")"
+  "["
+  "]"
+] @punctuation.bracket
+
+[
+  ","
+  "."
+  (pipe)
+  "->"
+] @punctuation.delimiter
+
+(integer) @number
+
+(decimal_number) @float
+
+[
+  (keyword_min)
+  (keyword_max)
+  (keyword_count)
+  (keyword_count_distinct)
+  (keyword_average)
+  (keyword_avg)
+  (keyword_sum)
+  (keyword_stddev)
+  (keyword_count)
+] @function
+
+[
+ (keyword_side)
+ (keyword_format)
+] @attribute
+
+[
+ (keyword_version)
+ (keyword_target)
+] @type.qualifier
+
+(target) @function.builtin
+
+ [
+  (date)
+  (time)
+  (timestamp)
+] @string.special
+
+[
+  (keyword_left)
+  (keyword_inner)
+  (keyword_right)
+  (keyword_full)
+  (keyword_csv)
+  (keyword_json)
+] @method.call
+
+[
+  (keyword_true)
+  (keyword_false)
+] @boolean
+
+[
+ (keyword_and)
+ (keyword_or)
+ (keyword_in)
+] @keyword.operator
+
+(function_definition
+  (keyword_func)
+  name: (identifier) @function)
+
+(parameter
+  (identifier) @parameter)
+
+(variable
+  (keyword_let)
+  name: (identifier) @constant)
+
+
+ (keyword_null) @constant.builtin
+
+
diff --git a/queries/prql/injections.scm b/queries/prql/injections.scm
new file mode 100644
index 000000000..a6d4ccb12
--- /dev/null
+++ b/queries/prql/injections.scm
@@ -0,0 +1,13 @@
+(
+ (s_string) @sql
+ (#offset! @sql 0 2 0 -1)
+)
+
+(from_text
+  (keyword_from_text)
+  (keyword_json)
+  (literal) @json
+  (#offset! @json 0 3 0 -3)
+)
+
+(comment) @comment

From 252c1011c4bae91d25a8c54be4ed1a7b341c088c Mon Sep 17 00:00:00 2001
From: Yochem van Rosmalen 
Date: Wed, 1 Mar 2023 14:26:52 +0100
Subject: [PATCH 0070/2730] comment(highlights): add `@nospell` to tags and
 user mentions

---
 queries/comment/highlights.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/queries/comment/highlights.scm b/queries/comment/highlights.scm
index 6466a4783..15adf45ab 100644
--- a/queries/comment/highlights.scm
+++ b/queries/comment/highlights.scm
@@ -1,39 +1,39 @@
 (_) @spell
 
 ((tag
-  (name) @text.todo
+  (name) @text.todo @nospell
   ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
   ":" @punctuation.delimiter)
   (#eq? @text.todo "TODO"))
 
-("text" @text.todo
+("text" @text.todo @nospell
  (#eq? @text.todo "TODO"))
 
 ((tag
-  (name) @text.note
+  (name) @text.note @nospell
   ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
   ":" @punctuation.delimiter)
   (#any-of? @text.note "NOTE" "XXX"))
 
-("text" @text.note
+("text" @text.note @nospell
  (#any-of? @text.note "NOTE" "XXX"))
 
 ((tag
-  (name) @text.warning
+  (name) @text.warning @nospell
   ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
   ":" @punctuation.delimiter)
   (#any-of? @text.warning "HACK" "WARNING"))
 
-("text" @text.warning
+("text" @text.warning @nospell
  (#any-of? @text.warning "HACK" "WARNING"))
 
 ((tag
-  (name) @text.danger
+  (name) @text.danger @nospell
   ("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
   ":" @punctuation.delimiter)
   (#any-of? @text.danger "FIXME" "BUG"))
 
-("text" @text.danger
+("text" @text.danger @nospell
  (#any-of? @text.danger "FIXME" "BUG"))
 
 ; Issue number (#123)
@@ -41,5 +41,5 @@
  (#lua-match? @number "^#[0-9]+$"))
 
 ; User mention (@user)
-("text" @constant
+("text" @constant @nospell
  (#lua-match? @constant "^[@][a-zA-Z0-9_-]+$"))

From b1450214993582d54b2fd7e0fe6b556710cae606 Mon Sep 17 00:00:00 2001
From: Jaehwang Jung 
Date: Thu, 2 Mar 2023 13:47:00 +0900
Subject: [PATCH 0071/2730] fix: remove wrong/pointless tostring

---
 lua/nvim-treesitter/caching.lua | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lua/nvim-treesitter/caching.lua b/lua/nvim-treesitter/caching.lua
index 810d3a408..7733202ed 100644
--- a/lua/nvim-treesitter/caching.lua
+++ b/lua/nvim-treesitter/caching.lua
@@ -8,7 +8,7 @@ local M = {}
 function M.create_buffer_cache()
   local cache = {}
 
-  ---@type table>
+  ---@type table>
   local items = setmetatable({}, {
     __index = function(tbl, key)
       rawset(tbl, key, {})
@@ -16,7 +16,7 @@ function M.create_buffer_cache()
     end,
   })
 
-  ---@type table
+  ---@type table
   local loaded_buffers = {}
 
   ---@param type_name string
@@ -30,21 +30,21 @@ function M.create_buffer_cache()
       api.nvim_buf_attach(bufnr, false, {
         on_detach = function()
           cache.clear_buffer(bufnr)
-          loaded_buffers[tostring(bufnr)] = nil
+          loaded_buffers[bufnr] = nil
           return true
         end,
         on_reload = function() end, -- this is needed to prevent on_detach being called on buffer reload
       })
     end
 
-    items[tostring(bufnr)][type_name] = value
+    items[bufnr][type_name] = value
   end
 
   ---@param type_name string
   ---@param bufnr integer
   ---@return any
   function cache.get(type_name, bufnr)
-    return items[tostring(bufnr)][type_name]
+    return items[bufnr][type_name]
   end
 
   ---@param type_name string
@@ -57,12 +57,12 @@ function M.create_buffer_cache()
   ---@param type_name string
   ---@param bufnr integer
   function cache.remove(type_name, bufnr)
-    items[tostring(bufnr)][type_name] = nil
+    items[bufnr][type_name] = nil
   end
 
   ---@param bufnr integer
   function cache.clear_buffer(bufnr)
-    items[tostring(bufnr)] = nil
+    items[bufnr] = nil
   end
 
   return cache

From 36b1038a65f250e93c88496350ab9f03ad00fa8a Mon Sep 17 00:00:00 2001
From: Preston Knopp 
Date: Wed, 1 Mar 2023 23:28:13 -0800
Subject: [PATCH 0072/2730] Update gdscript queries (#4405)

* locals(gdscript): update locals

* folds(gdscript): add folds

* indents(gdscript): update indents with notes

* highlights(gdscript): update highlights

* docs(gdscript): add gdscript maintainer

* indents(gdscript): add ERROR auto indent

Co-authored-by: Amaan Qureshi 

* highlights(gdscript): use text.uri for get_node and node_path

* highlights(gdscript): add "@" of annotation as attribute

* highlights(gdscript): use keyword.operator for "new", match all attribute_call

* highlights(gdscript): update (underscore) and (pattern_open_ending)

---------

Co-authored-by: Amaan Qureshi 
---
 lua/nvim-treesitter/parsers.lua |   1 +
 queries/gdscript/folds.scm      |  25 ++++
 queries/gdscript/highlights.scm | 249 +++++++++++++++++++++++++++++---
 queries/gdscript/indents.scm    |  80 ++++++++--
 queries/gdscript/locals.scm     |  92 +++++++++++-
 5 files changed, 412 insertions(+), 35 deletions(-)
 create mode 100644 queries/gdscript/folds.scm

diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index d0b933779..a600e2de0 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -478,6 +478,7 @@ list.gdscript = {
     files = { "src/parser.c", "src/scanner.cc" },
   },
   readme_name = "Godot (gdscript)",
+  maintainers = { "@PrestonKnopp" },
 }
 
 list.git_rebase = {
diff --git a/queries/gdscript/folds.scm b/queries/gdscript/folds.scm
new file mode 100644
index 000000000..946b0fea3
--- /dev/null
+++ b/queries/gdscript/folds.scm
@@ -0,0 +1,25 @@
+[
+  ; Body fold will "join" the next adjacent fold into a SUPER fold.
+  ; This is an issue with the grammar.
+  ; (body)
+
+  (if_statement)
+  (elif_clause)
+  (else_clause)
+  (for_statement)
+  (while_statement)
+  (class_definition)
+  (enum_definition)
+  (match_statement)
+  (pattern_section)
+  (function_definition)
+  (lambda)
+  (constructor_definition)
+] @fold
+
+; It's nice to be able to fold the if/elif/else clauses and the entire
+; if_statement.
+(if_statement (body) @fold)
+
+; Fold strings that are probably doc strings.
+(expression_statement (string) @fold)
diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm
index 7b5469f62..073096556 100644
--- a/queries/gdscript/highlights.scm
+++ b/queries/gdscript/highlights.scm
@@ -1,21 +1,30 @@
 ;; Basic
+(ERROR) @error
+
 (identifier) @variable
 (name) @variable
 (type) @type
-(comment) @comment
-(get_node) @string
+(comment) @comment @spell
+(string_name) @string
 (string) @string
 (float) @float
 (integer) @number
 (null) @constant
 (setter) @function
 (getter) @function
+(set_body "set" @keyword.function)
+(get_body "get" @keyword.function)
 (static_keyword) @type.qualifier
 (tool_statement) @keyword
-(breakpoint_statement) @keyword
+(breakpoint_statement) @debug
 (inferred_type) @operator
 [(true) (false)] @boolean
 
+[
+  (get_node)
+  (node_path)
+] @text.uri
+
 (class_name_statement
   (name) @type) @keyword
 
@@ -23,16 +32,13 @@
   "const" @type.qualifier
   (name) @constant)
 
-((identifier) @variable.builtin
-  (#eq? @variable.builtin "self"))
+(expression_statement (string) @comment @spell)
 
 ;; Identifier naming conventions
 ((identifier) @type
   (#lua-match? @type "^[A-Z]"))
 ((identifier) @constant
   (#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
-((identifier) @type
-  (#lua-match? @type "^[A-Z][A-Z_0-9]*$") . (_))
 
 ;; Functions
 (constructor_definition) @constructor
@@ -41,16 +47,44 @@
   (name) @function (parameters
     (identifier) @parameter)*)
 
-(typed_parameter
-  (identifier) @parameter)
+(typed_parameter (identifier) @parameter)
+(default_parameter (identifier) @parameter)
 
-(default_parameter
-  (identifier) @parameter)
+(call (identifier) @function.call)
+(call (identifier) @include
+      (#any-of? @include "preload" "load"))
 
-(call
-  (identifier) @function)
-(attribute_call
-  (identifier) @function)
+;; Properties and Methods
+
+; We'll use @property since that's the term Godot uses.
+; But, should (source (variable_statement (name))) be @property, too? Since a
+; script file is a class in gdscript.
+(class_definition
+  (body (variable_statement (name) @property)))
+
+; Same question but for methods?
+(class_definition
+  (body (function_definition (name) @method)))
+
+(attribute_call (identifier) @method.call)
+(attribute (_) (identifier) @property)
+
+;; Enums
+
+(enumerator left: (identifier) @constant)
+
+;; Special Builtins
+
+((identifier) @variable.builtin
+  (#any-of? @variable.builtin "self" "super"))
+
+(attribute_call (identifier) @keyword.operator
+ (#eq? @keyword.operator "new"))
+
+;; Match Pattern
+
+(underscore) @constant          ; The "_" pattern.
+(pattern_open_ending) @operator ; The ".." pattern.
 
 ;; Alternations
 ["(" ")" "[" "]" "{" "}"] @punctuation.bracket
@@ -109,7 +143,6 @@
   "class_name"
   "extends"
   "signal"
-  "func"
   "enum"
   "var"
   "onready"
@@ -123,4 +156,186 @@
   "puppetsync"
 ] @keyword
 
-"return" @keyword.return
+"func" @keyword.function
+
+[
+  "await"
+  "return"
+] @keyword.return
+
+(call (identifier) @keyword.return
+      (#eq? @keyword.return "yield"))
+
+
+;; Builtins
+; generated from
+; - https://github.com/godotengine/godot/blob/491ded18983a4ae963ce9c29e8df5d5680873ccb/doc/classes/@GlobalScope.xml
+; - https://github.com/godotengine/godot/blob/491ded18983a4ae963ce9c29e8df5d5680873ccb/modules/gdscript/doc_classes/@GDScript.xml
+; some from:
+; - https://github.com/godotengine/godot-vscode-plugin/blob/0636797c22bf1e23a41fd24d55cdb9be62e0c992/syntaxes/GDScript.tmLanguage.json
+
+;; Bulitin Annotations
+
+((annotation "@" @attribute (identifier) @attribute)
+ (#any-of? @attribute
+  ; @GDScript
+  "export" "export_category" "export_color_no_alpha" "export_dir"
+  "export_enum" "export_exp_easing" "export_file" "export_flags"
+  "export_flags_2d_navigation" "export_flags_2d_physics"
+  "export_flags_2d_render" "export_flags_3d_navigation"
+  "export_flags_3d_physics" "export_flags_3d_render" "export_global_dir"
+  "export_global_file" "export_group" "export_multiline" "export_node_path"
+  "export_placeholder" "export_range" "export_subgroup" "icon" "onready"
+  "rpc" "tool" "warning_ignore"
+ ))
+
+;; Builtin Types
+
+([(identifier) (type)] @type.builtin
+  (#any-of? @type.builtin
+   ; from godot-vscode-plugin
+   "Vector2" "Vector2i" "Vector3" "Vector3i"
+   "Color" "Rect2" "Rect2i" "Array" "Basis" "Dictionary"
+   "Plane" "Quat" "RID" "Rect3" "Transform" "Transform2D"
+   "Transform3D" "AABB" "String" "NodePath" "Object"
+   "PoolByteArray" "PoolIntArray" "PoolRealArray"
+   "PoolStringArray" "PoolVector2Array" "PoolVector3Array"
+   "PoolColorArray" "bool" "int" "float" "StringName" "Quaternion"
+   "PackedByteArray" "PackedInt32Array" "PackedInt64Array"
+   "PackedFloat32Array" "PackedFloat64Array" "PackedStringArray"
+   "PackedVector2Array" "PackedVector2iArray" "PackedVector3Array"
+   "PackedVector3iArray" "PackedColorArray"
+
+   ; @GlobalScope
+   "AudioServer" "CameraServer" "ClassDB" "DisplayServer" "Engine"
+   "EngineDebugger" "GDExtensionManager" "Geometry2D" "Geometry3D" "GodotSharp"
+   "IP" "Input" "InputMap" "JavaClassWrapper" "JavaScriptBridge" "Marshalls"
+   "NavigationMeshGenerator" "NavigationServer2D" "NavigationServer3D" "OS"
+   "Performance" "PhysicsServer2D" "PhysicsServer2DManager" "PhysicsServer3D"
+   "PhysicsServer3DManager" "ProjectSettings" "RenderingServer" "ResourceLoader"
+   "ResourceSaver" "ResourceUID" "TextServerManager" "ThemeDB" "Time"
+   "TranslationServer" "WorkerThreadPool" "XRServer"
+  ))
+
+;; Builtin Funcs
+
+(call (identifier) @function.builtin
+      (#any-of? @function.builtin
+       ; @GlobalScope
+       "abs" "absf" "absi" "acos" "asin" "atan" "atan2" "bezier_derivative"
+       "bezier_interpolate" "bytes_to_var" "bytes_to_var_with_objects" "ceil" "ceilf"
+       "ceili" "clamp" "clampf" "clampi" "cos" "cosh" "cubic_interpolate"
+       "cubic_interpolate_angle" "cubic_interpolate_angle_in_time"
+       "cubic_interpolate_in_time" "db_to_linear" "deg_to_rad" "ease" "error_string"
+       "exp" "floor" "floorf" "floori" "fmod" "fposmod" "hash" "instance_from_id"
+       "inverse_lerp" "is_equal_approx" "is_finite" "is_inf" "is_instance_id_valid"
+       "is_instance_valid" "is_nan" "is_same" "is_zero_approx" "lerp" "lerp_angle"
+       "lerpf" "linear_to_db" "log" "max" "maxf" "maxi" "min" "minf" "mini"
+       "move_toward" "nearest_po2" "pingpong" "posmod" "pow" "print" "print_rich"
+       "print_verbose" "printerr" "printraw" "prints" "printt" "push_error"
+       "push_warning" "rad_to_deg" "rand_from_seed" "randf" "randf_range" "randfn"
+       "randi" "randi_range" "randomize" "remap" "rid_allocate_id" "rid_from_int64"
+       "round" "roundf" "roundi" "seed" "sign" "signf" "signi" "sin" "sinh"
+       "smoothstep" "snapped" "snappedf" "snappedi" "sqrt" "step_decimals" "str"
+       "str_to_var" "tan" "tanh" "typeof" "var_to_bytes" "var_to_bytes_with_objects"
+       "var_to_str" "weakref" "wrap" "wrapf" "wrapi"
+
+       ; @GDScript
+       "Color8" "assert" "char" "convert" "dict_to_inst" "get_stack" "inst_to_dict"
+       "is_instance_of" "len" "print_debug" "print_stack" "range"
+       "type_exists"
+      ))
+
+;; Builtin Constants
+
+((identifier) @constant.builtin
+ (#any-of? @constant.builtin
+  ; @GDScript
+  "PI" "TAU" "INF" "NAN"
+
+  ; @GlobalScope
+  "SIDE_LEFT" "SIDE_TOP" "SIDE_RIGHT" "SIDE_BOTTOM" "CORNER_TOP_LEFT" "CORNER_TOP_RIGHT" "CORNER_BOTTOM_RIGHT"
+  "CORNER_BOTTOM_LEFT" "VERTICAL" "HORIZONTAL" "CLOCKWISE" "COUNTERCLOCKWISE" "HORIZONTAL_ALIGNMENT_LEFT"
+  "HORIZONTAL_ALIGNMENT_CENTER" "HORIZONTAL_ALIGNMENT_RIGHT" "HORIZONTAL_ALIGNMENT_FILL" "VERTICAL_ALIGNMENT_TOP"
+  "VERTICAL_ALIGNMENT_CENTER" "VERTICAL_ALIGNMENT_BOTTOM" "VERTICAL_ALIGNMENT_FILL" "INLINE_ALIGNMENT_TOP_TO"
+  "INLINE_ALIGNMENT_CENTER_TO" "INLINE_ALIGNMENT_BASELINE_TO" "INLINE_ALIGNMENT_BOTTOM_TO" "INLINE_ALIGNMENT_TO_TOP"
+  "INLINE_ALIGNMENT_TO_CENTER" "INLINE_ALIGNMENT_TO_BASELINE" "INLINE_ALIGNMENT_TO_BOTTOM" "INLINE_ALIGNMENT_TOP"
+  "INLINE_ALIGNMENT_CENTER" "INLINE_ALIGNMENT_BOTTOM" "INLINE_ALIGNMENT_IMAGE_MASK" "INLINE_ALIGNMENT_TEXT_MASK"
+  "EULER_ORDER_XYZ" "EULER_ORDER_XZY" "EULER_ORDER_YXZ" "EULER_ORDER_YZX" "EULER_ORDER_ZXY" "EULER_ORDER_ZYX" "KEY_NONE"
+  "KEY_SPECIAL" "KEY_ESCAPE" "KEY_TAB" "KEY_BACKTAB" "KEY_BACKSPACE" "KEY_ENTER" "KEY_KP_ENTER" "KEY_INSERT" "KEY_DELETE"
+  "KEY_PAUSE" "KEY_PRINT" "KEY_SYSREQ" "KEY_CLEAR" "KEY_HOME" "KEY_END" "KEY_LEFT" "KEY_UP" "KEY_RIGHT" "KEY_DOWN"
+  "KEY_PAGEUP" "KEY_PAGEDOWN" "KEY_SHIFT" "KEY_CTRL" "KEY_META" "KEY_ALT" "KEY_CAPSLOCK" "KEY_NUMLOCK" "KEY_SCROLLLOCK"
+  "KEY_F1" "KEY_F2" "KEY_F3" "KEY_F4" "KEY_F5" "KEY_F6" "KEY_F7" "KEY_F8" "KEY_F9" "KEY_F10" "KEY_F11" "KEY_F12"
+  "KEY_F13" "KEY_F14" "KEY_F15" "KEY_F16" "KEY_F17" "KEY_F18" "KEY_F19" "KEY_F20" "KEY_F21" "KEY_F22" "KEY_F23" "KEY_F24"
+  "KEY_F25" "KEY_F26" "KEY_F27" "KEY_F28" "KEY_F29" "KEY_F30" "KEY_F31" "KEY_F32" "KEY_F33" "KEY_F34" "KEY_F35"
+  "KEY_KP_MULTIPLY" "KEY_KP_DIVIDE" "KEY_KP_SUBTRACT" "KEY_KP_PERIOD" "KEY_KP_ADD" "KEY_KP_0" "KEY_KP_1" "KEY_KP_2"
+  "KEY_KP_3" "KEY_KP_4" "KEY_KP_5" "KEY_KP_6" "KEY_KP_7" "KEY_KP_8" "KEY_KP_9" "KEY_MENU" "KEY_HYPER" "KEY_HELP"
+  "KEY_BACK" "KEY_FORWARD" "KEY_STOP" "KEY_REFRESH" "KEY_VOLUMEDOWN" "KEY_VOLUMEMUTE" "KEY_VOLUMEUP" "KEY_MEDIAPLAY"
+  "KEY_MEDIASTOP" "KEY_MEDIAPREVIOUS" "KEY_MEDIANEXT" "KEY_MEDIARECORD" "KEY_HOMEPAGE" "KEY_FAVORITES" "KEY_SEARCH"
+  "KEY_STANDBY" "KEY_OPENURL" "KEY_LAUNCHMAIL" "KEY_LAUNCHMEDIA" "KEY_LAUNCH0" "KEY_LAUNCH1" "KEY_LAUNCH2" "KEY_LAUNCH3"
+  "KEY_LAUNCH4" "KEY_LAUNCH5" "KEY_LAUNCH6" "KEY_LAUNCH7" "KEY_LAUNCH8" "KEY_LAUNCH9" "KEY_LAUNCHA" "KEY_LAUNCHB"
+  "KEY_LAUNCHC" "KEY_LAUNCHD" "KEY_LAUNCHE" "KEY_LAUNCHF" "KEY_UNKNOWN" "KEY_SPACE" "KEY_EXCLAM" "KEY_QUOTEDBL"
+  "KEY_NUMBERSIGN" "KEY_DOLLAR" "KEY_PERCENT" "KEY_AMPERSAND" "KEY_APOSTROPHE" "KEY_PARENLEFT" "KEY_PARENRIGHT"
+  "KEY_ASTERISK" "KEY_PLUS" "KEY_COMMA" "KEY_MINUS" "KEY_PERIOD" "KEY_SLASH" "KEY_0" "KEY_1" "KEY_2" "KEY_3" "KEY_4"
+  "KEY_5" "KEY_6" "KEY_7" "KEY_8" "KEY_9" "KEY_COLON" "KEY_SEMICOLON" "KEY_LESS" "KEY_EQUAL" "KEY_GREATER" "KEY_QUESTION"
+  "KEY_AT" "KEY_A" "KEY_B" "KEY_C" "KEY_D" "KEY_E" "KEY_F" "KEY_G" "KEY_H" "KEY_I" "KEY_J" "KEY_K" "KEY_L" "KEY_M"
+  "KEY_N" "KEY_O" "KEY_P" "KEY_Q" "KEY_R" "KEY_S" "KEY_T" "KEY_U" "KEY_V" "KEY_W" "KEY_X" "KEY_Y" "KEY_Z"
+  "KEY_BRACKETLEFT" "KEY_BACKSLASH" "KEY_BRACKETRIGHT" "KEY_ASCIICIRCUM" "KEY_UNDERSCORE" "KEY_QUOTELEFT" "KEY_BRACELEFT"
+  "KEY_BAR" "KEY_BRACERIGHT" "KEY_ASCIITILDE" "KEY_YEN" "KEY_SECTION" "KEY_GLOBE" "KEY_KEYBOARD" "KEY_JIS_EISU"
+  "KEY_JIS_KANA" "KEY_CODE_MASK" "KEY_MODIFIER_MASK" "KEY_MASK_CMD_OR_CTRL" "KEY_MASK_SHIFT" "KEY_MASK_ALT"
+  "KEY_MASK_META" "KEY_MASK_CTRL" "KEY_MASK_KPAD" "KEY_MASK_GROUP_SWITCH" "MOUSE_BUTTON_NONE" "MOUSE_BUTTON_LEFT"
+  "MOUSE_BUTTON_RIGHT" "MOUSE_BUTTON_MIDDLE" "MOUSE_BUTTON_WHEEL_UP" "MOUSE_BUTTON_WHEEL_DOWN" "MOUSE_BUTTON_WHEEL_LEFT"
+  "MOUSE_BUTTON_WHEEL_RIGHT" "MOUSE_BUTTON_XBUTTON1" "MOUSE_BUTTON_XBUTTON2" "MOUSE_BUTTON_MASK_LEFT"
+  "MOUSE_BUTTON_MASK_RIGHT" "MOUSE_BUTTON_MASK_MIDDLE" "MOUSE_BUTTON_MASK_MB_XBUTTON1" "MOUSE_BUTTON_MASK_MB_XBUTTON2"
+  "JOY_BUTTON_INVALID" "JOY_BUTTON_A" "JOY_BUTTON_B" "JOY_BUTTON_X" "JOY_BUTTON_Y" "JOY_BUTTON_BACK" "JOY_BUTTON_GUIDE"
+  "JOY_BUTTON_START" "JOY_BUTTON_LEFT_STICK" "JOY_BUTTON_RIGHT_STICK" "JOY_BUTTON_LEFT_SHOULDER"
+  "JOY_BUTTON_RIGHT_SHOULDER" "JOY_BUTTON_DPAD_UP" "JOY_BUTTON_DPAD_DOWN" "JOY_BUTTON_DPAD_LEFT" "JOY_BUTTON_DPAD_RIGHT"
+  "JOY_BUTTON_MISC1" "JOY_BUTTON_PADDLE1" "JOY_BUTTON_PADDLE2" "JOY_BUTTON_PADDLE3" "JOY_BUTTON_PADDLE4"
+  "JOY_BUTTON_TOUCHPAD" "JOY_BUTTON_SDL_MAX" "JOY_BUTTON_MAX" "JOY_AXIS_INVALID" "JOY_AXIS_LEFT_X" "JOY_AXIS_LEFT_Y"
+  "JOY_AXIS_RIGHT_X" "JOY_AXIS_RIGHT_Y" "JOY_AXIS_TRIGGER_LEFT" "JOY_AXIS_TRIGGER_RIGHT" "JOY_AXIS_SDL_MAX"
+  "JOY_AXIS_MAX" "MIDI_MESSAGE_NONE" "MIDI_MESSAGE_NOTE_OFF" "MIDI_MESSAGE_NOTE_ON" "MIDI_MESSAGE_AFTERTOUCH"
+  "MIDI_MESSAGE_CONTROL_CHANGE" "MIDI_MESSAGE_PROGRAM_CHANGE" "MIDI_MESSAGE_CHANNEL_PRESSURE" "MIDI_MESSAGE_PITCH_BEND"
+  "MIDI_MESSAGE_SYSTEM_EXCLUSIVE" "MIDI_MESSAGE_QUARTER_FRAME" "MIDI_MESSAGE_SONG_POSITION_POINTER"
+  "MIDI_MESSAGE_SONG_SELECT" "MIDI_MESSAGE_TUNE_REQUEST" "MIDI_MESSAGE_TIMING_CLOCK" "MIDI_MESSAGE_START"
+  "MIDI_MESSAGE_CONTINUE" "MIDI_MESSAGE_STOP" "MIDI_MESSAGE_ACTIVE_SENSING" "MIDI_MESSAGE_SYSTEM_RESET" "OK" "FAILED"
+  "ERR_UNAVAILABLE" "ERR_UNCONFIGURED" "ERR_UNAUTHORIZED" "ERR_PARAMETER_RANGE_ERROR" "ERR_OUT_OF_MEMORY"
+  "ERR_FILE_NOT_FOUND" "ERR_FILE_BAD_DRIVE" "ERR_FILE_BAD_PATH" "ERR_FILE_NO_PERMISSION" "ERR_FILE_ALREADY_IN_USE"
+  "ERR_FILE_CANT_OPEN" "ERR_FILE_CANT_WRITE" "ERR_FILE_CANT_READ" "ERR_FILE_UNRECOGNIZED" "ERR_FILE_CORRUPT"
+  "ERR_FILE_MISSING_DEPENDENCIES" "ERR_FILE_EOF" "ERR_CANT_OPEN" "ERR_CANT_CREATE" "ERR_QUERY_FAILED"
+  "ERR_ALREADY_IN_USE" "ERR_LOCKED" "ERR_TIMEOUT" "ERR_CANT_CONNECT" "ERR_CANT_RESOLVE" "ERR_CONNECTION_ERROR"
+  "ERR_CANT_ACQUIRE_RESOURCE" "ERR_CANT_FORK" "ERR_INVALID_DATA" "ERR_INVALID_PARAMETER" "ERR_ALREADY_EXISTS"
+  "ERR_DOES_NOT_EXIST" "ERR_DATABASE_CANT_READ" "ERR_DATABASE_CANT_WRITE" "ERR_COMPILATION_FAILED" "ERR_METHOD_NOT_FOUND"
+  "ERR_LINK_FAILED" "ERR_SCRIPT_FAILED" "ERR_CYCLIC_LINK" "ERR_INVALID_DECLARATION" "ERR_DUPLICATE_SYMBOL"
+  "ERR_PARSE_ERROR" "ERR_BUSY" "ERR_SKIP" "ERR_HELP" "ERR_BUG" "ERR_PRINTER_ON_FIRE" "PROPERTY_HINT_NONE"
+  "PROPERTY_HINT_RANGE" "PROPERTY_HINT_ENUM" "PROPERTY_HINT_ENUM_SUGGESTION" "PROPERTY_HINT_EXP_EASING"
+  "PROPERTY_HINT_LINK" "PROPERTY_HINT_FLAGS" "PROPERTY_HINT_LAYERS_2D_RENDER" "PROPERTY_HINT_LAYERS_2D_PHYSICS"
+  "PROPERTY_HINT_LAYERS_2D_NAVIGATION" "PROPERTY_HINT_LAYERS_3D_RENDER" "PROPERTY_HINT_LAYERS_3D_PHYSICS"
+  "PROPERTY_HINT_LAYERS_3D_NAVIGATION" "PROPERTY_HINT_FILE" "PROPERTY_HINT_DIR" "PROPERTY_HINT_GLOBAL_FILE"
+  "PROPERTY_HINT_GLOBAL_DIR" "PROPERTY_HINT_RESOURCE_TYPE" "PROPERTY_HINT_MULTILINE_TEXT" "PROPERTY_HINT_EXPRESSION"
+  "PROPERTY_HINT_PLACEHOLDER_TEXT" "PROPERTY_HINT_COLOR_NO_ALPHA" "PROPERTY_HINT_OBJECT_ID" "PROPERTY_HINT_TYPE_STRING"
+  "PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" "PROPERTY_HINT_OBJECT_TOO_BIG" "PROPERTY_HINT_NODE_PATH_VALID_TYPES"
+  "PROPERTY_HINT_SAVE_FILE" "PROPERTY_HINT_GLOBAL_SAVE_FILE" "PROPERTY_HINT_INT_IS_OBJECTID"
+  "PROPERTY_HINT_INT_IS_POINTER" "PROPERTY_HINT_ARRAY_TYPE" "PROPERTY_HINT_LOCALE_ID" "PROPERTY_HINT_LOCALIZABLE_STRING"
+  "PROPERTY_HINT_NODE_TYPE" "PROPERTY_HINT_HIDE_QUATERNION_EDIT" "PROPERTY_HINT_PASSWORD" "PROPERTY_HINT_MAX"
+  "PROPERTY_USAGE_NONE" "PROPERTY_USAGE_STORAGE" "PROPERTY_USAGE_EDITOR" "PROPERTY_USAGE_INTERNAL"
+  "PROPERTY_USAGE_CHECKABLE" "PROPERTY_USAGE_CHECKED" "PROPERTY_USAGE_GROUP" "PROPERTY_USAGE_CATEGORY"
+  "PROPERTY_USAGE_SUBGROUP" "PROPERTY_USAGE_CLASS_IS_BITFIELD" "PROPERTY_USAGE_NO_INSTANCE_STATE"
+  "PROPERTY_USAGE_RESTART_IF_CHANGED" "PROPERTY_USAGE_SCRIPT_VARIABLE" "PROPERTY_USAGE_STORE_IF_NULL"
+  "PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED" "PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE" "PROPERTY_USAGE_CLASS_IS_ENUM"
+  "PROPERTY_USAGE_NIL_IS_VARIANT" "PROPERTY_USAGE_ARRAY" "PROPERTY_USAGE_ALWAYS_DUPLICATE"
+  "PROPERTY_USAGE_NEVER_DUPLICATE" "PROPERTY_USAGE_HIGH_END_GFX" "PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT"
+  "PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT" "PROPERTY_USAGE_KEYING_INCREMENTS" "PROPERTY_USAGE_DEFERRED_SET_RESOURCE"
+  "PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT" "PROPERTY_USAGE_EDITOR_BASIC_SETTING" "PROPERTY_USAGE_READ_ONLY"
+  "PROPERTY_USAGE_DEFAULT" "PROPERTY_USAGE_NO_EDITOR" "METHOD_FLAG_NORMAL" "METHOD_FLAG_EDITOR" "METHOD_FLAG_CONST"
+  "METHOD_FLAG_VIRTUAL" "METHOD_FLAG_VARARG" "METHOD_FLAG_STATIC" "METHOD_FLAG_OBJECT_CORE" "METHOD_FLAGS_DEFAULT"
+  "TYPE_NIL" "TYPE_BOOL" "TYPE_INT" "TYPE_FLOAT" "TYPE_STRING" "TYPE_VECTOR2" "TYPE_VECTOR2I" "TYPE_RECT2" "TYPE_RECT2I"
+  "TYPE_VECTOR3" "TYPE_VECTOR3I" "TYPE_TRANSFORM2D" "TYPE_VECTOR4" "TYPE_VECTOR4I" "TYPE_PLANE" "TYPE_QUATERNION"
+  "TYPE_AABB" "TYPE_BASIS" "TYPE_TRANSFORM3D" "TYPE_PROJECTION" "TYPE_COLOR" "TYPE_STRING_NAME" "TYPE_NODE_PATH"
+  "TYPE_RID" "TYPE_OBJECT" "TYPE_CALLABLE" "TYPE_SIGNAL" "TYPE_DICTIONARY" "TYPE_ARRAY" "TYPE_PACKED_BYTE_ARRAY"
+  "TYPE_PACKED_INT32_ARRAY" "TYPE_PACKED_INT64_ARRAY" "TYPE_PACKED_FLOAT32_ARRAY" "TYPE_PACKED_FLOAT64_ARRAY"
+  "TYPE_PACKED_STRING_ARRAY" "TYPE_PACKED_VECTOR2_ARRAY" "TYPE_PACKED_VECTOR3_ARRAY" "TYPE_PACKED_COLOR_ARRAY" "TYPE_MAX"
+  "OP_EQUAL" "OP_NOT_EQUAL" "OP_LESS" "OP_LESS_EQUAL" "OP_GREATER" "OP_GREATER_EQUAL" "OP_ADD" "OP_SUBTRACT"
+  "OP_MULTIPLY" "OP_DIVIDE" "OP_NEGATE" "OP_POSITIVE" "OP_MODULE" "OP_POWER" "OP_SHIFT_LEFT" "OP_SHIFT_RIGHT"
+  "OP_BIT_AND" "OP_BIT_OR" "OP_BIT_XOR" "OP_BIT_NEGATE" "OP_AND" "OP_OR" "OP_XOR" "OP_NOT" "OP_IN" "OP_MAX"
+ ))
+
diff --git a/queries/gdscript/indents.scm b/queries/gdscript/indents.scm
index 38069c38f..74d14d3b8 100644
--- a/queries/gdscript/indents.scm
+++ b/queries/gdscript/indents.scm
@@ -1,24 +1,78 @@
 [
-  (if_statement)
+  (lambda)
+  (function_definition)
 
   (for_statement)
   (while_statement)
-
-  (parenthesized_expression)
-
-  (function_definition)
+  (if_statement)
   (class_definition)
+  (match_statement)
+  (pattern_section)
+  (setget)
+  (match_body)
+  (set_body)
+  (get_body)
 ] @indent
 
-((arguments) @aligned_indent
- (#set! "delimiter" "()"))
-((parameters) @aligned_indent
- (#set! "delimiter" "()"))
-
 [
-  ")"
-  "]"
-  "}"
   (elif_clause)
   (else_clause)
 ] @branch
+
+[
+ (string)
+ (comment)
+ (array)
+ (dictionary)
+ (parenthesized_expression)
+ (ERROR)
+] @auto
+
+[
+  (pass_statement)
+  (continue_statement)
+  (break_statement)
+  (return_statement)
+] @dedent
+
+[
+  (ERROR "[")
+  (ERROR "(")
+  (ERROR "{")
+] @indent
+
+;; This only works with expanded tabs.
+; ((parameters) @aligned_indent (#set! "delimiter" "()"))
+; ((arguments)  @aligned_indent (#set! "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 @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
+; (parameters) @indent
+; (array) @indent
+; (dictionary) @indent
+; (parenthesized_expression) @indent
+
+;; 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 "]" @auto) ) .)
diff --git a/queries/gdscript/locals.scm b/queries/gdscript/locals.scm
index 313af2aef..2c352b4a3 100644
--- a/queries/gdscript/locals.scm
+++ b/queries/gdscript/locals.scm
@@ -1,10 +1,92 @@
-(function_definition) @definition.function
+;; Scopes
 
 [
-  (extends_statement)
-  (variable_statement)
-  (expression_statement)
   (if_statement)
+  (elif_clause)
+  (else_clause)
+  (for_statement)
+  (while_statement)
   (function_definition)
-  (body)
+  (constructor_definition)
+  (class_definition)
+  (match_statement)
+  (pattern_section)
+  (lambda)
+  (get_body)
+  (set_body)
 ] @scope
+
+;; Parameters
+
+(parameters (identifier) @definition.parameter)
+(default_parameter (identifier) @definition.parameter)
+(typed_parameter (identifier) @definition.parameter)
+(typed_default_parameter (identifier) @definition.parameter)
+
+;; Signals
+
+; Can gdscript 2 signals be considered fields?
+(signal_statement (name) @definition.field)
+
+;; Variable Definitions
+
+(const_statement (name) @definition.constant)
+; onready and export variations are only properties.
+(variable_statement (name) @definition.var)
+
+(setter) @reference
+(getter) @reference
+
+;; Function Definition
+
+((function_definition (name) @definition.function)
+ (#set! "definition.function.scope" "parent"))
+
+;; Lambda
+
+; lambda names are not accessible and are only for debugging.
+(lambda (name) @definition.function)
+
+;; Source
+
+(class_name_statement (name) @definition.type)
+
+(source (variable_statement (name) @definition.field))
+(source (onready_variable_statement (name) @definition.field))
+(source (export_variable_statement (name) @definition.field))
+
+;; Class
+
+((class_definition (name) @definition.type)
+ (#set! "definition.type.scope" "parent"))
+
+(class_definition
+  (body (variable_statement (name) @definition.field)))
+(class_definition
+  (body (onready_variable_statement (name) @definition.field)))
+(class_definition
+  (body (export_variable_statement (name) @definition.field)))
+(class_definition
+  (body (signal_statement (name) @definition.field)))
+
+; Although a script is also a class, let's only define functions in an inner class as
+; methods.
+((class_definition
+  (body (function_definition (name) @definition.method)))
+ (#set! "definition.method.scope" "parent"))
+
+;; Enum
+
+((enum_definition (name) @definition.enum))
+
+;; Repeat
+
+(for_statement . (identifier) @definition.var)
+
+;; Match Statement
+
+(pattern_binding (identifier) @definition.var)
+
+;; References
+
+(identifier) @reference

From 6d96e2b6ace02db0bedc60ff268f2da7877895e0 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Thu, 2 Mar 2023 06:41:32 +0000
Subject: [PATCH 0073/2730] Update parsers: erlang, haskell, qmldir, sql, v

---
 lockfile.json | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 437e104a3..91366890b 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -111,7 +111,7 @@
     "revision": "203f7bd3c1bbfbd98fc19add4b8fcb213c059205"
   },
   "erlang": {
-    "revision": "2422bc9373094bfa97653ac540e08759f812523c"
+    "revision": "9fe5cdfab0f0d753112e9949a3501f64b75a3d92"
   },
   "fennel": {
     "revision": "517195970428aacca60891b050aa53eabf4ba78d"
@@ -180,7 +180,7 @@
     "revision": "b7bd6928532ada34dddb1dece4a158ab62c6e783"
   },
   "haskell": {
-    "revision": "3bdba07c7a8eec23f87fa59ce9eb2ea4823348b3"
+    "revision": "0da7f826e85b3e589e217adf69a6fd89ee4301b9"
   },
   "hcl": {
     "revision": "0ff887f2a60a147452d52db060de6b42f42f1441"
@@ -351,7 +351,7 @@
     "revision": "bd087020f0d8c183080ca615d38de0ec827aeeaf"
   },
   "qmldir": {
-    "revision": "ce42c9abb9b86a563f117d733b3bc0dd7e2e6e76"
+    "revision": "6b2b5e41734bd6f07ea4c36ac20fb6f14061c841"
   },
   "qmljs": {
     "revision": "ab75be9750e6f2f804638824d1790034286a830c"
@@ -414,7 +414,7 @@
     "revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
   },
   "sql": {
-    "revision": "672fe6b5180d20e9e84fd61749cc3e083e88d9d9"
+    "revision": "d4b8be1e52b07b66e5ec62d2f1c0d701dfa85ed9"
   },
   "starlark": {
     "revision": "8ad93a74c2a880bc16325affba3cc66c14bb2bde"
@@ -474,7 +474,7 @@
     "revision": "debd26fed283d80456ebafa33a06957b0c52e451"
   },
   "v": {
-    "revision": "136f3a0ad91ab8a781c2d4eb419df0a981839f69"
+    "revision": "66cf9d3086fb5ecc827cb32c64c5d812ab17d2c6"
   },
   "vala": {
     "revision": "8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b"

From b31312729e1b779e2773d99bf83355b09b5ba3d3 Mon Sep 17 00:00:00 2001
From: Github Actions 
Date: Thu, 2 Mar 2023 07:28:32 +0000
Subject: [PATCH 0074/2730] Update README

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 666d264b6..90bebb570 100644
--- a/README.md
+++ b/README.md
@@ -218,7 +218,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
 - [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)
 - [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
-- [ ] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript)
+- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp)
 - [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)
 - [x] [gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) (maintained by @ObserverOfTime)
 - [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod)

From 07fb134752b4af49d1a87cc735573edeadcbb271 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Thu, 2 Mar 2023 17:53:56 +0100
Subject: [PATCH 0075/2730] markdown!: switch to scanner.c

---
 lockfile.json                   | 4 ++--
 lua/nvim-treesitter/parsers.lua | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 91366890b..44d7d437a 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -267,10 +267,10 @@
     "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
   },
   "markdown": {
-    "revision": "6138ee0c0d0ddafc4bf0e25728b73f902bbf2c98"
+    "revision": "afbb3195c9c1683e358eb36805c0088ffbb2306c"
   },
   "markdown_inline": {
-    "revision": "6138ee0c0d0ddafc4bf0e25728b73f902bbf2c98"
+    "revision": "afbb3195c9c1683e358eb36805c0088ffbb2306c"
   },
   "matlab": {
     "revision": "2d5d3d5193718a86477d4335aba5b34e79147326"
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index a600e2de0..249a1b00a 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -869,7 +869,7 @@ list.markdown = {
   install_info = {
     url = "https://github.com/MDeiml/tree-sitter-markdown",
     location = "tree-sitter-markdown",
-    files = { "src/parser.c", "src/scanner.cc" },
+    files = { "src/parser.c", "src/scanner.c" },
     branch = "split_parser",
     readme_name = "markdown (basic highlighting)",
   },
@@ -881,7 +881,7 @@ list.markdown_inline = {
   install_info = {
     url = "https://github.com/MDeiml/tree-sitter-markdown",
     location = "tree-sitter-markdown-inline",
-    files = { "src/parser.c", "src/scanner.cc" },
+    files = { "src/parser.c", "src/scanner.c" },
     branch = "split_parser",
     readme_name = "markdown_inline (needs to be installed for full markdown highlighting)",
   },

From e9fb90da020d08bda2a616324a64921fde3236f6 Mon Sep 17 00:00:00 2001
From: Matthias Queitsch 
Date: Thu, 2 Mar 2023 18:41:33 +0100
Subject: [PATCH 0076/2730] feat(prql): update queries

---
 lockfile.json               |  2 +-
 queries/prql/highlights.scm | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 44d7d437a..6b1281d85 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -339,7 +339,7 @@
     "revision": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f"
   },
   "prql": {
-    "revision": "3f27cac466f030ee7d985d91eba5470e01dd21ea"
+    "revision": "5f6c4e4a90633b19e2077c1d37248989789d64be"
   },
   "pug": {
     "revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
diff --git a/queries/prql/highlights.scm b/queries/prql/highlights.scm
index 3810bdda4..a69259a0a 100644
--- a/queries/prql/highlights.scm
+++ b/queries/prql/highlights.scm
@@ -22,7 +22,7 @@
 ] @keyword
 
 [
- (literal)
+ (literal_string)
  (f_string)
  (s_string)
 ] @string
@@ -84,6 +84,15 @@ alias: (identifier) @field
   (keyword_sum)
   (keyword_stddev)
   (keyword_count)
+  (keyword_lag)
+  (keyword_lead)
+  (keyword_first)
+  (keyword_last)
+  (keyword_rank)
+  (keyword_row_number)
+  (keyword_round)
+  (keyword_all)
+  (keyword_map)
 ] @function
 
 [

From 8894d78f63a589b7fca609e42d682e32067b2448 Mon Sep 17 00:00:00 2001
From: Anthony Shi <69449791+anthony-S93@users.noreply.github.com>
Date: Fri, 3 Mar 2023 11:37:21 +0800
Subject: [PATCH 0077/2730] Update highlights.scm for Python

Added new keywords "is not" and "not in"
---
 queries/python/highlights.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index b8b8b7b94..54ad82b09 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -227,6 +227,8 @@
   "is"
   "not"
   "or"
+  "is not"
+  "not in"
 
   "del"
 ] @keyword.operator

From a0d6c28f893cbbc761cfa7fc7204ba6f3e2710cf Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Fri, 3 Mar 2023 06:40:53 +0000
Subject: [PATCH 0078/2730] Update parsers: cpp, cuda, markdown,
 markdown_inline, racket, sql

---
 lockfile.json | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 6b1281d85..4720e882c 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -60,13 +60,13 @@
     "revision": "eedb93bf9e22e82ed6a67e6c57fd78731b44f591"
   },
   "cpp": {
-    "revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819"
+    "revision": "03fa93db133d6048a77d4de154a7b17ea8b9d076"
   },
   "css": {
     "revision": "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51"
   },
   "cuda": {
-    "revision": "9b1f7481a151686fce8af66da147f40388f8ee4d"
+    "revision": "91c3ca3e42326e0f7b83c82765940bbf7f91c847"
   },
   "d": {
     "revision": "c2fbf21bd3aa45495fe13247e040ad5815250032"
@@ -267,10 +267,10 @@
     "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
   },
   "markdown": {
-    "revision": "afbb3195c9c1683e358eb36805c0088ffbb2306c"
+    "revision": "10b9b5ad8742456b383908868b14709d73ff81f4"
   },
   "markdown_inline": {
-    "revision": "afbb3195c9c1683e358eb36805c0088ffbb2306c"
+    "revision": "10b9b5ad8742456b383908868b14709d73ff81f4"
   },
   "matlab": {
     "revision": "2d5d3d5193718a86477d4335aba5b34e79147326"
@@ -363,7 +363,7 @@
     "revision": "80efda55672d1293aa738f956c7ae384ecdc31b4"
   },
   "racket": {
-    "revision": "1a5df0206b25a05cb1b35a68d2105fc7493df39b"
+    "revision": "c2f7baa22053a66b4dba852cdba3f14f34bb6985"
   },
   "rasi": {
     "revision": "5f04634dd4e12de4574c4a3dc9d6d5d4da4a2a1b"
@@ -414,7 +414,7 @@
     "revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
   },
   "sql": {
-    "revision": "d4b8be1e52b07b66e5ec62d2f1c0d701dfa85ed9"
+    "revision": "ee50e2e8c3df92bd66093aefa1834b2735355b9b"
   },
   "starlark": {
     "revision": "8ad93a74c2a880bc16325affba3cc66c14bb2bde"

From 8212548e3346aa56166a0831016026f265562e4a Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Fri, 3 Mar 2023 15:49:25 +0100
Subject: [PATCH 0079/2730] docs(readme): recommend installing query parser

now bundled in Neovim
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 90bebb570..f97bcd5bb 100644
--- a/README.md
+++ b/README.md
@@ -105,8 +105,8 @@ All modules are disabled by default and need to be activated explicitly in your
 
 ```lua
 require'nvim-treesitter.configs'.setup {
-  -- A list of parser names, or "all" (the four listed parsers should always be installed)
-  ensure_installed = { "c", "lua", "vim", "help" },
+  -- A list of parser names, or "all" (the five listed parsers should always be installed)
+  ensure_installed = { "c", "lua", "vim", "help", "query" },
 
   -- Install parsers synchronously (only applied to `ensure_installed`)
   sync_install = false,

From 1bf4be044138cc9b3f802d77a9d5c2b5dd9be61d Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 05:37:39 -0500
Subject: [PATCH 0080/2730] docs: add `@keyword.coroutine`

---
 CONTRIBUTING.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 219555a8a..f954bff1d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -140,6 +140,7 @@ effect on highlighting. We will work on improving highlighting in the near futur
 
 ```scheme
 @keyword             ; various keywords
+@keyword.coroutine   ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
 @keyword.function    ; keywords that define a function (e.g. `func` in Go, `def` in Python)
 @keyword.operator    ; operators that are English words (e.g. `and` / `or`)
 @keyword.return      ; keywords like `return` and `yield`

From 33ba346e60c3151fcdafc55d0e547556dc803c03 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 06:37:45 -0500
Subject: [PATCH 0081/2730] feat!: add `@keyword.coroutine` capture

---
 queries/c_sharp/highlights.scm  |  7 ++-
 queries/clojure/highlights.scm  | 14 +++---
 queries/cpp/highlights.scm      | 15 ++++---
 queries/dart/highlights.scm     | 13 +++---
 queries/ecma/highlights.scm     | 79 +++++++++++++++++----------------
 queries/gdscript/highlights.scm |  9 ++--
 queries/hack/highlights.scm     |  7 ++-
 queries/kotlin/highlights.scm   |  8 +++-
 queries/python/highlights.scm   |  7 ++-
 queries/rust/highlights.scm     |  7 ++-
 queries/starlark/highlights.scm |  5 +++
 queries/svelte/highlights.scm   |  3 ++
 queries/swift/highlights.scm    |  6 ++-
 queries/thrift/highlights.scm   | 11 ++++-
 queries/tlaplus/highlights.scm  |  4 +-
 queries/vala/highlights.scm     |  7 ++-
 queries/zig/highlights.scm      | 13 +++---
 17 files changed, 137 insertions(+), 78 deletions(-)

diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm
index ddb08eca4..c2bac3c1d 100644
--- a/queries/c_sharp/highlights.scm
+++ b/queries/c_sharp/highlights.scm
@@ -337,8 +337,6 @@
  "implicit"
  "explicit"
  "override"
- "async"
- "await"
  "class"
  "delegate"
  "enum"
@@ -358,6 +356,11 @@
  "fixed"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
  "const"
  "extern"
diff --git a/queries/clojure/highlights.scm b/queries/clojure/highlights.scm
index 00a692521..e5609b25b 100644
--- a/queries/clojure/highlights.scm
+++ b/queries/clojure/highlights.scm
@@ -112,6 +112,9 @@
   "deftype"))
 ((sym_lit) @keyword
  (#eq? @keyword "declare"))
+((sym_name) @keyword.coroutine
+ (#any-of? @keyword.coroutine
+  "alts!" "alts!!" "await" "await-for" "await1" "chan" "close!" "future" "go" "sync" "thread" "timeout" "!" ">!!"))
 ((sym_lit) @keyword.function
  (#match? @keyword.function "^(defn|defn-|fn|fn[*])$"))
 
@@ -148,13 +151,13 @@
  (#any-of? @function.macro
   "." ".." "->" "->>" "amap" "areduce" "as->" "assert"
   "binding" "bound-fn" "delay" "do" "dosync"
-  "doto" "extend-protocol" "extend-type" "future"
+  "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->>" "sync"
+  "refer-clojure" "reify" "set!" "some->" "some->>"
   "time" "unquote" "unquote-splicing" "var" "vswap!"
-  "ex-cause" "ex-data" "ex-message")) 
+  "ex-cause" "ex-data" "ex-message"))
 ((sym_lit) @function.macro
  (#match? @function.macro "^with\\-.*$"))
 
@@ -175,9 +178,8 @@
   "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" "await" "await-for" "await1"
-  "bases" "bean" "bigdec" "bigint" "biginteger" "bit-and"
-  "bit-and-not" "bit-clear" "bit-flip" "bit-not" "bit-or"
+  "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"
diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm
index 1f770e9f8..0f12dd8df 100644
--- a/queries/cpp/highlights.scm
+++ b/queries/cpp/highlights.scm
@@ -143,11 +143,19 @@
  "template"
  "typename"
  "using"
- "co_await"
  "concept"
  "requires"
 ] @keyword
 
+[
+  "co_await"
+] @keyword.coroutine
+
+[
+ "co_yield"
+ "co_return"
+] @keyword.coroutine.return
+
 [
  "public"
  "private"
@@ -156,11 +164,6 @@
  "final"
 ] @type.qualifier
 
-[
- "co_yield"
- "co_return"
-] @keyword.return
-
 [
  "new"
  "delete"
diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm
index f5e391092..154a92b3a 100644
--- a/queries/dart/highlights.scm
+++ b/queries/dart/highlights.scm
@@ -195,14 +195,12 @@
 
 [
   "return"
-  "yield"
 ] @keyword.return
 
 
 ; Built in identifiers:
 ; alone these are marked as keywords
 [
-    "await"
     "deferred"
     "factory"
     "get"
@@ -216,17 +214,22 @@
     "typedef"
 ] @keyword
 
+[
+  "async"
+  "async*"
+  "sync*"
+  "await"
+  "yield"
+] @keyword.coroutine
+
 [
     (const_builtin)
     (final_builtin)
     "abstract"
-    "async"
-    "async*"
     "covariant"
     "dynamic"
     "external"
     "static"
-    "sync*"
 ] @type.qualifier
 
 ; when used as an identifier:
diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm
index e347098a3..cdae02ab2 100644
--- a/queries/ecma/highlights.scm
+++ b/queries/ecma/highlights.scm
@@ -210,15 +210,15 @@
 ;----------
 
 [
-"if"
-"else"
-"switch"
-"case"
+  "if"
+  "else"
+  "switch"
+  "case"
 ] @conditional
 
 [
-"import"
-"from"
+  "import"
+  "from"
 ] @include
 
 (export_specifier "as" @include)
@@ -227,53 +227,56 @@
 (namespace_import "as" @include)
 
 [
-"for"
-"of"
-"do"
-"while"
-"continue"
+  "for"
+  "of"
+  "do"
+  "while"
+  "continue"
 ] @repeat
 
 [
-"async"
-"await"
-"break"
-"class"
-"const"
-"debugger"
-"export"
-"extends"
-"get"
-"in"
-"instanceof"
-"let"
-"set"
-"static"
-"target"
-"typeof"
-"var"
-"with"
+  "break"
+  "class"
+  "const"
+  "debugger"
+  "export"
+  "extends"
+  "get"
+  "in"
+  "instanceof"
+  "let"
+  "set"
+  "static"
+  "target"
+  "typeof"
+  "var"
+  "with"
 ] @keyword
 
 [
-"return"
-"yield"
+  "async"
+  "await"
+] @keyword.coroutine
+
+[
+  "return"
+  "yield"
 ] @keyword.return
 
 [
- "function"
+  "function"
 ] @keyword.function
 
 [
- "new"
- "delete"
+  "new"
+  "delete"
 ] @keyword.operator
 
 [
- "throw"
- "try"
- "catch"
- "finally"
+  "throw"
+  "try"
+  "catch"
+  "finally"
 ] @exception
 
 (export_statement
diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm
index 073096556..c6c6dae13 100644
--- a/queries/gdscript/highlights.scm
+++ b/queries/gdscript/highlights.scm
@@ -159,12 +159,15 @@
 "func" @keyword.function
 
 [
-  "await"
   "return"
 ] @keyword.return
 
-(call (identifier) @keyword.return
-      (#eq? @keyword.return "yield"))
+[
+  "await"
+] @keyword.coroutine
+
+(call (identifier) @keyword.coroutine
+      (#eq? @keyword.coroutine "yield"))
 
 
 ;; Builtins
diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm
index e79d62c75..ffb365c87 100644
--- a/queries/hack/highlights.scm
+++ b/queries/hack/highlights.scm
@@ -17,8 +17,6 @@
 "function" @keyword.function
 
 [
- "async"
- "await"
  "type"
  "interface"
  "implements"
@@ -31,6 +29,11 @@
  "insteadof"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
  "use"
  "include"
diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm
index 2fd2c089b..caf62f1f0 100644
--- a/queries/kotlin/highlights.scm
+++ b/queries/kotlin/highlights.scm
@@ -307,7 +307,13 @@
 ;	"typeof" ; NOTE: It is reserved for future use
 ] @keyword
 
-("fun") @keyword.function
+[
+  "suspend"
+] @keyword.coroutine
+
+[
+  "fun"
+] @keyword.function
 
 (jump_expression) @keyword.return
 
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 54ad82b09..fe66d7ca3 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -240,8 +240,6 @@
 
 [
   "assert"
-  "async"
-  "await"
   "class"
   "exec"
   "global"
@@ -252,6 +250,11 @@
   "as"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
   "return"
   "yield"
diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm
index db80fbb32..c24a278f6 100644
--- a/queries/rust/highlights.scm
+++ b/queries/rust/highlights.scm
@@ -169,8 +169,6 @@
 (use_as_clause "as" @include)
 
 [
-  "async"
-  "await"
   "default"
   "dyn"
   "enum"
@@ -188,6 +186,11 @@
   "where"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
  "ref"
  (mutable_specifier)
diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm
index 401b985d7..a92832d68 100644
--- a/queries/starlark/highlights.scm
+++ b/queries/starlark/highlights.scm
@@ -228,6 +228,11 @@
   "as"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
   "return"
 ] @keyword.return
diff --git a/queries/svelte/highlights.scm b/queries/svelte/highlights.scm
index 058682a7c..e1a67296e 100644
--- a/queries/svelte/highlights.scm
+++ b/queries/svelte/highlights.scm
@@ -8,6 +8,9 @@
   (as)
 ] @keyword
 
+((special_block_keyword) @keyword.coroutine
+  (#eq? @keyword.coroutine "await"))
+
 [
   "{"
   "}"
diff --git a/queries/swift/highlights.scm b/queries/swift/highlights.scm
index c6220984e..5773c2377 100644
--- a/queries/swift/highlights.scm
+++ b/queries/swift/highlights.scm
@@ -22,7 +22,6 @@
 (function_declaration (simple_identifier) @method)
 (function_declaration ["init" @constructor])
 (throws) @keyword
-"async" @keyword
 (where_keyword) @keyword
 (parameter external_name: (simple_identifier) @parameter)
 (parameter name: (simple_identifier) @parameter)
@@ -47,6 +46,11 @@
   "some"
 ] @keyword
 
+[
+  "async"
+  "await"
+] @keyword.coroutine
+
 [
   (getter_specifier)
   (setter_specifier)
diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm
index c6ff6464f..5df609c3d 100644
--- a/queries/thrift/highlights.scm
+++ b/queries/thrift/highlights.scm
@@ -86,7 +86,6 @@
   "include"
   "interaction"
   "namespace"
-  "oneway"
   "optional"
   "required"
   "senum"
@@ -96,10 +95,13 @@
   "union"
 ] @keyword
 
+[
+  "oneway"
+] @keyword.coroutine
+
 ; Deprecated Keywords
 
 [
-  "async"
   "cocoa_prefix"
   "cpp_namespace"
   "csharp_namespace"
@@ -118,7 +120,12 @@
   "xsd_optional"
 ] @keyword
 
+[
+  "async"
+] @keyword.coroutine
+
 ; Extended Keywords
+
 [
   "client"
   "idempotent"
diff --git a/queries/tlaplus/highlights.scm b/queries/tlaplus/highlights.scm
index a94a91f4e..2199359f8 100644
--- a/queries/tlaplus/highlights.scm
+++ b/queries/tlaplus/highlights.scm
@@ -81,7 +81,6 @@
   (pcal_algorithm_start)
   "algorithm"
   "assert"
-  "await"
   "begin"
   "call"
   "define"
@@ -98,6 +97,9 @@
   "when"
   "with"
 ] @keyword
+[
+  "await"
+] @keyword.coroutine
 (pcal_with ("=") @keyword)
 (pcal_process ("=") @keyword)
 [ 
diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm
index 1c9732dff..5ad7e0345 100644
--- a/queries/vala/highlights.scm
+++ b/queries/vala/highlights.scm
@@ -90,7 +90,6 @@
 
 [
  "abstract"
- "async"
  "class"
  "construct"
  "continue"
@@ -114,6 +113,11 @@
  "with"
 ] @keyword
 
+[
+  "async"
+  "yield"
+] @keyword.coroutine
+
 [
  "const"
  "dynamic"
@@ -183,7 +187,6 @@
 
 [
   "return"
-  "yield"
 ] @keyword.return
 
 [
diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm
index e3e91dc65..60e5b373a 100644
--- a/queries/zig/highlights.scm
+++ b/queries/zig/highlights.scm
@@ -95,10 +95,17 @@ field_constant: (IDENTIFIER) @constant
   "asm"
   "defer"
   "errdefer"
-  "nosuspend"
   "test"
 ] @keyword
 
+[
+  "async"
+  "await"
+  "suspend"
+  "nosuspend"
+  "resume"
+] @keyword.coroutine
+
 [
   "fn"
 ] @keyword.function
@@ -111,10 +118,6 @@ field_constant: (IDENTIFIER) @constant
 
 [
   "return"
-  "async"
-  "await"
-  "suspend"
-  "resume"
 ] @keyword.return
 
 [

From 3c8842c79a2b499453c7f40d4babf5067a07e452 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 06:38:02 -0500
Subject: [PATCH 0082/2730] refactor(ruby): move keywords appropriately

---
 queries/ruby/highlights.scm | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm
index cf253a474..c350e5ad1 100644
--- a/queries/ruby/highlights.scm
+++ b/queries/ruby/highlights.scm
@@ -8,19 +8,13 @@
 [
  "alias"
  "begin"
- "break"
  "class"
- "def"
  "do"
  "end"
  "ensure"
  "module"
- "next"
- "redo"
  "rescue"
- "retry"
  "then"
- "undef"
  ] @keyword
 
 [
@@ -35,6 +29,14 @@
  "not"
 ] @keyword.operator
 
+[
+  "def"
+  "undef"
+] @keyword.function
+
+(method
+  "end" @keyword.function)
+
 [
  "case"
  "else"
@@ -44,10 +46,23 @@
  "when"
  ] @conditional
 
+(if
+  "end" @conditional)
+(if
+  (then) @conditional)
+(unless
+  (then) @conditional)
+(elsif
+  (then) @conditional)
+
 [
  "for"
  "until"
  "while"
+ "break"
+ "redo"
+ "retry"
+ "next"
  ] @repeat
 
 (constant) @type

From d2a45aa5318b7b1a6d66dbdd7d2d592dd5bb21d7 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 06:38:47 -0500
Subject: [PATCH 0083/2730] refactor(zig): `@type.definition` items belong in
 `@keyword`, differentiate `@boolean` from `@constant.builtin`

---
 queries/zig/highlights.scm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm
index 60e5b373a..0989704ce 100644
--- a/queries/zig/highlights.scm
+++ b/queries/zig/highlights.scm
@@ -79,6 +79,11 @@ field_constant: (IDENTIFIER) @constant
 
 (FLOAT) @float
 
+[
+  "true"
+  "false"
+] @boolean
+
 [
   (LINESTRING)
   (STRINGLITERALSINGLE)
@@ -96,6 +101,11 @@ field_constant: (IDENTIFIER) @constant
   "defer"
   "errdefer"
   "test"
+  "struct"
+  "union"
+  "enum"
+  "opaque"
+  "error"
 ] @keyword
 
 [
@@ -147,14 +157,6 @@ field_constant: (IDENTIFIER) @constant
   (BuildinTypeExpr)
 ] @type.builtin
 
-[
-  "struct"
-  "union"
-  "enum"
-  "opaque"
-  "error"
-] @type.definition
-
 [
   "const"
   "var"
@@ -185,8 +187,6 @@ field_constant: (IDENTIFIER) @constant
   "null"
   "unreachable"
   "undefined"
-  "true"
-  "false"
 ] @constant.builtin
 
 [

From 3c42fb9d702e1246313d2b5531b815595cb4d889 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 24 Feb 2023 06:54:21 -0500
Subject: [PATCH 0084/2730] refactor(svelte): match certain keywords for
 conditional and exception

---
 queries/svelte/highlights.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/queries/svelte/highlights.scm b/queries/svelte/highlights.scm
index e1a67296e..9877fc7a5 100644
--- a/queries/svelte/highlights.scm
+++ b/queries/svelte/highlights.scm
@@ -11,6 +11,12 @@
 ((special_block_keyword) @keyword.coroutine
   (#eq? @keyword.coroutine "await"))
 
+((special_block_keyword) @exception
+  (#eq? @exception "catch"))
+
+((special_block_keyword) @conditional
+  (#match? @conditional "^(if|else)$"))
+
 [
   "{"
   "}"

From f225f53510986997ae843b2a825df8083d85a191 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Fri, 3 Mar 2023 15:23:53 +0000
Subject: [PATCH 0085/2730] Update parsers: sql, yuck

---
 lockfile.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index 4720e882c..bf3d59baf 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -414,7 +414,7 @@
     "revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
   },
   "sql": {
-    "revision": "ee50e2e8c3df92bd66093aefa1834b2735355b9b"
+    "revision": "1cb7c7a11015983f6d173847d5a3574f8e20107b"
   },
   "starlark": {
     "revision": "8ad93a74c2a880bc16325affba3cc66c14bb2bde"
@@ -504,7 +504,7 @@
     "revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502"
   },
   "yuck": {
-    "revision": "1e1a7e10053b910f3864fe8d97ca1741d2df66b2"
+    "revision": "0f96c1d3bbdd32ca92b4e706c3f1fc2cb0d26b3f"
   },
   "zig": {
     "revision": "1cd5f339b146b764f39b36bb7be98ca631a2e02a"

From 190561df8995ff9526c06d33cf17416b9e0791e3 Mon Sep 17 00:00:00 2001
From: Yochem van Rosmalen 
Date: Fri, 3 Mar 2023 18:55:49 +0100
Subject: [PATCH 0086/2730] v(injections): inject regex for some methods in
 `re` module

---
 queries/v/highlights.scm | 2 ++
 queries/v/injections.scm | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/queries/v/highlights.scm b/queries/v/highlights.scm
index af2905239..16904d18b 100644
--- a/queries/v/highlights.scm
+++ b/queries/v/highlights.scm
@@ -396,6 +396,8 @@
 
 (rune_literal) @string
 
+(raw_string_literal) @string
+
 (escape_sequence) @string.escape
 
 (float_literal) @float
diff --git a/queries/v/injections.scm b/queries/v/injections.scm
index b77e7c630..11f02639e 100644
--- a/queries/v/injections.scm
+++ b/queries/v/injections.scm
@@ -4,3 +4,10 @@
 ;; #include <...>
 (hash_statement) @c
 
+;; regex for the methods defined in `re` module
+((call_expression
+    function: (selector_expression
+      field: (identifier) @_re)
+    arguments: (argument_list
+  (raw_string_literal) @regex (#offset! @regex 0 2 0 -1)))
+  (#any-of? @_re "regex_base" "regex_opt" "compile_opt"))

From 28f84d69e3b6c26f1f7a2ef3f248a7242f36d620 Mon Sep 17 00:00:00 2001
From: Evan Phoenix 
Date: Fri, 3 Mar 2023 20:26:51 -0800
Subject: [PATCH 0087/2730] fix(go): Indent on type switch case properly

---
 queries/go/indents.scm    | 1 +
 tests/indent/go/switch.go | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/queries/go/indents.scm b/queries/go/indents.scm
index e21fc8771..fe6e447eb 100644
--- a/queries/go/indents.scm
+++ b/queries/go/indents.scm
@@ -7,6 +7,7 @@
   (literal_value)
   (expression_case)
   (communication_case)
+  (type_case)
   (default_case)
   (block)
   (call_expression)
diff --git a/tests/indent/go/switch.go b/tests/indent/go/switch.go
index 8ccacd564..9b6e74db2 100644
--- a/tests/indent/go/switch.go
+++ b/tests/indent/go/switch.go
@@ -11,4 +11,10 @@ func test(ch byte) {
 	case 'l':
 		return
 	}
+
+	var i interface{}
+	switch i.(type) {
+	case int:
+		return
+	}
 }

From 88c490f00f837fbac95b2948bb7f0454a9cc4cf0 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Sat, 4 Mar 2023 06:39:17 +0000
Subject: [PATCH 0088/2730] Update parsers: hlsl, yuck

---
 lockfile.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index bf3d59baf..9e795a15f 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -195,7 +195,7 @@
     "revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0"
   },
   "hlsl": {
-    "revision": "18f2dcb5f65075457638658c4763672e826dcddf"
+    "revision": "306d48516a6b3dbb18a184692e8edffa8403018f"
   },
   "hocon": {
     "revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc"
@@ -504,7 +504,7 @@
     "revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502"
   },
   "yuck": {
-    "revision": "0f96c1d3bbdd32ca92b4e706c3f1fc2cb0d26b3f"
+    "revision": "48af129ab5411cd6f7ae2b36f53c1192572fa030"
   },
   "zig": {
     "revision": "1cd5f339b146b764f39b36bb7be98ca631a2e02a"

From c553e6c5608ba54e210e9131bf9ba5e36ef18e57 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 3 Mar 2023 06:32:24 -0500
Subject: [PATCH 0089/2730] fix(ecma): properly capture constants in const
 declarations

---
 queries/ecma/highlights.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm
index cdae02ab2..97feae8f3 100644
--- a/queries/ecma/highlights.scm
+++ b/queries/ecma/highlights.scm
@@ -24,10 +24,15 @@
  (#lua-match? @type "^[A-Z]"))
 
 ((identifier) @constant
- (#lua-match? @constant "^[A-Z_][A-Z%d_]+$"))
+ (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$"))
 
 ((shorthand_property_identifier) @constant
- (#lua-match? @constant "^[A-Z_][A-Z%d_]+$"))
+ (#lua-match? @constant "^_*[A-Z][A-Z%d_]*$"))
+
+(lexical_declaration
+  "const"
+  . (variable_declarator
+      . name: (identifier) @constant))
 
 ((identifier) @variable.builtin
  (#vim-match? @variable.builtin "^(arguments|module|console|window|document)$"))

From d7cef15b01e04f8322900f4b0294be582d31ab9d Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 3 Mar 2023 20:04:08 -0500
Subject: [PATCH 0090/2730] feat(ecma): add tests for constants

---
 tests/query/highlights/ecma/const.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 tests/query/highlights/ecma/const.js

diff --git a/tests/query/highlights/ecma/const.js b/tests/query/highlights/ecma/const.js
new file mode 100644
index 000000000..2b778fd15
--- /dev/null
+++ b/tests/query/highlights/ecma/const.js
@@ -0,0 +1,13 @@
+_FOO = 4
+// <- @constant
+__A__ = 2
+// <- @constant
+_ = 2
+// <- @variable
+A_B_C = 4
+// <- @constant
+_1 = 1
+// <- @variable
+
+const A = 2
+//    ^ @constant

From 376d74006fd8fff91431639136416ffca4458bfd Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Sat, 4 Mar 2023 04:31:11 -0500
Subject: [PATCH 0091/2730] feat: add cue

---
 README.md                       |   1 +
 lockfile.json                   |   3 +
 lua/nvim-treesitter/parsers.lua |   8 ++
 queries/cue/folds.scm           |   5 +
 queries/cue/highlights.scm      | 164 ++++++++++++++++++++++++++++++++
 queries/cue/indents.scm         |  21 ++++
 queries/cue/injections.scm      |   1 +
 queries/cue/locals.scm          |  34 +++++++
 8 files changed, 237 insertions(+)
 create mode 100644 queries/cue/folds.scm
 create mode 100644 queries/cue/highlights.scm
 create mode 100644 queries/cue/indents.scm
 create mode 100644 queries/cue/injections.scm
 create mode 100644 queries/cue/locals.scm

diff --git a/README.md b/README.md
index f97bcd5bb..cb16f3c77 100644
--- a/README.md
+++ b/README.md
@@ -196,6 +196,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
 - [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
 - [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)
+- [x] [cue](https://github.com/eonpatapon/tree-sitter-cue) (maintained by @amaanq)
 - [x] [d](https://github.com/CyberShadow/tree-sitter-d) (experimental, maintained by @nawordar)
 - [x] [dart](https://github.com/UserNobody14/tree-sitter-dart) (maintained by @akinsho)
 - [x] [devicetree](https://github.com/joelspadin/tree-sitter-devicetree) (maintained by @jedrzejboczar)
diff --git a/lockfile.json b/lockfile.json
index 9e795a15f..f1f630267 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -68,6 +68,9 @@
   "cuda": {
     "revision": "91c3ca3e42326e0f7b83c82765940bbf7f91c847"
   },
+  "cue": {
+    "revision": "4ffcda8c2bdfee1c2ba786cd503d0508ea92cca2"
+  },
   "d": {
     "revision": "c2fbf21bd3aa45495fe13247e040ad5815250032"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 249a1b00a..179513d9b 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -271,6 +271,14 @@ list.cuda = {
   maintainers = { "@theHamsta" },
 }
 
+list.cue = {
+  install_info = {
+    url = "https://github.com/eonpatapon/tree-sitter-cue",
+    files = { "src/parser.c", "src/scanner.c" },
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.d = {
   install_info = {
     url = "https://github.com/CyberShadow/tree-sitter-d",
diff --git a/queries/cue/folds.scm b/queries/cue/folds.scm
new file mode 100644
index 000000000..934b59e6f
--- /dev/null
+++ b/queries/cue/folds.scm
@@ -0,0 +1,5 @@
+[
+  (import_spec_list)
+  (field)
+  (string)
+] @fold
diff --git a/queries/cue/highlights.scm b/queries/cue/highlights.scm
new file mode 100644
index 000000000..c1f27fb8f
--- /dev/null
+++ b/queries/cue/highlights.scm
@@ -0,0 +1,164 @@
+; Includes
+
+[
+  "package"
+  "import"
+] @include
+
+; Namespaces
+
+(package_identifier) @namespace
+
+(import_spec ["." "_"] @punctuation.special)
+
+[
+  (attr_path)
+  (package_path)
+] @text.uri ;; In attributes
+
+; Attributes
+
+(attribute) @attribute
+
+; Conditionals
+
+"if" @conditional
+
+; Repeats
+
+[
+  "for"
+] @repeat
+
+(for_clause "_" @punctuation.special)
+
+; Keywords
+
+[
+  "let"
+] @keyword
+
+[
+  "in"
+] @keyword.operator
+
+; Operators
+
+[
+  "+"
+  "-"
+  "*"
+  "/"
+  "|"
+  "&"
+  "||"
+  "&&"
+  "=="
+  "!="
+  "<"
+  "<="
+  ">"
+  ">="
+  "=~"
+  "!~"
+  "!"
+  "="
+] @operator
+
+; Fields & Properties
+
+(field 
+  (label 
+  (identifier) @field))
+
+(selector_expression
+  (_)
+  (identifier) @property)
+
+; Functions
+
+(call_expression
+  function: (identifier) @function.call)
+(call_expression
+  function: (selector_expression
+  (_)
+  (identifier) @function.call))
+(call_expression
+  function: (builtin_function) @function.call)
+
+(builtin_function) @function.builtin
+
+; Variables
+
+(identifier) @variable
+
+; Types
+
+(primitive_type) @type.builtin
+
+((identifier) @type
+  (#match? @type "^(#|_#)"))
+
+[
+  (slice_type)
+  (pointer_type)
+] @type ;; In attributes
+
+; Punctuation
+
+[
+  ","
+  ":"
+] @punctuation.delimiter
+
+[ "{" "}" ] @punctuation.bracket
+
+[ "[" "]" ] @punctuation.bracket
+
+[ "(" ")" ] @punctuation.bracket
+
+[ "<" ">" ] @punctuation.bracket
+
+[
+  (ellipsis)
+  "?"
+] @punctuation.special
+
+; Literals
+
+(string) @string
+
+[
+  (escape_char)
+  (escape_unicode)
+] @string.escape
+
+(number) @number
+
+(float) @float
+
+(si_unit
+  (float)
+  (_) @symbol)
+
+(boolean) @boolean
+
+[
+  (null)
+  (top)
+  (bottom)
+] @constant.builtin
+
+; Interpolations
+
+(interpolation "\\(" @punctuation.special (_) ")" @punctuation.special) @none
+
+(interpolation "\\(" (identifier) @variable ")")
+
+; Commments
+
+(comment) @comment @spell
+
+; Errors
+
+(ERROR) @error
diff --git a/queries/cue/indents.scm b/queries/cue/indents.scm
new file mode 100644
index 000000000..731e69b79
--- /dev/null
+++ b/queries/cue/indents.scm
@@ -0,0 +1,21 @@
+[
+  (import_spec_list)
+  (field)
+] @indent
+
+[
+  "}"
+  "]"
+  ")"
+] @indent_end
+
+[ "{" "}" ] @branch
+
+[ "[" "]" ] @branch
+
+[ "(" ")" ] @branch
+
+[
+  (ERROR)
+  (comment)
+] @auto
diff --git a/queries/cue/injections.scm b/queries/cue/injections.scm
new file mode 100644
index 000000000..4bb7d675d
--- /dev/null
+++ b/queries/cue/injections.scm
@@ -0,0 +1 @@
+(comment) @comment
diff --git a/queries/cue/locals.scm b/queries/cue/locals.scm
new file mode 100644
index 000000000..b99a4fca8
--- /dev/null
+++ b/queries/cue/locals.scm
@@ -0,0 +1,34 @@
+; Scopes
+
+[
+  (source_file)
+  (field)
+  (for_clause)
+] @scope
+
+; References
+
+(identifier) @reference
+
+; Definitions
+
+(import_spec
+  path: (string) @definition.import)
+
+(field
+  (label
+  (identifier) @definition.field))
+
+(package_identifier) @definition.namespace
+
+(for_clause
+  (identifier) @definition.variable
+  (expression))
+
+(for_clause
+  (identifier)
+  (identifier) @definition.variable
+  (expression))
+
+(let_clause
+  (identifier) @definition.variable)

From e3a1ae4c4eccf309eaa1880176de7307cd70748a Mon Sep 17 00:00:00 2001
From: Matthias Queitsch 
Date: Thu, 2 Mar 2023 23:18:10 +0100
Subject: [PATCH 0092/2730] highlights(sql): add missing keywords

---
 queries/sql/highlights.scm | 81 +++++++++++++++++++++++++++++---------
 1 file changed, 62 insertions(+), 19 deletions(-)

diff --git a/queries/sql/highlights.scm b/queries/sql/highlights.scm
index 274469989..4178f9727 100644
--- a/queries/sql/highlights.scm
+++ b/queries/sql/highlights.scm
@@ -2,13 +2,16 @@
   name: (identifier) @function.call
   parameter: [(field)]? @parameter)
 
-(keyword_gist) @function.call
-(keyword_btree) @function.call
-(keyword_hash) @function.call
-(keyword_spgist) @function.call
-(keyword_gin) @function.call
-(keyword_brin) @function.call
-(keyword_float) @function.call
+[
+  (keyword_gist)
+  (keyword_btree)
+  (keyword_hash)
+  (keyword_spgist)
+  (keyword_gin)
+  (keyword_brin)
+  (keyword_float)
+  (keyword_array)
+] @function.call
 
 (count
   name: (keyword_count) @function.call
@@ -33,7 +36,7 @@
     parameter: [(literal)]?)))
 
 (literal) @string
-(comment) @comment
+(comment) @comment @spell
 (marginalia) @comment
 
 ((literal) @number
@@ -53,7 +56,6 @@
  (keyword_asc)
  (keyword_desc)
  (keyword_external)
- (keyword_stored)
  (keyword_parquet)
  (keyword_csv)
  (keyword_rcfile)
@@ -61,21 +63,27 @@
  (keyword_orc)
  (keyword_avro)
  (keyword_jsonfile)
+ (keyword_sequencefile)
  (keyword_temp)
- (keyword_cached)
  (keyword_uncached)
  (keyword_unlogged)
  (keyword_terminated)
  (keyword_escaped)
- (keyword_partitioned)
- (keyword_location)
- (keyword_lines)
  (keyword_unsigned)
  (keyword_nulls)
  (keyword_last)
  (keyword_materialized)
  (keyword_temp)
  (keyword_temporary)
+ (keyword_delimited)
+ (keyword_replication)
+ (keyword_auto_increment)
+ (keyword_default)
+ (keyword_collate)
+ (keyword_concurrently)
+ (keyword_engine)
+ (keyword_character)
+  (keyword_concurrently)
 ] @attribute
 
 [
@@ -91,7 +99,6 @@
   (keyword_where)
   (keyword_index)
   (keyword_join)
-  (keyword_on)
   (keyword_primary)
   (keyword_delete)
   (keyword_create)
@@ -107,10 +114,9 @@
   (keyword_outer)
   (keyword_inner)
   (keyword_order)
+  (keyword_partition)
   (keyword_group)
-  (keyword_by)
   (keyword_having)
-  (keyword_as)
   (keyword_limit)
   (keyword_offset)
   (keyword_table)
@@ -121,8 +127,6 @@
   (keyword_for)
   (keyword_if)
   (keyword_exists)
-  (keyword_auto_increment)
-  (keyword_default)
   (keyword_max)
   (keyword_min)
   (keyword_avg)
@@ -139,7 +143,6 @@
   (keyword_cascade)
   (keyword_between)
   (keyword_window)
-  (keyword_with)
   (keyword_no)
   (keyword_data)
   (keyword_type)
@@ -160,18 +163,54 @@
   (keyword_like)
   (keyword_similar)
   (keyword_over)
+  (keyword_change)
+  (keyword_modify)
+  (keyword_restrict)
+  (keyword_first)
+  (keyword_after)
+  (keyword_range)
+  (keyword_rows)
+  (keyword_groups)
+  (keyword_unbounded)
+  (keyword_preceding)
+  (keyword_following)
+  (keyword_exclude)
+  (keyword_current)
+  (keyword_ties)
+  (keyword_others)
+  (keyword_unique)
+  (keyword_preserve)
+  (keyword_zerofill)
+  (keyword_format)
+  (keyword_fields)
+  (keyword_row)
+  (keyword_sort)
+  (keyword_compute)
+  (keyword_stats)
+  (keyword_comment)
+  (keyword_partitioned)
+  (keyword_location)
+  (keyword_cached)
+  (keyword_lines)
+  (keyword_stored)
 ] @keyword
 
+(keyword_with) @repeat
+
+(keyword_as) @label
+
 [
   (keyword_int)
   (keyword_null)
   (keyword_boolean)
+  (keyword_bit)
   (keyword_smallserial)
   (keyword_serial)
   (keyword_bigserial)
   (keyword_smallint)
   (keyword_bigint)
   (keyword_decimal)
+  (keyword_float)
   (keyword_numeric)
   (keyword_real)
   (double)
@@ -199,6 +238,8 @@
   (keyword_and)
   (keyword_or)
   (keyword_not)
+  (keyword_by)
+  (keyword_on)
 ] @keyword.operator
 
 [
@@ -214,6 +255,7 @@
   "!="
   ">="
   ">"
+  "<>"
 ] @operator
 
 [
@@ -227,3 +269,4 @@
   "."
 ] @punctuation.delimiter
 
+

From d382b4156326195725d0d8cd84fe8b60a39bb73b Mon Sep 17 00:00:00 2001
From: Matthias Queitsch 
Date: Fri, 3 Mar 2023 20:52:59 +0100
Subject: [PATCH 0093/2730] highlights(sql): added missing kwds, added
 `@attribute` and @`type.qualifier` kwds

---
 queries/sql/highlights.scm | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/queries/sql/highlights.scm b/queries/sql/highlights.scm
index 4178f9727..a0e049082 100644
--- a/queries/sql/highlights.scm
+++ b/queries/sql/highlights.scm
@@ -11,6 +11,7 @@
   (keyword_brin)
   (keyword_float)
   (keyword_array)
+  (keyword_group_concat)
 ] @function.call
 
 (count
@@ -83,7 +84,10 @@
  (keyword_concurrently)
  (keyword_engine)
  (keyword_character)
-  (keyword_concurrently)
+ (keyword_concurrently)
+ (keyword_preceding)
+ (keyword_following)
+ (keyword_first)
 ] @attribute
 
 [
@@ -116,6 +120,8 @@
   (keyword_order)
   (keyword_partition)
   (keyword_group)
+  (keyword_with)
+  (keyword_as)
   (keyword_having)
   (keyword_limit)
   (keyword_offset)
@@ -140,7 +146,6 @@
   (keyword_end)
   (keyword_is)
   (keyword_using)
-  (keyword_cascade)
   (keyword_between)
   (keyword_window)
   (keyword_no)
@@ -165,20 +170,14 @@
   (keyword_over)
   (keyword_change)
   (keyword_modify)
-  (keyword_restrict)
-  (keyword_first)
   (keyword_after)
   (keyword_range)
   (keyword_rows)
   (keyword_groups)
-  (keyword_unbounded)
-  (keyword_preceding)
-  (keyword_following)
   (keyword_exclude)
   (keyword_current)
   (keyword_ties)
   (keyword_others)
-  (keyword_unique)
   (keyword_preserve)
   (keyword_zerofill)
   (keyword_format)
@@ -195,9 +194,12 @@
   (keyword_stored)
 ] @keyword
 
-(keyword_with) @repeat
-
-(keyword_as) @label
+[
+ (keyword_restrict)
+ (keyword_unbounded)
+ (keyword_unique)
+ (keyword_cascade)
+] @type.qualifier
 
 [
   (keyword_int)
@@ -231,6 +233,7 @@
   (keyword_geography)
   (keyword_box2d)
   (keyword_box3d)
+  (keyword_interval)
 ] @type.builtin
 
 [

From d4e48be88d9822d98c9194f5cc2778c9953afb66 Mon Sep 17 00:00:00 2001
From: Matthias Queitsch 
Date: Sat, 4 Mar 2023 00:36:52 +0100
Subject: [PATCH 0094/2730] highlights(sql): keywords as `@storageclass`

---
 queries/sql/highlights.scm | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/queries/sql/highlights.scm b/queries/sql/highlights.scm
index a0e049082..db413cc0e 100644
--- a/queries/sql/highlights.scm
+++ b/queries/sql/highlights.scm
@@ -56,26 +56,11 @@
 [
  (keyword_asc)
  (keyword_desc)
- (keyword_external)
- (keyword_parquet)
- (keyword_csv)
- (keyword_rcfile)
- (keyword_textfile)
- (keyword_orc)
- (keyword_avro)
- (keyword_jsonfile)
- (keyword_sequencefile)
- (keyword_temp)
- (keyword_uncached)
- (keyword_unlogged)
  (keyword_terminated)
  (keyword_escaped)
  (keyword_unsigned)
  (keyword_nulls)
  (keyword_last)
- (keyword_materialized)
- (keyword_temp)
- (keyword_temporary)
  (keyword_delimited)
  (keyword_replication)
  (keyword_auto_increment)
@@ -90,6 +75,22 @@
  (keyword_first)
 ] @attribute
 
+[
+ (keyword_materialized)
+ (keyword_temp)
+ (keyword_temporary)
+ (keyword_unlogged)
+ (keyword_external)
+ (keyword_parquet)
+ (keyword_csv)
+ (keyword_rcfile)
+ (keyword_textfile)
+ (keyword_orc)
+ (keyword_avro)
+ (keyword_jsonfile)
+ (keyword_sequencefile)
+] @storageclass
+
 [
  (keyword_case)
  (keyword_when)
@@ -190,8 +191,12 @@
   (keyword_partitioned)
   (keyword_location)
   (keyword_cached)
+  (keyword_uncached)
   (keyword_lines)
   (keyword_stored)
+  (keyword_location)
+  (keyword_partitioned)
+  (keyword_cached)
 ] @keyword
 
 [

From c9d7918901693041179ef569eb9b7f3f88a89e52 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 3 Mar 2023 05:33:20 -0500
Subject: [PATCH 0095/2730] feat: add luap

---
 README.md                       |  1 +
 lockfile.json                   |  3 +++
 lua/nvim-treesitter/parsers.lua |  9 +++++++++
 queries/luap/highlights.scm     | 35 +++++++++++++++++++++++++++++++++
 4 files changed, 48 insertions(+)
 create mode 100644 queries/luap/highlights.scm

diff --git a/README.md b/README.md
index cb16f3c77..d11ffd833 100644
--- a/README.md
+++ b/README.md
@@ -261,6 +261,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
 - [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
 - [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim)
+- [x] [lua patterns](https://github.com/vhyrro/tree-sitter-luap) (maintained by @amaanq)
 - [x] [m68k](https://github.com/grahambates/tree-sitter-m68k) (maintained by @grahambates)
 - [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991)
 - [x] [markdown](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
diff --git a/lockfile.json b/lockfile.json
index f1f630267..ddef7a391 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -263,6 +263,9 @@
   "lua": {
     "revision": "0fc89962b7ff5c7d676b8592c1cbce1ceaa806fd"
   },
+  "luap": {
+    "revision": "ebc6739bf8900a0191a386ef53371fc556c662a8"
+  },
   "m68k": {
     "revision": "d097b123f19c6eaba2bf181c05420d88b9fc489d"
   },
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 179513d9b..4c873df81 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -855,6 +855,15 @@ list.lua = {
   maintainers = { "@muniftanjim" },
 }
 
+list.luap = {
+  install_info = {
+    url = "https://github.com/amaanq/tree-sitter-luap",
+    files = { "src/parser.c" },
+    readme_name = "lua patterns",
+  },
+  maintainers = { "@amaanq" },
+}
+
 list.m68k = {
   install_info = {
     url = "https://github.com/grahambates/tree-sitter-m68k",
diff --git a/queries/luap/highlights.scm b/queries/luap/highlights.scm
new file mode 100644
index 000000000..62d2b3182
--- /dev/null
+++ b/queries/luap/highlights.scm
@@ -0,0 +1,35 @@
+"." @character
+
+[
+  (anchor_begin)
+  (anchor_end)
+] @string.escape
+
+[
+  "[" "]"
+  "(" ")"
+] @punctuation.bracket
+
+[
+  (zero_or_more)
+  (shortest_zero_or_more)
+  (one_or_more)
+  (zero_or_one)
+] @operator
+
+(range
+  from: (character) @constant
+  "-" @punctuation.delimiter
+  to: (character) @constant)
+
+(set
+  (character) @constant)
+
+(class) @keyword
+
+(negated_set
+  "^" @operator
+  (character) @constant)
+
+(balanced_match
+  (character) @parameter)

From 25f99a270ac94afd7a4adc8c2055d33ec60125ab Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 3 Mar 2023 05:35:20 -0500
Subject: [PATCH 0096/2730] feat(lua): add luap injections

---
 queries/lua/injections.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/queries/lua/injections.scm b/queries/lua/injections.scm
index c11e3fb29..14714573a 100644
--- a/queries/lua/injections.scm
+++ b/queries/lua/injections.scm
@@ -19,4 +19,30 @@
 ;; highlight string as query if starts with `;; query`
 ((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
 
+; string.match("123", "%d+")
+(function_call
+  (dot_index_expression
+    field: (identifier) @_method
+    (#any-of? @_method "find" "match"))
+  arguments: (arguments (_) . (string content: _ @luap)))
+
+(function_call
+  (dot_index_expression
+    field: (identifier) @_method
+    (#eq? @_method "gmatch" "gsub"))
+  arguments: (arguments (_) (string content: _ @luap)))
+
+; ("123"):match("%d+")
+(function_call
+  (method_index_expression
+    method: (identifier) @_method
+    (#any-of? @_method "find" "match"))
+    arguments: (arguments . (string content: _ @luap)))
+
+(function_call
+  (method_index_expression
+    method: (identifier) @_method
+    (#any-of? @_method "gmatch" "gsub"))
+    arguments: (arguments (string content: _ @luap)))
+
 (comment) @comment

From 4beba61ddec3e2d470796b1822af21f0cc6008d3 Mon Sep 17 00:00:00 2001
From: Amaan Qureshi 
Date: Fri, 3 Mar 2023 05:36:23 -0500
Subject: [PATCH 0097/2730] feat(query): differentiate lua-match strings by
 using luap injections and fix offset matches

---
 queries/query/injections.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/queries/query/injections.scm b/queries/query/injections.scm
index 95ce2978f..c4b877d0b 100644
--- a/queries/query/injections.scm
+++ b/queries/query/injections.scm
@@ -1,6 +1,13 @@
 ((predicate 
   name: (identifier) @_name
   parameters: (parameters (string) @regex))
- (#match? @_name "^#?(not-)?(match|vim-match|lua-match)$"))
+ (#match? @_name "^#?(not-)?(match|vim-match)$")
+ (#offset! @regex 0 1 0 -1))
+
+((predicate
+  name: (identifier) @_name
+  parameters: (parameters (string) @luap))
+ (#match? @_name "^#?(not-)?lua-match$")
+ (#offset! @luap 0 1 0 -1))
 
 (comment) @comment

From 00b403f190949275c809d83771a1927d2376c694 Mon Sep 17 00:00:00 2001
From: Github Actions 
Date: Sat, 4 Mar 2023 16:32:48 +0000
Subject: [PATCH 0098/2730] Update README

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index d11ffd833..e6d00fbb9 100644
--- a/README.md
+++ b/README.md
@@ -261,7 +261,7 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
 - [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
 - [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim)
-- [x] [lua patterns](https://github.com/vhyrro/tree-sitter-luap) (maintained by @amaanq)
+- [x] [luap](https://github.com/amaanq/tree-sitter-luap) (maintained by @amaanq)
 - [x] [m68k](https://github.com/grahambates/tree-sitter-m68k) (maintained by @grahambates)
 - [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991)
 - [x] [markdown](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)

From 1ceaceb9dea9b0bac2162345ee11e47a44e07a70 Mon Sep 17 00:00:00 2001
From: ObserverOfTime 
Date: Sat, 4 Mar 2023 20:25:03 +0200
Subject: [PATCH 0099/2730] docs: fix readme names

---
 README.md                       | 6 +++---
 lua/nvim-treesitter/parsers.lua | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index e6d00fbb9..6371f7c10 100644
--- a/README.md
+++ b/README.md
@@ -261,11 +261,11 @@ We are looking for maintainers to add more parsers and to write query files for
 - [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
 - [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
 - [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim)
-- [x] [luap](https://github.com/amaanq/tree-sitter-luap) (maintained by @amaanq)
+- [x] [lua patterns](https://github.com/amaanq/tree-sitter-luap) (maintained by @amaanq)
 - [x] [m68k](https://github.com/grahambates/tree-sitter-m68k) (maintained by @grahambates)
 - [x] [make](https://github.com/alemuller/tree-sitter-make) (maintained by @lewis6991)
-- [x] [markdown](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
-- [x] [markdown_inline](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
+- [x] [markdown (basic highlighting)](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
+- [x] [markdown_inline (needed for full highlighting)](https://github.com/MDeiml/tree-sitter-markdown) (experimental, maintained by @MDeiml)
 - [x] [matlab](https://github.com/mstanciu552/tree-sitter-matlab) (maintained by @amaanq)
 - [x] [menhir](https://github.com/Kerl13/tree-sitter-menhir) (maintained by @Kerl13)
 - [ ] [mermaid](https://github.com/monaqa/tree-sitter-mermaid) (experimental)
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 4c873df81..1185d02d3 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -859,9 +859,9 @@ list.luap = {
   install_info = {
     url = "https://github.com/amaanq/tree-sitter-luap",
     files = { "src/parser.c" },
-    readme_name = "lua patterns",
   },
   maintainers = { "@amaanq" },
+  readme_name = "lua patterns",
 }
 
 list.m68k = {
@@ -888,9 +888,9 @@ list.markdown = {
     location = "tree-sitter-markdown",
     files = { "src/parser.c", "src/scanner.c" },
     branch = "split_parser",
-    readme_name = "markdown (basic highlighting)",
   },
   maintainers = { "@MDeiml" },
+  readme_name = "markdown (basic highlighting)",
   experimental = true,
 }
 
@@ -900,9 +900,9 @@ list.markdown_inline = {
     location = "tree-sitter-markdown-inline",
     files = { "src/parser.c", "src/scanner.c" },
     branch = "split_parser",
-    readme_name = "markdown_inline (needs to be installed for full markdown highlighting)",
   },
   maintainers = { "@MDeiml" },
+  readme_name = "markdown_inline (needed for full highlighting)",
   experimental = true,
 }
 

From 14fb59e125d7db4378e2345f36c9d2735528b899 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Sun, 5 Mar 2023 06:38:51 +0000
Subject: [PATCH 0100/2730] Update parsers: c_sharp, luap, perl

---
 lockfile.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lockfile.json b/lockfile.json
index ddef7a391..a231b4d53 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -33,7 +33,7 @@
     "revision": "f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2"
   },
   "c_sharp": {
-    "revision": "fc6be5ae61c8788e0c028e757f132d67bfc538f5"
+    "revision": "fcacbeb4af6bcdcfb4527978a997bb03f4fe086d"
   },
   "capnp": {
     "revision": "fc6e2addf103861b9b3dffb82c543eb6b71061aa"
@@ -264,7 +264,7 @@
     "revision": "0fc89962b7ff5c7d676b8592c1cbce1ceaa806fd"
   },
   "luap": {
-    "revision": "ebc6739bf8900a0191a386ef53371fc556c662a8"
+    "revision": "bfb38d254f380362e26b5c559a4086ba6e92ba77"
   },
   "m68k": {
     "revision": "d097b123f19c6eaba2bf181c05420d88b9fc489d"
@@ -321,7 +321,7 @@
     "revision": "20239395eacdc2e0923a7e5683ad3605aee7b716"
   },
   "perl": {
-    "revision": "c43bae0090cfcfc62d9904312599ded1b645a66d"
+    "revision": "ff1f0ac0f1c678a23f68d0140e75a0da8e11b7b5"
   },
   "php": {
     "revision": "f860e598194f4a71747f91789bf536b393ad4a56"

From 3731cf1c0c70287568d26f190849c68a46c21297 Mon Sep 17 00:00:00 2001
From: GitHub 
Date: Sun, 5 Mar 2023 11:24:18 +0000
Subject: [PATCH 0101/2730] Update parsers: zig

---
 lockfile.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lockfile.json b/lockfile.json
index a231b4d53..5b60f8f54 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -513,6 +513,6 @@
     "revision": "48af129ab5411cd6f7ae2b36f53c1192572fa030"
   },
   "zig": {
-    "revision": "1cd5f339b146b764f39b36bb7be98ca631a2e02a"
+    "revision": "f3bc9ffe9ca10f52dee01999b5b6ce9a4074b0ac"
   }
 }

From d11dd552dbde181cd49652188521f4b5f6cad2f8 Mon Sep 17 00:00:00 2001
From: Pham Huy Hoang 
Date: Fri, 3 Mar 2023 09:09:52 +0700
Subject: [PATCH 0102/2730] injections(html): fix faulty css/js injections

Group queries to reduce duplicate injection tree

use only regex
---
 queries/html_tags/injections.scm              | 34 ++++---------------
 .../injections/html/test-html-injections.html |  4 +++
 .../injections/vue/test-vue-injections.vue    |  6 ++++
 3 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/queries/html_tags/injections.scm b/queries/html_tags/injections.scm
index c29619281..5f0719c64 100644
--- a/queries/html_tags/injections.scm
+++ b/queries/html_tags/injections.scm
@@ -1,22 +1,12 @@
 ; 
-(
-  (style_element
-    (start_tag
-      (tag_name) .) 
-    (raw_text) @css)
-) 
-
 ; 
 ; Add "lang" to predicate check so that vue/svelte can inherit this
 ; without having this element being captured twice
 (
   (style_element
-    (start_tag
-      (attribute
-        (attribute_name) @_no_set_type))
-    (raw_text) @css)
-  (#not-any-of? @_no_set_type "type" "lang")
-) 
+    (start_tag) @_no_type_lang 
+      (#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=")
+    (raw_text) @css))
 
 (
   (style_element
@@ -30,22 +20,12 @@
 )
 
 ; 
-(
-  (script_element
-    (start_tag
-      (tag_name) .) 
-    (raw_text) @javascript)
-) 
-
 ; 
 (
   (script_element
-    (start_tag
-      (attribute
-        (attribute_name) @_no_set_type))
-    (raw_text) @javascript)
-  (#not-any-of? @_no_set_type "type" "lang")
-) 
+    (start_tag) @_no_type_lang 
+      (#not-match? @_no_type_lang "\\s(lang|type)\\s*\\=")
+    (raw_text) @javascript))
 
 (
   (script_element
@@ -55,7 +35,7 @@
         (quoted_attribute_value (attribute_value) @_javascript)))
     (raw_text) @javascript)
   (#eq? @_type "type")
-  (#eq? @_javascript "text/javascript")
+  (#any-of? @_javascript "text/javascript" "module")
 )
 
 ((attribute
diff --git a/tests/query/injections/html/test-html-injections.html b/tests/query/injections/html/test-html-injections.html
index 4449923c6..348d901ca 100644
--- a/tests/query/injections/html/test-html-injections.html
+++ b/tests/query/injections/html/test-html-injections.html
@@ -19,6 +19,10 @@
     
     
     
+    
+    
+    
+                                        
     
Test div to test css injections for style attributes diff --git a/tests/query/injections/vue/test-vue-injections.vue b/tests/query/injections/vue/test-vue-injections.vue index 4cb4ae215..b0df16071 100644 --- a/tests/query/injections/vue/test-vue-injections.vue +++ b/tests/query/injections/vue/test-vue-injections.vue @@ -17,6 +17,9 @@ + + + @@ -26,3 +29,6 @@ + + + From 51030378eb12160cbf802b68aaf56b3116aa22de Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 1 Mar 2023 12:25:39 -0500 Subject: [PATCH 0103/2730] docs: add `@string.documentation` --- CONTRIBUTING.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f954bff1d..c972da7e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,17 +108,18 @@ effect on highlighting. We will work on improving highlighting in the near futur #### Literals ```scheme -@string ; string literals -@string.regex ; regular expressions -@string.escape ; escape sequences -@string.special ; other special strings (e.g. dates) +@string ; string literals +@string.documentation ; string documenting code (e.g. Python docstrings) +@string.regex ; regular expressions +@string.escape ; escape sequences +@string.special ; other special strings (e.g. dates) -@character ; character literals -@character.special ; special characters (e.g. wildcards) +@character ; character literals +@character.special ; special characters (e.g. wildcards) -@boolean ; boolean literals -@number ; numeric literals -@float ; floating-point number literals +@boolean ; boolean literals +@number ; numeric literals +@float ; floating-point number literals ``` #### Functions From 95bcd6a8fa1baa0824d44b697ba05bcc0b97bd34 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 1 Mar 2023 12:26:26 -0500 Subject: [PATCH 0104/2730] feat: add `@string.documentation` where applicable --- queries/graphql/highlights.scm | 4 ++-- queries/julia/highlights.scm | 12 +++++++++++- queries/python/highlights.scm | 13 ++++++++++++- queries/starlark/highlights.scm | 8 +++++++- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/queries/graphql/highlights.scm b/queries/graphql/highlights.scm index 3a9d47dad..48f27f983 100644 --- a/queries/graphql/highlights.scm +++ b/queries/graphql/highlights.scm @@ -111,9 +111,9 @@ ;--------- (description - (string_value) @comment) + (string_value) @string.documentation @spell) -(comment) @comment +(comment) @comment @spell (directive_location (executable_directive_location) @type.builtin) diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index bf51076c7..6044e66de 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -226,8 +226,18 @@ (prefixed_command_literal prefix: (identifier) @function.macro) @string.special +((string_literal) @string.documentation + . [ + (module_definition) + (abstract_definition) + (struct_definition) + (function_definition) + (assignment) + (const_declaration) + ]) + [ (line_comment) (block_comment) -] @comment +] @comment @spell diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index fe66d7ca3..d25448000 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -176,7 +176,18 @@ (escape_sequence) @string.escape ; doc-strings -(expression_statement (string) @spell) + +(module . (expression_statement (string) @string.documentation @spell)) + +(class_definition + body: + (block + . (expression_statement (string) @string.documentation @spell))) + +(function_definition + body: + (block + . (expression_statement (string) @string.documentation @spell))) ; Tokens diff --git a/queries/starlark/highlights.scm b/queries/starlark/highlights.scm index a92832d68..ab9bfd68d 100644 --- a/queries/starlark/highlights.scm +++ b/queries/starlark/highlights.scm @@ -158,7 +158,13 @@ ] @string.escape ; doc-strings -(expression_statement (string) @spell) + +(module . (expression_statement (string) @string.documentation @spell)) + +(function_definition + body: + (block + . (expression_statement (string) @string.documentation @spell))) ; Tokens From 3a82b58745c668eb9a456eb061455b1ef497710e Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 2 Mar 2023 08:06:23 -0500 Subject: [PATCH 0105/2730] docs: add `@comment.documentation` --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c972da7e0..cea14ac53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,12 +89,13 @@ effect on highlighting. We will work on improving highlighting in the near futur #### Misc ```scheme -@comment ; line and block comments -@error ; syntax/parser errors -@none ; completely disable the highlight -@preproc ; various preprocessor directives & shebangs -@define ; preprocessor definition directives -@operator ; symbolic operators (e.g. `+` / `*`) +@comment ; line and block comments +@comment.documentation ; comments documenting code +@error ; syntax/parser errors +@none ; completely disable the highlight +@preproc ; various preprocessor directives & shebangs +@define ; preprocessor definition directives +@operator ; symbolic operators (e.g. `+` / `*`) ``` #### Punctuation From 5a87bc98dabd0d38152a6fa774005f7ecbd40f1b Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 2 Mar 2023 08:06:35 -0500 Subject: [PATCH 0106/2730] feat: add `@comment.documentation` where applicable --- queries/ada/highlights.scm | 26 +++++++++++++++++----- queries/c/highlights.scm | 3 +++ queries/c_sharp/highlights.scm | 8 +++++++ queries/d/highlights.scm | 13 ++++++++++- queries/dart/highlights.scm | 4 ++-- queries/ecma/highlights.scm | 7 +++--- queries/elixir/highlights.scm | 20 ++++++++--------- queries/elm/highlights.scm | 5 ++++- queries/erlang/highlights.scm | 6 ++++-- queries/fortran/highlights.scm | 3 +++ queries/gleam/highlights.scm | 7 ++++-- queries/go/highlights.scm | 38 +++++++++++++++++++++++++++------ queries/hack/highlights.scm | 5 ++++- queries/java/highlights.scm | 9 ++++++++ queries/kotlin/highlights.scm | 7 +++--- queries/lua/highlights.scm | 6 ++++++ queries/pascal/highlights.scm | 31 ++++++++++++++++++++++++++- queries/prisma/highlights.scm | 7 +++--- queries/proto/highlights.scm | 7 ++++-- queries/ql/highlights.scm | 5 +++-- queries/ruby/highlights.scm | 23 +++++++++++++++++--- queries/rust/highlights.scm | 12 +++++++++++ queries/scala/highlights.scm | 3 +++ queries/smali/highlights.scm | 7 ++++++ queries/smithy/highlights.scm | 7 +++--- queries/solidity/highlights.scm | 8 +++++++ queries/swift/highlights.scm | 9 ++++++++ queries/teal/highlights.scm | 6 +++++- queries/thrift/highlights.scm | 8 +++++++ queries/v/highlights.scm | 5 ++++- queries/vala/highlights.scm | 4 +++- queries/zig/highlights.scm | 5 +++-- 32 files changed, 256 insertions(+), 58 deletions(-) diff --git a/queries/ada/highlights.scm b/queries/ada/highlights.scm index 884203791..bcd041d5a 100644 --- a/queries/ada/highlights.scm +++ b/queries/ada/highlights.scm @@ -94,11 +94,9 @@ [ "exception" "raise" -] @exception -(comment) @comment -(comment) @spell ;; spell-check comments -(string_literal) @string -(string_literal) @spell ;; spell-check strings +] @exception +(comment) @comment @spell +(string_literal) @string @spell (character_literal) @string (numeric_literal) @number @@ -173,6 +171,24 @@ ; ] @function.spec ;) +((comment) @comment.documentation + . [ + (entry_declaration) + (subprogram_declaration) + (parameter_specification) + ]) + +(compilation_unit + . (comment) @comment.documentation) + +(component_list + (component_declaration) + . (comment) @comment.documentation) + +(enumeration_type_definition + (identifier) + . (comment) @comment.documentation) + ;; Highlight errors in red. This is not very useful in practice, as text will ;; be highlighted as user types, and the error could be elsewhere in the code. ;; This also requires defining :hi @error guifg=Red for instance. diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index 661f71b53..f607d3b8c 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -176,6 +176,9 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + ;; Parameters (parameter_declaration declarator: (identifier) @parameter) diff --git a/queries/c_sharp/highlights.scm b/queries/c_sharp/highlights.scm index c2bac3c1d..993609485 100644 --- a/queries/c_sharp/highlights.scm +++ b/queries/c_sharp/highlights.scm @@ -75,6 +75,14 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + (using_directive (identifier) @type) diff --git a/queries/d/highlights.scm b/queries/d/highlights.scm index 8bec1ca10..229a9bf55 100644 --- a/queries/d/highlights.scm +++ b/queries/d/highlights.scm @@ -4,7 +4,18 @@ (line_comment) (block_comment) (nesting_block_comment) -] @comment +] @comment @spell + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((nesting_block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[+][+][^+].*[+]/$")) [ "(" ")" diff --git a/queries/dart/highlights.scm b/queries/dart/highlights.scm index 154a92b3a..e34467f65 100644 --- a/queries/dart/highlights.scm +++ b/queries/dart/highlights.scm @@ -155,8 +155,8 @@ (false) @boolean (null_literal) @constant.builtin -(documentation_comment) @comment -(comment) @comment +(comment) @comment @spell +(documentation_comment) @comment.documentation @spell ; Keywords ; -------------------- diff --git a/queries/ecma/highlights.scm b/queries/ecma/highlights.scm index 97feae8f3..82a0b99ab 100644 --- a/queries/ecma/highlights.scm +++ b/queries/ecma/highlights.scm @@ -123,12 +123,13 @@ (undefined) ] @constant.builtin -(comment) @comment +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (hash_bang_line) @preproc -(comment) @spell - (string) @string @spell (template_string) @string (escape_sequence) @string.escape diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm index d87afcf1b..3223fa683 100644 --- a/queries/elixir/highlights.scm +++ b/queries/elixir/highlights.scm @@ -29,12 +29,10 @@ ((identifier) @comment (#match? @comment "^_")) ; Comments -(comment) @comment -(comment) @spell +(comment) @comment @spell ; Strings -(string) @string -(string) @spell +(string) @string @spell ; Modules (alias) @type @@ -214,15 +212,15 @@ (unary_operator operator: "@" operand: (call - target: ((identifier) @_identifier (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment + target: ((identifier) @_identifier (#any-of? @_identifier "moduledoc" "typedoc" "shortdoc" "doc")) @comment.documentation (arguments [ (string) (boolean) (charlist) (sigil - "~" @comment - ((sigil_name) @comment) - quoted_start: _ @comment - (quoted_content) @comment - quoted_end: _ @comment) - ] @comment))) @comment + "~" @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/queries/elm/highlights.scm b/queries/elm/highlights.scm index 4d0f6f447..fbd3a4c3f 100644 --- a/queries/elm/highlights.scm +++ b/queries/elm/highlights.scm @@ -1,7 +1,10 @@ [ (line_comment) (block_comment) -] @comment +] @comment @spell + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^{[-]|[^|]")) ; Keywords diff --git a/queries/erlang/highlights.scm b/queries/erlang/highlights.scm index fba44359f..63e6ea214 100644 --- a/queries/erlang/highlights.scm +++ b/queries/erlang/highlights.scm @@ -5,7 +5,10 @@ (integer) @number (float) @float -(comment) @comment +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[%%][%%]")) ;; keyword [ @@ -104,7 +107,6 @@ (type_alias name: _ @type) @type.definition (spec) @type.definition -(comment) @comment [(string) (binary)] @string ;;; expr_function_call diff --git a/queries/fortran/highlights.scm b/queries/fortran/highlights.scm index 4604e9a92..a6b55413b 100644 --- a/queries/fortran/highlights.scm +++ b/queries/fortran/highlights.scm @@ -324,6 +324,9 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^!>")) + ; Errors (ERROR) @error diff --git a/queries/gleam/highlights.scm b/queries/gleam/highlights.scm index 0e2712879..00cabd171 100644 --- a/queries/gleam/highlights.scm +++ b/queries/gleam/highlights.scm @@ -82,11 +82,14 @@ (identifier) @variable ; Comments +[ + (comment) +] @comment @spell + [ (module_comment) (statement_comment) - (comment) -] @comment +] @comment.documentation @spell ; Unused Identifiers [ diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm index be72804b6..ce4ae89b6 100644 --- a/queries/go/highlights.scm +++ b/queries/go/highlights.scm @@ -196,20 +196,46 @@ (float_literal) @float (imaginary_literal) @number -(true) @boolean -(false) @boolean +[ + (true) + (false) +] @boolean + (nil) @constant.builtin (keyed_element . (literal_element (identifier) @field)) (field_declaration name: (field_identifier) @field) +; Comments + (comment) @comment @spell +;; Doc Comments + +(source_file . (comment)+ @comment.documentation) + +(source_file + (comment)+ @comment.documentation + . (const_declaration)) + +(source_file + (comment)+ @comment.documentation + . (function_declaration)) + +(source_file + (comment)+ @comment.documentation + . (type_declaration)) + +(source_file + (comment)+ @comment.documentation + . (var_declaration)) + +; Errors + (ERROR) @error +; Spell + ((interpreted_string_literal) @spell - (#not-has-parent? @spell - import_spec - ) -) + (#not-has-parent? @spell import_spec)) diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm index ffb365c87..a75b166ca 100644 --- a/queries/hack/highlights.scm +++ b/queries/hack/highlights.scm @@ -12,7 +12,10 @@ [ (comment) (heredoc) -] @comment +] @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) "function" @keyword.function diff --git a/queries/java/highlights.scm b/queries/java/highlights.scm index 717a13bad..c97242295 100644 --- a/queries/java/highlights.scm +++ b/queries/java/highlights.scm @@ -279,3 +279,12 @@ (line_comment) (block_comment) ] @comment @spell + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) + +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index caf62f1f0..679cc0ad6 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -217,12 +217,13 @@ ;;; Literals -(comment) @comment +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (shebang_line) @preproc -(comment) @spell - (real_literal) @float [ (integer_literal) diff --git a/queries/lua/highlights.scm b/queries/lua/highlights.scm index 1c17d823b..fa2eff68d 100644 --- a/queries/lua/highlights.scm +++ b/queries/lua/highlights.scm @@ -187,6 +187,12 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[-][-][-]")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[-][-](%s?)@")) + (hash_bang_line) @preproc (number) @number diff --git a/queries/pascal/highlights.scm b/queries/pascal/highlights.scm index 3a1c484e0..e11e0eaa2 100644 --- a/queries/pascal/highlights.scm +++ b/queries/pascal/highlights.scm @@ -248,7 +248,36 @@ ; -- Comments -(comment) @comment +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((comment) @comment.documentation + . [(unit) (declProc)]) + +(declTypes + (comment) @comment.documentation + . (declType)) + +(declSection + (comment) @comment.documentation + . [(declField) (declProc)]) + +(declEnum + (comment) @comment.documentation + . (declEnumValue)) + +(declConsts + (comment) @comment.documentation + . (declConst)) + +(declVars + (comment) @comment.documentation + . (declVar)) + (pp) @preproc ; -- Type declaration diff --git a/queries/prisma/highlights.scm b/queries/prisma/highlights.scm index e3a025d98..59ee2881c 100644 --- a/queries/prisma/highlights.scm +++ b/queries/prisma/highlights.scm @@ -8,10 +8,9 @@ "type" ] @keyword -[ - (comment) - (developer_comment) -] @comment +(comment) @comment @spell + +(developer_comment) @comment.documentation @spell [ (attribute) diff --git a/queries/proto/highlights.scm b/queries/proto/highlights.scm index 48c18906c..a6f47da93 100644 --- a/queries/proto/highlights.scm +++ b/queries/proto/highlights.scm @@ -42,7 +42,10 @@ (false) ] @boolean -(comment) @comment +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) [ "(" @@ -53,7 +56,7 @@ "}" "<" ">" -] @punctuation.bracket +] @punctuation.bracket [ ";" diff --git a/queries/ql/highlights.scm b/queries/ql/highlights.scm index 009920a82..dcc702263 100644 --- a/queries/ql/highlights.scm +++ b/queries/ql/highlights.scm @@ -130,5 +130,6 @@ [ (line_comment) (block_comment) - (qldoc) -] @comment +] @comment @spell + +(qldoc) @comment.documentation diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm index c350e5ad1..9488297b4 100644 --- a/queries/ruby/highlights.scm +++ b/queries/ruby/highlights.scm @@ -173,13 +173,30 @@ (float) @float [ - (nil) (true) (false) ] @boolean -(comment) @comment -(comment) @spell +(nil) @constant.builtin + +(comment) @comment @spell + +(program + (comment)+ @comment.documentation + (class)) + +(module + (comment)+ @comment.documentation + (body_statement (class))) + +(class + (comment)+ @comment.documentation + (body_statement (method))) + +(body_statement + (comment)+ @comment.documentation + (method)) + (string_content) @spell ; Operators diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm index c24a278f6..1a9330a70 100644 --- a/queries/rust/highlights.scm +++ b/queries/rust/highlights.scm @@ -148,6 +148,18 @@ (block_comment) ] @comment @spell +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) +((line_comment) @comment.documentation + (#lua-match? @comment.documentation "^//!")) + +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) +((block_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][!]")) + (boolean_literal) @boolean (integer_literal) @number (float_literal) @float diff --git a/queries/scala/highlights.scm b/queries/scala/highlights.scm index f600dc185..6220cbfe1 100644 --- a/queries/scala/highlights.scm +++ b/queries/scala/highlights.scm @@ -234,6 +234,9 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + ;; `case` is a conditional keyword in case_block (case_block diff --git a/queries/smali/highlights.scm b/queries/smali/highlights.scm index 5f89cfa74..bdcb464ae 100644 --- a/queries/smali/highlights.scm +++ b/queries/smali/highlights.scm @@ -182,3 +182,10 @@ ; Comments (comment) @comment @spell + +(class_definition + (comment) @comment.documentation) + +; Errors + +(ERROR) @error diff --git a/queries/smithy/highlights.scm b/queries/smithy/highlights.scm index 07ee328f1..2b709c2a2 100644 --- a/queries/smithy/highlights.scm +++ b/queries/smithy/highlights.scm @@ -108,7 +108,6 @@ ; Comments -[ - (comment) - (documentation_comment) -] @comment @spell +(comment) @comment @spell + +(documentation_comment) @comment.documentation @spell diff --git a/queries/solidity/highlights.scm b/queries/solidity/highlights.scm index 5afebb990..76a623267 100644 --- a/queries/solidity/highlights.scm +++ b/queries/solidity/highlights.scm @@ -252,6 +252,14 @@ (comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + ; Errors (ERROR) @error diff --git a/queries/swift/highlights.scm b/queries/swift/highlights.scm index 5773c2377..4cdd882a8 100644 --- a/queries/swift/highlights.scm +++ b/queries/swift/highlights.scm @@ -107,6 +107,15 @@ (multiline_comment) ] @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///[^/]")) + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^///$")) + +((multiline_comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) + ; String literals (line_str_text) @string (str_escaped_char) @string diff --git a/queries/teal/highlights.scm b/queries/teal/highlights.scm index 2af9be589..4af3e212b 100644 --- a/queries/teal/highlights.scm +++ b/queries/teal/highlights.scm @@ -2,7 +2,11 @@ ;; Primitives (boolean) @boolean (comment) @comment @spell -(shebang_comment) @comment +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[-][-][-]")) +((comment) @comment.documentation + (#lua-match? @comment.documentation "^[-][-](%s?)@")) +(shebang_comment) @preproc (identifier) @variable ((identifier) @variable.builtin (#eq? @variable.builtin "self")) diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm index 5df609c3d..adf147d9d 100644 --- a/queries/thrift/highlights.scm +++ b/queries/thrift/highlights.scm @@ -198,3 +198,11 @@ ; 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 "^///$")) diff --git a/queries/v/highlights.scm b/queries/v/highlights.scm index 16904d18b..c4e69e802 100644 --- a/queries/v/highlights.scm +++ b/queries/v/highlights.scm @@ -406,5 +406,8 @@ (ERROR) @error -(comment) @comment +(comment) @comment @spell +(_ + (comment)+ @comment.documentation + [(function_declaration) (type_declaration) (const_spec) (enum_declaration)]) diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm index 5ad7e0345..e1a20b8a0 100644 --- a/queries/vala/highlights.scm +++ b/queries/vala/highlights.scm @@ -1,7 +1,9 @@ ; highlights.scm ; highlight comments and symbols -(comment) @comment +(comment) @comment @spell +((comment) @comment.documentation + (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (symbol) @symbol (member_access_expression (_) (identifier) @symbol) diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index 0989704ce..37afe1c2f 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -1,8 +1,9 @@ +(line_comment) @comment @spell + [ (container_doc_comment) (doc_comment) - (line_comment) -] @comment @spell +] @comment.documentation @spell [ variable: (IDENTIFIER) From 5ac39d10cc8a28f7bdb3725f3ee84a132ba783a8 Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Mon, 6 Mar 2023 09:56:25 +0700 Subject: [PATCH 0107/2730] indents(vue): fix indents on new line after