Compare commits

...

2711 commits
v0.8.5 ... main

Author SHA1 Message Date
Christian Clason
4916d6592e fix(health): normalize rtp when checking install_dir
Problem: Windows.

Solution: vim.fs.normalize.
2026-04-03 15:11:40 +02:00
Christian Clason
234d76709e ci(tests): remove ilammy/msvc-dev-cmd
Problem: Action uses deprecated Node 20, and Windows runners have a
current msvc build tools by default.

Solution: Remove action.
2026-04-03 14:38:57 +02:00
Christian Clason
2098db61dc fix(yuck): improper use of supertypes in queries
Problem: `(ast_block)` is a supertype, of which `(symbol)` (among
others) is a subtype, which makes the final local pattern invalid.
(This was not noticed before because the parser is stuck at ABI 14
due to a missing `tree-sitter.json`.)

Solution: Fix the pattern and use supertype where appropriate.
2026-04-03 14:23:36 +02:00
Riley Bruins
81295eb0c5
feat(parsers): add jjdescription (#8625) 2026-04-03 10:43:28 +02:00
Christian Clason
539abf6da5 chore: remove redundant emmyluarc entry 2026-04-02 19:03:52 +02:00
Christian Clason
6878ae017d ci: migrate to emmyluals 2026-04-02 15:00:21 +02:00
Christian Clason
c82bf96f0a feat!: drop support for Nvim 0.11 2026-04-01 14:59:03 +02:00
Christian Clason
90cd6580e7 tests: add stable Nvim 2026-04-01 14:59:03 +02:00
nvim-treesitter-bot[bot]
7caec274fd bot(parsers): update beancount, gotmpl, heex, helm, idl, javadoc, jinja, jinja_inline, just, kotlin, liquid, mlir, ocaml, ocaml_interface, pkl, pod, rust, supercollider, typoscript 2026-03-28 07:33:46 +00:00
Riley Bruins
da8bf82a53
fix(kotlin): regex and printf injections not applying (#8613) 2026-03-27 15:22:25 -07:00
Riley Bruins
f059649bc3
fix(go): highlight rune as @character (#8612) 2026-03-27 11:37:59 -07:00
Adrian Wang
6620ae1c44
fix(install): use rename-before-unlink on all platforms
Problem: On macOS Apple Silicon, a plain unlink can leave stale code
signature metadata in the kernel cache, causing SIGKILL on next page
fault after `TSUpdate`.

Solution: Apply the rename-then-unlink strategy unconditionally instead
of only on Windows.
2026-03-23 10:32:51 +01:00
Christian Clason
8755152551
fix(parsers): track default branch for perl, pod (#8605)
Problem: non-default "release" branch tracking is broken, but the
default branch contains grammar.json.

Solution: track default `main` branch and generate parser from JSON.
2026-03-22 16:49:17 +00:00
Christian Clason
0e0db770f2 fix(parsers): don't specify default branch 2026-03-22 12:20:33 +01:00
nvim-treesitter-bot[bot]
e5f65e31a5 bot(parsers): update arduino, c3, cue, dart, fortran, fsharp, git_rebase, gleam, heex, idl, just, kotlin, ledger, mlir, nim, nu, php, php_only, powershell, proto, racket, rust, scheme, swift, vhdl 2026-03-21 07:17:33 +00:00
dependabot[bot]
877f724846 ci: bump actions/create-github-app-token in the actions group
Bumps the actions group with 1 update: [actions/create-github-app-token](https://github.com/actions/create-github-app-token).


Updates `actions/create-github-app-token` from 2 to 3
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](https://github.com/actions/create-github-app-token/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-20 17:42:48 +01:00
Christian Clason
53f6ce29df feat(zsh)!: update parser and queries 2026-03-20 10:43:21 +01:00
Christian Clason
2b50ab5ccb test: replace plenary with plentest.nvim
Problem: plenary.nvim as test runner is overkill and no longer
maintained.

Solution: Replace with a minimal fork based on Neovim API and vendored
luassert.
2026-03-17 18:20:03 +01:00
Christian Clason
2cc172c28e test(indent): we have scan_dir at home 2026-03-17 09:47:15 +01:00
Christian Clason
c9fea86a5a test(indent): drop plenary.path 2026-03-16 22:51:41 +01:00
George Harker
b9f9d692f1
feat(zsh): update parser and queries
add `;|` highlighting
2026-03-16 20:08:58 +01:00
Christian Clason
ebc3201290 fix(zsh): mark as tier 2 2026-03-16 10:03:08 +01:00
Christian Clason
2f5d4c3f3c docs(readme): clarify pre-release support policy 2026-03-14 19:46:07 +01:00
Christian Clason
f873ec2955 refactor(config): no trailing slash in installdir 2026-03-14 19:19:10 +01:00
Luca Papagni
88a217f570
Show errors on vim.system failure (#8552)
Problem: `vim.system` throws an error when `uv.spawn` fails, in
particular when `cmd` or `cwd` does not exist. This kills the coroutine,
which makes the corresponding async call hang.

Solution: Wrap `vim.system` in a function that catches any error and
returns it as `stderr` in a `SystemObj`.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2026-03-14 19:06:38 +01:00
nvim-treesitter-bot[bot]
eb1f8e80cb bot(parsers): update c3, elixir, erlang, fsharp, gitcommit, hyprlang, kotlin, ledger, pkl, powershell, proto, ruby, scala, scheme, t32, v 2026-03-14 07:15:51 +00:00
Riley Bruins
493890b87a feat(textproto): punctuation and string escape highlights 2026-03-12 09:28:44 +01:00
Christian Clason
5cb05e1b0f fix(filetype): don't register c-sharp
Language names can only contain hyphens, and dashes are normalized by
Nvim itself now.
2026-03-07 11:15:38 +01:00
nvim-treesitter-bot[bot]
4110daee15 bot(parsers): update blade, elixir, gitcommit, groovy, idl, javadoc, kotlin, liquidsoap, matlab, nu, pkl, proto, t32, vhdl 2026-03-07 09:33:18 +00:00
nvim-treesitter-bot[bot]
9fd4d998c3 bot(parsers): update wit, zsh 2026-03-07 10:32:48 +01:00
Stefan VanBuren
ebe76eb800
feat(proto): sync queries with upstream (#8554)
This adds support for [Protobuf Editions][1], and a couple other minor
fixes.

Ref: https://github.com/coder3101/tree-sitter-proto/tree/main/queries

[1]: https://protobuf.dev/editions/overview/
2026-03-06 16:12:43 +00:00
Christian Clason
1970f0d3bb feat(robot)!: update parser and queries
Breaking change: replaced `(variable_definition)` by
`(scalar_variable)`, `(list_variable)` and `(dictionary_variable)`.

Also mark queries as unmaintained.
2026-03-06 11:04:36 +01:00
elgiano
544320a9cf feat(supercollider)!: update parser and queries
parser PR: https://github.com/madskjeldgaard/tree-sitter-supercollider/pull/67

removed nodes:
control_structure, if, while, for, forby, method_call,
method_name, instance_variable_setter_call, argument_calls

added nodes:
class_def_body, !==, ===

modified nodes:
function_call now has fields receiver, name and arguments
chained method calls now appear as nested function_calls (where receiver
is another function_call)
2026-03-04 12:35:03 +01:00
Christian Clason
972f378653 fix(config): normalize default install_dir
Problem: The default `install_dir` is not normalized, leading to a
false positive checkhealth failure when comparing against the normalized
`runtimepath` directories.

Solution: Use trailing slash in default `install_dir`.
2026-03-03 19:25:06 +01:00
Riley Bruins
cb2cb74f3c feat(nickel): many more highlights 2026-03-01 22:56:47 +01:00
Ethan Rutt
995b75fd51
feat: add gql function highlighting for ecmascript injection (#8541) 2026-03-01 13:29:06 -08:00
nvim-treesitter-bot[bot]
6bc51d020a bot(parsers): update blade, kotlin, liquidsoap, lua, markdown, markdown_inline, mlir, proto, unison, vim 2026-02-28 07:10:54 +00:00
Igor
ae2081cfcd feat(ecma): variable definition from object destructure with alias 2026-02-27 09:00:07 +01:00
Tomas Sandven
b9171ede5d
feat(robot): update parser, mark as stable 2026-02-26 20:17:27 +01:00
nvim-treesitter-bot[bot]
957f86ae3f bot(parsers): update zsh 2026-02-26 11:17:02 +01:00
nvim-treesitter-bot[bot]
8ada222612 bot(parsers): update cpp, cue, fish, groovy, julia, liquid, lua, markdown, markdown_inline, mlir, pkl, powershell, query, slint, sql, swift, systemverilog, vhdl, vim 2026-02-26 10:06:44 +00:00
Christian Clason
eaa5caed2a feat(make): update parser and queries 2026-02-26 10:45:02 +01:00
Ilya Ilyinykh
0f5b204603
fix(typst): indentation for block and branch 2026-02-25 18:35:46 +01:00
Omar Valdez
67d0fd3e0a feat(xresources,desktop): mark as tier 1 2026-02-25 15:40:58 +01:00
Salomon Popp
c6d295e966
feat(nickel): update highlight queries to grammar changes 2026-02-25 10:06:48 +01:00
Ark1409
a8845121f0
fix(c_sharp): missing highlight for lambda modifier (#8526) 2026-02-24 18:25:39 -08:00
Omar Valdez
d660b7c002 feat(editorconfig)!: update parser and queries
Removed nodes:
section_name, expansion_string, wildcard_characters,
wildcard_any_characters, wildcard_single_character, unset, boolean,
spelling_language, indent_style, end_of_line, charset, unknown

Renamed nodes:
identifier -> property
negation -> "!"
path_separator -> "/"
escaped_character -> character_escape
2026-02-23 17:49:34 +01:00
nvim-treesitter-bot[bot]
dc42c209f3 bot(parsers): update c_sharp, desktop, editorconfig, fish, kitty, kotlin, mlir, proto, rescript, sql, swift, xresources 2026-02-21 07:10:10 +00:00
Christian Clason
fcd51bbe92 fix(supercollider): mark as tier 3 2026-02-20 11:08:31 +01:00
Robert Muir
3edb01f912
fix(install): unlink files before copy on unix to prevent crashes (#8517)
uv_fs_copyfile will truncate the target first, which can result in
hard-to-debug crashes if the shared object is currently in use.

instead, unlink the target first, so that the operation doesn't modify
any in-use files. the disk space from the old parsers won't be reclaimed
until any processes using them relinquish their open file handles.
2026-02-19 15:39:22 +01:00
Christian Clason
ecdae44bae feat(kotlin)!: update parser and queries
Breaking change: removed nodes `"!in"` and `"!is"`.
2026-02-18 19:53:54 +01:00
NullVoxPopuli
23502d650a
fix(glimmer_typescript): inherit typescript indents 2026-02-18 17:32:57 +01:00
Stefan VanBuren
0211563445
feat(protobuf)!: switch parser repo (#8514)
This switches the protobuf parser to https://github.com/coder3101/tree-sitter-proto,
which is a maintained parser and used in Zed.

The old https://github.com/treywood/tree-sitter-proto is effectively
unmaintained AFAICT, so it would be nice to have a maintained repo here.
2026-02-18 16:26:40 +00:00
nvim-treesitter-bot[bot]
2bd9b9b4f1 bot(parsers): update angular, bpftrace, c_sharp, fortran, markdown, markdown_inline, mlir, nickel, tlaplus 2026-02-17 17:02:40 +00:00
Dennis van den Berg
ca35dc5184 feat(angular): adds support for css class bindings 2026-02-17 14:56:12 +01:00
Christian Clason
4d9466677a fix(install): raise number of retries
Seven retries ought to be enough for anybody.
2026-02-14 13:18:48 +01:00
fin-w
b032f66f0b
fix(health): consistent abbreviations in legend 2026-02-14 12:33:04 +01:00
nvim-treesitter-bot[bot]
88a8487378 bot(parsers): update dart, fortran, gleam, janet_simple, just, mlir, rescript, slint, solidity, sql, t32, unison 2026-02-14 11:19:53 +00:00
Christian Clason
9f2dad22ef feat(vento)!: update parser and queries
Breaking change: `(keyword)` node removed.

Also mark as unmaintained (Copilot-maintained)
2026-02-11 12:14:00 +01:00
nvim-treesitter-bot[bot]
45a07f869b bot(parsers): update javadoc, just, kotlin, markdown, markdown_inline, matlab, mlir, php, php_only, pkl, slint, unison 2026-02-07 07:11:42 +00:00
Christian Clason
92c9b016d1 fix(install): retry on server error 2026-02-06 12:16:51 +01:00
phanium
70a9fecaf5 fix(lua): injections in vim.{rpcrequest,rpcnotify} 2026-02-05 09:15:56 +01:00
nvim-treesitter-bot[bot]
4967fa48b0 bot(parsers): update beancount, c3, dart, desktop, editorconfig, gap, jinja, jinja_inline, matlab, mlir, nu, pkl, swift, unison, xresources, yaml 2026-01-31 10:18:44 +00:00
Christian Clason
ac1d0ff910 fix(scripts): guard against empty reply when checking new revisions 2026-01-31 11:07:03 +01:00
Christian Clason
19c729dae6 fix(install)!: remove gitlab codepath
Gitlab tarballs have started including the commit hash, so downstream
processing fails anyway.
2026-01-29 16:22:32 +01:00
Christian Buttner
04ab807f8e
feat(c3)!: update parser and highlights (#8477)
Breaking: `(import_declaration (path_ident))` changed to `(import_path (path_ident))`
2026-01-29 10:02:30 +00:00
stefan
cc12e37e5b fix(nix): make all bash injections combined 2026-01-29 10:41:43 +01:00
Christian Clason
5465196ba8 fix(health): update required tree-sitter version 2026-01-29 10:29:15 +01:00
Christian Clason
f8bbc3177d feat(roc): mark as unmaintained 2026-01-27 12:02:53 +01:00
Christian Clason
0ac55b85c6 refactor(lua): replace vim.opt with vim.o 2026-01-27 11:57:04 +01:00
nvim-treesitter-bot[bot]
568ede7e79 bot(parsers): update ruby, vue 2026-01-25 11:08:41 +00:00
Bartłomiej Maryńczak
81aca2f981
feat(rust): add !xml injection 2026-01-24 22:21:27 +01:00
NullVoxPopuli
67b3ce0529
fix(glimmer) update injections 2026-01-24 22:21:10 +01:00
nvim-treesitter-bot[bot]
275b9fe801 bot(parsers): update zsh 2026-01-24 10:58:14 +01:00
nvim-treesitter-bot[bot]
b67d29ce74 bot(parsers): update c_sharp, desktop, dtd, editorconfig, fennel, fortran, hcl, javadoc, just, lalrpop, lua, markdown, markdown_inline, meson, mlir, rescript, rifleconf, sql, swift, terraform, tlaplus, vim, xml, xresources 2026-01-24 07:03:36 +00:00
Stanislaw Gruszka
88f1dfc211 feat(bpftrace): update parser and small highlights improvements
Update parser. Use new builtins from grammar (don't use lua-match).
2026-01-23 10:52:33 +01:00
Christian Clason
511e5ccf40 ci: correct concurrency group for downstream 2026-01-22 18:44:49 +01:00
Christian Clason
62dad2a60a ci: add concurrency for downstream tests 2026-01-22 18:36:56 +01:00
Christian Clason
61d3f5b186 test(lint): bump luals to 3.17.1 2026-01-22 18:36:56 +01:00
Christian Clason
0d1b8b026b ci: use ubuntu-slim for small jobs 2026-01-22 18:36:56 +01:00
mintbug
ec03481377 feat(typst): set url attribute for links 2026-01-20 16:01:54 +01:00
Peter Cardenas
e75c007f27 fix(fish): update builtin highlights 2026-01-19 17:36:05 +01:00
Christian Clason
b9933f0e13 test(init): remove upstreamed Tiger ft detection 2026-01-19 10:37:35 +01:00
Mariusz Biegański
d9a5fb8484 docs(supported_languages): fix order of available queries 2026-01-18 17:34:33 +01:00
Christian Clason
3121570f07 docs(contributing): inclusion criteria 2026-01-18 17:31:30 +01:00
Christian Clason
d19def46c1 fix(make): switch to maintained fork 2026-01-17 16:15:39 +01:00
Nico Salm
19261d56ed fix(rust): highlight doc comment markers as @comment.documentation
Co-authored-by: LunarLambda <LunarLambda@users.noreply.github.com>
2026-01-17 12:12:37 +01:00
nvim-treesitter-bot[bot]
7c14161403 bot(parsers): update bpftrace, desktop, editorconfig, glimmer, javadoc, liquidsoap, markdown, markdown_inline, matlab, meson, mlir, nim, pkl, rego, rescript, swift, vhdl, xresources 2026-01-17 06:56:25 +00:00
Abbath
8aada0e394 fix(haskell): use grammar for operator detection instead of match 2026-01-16 18:11:27 +01:00
Abbath
15b3416cc1 fix(haskell): highlighting for operator definition and operator-like constructors. 2026-01-15 09:19:05 +01:00
Abbath
c872ec85cc fix(haskell): syntax highlighting for Haskell lambda expressions
Fixes highlighting for lambdas with multiple parameters.
2026-01-15 09:19:05 +01:00
nvim-treesitter-bot[bot]
5a7e5638e7 bot(parsers): update inko 2026-01-10 10:39:10 +01:00
nvim-treesitter-bot[bot]
6016f1232d bot(parsers): update beancount, bpftrace, c3, fortran, gleam, lua, mlir, sql 2026-01-10 06:57:05 +00:00
Christian Clason
2ba5ec1846 test(init): remove upstreamed Nickel ft detection 2026-01-08 10:34:30 +01:00
Riley Bruins
5e8652dbaf fix(usd): misc punctuation highlights 2026-01-08 10:17:12 +01:00
Stanislaw Gruszka
9177f2ff06
feat(parsers): add bpftrace (#8399)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2026-01-07 21:59:10 -08:00
Chris Dragan
6feaebb456
feat(kos): highlights improvements (#8404)
* Mark floats as number.float
* Mark function arguments as variable.parameter
* Mark _ placeholder as character.special
* Mark string interpolation delimiters as punctuation.special
2026-01-07 21:53:42 -08:00
Igor Lacerda
de878155ca
fix(html_tags): disable spell for tags (#8410)
When tags are embedded into markdown, they'd get spell checked, in spite
of that not really making sense. The real culprit of this issue is
markdown's spell being too "loose".
2026-01-07 16:39:29 +01:00
Farid
b033ab331c docs(readme): fix lazy snippet 2026-01-05 12:01:59 +01:00
Christian Clason
99dfc5acef docs(readme): fix lazy snippet 2026-01-04 18:08:46 +01:00
Chris Dragan
31fc7e10cd
feat: add kos parser and queries (#8389) 2026-01-04 11:08:07 +01:00
PolarMutex
300b906a95
fix(beancount): update to windows-compatible version (#8401) 2026-01-03 18:15:14 +01:00
Sten Laane
4337799162 feat(bash): add indents query
It's pretty basic at the moment but already makes working with bash
scripts way easier.
2026-01-03 11:29:39 +01:00
neno
86cf4fb684 fix(ruby): improve highlights for pattern matching and for...in loops 2026-01-03 11:28:41 +01:00
nvim-treesitter-bot[bot]
46c16d89a8 bot(parsers): update c3, desktop, editorconfig, javadoc, kitty, lua, nginx, query, swift, templ, typespec, v, vim, xresources 2026-01-03 10:20:31 +00:00
Daniel Jakots
737088f857
docs(languages): remove unused node legend (#8396)
erroneously reintroduced in 69c76488f7.
2026-01-02 15:37:00 +00:00
Christian Clason
1927c76aec feat(install): warn on unsupported parsers 2026-01-02 10:04:03 +01:00
Christian Clason
efa5d1fa3a feat(robots)!: adapt to renamed parser 2026-01-02 10:02:25 +01:00
Christian Clason
c6dd314086 fix(lua): re-add missing assignment operator 2025-12-31 15:21:31 +01:00
Christian Clason
d6ce707613 feat(lua): replace operator list with field 2025-12-31 13:57:06 +01:00
Marc Jakobi
7efc1b58a8
fix(nix): refactor nixosTest injections for better performance (#8378) 2025-12-29 16:47:03 +01:00
nvim-treesitter-bot[bot]
36fcb4a423 bot(parsers): update desktop, editorconfig, erlang, gotmpl, helm, lua, mlir, pascal, sql, typoscript, v, xresources 2025-12-27 06:56:45 +00:00
Marc Jakobi
45d08da7bb chore(nix): add mrcjkb to maintainers 2025-12-26 22:13:05 +01:00
Marc Jakobi
7ba26e7685 perf(nix): replace match with lua-match 2025-12-26 22:13:05 +01:00
Christian Clason
6e42d823ce fix(strace): no longer need to generate 2025-12-21 15:27:47 +01:00
Christian Clason
8cdffc6d33 feat(vim): support :tab command 2025-12-20 12:40:15 +01:00
Christian Clason
f795520371 fix(strace): generate removed parser 2025-12-20 12:36:44 +01:00
nvim-treesitter-bot[bot]
e08ad49dbd bot(parsers): update editorconfig, meson, mlir, phpdoc, t32, vhdl 2025-12-20 06:55:48 +00:00
Christian Clason
4fc09bee78 ci(dependabot): fix labels 2025-12-17 13:12:25 +01:00
dependabot[bot]
cfdca13a5d ci: bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

Updates `peter-evans/create-pull-request` from 7 to 8
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: peter-evans/create-pull-request
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-17 13:00:42 +01:00
Christian Clason
fc21d3db8c ci: add dependabot for GH actions 2025-12-17 12:55:05 +01:00
Christian Clason
846c7b50ee chore: remove FUNDING.yml 2025-12-17 12:55:05 +01:00
Christian Clason
d0bf5ff2b0 feat(parsers): update ada, c3, comment, desktop, editorconfig, elm, julia, mlir, nu, phpdoc, t32, tera, vim, vimdoc, xresources, zsh 2025-12-17 11:53:39 +01:00
Manfred Egger
568f2a3b7d
feat(typoscript)!: update grammar and queries (#8341)
Breaking change: `(condition_bool)` renamed to `(condition_bool_legacy)`
2025-12-17 11:48:06 +01:00
Christian Clason
d3218d988f docs(readme)!: main is now the default branch 2025-12-14 13:16:25 +01:00
Christian Clason
74b119812e feat(gleam)!: update parser and queries
Breaking change: `(bit_string_*)` renamed to `(bit_array_*)`
2025-12-13 14:28:41 +01:00
Christian Clason
74d3999522 feat(parsers): update fortran, gotmpl, helm, idl, mlir, pkl, query, racket, scheme, slint, vhdl, zsh 2025-12-13 14:21:32 +01:00
Christian Clason
2979e048b3 ci(test): bump tree-sitter/setup-actions to v2 2025-12-11 10:57:07 +01:00
Marc Jakobi
b6271b678e feat(haskell): injection for morpheus-graphql-client quasiquotes 2025-12-09 11:02:20 +01:00
Riad
186810d6ad feat(gdscript): update builtin highlights
Added all builtin annotations, constants, methods
and types as of godot commit : 10c7cb8
2025-12-09 11:01:36 +01:00
adaitche
02693ce64c
feat(sql): improve @type capture (#8315)
Problem: `@type` currently captures function calls but fails to
capture CTE names.

Solution: Don't capture types in invocations. Add pattern for `cte`.
2025-12-09 10:53:37 +01:00
Christian Clason
a98a740c55 feat(parsers): update brightscript, desktop, gotmpl, helm, ini, javadoc, mlir, nu, powershell, slint, vimdoc, xresources 2025-12-09 10:19:54 +01:00
Omar Valdez
f47f549f74 feat(bash): highlight arguments of trap and kill builtin commands 2025-12-08 14:47:59 +01:00
Omar Valdez
93537d6998 feat(bash): remove unnecessary captures
- Bash does not have boolean values and the builtin `true`
  and `false` commands are already covered by another capture.
- The grammar has a `number` node and it's already captured.
2025-12-08 13:08:03 +01:00
Cameron
bfc6c99540
fix(ruby): highlighting for string-literal symbols (#8317) 2025-12-08 11:27:09 +01:00
Yorick Peterse
20db421f5f
feat(inko): update to v0.4.0 (#8327)
This changes the structure of "if" expressions so the queries for
nvim-treesitter-textobjects can be changed as to not cause any crashes.
2025-12-06 22:38:22 +01:00
Christian Clason
9d47b2558b feat(json): add support for jsonc files 2025-12-06 18:10:39 +01:00
Christian Clason
d2350758b3 feat(parsers)!: remove gitlab-hosted blueprint, fusion, jsonc
Problem: Gitlab has too frequent outages, which break automation.

Solution: Drop all Gitlab-hosted parsers (two of which have been
unmaintained for years).
2025-12-06 18:10:39 +01:00
Christian Clason
d72fa25b54 feat(fortran)!: update parser and queries
Breaking change: `(do_loop_statement)` renamed to `(do_loop)`
2025-12-06 14:13:26 +01:00
Christian Clason
41913a8d44 feat(bash): update parser
Breaking change: removed double parenthesis as valid opening to
arithmetic expansion. (Only `$((` is allowed according to the manual.)
2025-12-06 14:04:19 +01:00
Christian Clason
596923959a fix(inko): downgrade parser
Problem: The commit fc37d05c36 broke parsing a textobjects query.

Solution: Downgrade parser to previous commit and pin it (until we can move it to tier 1).
2025-12-06 13:29:48 +01:00
Christian Clason
6f2121231a feat(parsers): update angular, c3, desktop, elm, forth, inko, mlir, nix, pkl, powershell, templ, xresources 2025-12-06 13:09:06 +01:00
Christian Clason
e0eec76dad fix(lua): fix some emmyluals warnings 2025-12-06 11:16:30 +01:00
Dennis van den Berg
75797cdd8a
feat(angular): add style_unit highlighting(#8312) 2025-12-04 10:42:01 +01:00
Alexei Mozaidze
857fb97bb6 fix(fennel): highlight $[1-9] in multi-symbol context properly
Highlights the dollar symbol properly in multi-symbol contexts, like `$3.some.properties`.
There was already a fix for a similar issue on #8067, but it only addressed `$.some.properties`, but not the variant with the argument number in it.
2025-12-03 17:49:36 +01:00
Gabriel Holodak
c5623d3486
docs: document setting foldmethod alongside foldexpr (#8187) 2025-12-02 17:15:52 -08:00
nsfisis
e527584cf8
feat(vhs): update options list (#8309) 2025-12-02 12:03:33 -08:00
George Harker
00c906abb9
fix(zsh): update posix shell variables 2025-12-01 08:46:21 +01:00
Christian Clason
17885756e6 feat(parsers): update angular, c3, desktop, editorconfig, elm, gdshader, gleam, haskell, idl, php, php_only, pkl, query, readline, vimdoc, xresources 2025-11-27 18:54:20 +01:00
Tayfun Bocek
d56ed0f7f9
feat(gdshader): update highlight queries (#8299)
* use uniform scope node instead of literal matching

This avoids the need to refactor if other scope types are added. Maybe
helps performance as well.

* add method expression highlight
2025-11-27 10:35:21 +01:00
Christian Clason
c5871d9d87 fix(perl): correct use of supertypes 2025-11-25 10:40:58 +01:00
Christian Clason
d6ebbd5039 fix(haskell): correct use of supertypes in (decl) patterns
Problem: These patterns were impossible, since children need to be children of
every subtype of a supertype to be captured in this way. As subtypes
could appear as children themselves, the query code silently "skipped
over" the supertype restriction in the pattern. This was fixed in
tree-sitter v0.26.0, which now (correctly) flags these patterns as
"impossible".

Solution: Add the appropriate child nodes explicitly.
2025-11-25 10:28:33 +01:00
Christian Clason
3bbae7b32e feat(parsers): update angular, ini, json5, koto, matlab, mlir, nix, pkl, query, sql, t32, vimdoc, zsh 2025-11-23 13:31:11 +01:00
Christian Clason
bb83a67612 fix(fsharp): correct use of supertypes in (_type) patterns
Problem: These patterns were impossible, since children need to be children of
every subtype of a supertype to be captured in this way. As subtypes
could appear as children themselves, the query code silently "skipped
over" the supertype restriction in the pattern. This was fixed in
tree-sitter v0.26.0, which now (correctly) flags these patterns as
"impossible".

Solution: Add the appropriate child nodes explicitly.
2025-11-19 11:03:04 +01:00
Christian Clason
c682a239a9 feat(parsers): update asm, c_sharp, csv, desktop, gdshader, gotmpl, haskell, heex, helm, javadoc, matlab, mlir, pkl, psv, t32, tsv, xresources 2025-11-17 11:17:13 +01:00
Christian Clason
3a48d16c95 fix(ziggy): mark as unmaintained 2025-11-17 11:12:09 +01:00
Mikhail Katychev
69c76488f7
feat(wit)! update parser and queries to 1.2.0 (#8199) 2025-11-17 10:06:00 +00:00
Christian Clason
0cfa599474 chore: remove format-queries script
The source of truth for formatting (according to make formatquery and
 CI) is now ts_query_ls, so remove the no longer required script to
 prevent divergence and bitrotting.
2025-11-14 22:58:12 +01:00
Tomohiro Hashidate
2696fb8326
feat(ruby): update queries to support rbs-inline syntax (#8282) 2025-11-14 07:04:54 -08:00
George Harker
2144e88dac
feat(zsh): bump parser, disallow injections for regex with expansion 2025-11-13 15:20:34 -08:00
Derek Stride
0427eeb385
feat(sql): update parser, highlights (#8272) 2025-11-13 15:15:19 -08:00
Christoph Sax
b50774079a
feat(t32)!: update parser and queries (#8276)
`trace32_hll_variable` has been removed from the grammar. The
queries are now capturing `symbol` instead. `symbol` is highlighted
as variable or constant.
2025-11-12 10:06:04 +01:00
Tayfun Bocek
f46e3a09bd
fix(gdshader): add missing keyword to group (#8274) 2025-11-10 23:21:29 -08:00
Christian Clason
0a6817bcbb feat(haskell): switch to maintained fork 2025-11-10 23:15:20 +01:00
Christian Clason
81aec1e45d ci: add check for downstream queries
Problem: Parser updates may break downstream queries.

Solution: Add workflow that clones and validates queries in

* https://github.com/nvim-treesitter/nvim-treesitter-textobjects#main
* https://github.com/nvim-treesitter/nvim-treesitter-context

on changes to the parsers.lua table. (Workflow should not be required to
pass; the purpose is to give a heads-up that follow-up PRs are needed.)
2025-11-10 11:32:04 +01:00
Christian Clason
d97d226cfd feat(parsers): update asm, devicetree, gdshader, hack, hyprlang, koto, matlab, mlir, nix, ocamllex, pkl, sql, templ, zsh 2025-11-08 11:55:40 +01:00
Jaehwang Jung
5eca61b32a fix(python): nospell for interpolation 2025-11-06 12:35:06 +01:00
George Harker
1ddb266477
feat(parsers): add zsh support (#8240)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Co-authored-by: Tayfun Bocek <tayfunbocek@live.ca>
2025-11-05 20:13:53 -08:00
Alexey Svirshchevskiy
896e92a7f6
fix(typescript): support type param for styled components (#8066) 2025-11-04 20:07:27 -08:00
Igor Lacerda
53049d6678
feat(ecma): variable definition from object destructure (#8233) 2025-11-04 20:03:42 -08:00
Izzy Muerte
65a266bf69
fix(xml): remove CDATA injection
This change does not break existing injections that currently ship with nvim-treesitter, but instead allows additional injections to be defined by users, like those found in the Max/MSP Jitter XML Shader format.
2025-11-03 09:37:30 +01:00
Christian Clason
55820833a3 feat(parsers): update angular, desktop, earthfile, editorconfig, gdshader, javadoc, matlab, mlir, pkl, powershell, xresources 2025-11-02 10:47:45 +01:00
Tayfun Bocek
64f4755b9d
feat!(gdshader): replace gdshader parser and queries (#8244)
Switch parser to https://github.com/airblast-dev/tree-sitter-gdshader
2025-10-30 14:59:19 +01:00
Christian Clason
fd2880e8bc feat(install): remove node requirement
* supported parsers _must_ commit at least `grammar.json`
* set `TREE_SITTER_JS_RUNTIME=native` when generating parser to use
  built-in quickjs instead of node (requires tree-sitter 0.26)
2025-10-30 08:36:00 +01:00
Christian Clason
a3b489680f feat(scfg): update parser 2025-10-30 08:36:00 +01:00
Riley Bruins
2c30e515eb
fix: prefer #eq? for checking equality with one string (#8246) 2025-10-30 10:51:42 +09:00
Christian Clason
9ddd853e7e feat(diff): update parser after move 2025-10-29 19:32:05 +01:00
Christoph Horn
645f42e85d
feat(julia)!: update parser and queries (#8235)
sync locals queries with upstream

---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-10-27 10:43:58 +00:00
imawaki
738d9ced4c
feat(apex): javadoc injections (#8232)
Apex codebases commonly use Javadoc-style comments, similar to Java (Apex is Salesforce's object-oriented language).

This updates the injection query to capture javadoc nodes instead of the generic comment for better highlighting and parsing accuracy.
2025-10-26 19:07:19 +01:00
Lev Velykoivanenko
c53bb10a71
fix(python): regex injection not working for concatenated strings (#8197)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-10-26 09:25:42 -07:00
Christian Clason
98fe644cb3 feat(parsers): update c3, desktop, dot, gomod, idl, julia, kitty, matlab, mlir, nu, php, php_only, tmux 2025-10-25 11:48:13 +02:00
zc he
9ee023538e
feat(nu): update syntax to Nu 0.108.0 (#8227)
also deduplicate bracket rules
2025-10-25 11:14:38 +02:00
Omar Valdez
400f38cc23
feat(hyprlang): update parser and queries (#8224) 2025-10-24 18:50:42 -07:00
Riley Bruins
f2204e58db
fix: use proper ; inherits syntax in queries (#8226)
Some queries don't add a colon after the `inherits` keyword, which nvim
could handle but `ts_query_ls` could not, causing it to give incomplete
diagnostics.
2025-10-24 18:47:39 -07:00
Isla Waters
4a9f57971a Remove empty capture based on ts_query_ls output 2025-10-24 09:31:21 +02:00
Isla Waters
eea5725822 feat(perl): Add language injection based on heredoc delimiter 2025-10-24 09:31:21 +02:00
Christian Clason
8fecb46258 feat(julia)!: switch to maintained fork
breaking change: ABI 15, drop support for emoji identifiers
2025-10-23 10:41:53 +02:00
zc he
30c466ad57
fix(nu): separate patterns for collection_type 2025-10-21 09:10:18 +02:00
Christian Clason
71bf1665f8 feat(parsers): update ada, cmake, desktop, dot, mlir, nu, qmljs, sparql, sql, superhtml, systemverilog, t32, tmux, xresources 2025-10-19 11:34:46 +02:00
Christian Clason
846d51137b
feat(julia): update builtin functions and types (#8203)
Update to Julia 1.12 (sync with upstream)
2025-10-17 13:54:28 +00:00
Christian Clason
cdb5d5ef23 docs(readme): remove wiki link 2025-10-17 14:24:49 +02:00
Riley Bruins
63fac0a576
fix(vue): @character.special highlights for :, . (#8200) 2025-10-15 23:17:41 -07:00
Christoph Sax
4968877bb2 fix(t32): update repo url
Switches the grammar repository from GitLab to GitHub.
2025-10-15 21:49:59 +02:00
Riley Bruins
0606c7a9dc feat(vue): delimiter highlight touch-ups 2025-10-12 11:22:15 +02:00
Riley Bruins
4b74045bbe chore: ask for file extension in new language PR template
This will really help me to search on github for diverse code samples.
2025-10-11 18:09:54 +02:00
Riley Bruins
09d50fd157 fix(kitty): align line continuation highlights
Changes them from `@comment` to `@punctuation.special`, which is how
they are in other languages.
2025-10-11 17:51:13 +02:00
Christian Clason
763f1e650b feat(parsers): update angular, comment, dart, desktop, enforce, erlang, gleam, gotmpl, hare, helm, javadoc, kitty, koto, mlir, racket, rust, scheme, superhtml, systemverilog, wit, xresources, yaml 2025-10-11 11:16:55 +02:00
Steven Xu
cbafde9925 feat(tmux)!: update parser and highlights
Breaking changes:

- Nodes `(variable_name)`, `(expr_variable_name)`, `(variable_name_short)`, are exposed as `(name)`.
2025-10-11 10:52:02 +02:00
Steven Xu
de003000a2 feat(tmux)!: update parser and highlights
Breaking changes:

- Node `(variable)` was renamed to `(expr_double_quotes)`.
- Node `(variable_raw)` was renamed to `(expr_single_quotes)`.
- Node `(string)` was renamed to `(str_double_quotes)`.
- Node `(raw_string)` was renamed to `(str_single_quotes)`.
- Node `(raw_string_quote)` was removed.
2025-10-10 12:53:39 +02:00
Yorick Peterse
3ab4f2d2d2 feat(inko): update parser for let pattern matching
Commit 9d7ed4 of the Inko tree-sitter grammar introduces support for
pattern matching in `let` expressions. This requires some corresponding
changes to the "local" queries to correctly define local variables. This
is done by simply defining locals for all "identifier_pattern" nodes,
instead of only doing this for "define_variable" nodes.
2025-10-07 10:00:15 +02:00
blindfs
0594d1ba65 feat(nu)!: update parser and queries 2025-10-06 16:31:28 +02:00
Christian Clason
01ced7499f feat(angular)!: update parser and queries
Breaking change: node `(static_member_expression)` was removed
2025-10-04 11:13:37 +02:00
Christian Clason
c579a8c0cf feat(parsers): update ada, c_sharp, css, dart, editorconfig, enforce, javadoc, koto, prisma, rust, sql, superhtml, t32 2025-10-04 11:07:11 +02:00
Christian Clason
b4888ed9e8 chore(gdscript): mark as unmaintained
Significant upstream breaking changes are not adapted to.
2025-10-04 10:58:16 +02:00
Yorick Peterse
b684696315 feat(inko): update parser and highlights
This commit includes syntax support for a few new syntax elements, and
updates the highlights queries to highlight two new expression keywords.
2025-10-03 15:18:41 +02:00
Omar Valdez
4709d4276c feat(python): highlight special brackets in format_expression 2025-10-03 09:53:33 +02:00
Riley Bruins
99bd52ba56
feat(java): highlight wildcards (#8165) 2025-10-02 03:33:49 +00:00
Riley Bruins
77362027f7
fix: remove redundant alternants (#8159) 2025-09-28 18:39:09 -07:00
Mouinul Hossain
db50897909
feat(parsers): add kitty (#8129) 2025-09-28 18:04:09 -07:00
Christian Clason
9176343647 feat(inko)!: update parser and queries
Breaking change: `(array_pattern)` rule and node was removed again.
2025-09-28 12:06:59 +02:00
Christian Clason
1df23c59d8 feat(parsers): update ada, cpp, desktop, erlang, godot_resource, ini, javadoc, mlir, powershell, rifleconf, slint, sql, superhtml, t32, xresources 2025-09-28 12:00:40 +02:00
Omar Valdez
5a70b1eb8c feat(hyprlang): highlight more exec keywords 2025-09-22 17:22:57 +02:00
Minijackson
53819acac2 feat(snl): add parser and queries 2025-09-22 15:41:39 +02:00
Riley Bruins
6ac9f2e512
fix: align line continuation highlights (#8146)
These should be `@punctuation.special`. Added the highlight for python,
cylc, and make. Corrected it for earthfile and matlab.
2025-09-21 16:59:47 -07:00
Christian Clason
bd99d6bd2b feat(koto)!: update parser and queries
Breaking changes: `call`, `index`, `lookup` fields removed
2025-09-21 10:42:51 +02:00
Christian Clason
a1d3efbdf5 feat(parsers): update ada, cuda, desktop, gdscript, json5, mlir, nu, slint, snakemake, supercollider, superhtml, vhdl, wgsl_bevy, xresources 2025-09-21 10:36:57 +02:00
Christian Clason
20fc6b1270 feat(python): revert breaking change
This reverts the update in
https://github.com/nvim-treesitter/nvim-treesitter/pull/8128 which
turned out to have further breaking consequences.

Pin the parser to the last release (tier 1) to avoid pulling in more
breaking changes.
2025-09-19 13:41:33 +02:00
Thibault de Villèle
c41b3b9841 feat(latex): add counter nodes' highlight rules 2025-09-19 10:35:18 +02:00
Thibault de Villèle
1b8622a830 feat(latex)!: update parser and queries
Breaking change: `(curly_group_label)` replaced by `(curly_group_text)`

see latex-lsp/tree-sitter-latex#213
2025-09-19 10:35:18 +02:00
sharpchen
317a77affc fix(c_sharp): missing highlight for parameter modifier 2025-09-19 10:27:32 +02:00
sharpchen
8ab64a37ea fix(c_sharp): missing query for delegate name 2025-09-17 21:05:25 +02:00
Christian Clason
1c760c1888 feat(parsers): update bash, c, cpp, desktop, djot, dtd, editorconfig, gdscript, go, html, idl, java, javadoc, javascript, json, markdown, markdown_inline, mlir, php, php_only, python, r, rust, scheme, ssh_config, supercollider, superhtml, systemverilog, templ, xml, xresources 2025-09-17 18:30:32 +02:00
Christian Clason
f4d22b96c5 docs(health): consistent use of tree-sitter-cli 2025-09-17 18:00:58 +02:00
Sergio A. Vargas
030e979b23
docs(README): clarify that tree-sitter-cli is required (#8124)
Seems like most distros have split out the CLI package under this name and reserve `tree-sitter` for the library (and crates) only.
2025-09-17 17:53:25 +02:00
purarue
7aa24acae3
feat(rifleconf): add parser and queries 2025-09-14 10:53:21 +02:00
Christian Clason
682d083292 feat(python)!: update parser and queries
Breaking change: anonymous node `"expect*"` was removed by the refactor.
2025-09-13 10:36:51 +02:00
Christian Clason
f6adaede57 feat(parsers): update authzed, bash, cpp, cylc, editorconfig, foam, gdscript, go, html, hurl, idl, java, javadoc, javascript, jsdoc, json, mlir, php, php_only, powershell, regex, rust, supercollider, zig 2025-09-13 10:27:44 +02:00
NullVoxPopuli
f42378a959
feat(glimmer_*): add glimmer_template folds (#8115) 2025-09-13 10:24:44 +02:00
altermo
7f8dd2e48b
fix(filetypes): correct glimmer_* mappings (#8110) 2025-09-10 07:29:48 +00:00
osthomas
fee71c102c
feat(snakemake): update queries (#8106)
also add indent tests
2025-09-07 13:58:28 +02:00
Christian Clason
939556333f feat(parsers): update arduino, desktop, hurl, mlir, query, slint, snakemake, xresources 2025-09-07 11:32:22 +02:00
Christian Clason
9addcdd015 feat(parsers): update agda, c3, embedded_template, javadoc, javascript, jinja, jinja_inline, pkl, slang, supercollider, sway, systemverilog 2025-09-06 11:12:58 +02:00
Riley Bruins
802195d8f1 feat(proto): folds for import statements 2025-08-31 08:06:48 +02:00
Riley Bruins
8fccdb3d49 feat(proto): more delimiter, property highlights 2025-08-31 08:06:48 +02:00
BlockLune
cd64fd3f44
feat(wxml): add parser and queries 2025-08-29 18:30:18 +02:00
Christian Clason
16da7ded58 feat(matlab)!: update parser and queries 2025-08-29 14:54:38 +02:00
Christian Clason
8302d4f547 feat(parsers): update bash, c, clojure, cpp, embedded_template, gap, go, html, java, javascript, json, json5, pkl, rust, supercollider 2025-08-29 14:49:35 +02:00
Christian Clason
85ec015f3b feat(nu)!: update parser and queries 2025-08-26 10:32:32 +02:00
Christian Clason
37cec5ec59 feat(gotmpl,helm)!: update parser and queries 2025-08-25 19:13:51 +02:00
Christian Clason
35a124cb60 feat(parsers): update arduino, blade, desktop, elixir, javadoc, llvm, mlir, perl, superhtml, vhdl, xresources, ziggy, ziggy_schema 2025-08-25 19:06:00 +02:00
Caleb White
9f15c2b050 fix(blade): fix highlighting of php tags 2025-08-25 15:39:40 +02:00
Yorick Peterse
44e90ec66e feat(inko): add support for array patterns
This updates the version of the Inko parser to the latest version and
includes indent support for the new array pattern node.
2025-08-21 19:51:10 +02:00
Christian Clason
6fd7117c1d feat(matlab)!: update parser and queries 2025-08-19 11:56:38 +02:00
Christian Clason
2f28a14ed2 feat(parsers): update arduino, chatito, desktop, editorconfig, gitattributes, gpg, idl, javadoc, mlir, pem, php, php_only, poe_filter, xresources 2025-08-19 11:51:52 +02:00
Christian Clason
32cb9f9b9d feat(parsers): update fennel, javadoc, llvm, matlab, mlir, nickel, nix, php, php_only, query, superhtml, vimdoc, wit 2025-08-16 10:11:22 +02:00
hsi
cabbd52bb8 fix(health): highlights legend label 2025-08-13 10:01:54 +02:00
Christian Clason
bf0234010a ci: bump actions/checkout to v5 2025-08-12 11:08:18 +02:00
Riley Bruins
4d43480167 ci: validate predicate/directive string parameters 2025-08-12 10:25:50 +02:00
Alexei Mozaidze
21da8ac251 fix(fennel): highlight $ in multi-symbol context properly
Highlights the dollar symbol properly in multi-symbol contexts like
`$.some.properties`
2025-08-12 10:25:22 +02:00
Caleb White
42ea539243 feat(php): update php and php_only parsers to v0.24.0 2025-08-12 10:25:14 +02:00
涵曦
13e3ce3bf4 feat(sproto): add parser 2025-08-12 10:24:58 +02:00
Christian Clason
9866036ec3 feat(parsers): update c3, c_sharp, desktop, editorconfig, fennel, gdshader, javadoc, llvm, matlab, nix, perl, scala, solidity, superhtml, xresource 2025-08-08 10:14:04 +02:00
Riley Bruins
4eb35c0344 feat(gdscript): misc operators, semicolon highlight 2025-08-06 18:49:54 +02:00
Christian Clason
37bcfdc6eb refactor(config): prefer vim.list.unique for normalization
Also fix some emmyluals warnings
2025-08-06 13:22:02 +02:00
Robert Muir
4d9916e477 fix(jinja_inline): fix crashing query pattern
If jinja_inline parser is regenerated, then this pattern hits an
"impossible" assert in tree-sitter query processing.
2025-08-05 20:06:49 +02:00
Robert Muir
a4fa3e2d18 Revert "fix(jinja): remove crashing pattern"
This reverts commit 8c8742871a.
2025-08-05 20:06:49 +02:00
Christian Clason
05f2910355 feat(systemverilog)!: update parser and queries
Breaking changes:
1. `(comment)` node split into `(one_line_comment)` and
   `(block_comment)`
2. named `(directive_foo)` nodes replaced by anonymous `"'foo"`
   (with backtick!) nodes -- but not consistently
2025-08-05 20:06:15 +02:00
Christian Clason
3561e1fb19 feat(parsers): update ada, fortran, idl, javadoc, matlab, nim, powershell, slang, superhtml, swift, templ 2025-08-02 14:53:13 +02:00
Christian Clason
b26b425829 feat(parsers): update gdscript, javadoc, lua, solidity, superhtml, systemverilog, zig, ziggy, ziggy_schema 2025-07-26 17:34:44 +02:00
Igor
12be0e9f24 fix(ini): register dosini and confini filetypes 2025-07-26 17:32:28 +02:00
MeanderingProgrammer
57aa15d4cc fix(install): skip duplicate dependencies 2025-07-25 11:55:13 +02:00
Christian Clason
5d539943c6 feat(parsers): update angular, beancount, fennel, gleam, idl, javadoc, jinja, jinja_inline, koto, llvm, swift, systemverilog, tera, vhdl 2025-07-23 13:38:53 +02:00
Riley Bruins
40cca05b40 fix(c, ecma): remove invalid predicate parameters
These are not valid named nodes in their respective languages.
2025-07-22 09:52:32 +02:00
Christian Clason
8c8742871a fix(jinja): remove crashing pattern
https://github.com/cathaysia/tree-sitter-jinja/issues/37
2025-07-21 11:21:52 +02:00
NullVoxPopuli
6b3bf164b2
feat(glimmer): add fold queries (#8020) 2025-07-21 09:40:37 +02:00
MeanderingProgrammer
3650b4ef6a refactor(install): replace status enum with boolean 2025-07-21 09:40:08 +02:00
MeanderingProgrammer
d116118add fix(install): don't make "installed" status persistent
Problem: Setting `install_status` to "installed" skips any future
install or update operation (even if forced). In particular, this breaks
`:TSUpdate` when calling `install()` in config files.

Solution: Don't set "installed" when skipping install and clear status
on successful operations.
2025-07-20 14:39:10 +02:00
Christian Clason
f14b356d54 feat(chatito)!: update parser and queries
node `(eq)` is replaced by field `eq: _`
2025-07-20 11:53:37 +02:00
Jonas Chevalier
afe267b50e
chore(nix): update url and maintainers 2025-07-20 09:50:56 +00:00
Christian Clason
d6bce02b89 feat(parsers): update beancount, brightscript, enforce, gdscript, gpg, groq, matlab, mlir, nix, pem, pymanifest, t32, udev, vhdl 2025-07-20 11:43:07 +02:00
Robert Muir
20d77c2e5b fix(jinja): assign highlights to all variables and functions
The majority of jinja variables aren't assigned any highlights at all.
Assign @variable to all identifiers.

Jinja filters without parameters are not highlighted as functions: add a
query for these.

Refine the existing @variable.member to only capture identifiers instead
of broader nodes.
2025-07-19 18:25:47 +02:00
Christian Clason
1e3b7562c2 feat(wit)!: update parser and queries 2025-07-19 15:19:50 +02:00
Christian Clason
a98e67ad40 fix(wit): update repo url 2025-07-19 15:06:34 +02:00
Riley Bruins
fba060b623
feat(pkl): add parser and queries (#8011) 2025-07-19 11:36:38 +02:00
Alan Russell
61ec748ef7
feat(groq): add parser and queries (#8008) 2025-07-18 18:04:42 +02:00
Christian Clason
a5edb0a274 feat(parsers): update arduino, editorconfig, gdscript, idl, javadoc, koto, matlab, mlir, nix, nu, powershell, printf, properties, slint, superhtml, systemverilog, t32, tera, twig, xcompose, xresources, ziggy, ziggy_schema 2025-07-17 11:42:27 +02:00
Riley Bruins
992e9ef3d0 ci: ensure parsers have a supported ABI version 2025-07-16 10:54:41 +02:00
Riley Bruins
8d8ca0996c docs: specify fold dos and don'ts 2025-07-15 10:53:32 +02:00
Riley Bruins
96f51adf71
fix(c_sharp): "<", ">" in type param lists are brackets (#8003) 2025-07-15 00:55:29 +00:00
Riley Bruins
6c2234f7ba
feat(c_sharp): highlight :: (#8002) 2025-07-14 17:48:23 -07:00
Christian Clason
c3ecec599b feat(parsers): update beancount, blade, cpp, desktop, gosum, javadoc, liquidsoap, mlir, nix, slint, systemverilog, t32, vim, xresources 2025-07-13 11:35:38 +02:00
Caleb White
c9e4edc127 feat(blade): update blade parser and queries 2025-07-11 17:34:30 +02:00
Christian Clason
4eb12d7a1f feat(ziggy,ziggy-schema): update parser and queries
Breaking change: ziggy-schema removed "map" node
2025-07-09 10:30:54 +02:00
Christian Clason
3dc6834b30 feat(parsers): update blueprint, desktop, fortran, javadoc, llvm, mlir, nu, requirements, superhtml, swift, v, xresources 2025-07-08 16:58:37 +02:00
Christian Clason
4400990e73 feat(vim): highlight "trim" in script heredocs
Allow the optional "trim", as documented in ":help :lua-heredoc".
2025-07-07 12:22:10 +02:00
Christian Clason
0d32ec3c3e feat(latex)!: update parser and queries
Breaking change: `label_definition`, `label_text` patterns
2025-07-05 17:46:07 +02:00
Christian Clason
80281c19fd feat(parsers): update c3, cpp, d, faust, fsharp, javadoc, julia, liquidsoap, meson, mlir, nu, powershell, roc, swift, systemverilog, t32, v 2025-07-05 17:46:07 +02:00
Igor
dafb3cb3cb fix(http): prefer folding requests 2025-07-04 08:56:45 +02:00
Riley Bruins
04935dec42 fix: remove import references to jsx/locals.scm
There are no JSX locals (yet...?)
2025-07-03 18:33:31 +02:00
Baruch Even
1f069f1bc6
feat(D): highlight (string) etc. as @keyword.type (#7978)
Co-authored-by: Baruch Even <baruch@weka.io>
2025-06-29 16:10:29 +00:00
przepompownia
dbb63c8b7a feat(php): fold match_expression 2025-06-29 15:59:54 +02:00
przepompownia
4b2e9b049c feat(php): fold array_creation_expression 2025-06-29 15:17:01 +02:00
Christian Clason
5948977de4 feat(parsers): update angular, clojure, gleam, idl, javadoc, jinja, jinja_inline, liquidsoap, nim, nu, poe_filter, r, ssh_config, systemverilog, v 2025-06-29 11:39:30 +02:00
Christian Clason
2e8f8562e6 fix(scripts): sort list of updated parsers 2025-06-29 11:39:30 +02:00
Eric Mrak
7110df63e1
feat(fish): more builtin commands and variables (#7972)
builtin commands:
* abbr
* path

builtin variables:
* fish_cursor_*
2025-06-26 09:04:48 +02:00
Christian Clason
77ba555cef ci: bump luals to 3.15.0 2025-06-25 12:01:18 +02:00
Christian Clason
98459ffcf7 fix(health): sort language names 2025-06-24 12:23:23 +02:00
Christian Clason
1181cd9a25 feat(verilog)!: rename to systemverilog
Grammar name was changed to coincide with repository name
2025-06-24 10:07:36 +02:00
Christian Clason
13ddd4d752 feat(swift)!: update parser and queries 2025-06-24 10:07:24 +02:00
Christian Clason
6c50310371 chore(wit): mark as unmaintained 2025-06-23 20:25:00 +02:00
Luis Calle
2317241896
fix: register powershell language for ps1 filetype (#7965)
* chore: sort languages

* fix: register `powershell` language for `ps1` filetype
2025-06-23 18:15:08 +00:00
Christian Clason
8867a9d6bf feat(powershell)!: update parser and queries
removed nodes: `"class"`, `"enum"`
2025-06-22 15:51:32 +02:00
Christian Clason
1bfa557b7d feat(parsers): update gleam, latex, typespec, purescript, heex, nu 2025-06-22 15:46:42 +02:00
guilhas07
2a677dede2 feat(vue): add template commentstring metadata 2025-06-18 18:34:40 +02:00
Christian Clason
7e6fbcaa20 feat(purescript)!: update parser and queries
removed note: `(constructor_operator)`
2025-06-17 15:55:21 +02:00
Christian Clason
9807487fe9 feat(parsers): update desktop, query, editorconfig, xresources, hcl, slint, markdown_inline, matlab, terraform, templ, nu, vhdl, tera, markdown, javadoc 2025-06-17 15:55:21 +02:00
Christian Clason
43b7f16c50 feat(parsers): update php_only, javadoc, erlang, faust, php, roc, slim, fortran, terraform, fish, mlir, sourcepawn, latex, matlab, hcl, vhdl 2025-06-15 10:52:24 +02:00
uncenter
a64ef334be
fix(css): universal selector "*" has precedence over operator (#7948) 2025-06-14 11:01:04 +02:00
Igor
c29969e8ef feat(dot): fold queries 2025-06-13 09:24:28 +02:00
Christian Clason
0fb1c6e92e feat(parsers): update bash, purescript, r, cylc, meson, mlir, xresources, markdown, markdown_inline, scala, javadoc, slint, desktop, enforce, editorconfig, query 2025-06-09 17:47:41 +02:00
Éric NICOLAS
9c03c835fb fix(bash): highlight shebang also when spaced
This commit aligns the shebang highlighting in bash syntax to what the
Linux kernel will recognise as a valid shebang construct.

In summary, the kernel will accept both headers:

    #!/usr/bin/env lua
    #! /usr/bin/env lua

The second one is quite prominently used throughout documentation
online, such as on Wikipedia's page for Shebang (Unix) [1].

Some sources are adamant it wouldn't be supported at a kernel level, but
it looks to me, upon closer inspection of the current kernel code [2],
that it is indeed quite evidently valid.  It'll simply skip over to the
first character that's neither a space 0x20 nor a tab 0x09.

[1] https://en.wikipedia.org/wiki/Shebang_(Unix)
[2] ec7714e494/fs/binfmt_script.c (L44-L71)
2025-06-09 10:43:31 +02:00
Jaehwang Jung
c48b37a3c9 feat(cpp): highlight template method call 2025-06-07 10:28:49 +02:00
Christian Clason
faf63903ff fix(ipkg)!: remove parser and queries
grammar repo is 404 (user removed) and no forks exist
2025-06-06 16:59:44 +02:00
Omar Valdez
27d0bef81e feat(desktop): update parser and queries 2025-06-06 09:07:06 +02:00
Christian Clason
f976acdc9c refactor(install): inline, rename, annotate 2025-06-04 11:35:41 +02:00
Christian Clason
057e845518 feat(install): support custom queries 2025-06-04 11:35:41 +02:00
Christian Clason
fb9b2cfdc3 feat(parsers): update bash, scala, slang, hyprlang, ini, query, javadoc, xml, php_only, angular, dtd, nu, php 2025-06-04 10:37:27 +02:00
Christian Clason
27b0bd487c feat(nickel)!: update parser and queries
Breaking change: `(record_field)` -> `field_decl`
2025-06-02 13:30:07 +02:00
Christian Clason
6d54a47f44 feat(parsers): update desktop, javadoc, t32, templ, fortran, editorconfig, mlir, xresources, ocaml_interface, r, ocaml 2025-06-02 13:30:07 +02:00
Christian Clason
3cad4eb434 fix(lua): fix some emmyluals warnings 2025-05-31 11:30:56 +02:00
Éric NICOLAS
9a51f860c1 fix(git_config): match lowercase Git config vars
Git config's sections, variable names, and (sometimes) subsections are
case-insensitive.  This commit proposes to match the full lowercase
variants in addition to the non-normalised, lowerCamelCase ones.

See `git help config`
2025-05-31 10:12:23 +02:00
Christian Clason
01dd4b05cf fix(check-queries): only show timings for existing queries 2025-05-30 16:23:44 +02:00
Christian Clason
fa0bb30ebd feat(parsers): update gdscript, gitattributes, godot_resource, xresources, yaml, ocaml, koto, ocaml_interface, c, ini, mlir, scheme, slint, c3, r, clojure, desktop, editorconfig, fortran 2025-05-30 10:25:47 +02:00
Christian Clason
ff770d718b fix(install): don't print operation summary by default
Problem: People complain about noisy `install()`.

Solution: Gate operation summary behind `summary` install option
(default false, set to true for interactive `:TS*` commands).
2025-05-29 20:08:10 +02:00
Christian Clason
ce903fde5d feat(api): expose list of available and installed languages 2025-05-29 12:11:56 +02:00
Christian Clason
0860b9b107 fix(config): check both installed parsers and queries
Problem: Can't uninstall custom parsers without queries since
`installed_parsers` only iterates over installed queries (to include
query-only languages, and to avoid string manipulation).

Solution: Iterate over both queries and parsers to collect list of
installed languages (optionally only queries or only parsers).
2025-05-29 11:52:58 +02:00
Christian Clason
03c9048090 fix(install): only install queries for bundled parsers 2025-05-29 11:52:58 +02:00
Christian Clason
f9ab837ca1 fix(install): don't skip un-tiered parsers 2025-05-29 11:52:58 +02:00
Christian Buttner
c59004f1e0
feat: add c3 (#7891) 2025-05-28 23:04:10 +02:00
Noah Bogart
71d2fd1bd4
fix(just): do not restrict @function.call to explicit list (#7905) 2025-05-28 22:44:34 +02:00
Christian Clason
024e6c5e46 fix(queries): fix rebase errors on main 2025-05-28 14:35:36 +02:00
Christian Clason
0140c29b31 fix(health): only require ts>=v0.25 2025-05-27 15:25:49 +02:00
Marc Jakobi
dd63d7141f fix(haskell): properly set inline-python injection language 2025-05-27 14:17:05 +02:00
Christian Clason
61b0a05ec0 fix(install): create cache dir if not existing 2025-05-26 17:21:18 +02:00
Christian Clason
1043871ef4 fix(swift): mark as unmaintained
Prevent from updating parser with breaking changes until queries are
adapted.
2025-05-26 14:57:57 +02:00
Christian Clason
c1dfc39285 fix(config): prepend install_dir to rtp 2025-05-25 13:11:28 +02:00
Christian Clason
0d60a09252 fix(typst): restore missing injections 2025-05-25 10:51:44 +02:00
Christian Clason
354c30d2a2 feat(parsers): update desktop, dtd, editorconfig, janet_simple, liquid, c, v, perl, mlir, templ, vhdl, xml, xresources, yaml, tlaplus, cmake 2025-05-24 19:27:04 +02:00
Omar Valdez
652831b231 feat(bash): highlight variable argument for printf -v 2025-05-24 11:39:59 +02:00
Christian Clason
c78594ce06 ci(test): throttle all install steps 2025-05-22 19:50:31 +02:00
Christian Clason
011f02936f fix(install): return task object in API functions 2025-05-22 08:34:45 +02:00
Yorick Peterse
d08cf75e1b feat(inko): add scoping to the locals queries
This way tooling that makes use of these queries (e.g. snacks.nvim) is
aware of the scoping of Inko types and methods.
2025-05-22 07:47:03 +02:00
Christian Clason
b19b5ce171 docs: final update after rewrite
Make clear this is not the default branch
2025-05-21 09:15:29 +02:00
Christian Clason
40cbddedf7 feat(parsers): update markdown_inline, markdown, vimdoc, fsharp, pascal, racket, lua, scheme, gleam, ocamllex, query 2025-05-18 10:22:42 +02:00
Riley Bruins
168fe16cdd fix: tidy up some query mistakes
Revealed by the capture-less patterns lint
2025-05-18 09:46:27 +02:00
Christian Clason
a663e69447 feat(parsers): update javadoc, jq, hcl, query, smithy, earthfile, tcl, llvm, godot_resource, git_config, terraform, teal, gdscript, mlir 2025-05-16 18:33:52 +02:00
Lewis Russell
69371f0148 feat(install)!: migrate to latest async.nvim impl (#7856)
Provides significantly simpler blocking installation and update.
2025-05-16 18:33:52 +02:00
Christian Clason
7a4a35de3e refactor(indent): use `node:byte_length() 2025-05-16 15:00:37 +02:00
Christian Clason
b0a20057b0 feat(config)!: remove ignore_install
This was only useful for no longer supported `auto_install` option.
2025-05-16 08:48:27 +02:00
Christian Clason
864e75a85d fix(c,cpp,fsharp,idl,powershell,sql,systemtap): remove unneeded escapes 2025-05-13 18:12:58 +02:00
Christian Clason
25f08b82af fix(hcl): remove unnecessary escapes 2025-05-13 18:12:58 +02:00
Christian Clason
6b55bc0fab ci(test): remove parser cache
Since installation now installs parsers _and_ queries, caching parsers
doesn't allow skipping the installation step (and caching queries does
not pay off).
2025-05-13 18:12:58 +02:00
Christian Clason
e8bfe271b0 docs: update to rewrite
This updates

* README
* CONTRIBUTING
* the `:h nvim-treesitter` documentation

to the current state of `main`. It also adds a pull request template for
adding a new language.
2025-05-12 18:43:41 +02:00
Christian Clason
a7ab4381ae feat(parsers): update t32, query, markdown, markdown_inline, meson, hyprlang, mlir, cpp, cylc 2025-05-12 18:43:41 +02:00
Christian Clason
f10bcac66b feat(parsers): update vim, gren, comment, purescript, elm, matlab, javadoc, swift, godot_resource, query, vimdoc, ledger 2025-05-12 18:43:41 +02:00
Christian Clason
dc8f3415a7 feat!: update tier 1 parsers to versions 2025-05-12 18:43:41 +02:00
Christian Clason
18bb653917 feat(locals)!: remove locals module
Problem: `locals.lua` was neither used nor tested, and providing it goes
against the goal of nvim-treesitter not being a required dependency for
other plugins.

Solution: Remove the module and document that the queries are provided
as-is for limited backward compatibility only.
2025-05-12 18:43:41 +02:00
Christian Clason
53dccb3a77 feat(tests)!: new infrastructure based on makefile
Problem: Not easy to run all checks and tests locally. Redundant CI
workflows.

Solution: Separate CI into two workflows:
 * lint: Lua files (stylua, luals), query files (valid captures,
   predicates, directives using tsqueryls), docs
   (SUPPORTED_LANGUAGES.md) -- does not need parser installation
 * tests: parsers (ABI compatibility), query files (tsqueryls on
   Linux/macOS; nvim on Windows), highlight and indent tests (separated
   for better readability) -- needs parser installation (but only once)

Switch to https://github.com/nvim-treesitter/highlight-assertions fork
with ABI 15 support.

Run all tests (on Linux and macOS) through `make` (`formatlua`,
`checklua`, `lintquery`, `formatquery`, `checkquery`, `docs`, `tests`),
which downloads and caches all necessary dependencies.

Remove `update-readme` workflow (replaced by lint job on PRs).
2025-05-12 18:43:41 +02:00
Riley Bruins
4e906caca3 refactor(locals): fix type annotations and warnings 2025-05-12 18:43:40 +02:00
Christian Clason
afaf01ebd3 tests(angular): don' reset filetype
`htmlangular` filetype support is now included in Nvim, so don't set
the filetype.
2025-05-12 18:43:40 +02:00
Christian Clason
75ee7ff2f0 tests(gleam): fix assert tests that no longer parse correctly 2025-05-12 18:43:40 +02:00
Christian Clason
a83f2d1417 feat(vim): update parser and queries
* add support for `:substitute` command
* add support for `=` lua chunks
2025-05-12 18:43:40 +02:00
Christian Clason
3d0e642764 feat(gdscript)!: update parser and queries
`(underscore)` node was removed
2025-05-12 18:43:40 +02:00
Christian Clason
f7c5f7de55 feat(parsers): update robot, earthfile, racket, javadoc, scheme, t32, tact, templ, kotlin, tcl, meson, mlir 2025-05-12 18:43:40 +02:00
Christian Clason
11736494df fix(indent): don't skip parsing for yaml 2025-05-12 18:43:40 +02:00
Christian Clason
44bb06bc12 chore: remove lockfile and update script
`main` branch and `parsers.lua` is the record of truth now
2025-05-12 18:43:40 +02:00
Christian Clason
53d7118483 refactor(lua): fix some luals warnings 2025-05-12 18:43:40 +02:00
Christian Clason
bdc2e01958 feat(install)!: always generate from json if possible 2025-05-12 18:43:40 +02:00
Christian Clason
522e0c6991 feat(setup)!: remove ensure_install field
Instead, call `require('nvim-treesitter').install( { ... } )` manually.

This gives users full control over how they want to install parsers
(sync, from grammar, limited concurrency) and obviates the need for
calling `setup` for most users.
2025-05-12 18:43:40 +02:00
Christian Clason
73adbe597e feat(parsers): update swift, tact, tcl, templ, mlir, kotlin, koto, elixir, php_only, ocaml, ocaml_interface, php, astro, slang, slim, blade, gleam, v, ledger 2025-05-12 18:43:40 +02:00
Christian Clason
037ac775e1 feat: add .tsqueryrc.json 2025-05-12 18:43:40 +02:00
Christian Clason
ed1f573aae feat(parsers): update ziggy, ziggy_schema, bibtex, latex 2025-05-12 18:43:40 +02:00
Christian Clason
308c9b26c7 feat(tcl)!: update parser and queries 2025-05-12 18:43:40 +02:00
Christian Clason
990110336c feat(julia)!: update parser and queries 2025-05-12 18:43:40 +02:00
Christian Clason
c13511c884 feat(parsers): update nickel, sql, devicetree, dhall, htmldjango, t32, gap, javadoc, templ, jinja, tera, verilog, meson, mlir, typespec, wit, phpdoc, superhtml, git_config, swift, terraform, vim, koto, rasi, rescript, bp, enforce, erlang, jinja_inline, cmake, fennel, comment, slint, elm, rust, hcl 2025-05-12 18:43:40 +02:00
Christian Clason
cbfe8a20c7 feat(html): use gsub for mimetype lookup 2025-05-12 18:43:40 +02:00
Christian Clason
328ee3db54 fix(install): skip tier 4 parsers when installing and updating 2025-05-12 18:43:40 +02:00
Christian Clason
9365cf8a97 fix(install): don't prompt on installed parsers (skip)
Use `:TSInstall!` or `force = true` to reinstall.
2025-05-12 18:43:40 +02:00
Christian Clason
12e0246e4f fix(formatter): increase match limit
Problem: Some very long patterns were not formatted correctly.

Solution: Increase the match limit when iterating to 1024.
2025-05-12 18:43:40 +02:00
przepompownia
6fe0032640 feat(install): allow pass callback to update()
Problem: cannot run `:TSUpdate synchronously`

Solution: pass callback used after exiting jobs
(like in `install-parsers`).
2025-05-12 18:43:40 +02:00
Sebastian Lyng Johansen
02a1a0537c fix(install): early return if parser_info does not exist 2025-05-12 18:43:40 +02:00
Christian Clason
a9f34d5a76 feat(parsers): rework tiers
* stable: updates follow semver releases (todo)
* unstable: updates follow HEAD (default)
* unmaintained: no automatic updates
* unsupported: no updates, cannot be installed
2025-05-12 18:43:40 +02:00
Christian Clason
188bbf7a09 fix(ci): update to changed neovim release name 2025-05-12 18:43:40 +02:00
Christian Clason
aaf5b7fdf7 fix(install): return error code in callback 2025-05-12 18:43:40 +02:00
Christian Clason
a2841d29d7 feat(install)!: bump minimum tree-sitter version to 0.24 2025-05-12 18:43:40 +02:00
Christian Clason
c5a8c9d01a ci(tests): add optional workflow for generating grammars
run on PR by adding label `ci:generate` or manually
2025-05-12 18:43:40 +02:00
Christian Clason
83dae49a10 feat(install): allow specifying max jobs 2025-05-12 18:43:40 +02:00
Christian Clason
ab230eadd4 feat(config)!: remove auto_install
use https://github.com/lewis6991/ts-install.nvim instead
2025-05-12 18:43:40 +02:00
Christian Clason
a8677385b7 feat(install)!: drop support for git
Problem: Using git for installing parsers can lead to data loss if in a
git commit buffer.

Solution: Only support downloading via curl+tar, which are installed on
all supported platforms (since Windows 10). Curl will also be required
for WASM parsers (and for `vim.net.download()`).
2025-05-12 18:43:40 +02:00
Christian Clason
214cfcf851 feat!: use tree-sitter build 2025-05-12 18:43:40 +02:00
Christian Clason
c17de56890 feat!: track parser revision in Lua
Problem: Tracking parser revision in lockfile and allowing override
through the parsers module complicates the code. In addition, only
revision changes are handled robustly, not changes to other installation
info.

Solution: Track parser revision in the parsers module directly. Reload
parser table on every install or update call. Support modifying parser
table in a `User TSUpdate` autocommand.
2025-05-12 18:43:40 +02:00
Christian Clason
054080bf59 fix: vim.tbl_flatten is deprecated 2025-05-12 18:43:40 +02:00
Christian Clason
5a38df5627 feat(install)!: generate from json instead of requiring node
Problem: Many parsers require node/npm to evaluate the `grammar.js`
before being able to generate a parser from it.

Solution: Generate from `grammar.json` instead, which is fully resolved.
Drops `node` and `npm` as (optional) requirements for nvim-treesitter.

Note that this requires parsers to commit the generated json iff the
grammar requires evaluation (which is currently the case for all tracked
languages).
2025-05-12 18:43:40 +02:00
nvim-treesitter-bot[bot]
8f8cf7144d bot(readme): update 2025-05-12 18:43:40 +02:00
Christian Clason
c70daa36dc feat(install)!: add explicit path field to parser info (#6476)
Problem: Using `url` for both remote repo and local path complicates the
code.

Solution: Add `path` field that overrides `url` and bypasses
git-specific manipulations, i.e., the contents of the `path` are used
as-is (no git repo needed).

This means `:TSUpdate` will skip such parsers; use `:TSInstall!` instead
after making local changes.

---------

Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2025-05-12 18:43:40 +02:00
Lewis Russell
0bb981c876 fix: do not use vim.iter (#6469) 2025-05-12 18:43:40 +02:00
Lewis Russell
421e2fb7b2 feat: improve logging of failed installs 2025-05-12 18:43:40 +02:00
Christian Clason
a8f5641ab3 feat(install)!: remove support for C++ scanners 2025-05-12 18:43:40 +02:00
Phạm Huy Hoàng
429e6f446b doc: better clarification of highlights/injections 2025-05-12 18:43:40 +02:00
Phạm Huy Hoàng
039fe9095d fix(format): update scripts to support nightly (#6126)
No need for assert as the use is contained within the script only
2025-05-12 18:43:40 +02:00
Gregory Anders
be5f9b0eaa fix: update add_predicate and add_directive calls for upstream (#6106)
Update custom predicates and directives to handle multiple nodes per
capture ID per changes upstream.
2025-05-12 18:43:40 +02:00
Christian Clason
885c2960ef fix: better output for update-lockfile 2025-05-12 18:43:40 +02:00
Christian Clason
e77506bde3 feat: improve check-queries 2025-05-12 18:43:40 +02:00
Christian Clason
178c6a84c1 docs: update CONTRIBUTING.md 2025-05-12 18:43:40 +02:00
Lewis Russell
5f2c6c0c83 refactor: pull out predicate function 2025-05-12 18:43:40 +02:00
Lewis Russell
59f5d64a61 fix: update vim.system types 2025-05-12 18:43:40 +02:00
Lewis Russell
efbc2a4b72 fix: remove downcase! directive use 2025-05-12 18:43:40 +02:00
Lewis Russell
1bec16362f feat: allow a custom revision in install_info 2025-05-12 18:43:40 +02:00
Pham Huy Hoang
3966b8808b fix!: indents now rely on treesitter highlight
- Apply suggestions from Lewis to only parse visible lines
- Fix failed tests
2025-05-12 18:43:40 +02:00
Christian Clason
abcbe65b6e docs(readme): document 'location' key 2025-05-12 18:43:40 +02:00
Pham Huy Hoang
673fdccd21 tests: remove set ft 2025-05-12 18:43:40 +02:00
Lewis Russell
b5a3f5c286 fix: cleanup diagnostics 2025-05-12 18:43:40 +02:00
Lewis Russell
26302f412f fix: add stricter cc options (#5063) 2025-05-12 18:43:40 +02:00
Christian Clason
f13420ccff fix: remove upstreamed directives
`#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype`
2025-05-12 18:43:40 +02:00
TheLeoP
dd6ec13268 fix: always normalize paths
Not doing this results in paths with a mix of '\\' and '/' for Windows.
This isn't a problem when dealing with Neovim/luv APIs, but it is a
problem when comparing strings.
2025-05-12 18:43:40 +02:00
TheLeoP
b4c9c81a80 fix: check if config has install_info in filter 2025-05-12 18:43:40 +02:00
Lewis Russell
934b751f9d fix: check queries in needs_update() 2025-05-12 18:43:40 +02:00
Lewis Russell
041f117fb1 fix: filter languages through parser.configs 2025-05-12 18:43:40 +02:00
Christian Clason
bae77b87b1 feat: add parser tiers
Tier 1: Stable
Tier 2: Core (maintained by org members)
Tier 3: Community (maintained by external contributors, to varying
degree)
Tier 4: Unsupported (lacking active maintainer or declared
experimental); skipped in lockfile update and ignored for automatic
install by default
2025-05-12 18:43:40 +02:00
Christian Clason
f0a984347c feat!: drop makefile support, norg parser
Norg install_info and queries are maintained by neorg.

All other parsers are compatible with C++11, so fix that as standard.
(Can be bumped if all supported platforms support C++14.)

Remove Makefile support, as it's no longer needed.
2025-05-12 18:43:40 +02:00
Lewis Russell
c5152f3e83 refactor: use vim.system (#4923) 2025-05-12 18:43:40 +02:00
Christian Clason
68508631de fix: expand tiers in ignore_install 2025-05-12 18:43:40 +02:00
Christian Clason
5a70048116 feat: drop TSInstallInfo in favor of better checkhealth
also fixes the hole in install.compilers
2025-05-12 18:43:40 +02:00
Christian Clason
37957d6bcf refactor: use vim.uv 2025-05-12 18:43:40 +02:00
Christian Clason
cd2c826972 fix: install dependencies 2025-05-12 18:43:40 +02:00
Christian Clason
9c0a99819c ci: remove update-lockfile shell script 2025-05-12 18:43:40 +02:00
Lewis Russell
cde679e435 refactor: rewrite installation using jobs and async
Replace sync variants with callback support
2025-05-12 18:43:40 +02:00
Christian Clason
5aa2984a02 refactor: use vim.fs.joinpath 2025-05-12 18:43:40 +02:00
Christian Clason
eb1b6ec542 feat!: drop luarocks release 2025-05-12 18:43:40 +02:00
Christian Clason
5817ff01b5 feat(locals)!: refactor locals.lua into standalone
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
2025-05-12 18:43:40 +02:00
Christian Clason
692b051b09 feat!: drop modules, general refactor and cleanup 2025-05-12 18:43:40 +02:00
ObserverOfTime
310f0925ec feat(c-family): inherit injections 2025-05-12 18:43:40 +02:00
Marc Jakobi
628d5e442c injections(nix): add nixosTest.testScript + home-manager nvim config
(+ add Check to mkDerivation bash matches)

(+ add Check to mkDerivation bash matches)
2025-05-12 18:43:40 +02:00
ObserverOfTime
b171f948da feat(yuck): add missing injections
And builtin variable highlights
2025-05-12 18:43:40 +02:00
Leo
066fd65053
feat(solidity): add doxygen injections (#7853) 2025-05-12 18:43:30 +02:00
Leo
0484f881c6
feat(solidity): add abstract keyword 2025-05-12 18:43:10 +02:00
Caleb White
28d480e062
fix: blade injection highlighting (#7846)
Injecting php was broken upstream so this is a temporary fix until
upstream fixes it.

See https://github.com/nvim-treesitter/nvim-treesitter/issues/7842
2025-05-05 20:05:53 -07:00
Marc Jakobi
94ea4f436d feat(haskell): injections for inline-python quasiquotes 2025-04-30 11:45:52 +02:00
Christian Clason
3b308861a8 fix(injections): dtd, glimmer.*, razor, tablegen, teal 2025-04-27 11:04:54 +02:00
Christian Clason
4c7509e7b0 fix(roc): use correct predicate in injections 2025-04-26 22:12:46 +02:00
blindfs
58dd149629 fix(nu): add missing ctrl_match to query files 2025-04-26 10:41:10 +02:00
Peter Cardenas
684eeac91e feat(fish): highlight $ punctuation.special 2025-04-15 14:24:15 +02:00
Peter Cardenas
54fc8e311c feat(fish): add variable.builtin highlights 2025-04-15 14:24:15 +02:00
AJ Delcimmuto
7bbed4b548
feat(brightscript): brightscript parser and queries (#7780) 2025-04-13 13:20:09 -07:00
Mikkel Mondrup Kristensen
0e21ee8df6
More bash injection support for Taskfile (#7805) 2025-04-07 21:08:22 +02:00
Anthony Fiddes
205faba176
feat(yaml): inject bash for taskfiles (#7804) 2025-04-06 19:09:27 +02:00
Christian Clason
e5c8398e44 ci(bot): bump create-github-app-token to v2 2025-04-06 11:23:58 +02:00
Maksim Terpilovskii
523a9e1489
fix(svelte): else if highlight (#7797) 2025-04-04 14:08:02 +02:00
Jakob Zahn
997288c552
fix(python): highlight all types of docstrings (#7788) 2025-04-03 09:35:41 +02:00
Christian Clason
30654ee72a ci(tests): run tests on v0.10.4 2025-04-02 11:40:11 +02:00
Christian Clason
36a7d010bb ci(update): only check once a week (sat)
I need a break...
2025-04-02 11:19:22 +02:00
Christian Clason
79a6192d47 ci(update): block dhall,elm,enforce,rust (ABI 15) 2025-04-02 11:19:22 +02:00
Christian Clason
69cb3aafb6 fix(rust,dhall,elm,enforce): revert to ABI 14 parser 2025-04-02 11:19:22 +02:00
Christian Clason
cfbbea187b ci(tests): check queries on 0.10.4 2025-04-02 11:19:22 +02:00
nvim-treesitter-bot[bot]
288b4fb4d7 bot(lockfile): update erlang, glimmer_javascript, glimmer_typescript, php, php_only, qmljs, rust 2025-04-02 06:55:05 +00:00
nvim-treesitter-bot[bot]
4b390e1e46 bot(lockfile): update fortran, scala, tcl 2025-04-01 10:29:07 +02:00
nvim-treesitter-bot[bot]
9be6836ebe bot(lockfile): update editorconfig, elm, tcl 2025-03-31 10:47:25 +02:00
savanto
9df671fda4 dhall: recognize several missing builtins
- recognize builtin type `Bool`
- recognize import `... as Bytes`
- recognize builtin functions `Date/show`, `Time/show`, `TimeZone/show`
- recognize a bytes literal (ie. `0x"deadbeef"`)
2025-03-30 17:23:08 +02:00
nvim-treesitter-bot[bot]
86768fdd00 bot(lockfile): update dhall, enforce, http, javadoc, nu, superhtml, tcl, tera 2025-03-30 10:31:16 +02:00
Dennis van den Berg
aece106233 feat(angular): update highlights for template literals 2025-03-29 10:52:22 +01:00
nvim-treesitter-bot[bot]
a70d883976 bot(lockfile): update scala 2025-03-29 09:17:03 +01:00
nvim-treesitter-bot[bot]
a3315b8c7f bot(lockfile): update angular, koto, superhtml 2025-03-28 09:09:12 +01:00
nvim-treesitter-bot[bot]
da5825bf70 bot(lockfile): update angular, hcl, koto, meson, perl, superhtml, tact, terraform, vhs 2025-03-27 09:16:15 +01:00
nvim-treesitter-bot[bot]
85168f1580 bot(lockfile): update angular, koto, scala 2025-03-26 06:56:12 +00:00
nvim-treesitter-bot[bot]
e329e94a6a bot(lockfile): update javadoc, problog, prolog 2025-03-24 06:56:42 +00:00
nvim-treesitter-bot[bot]
d26ce01266 bot(lockfile): update hlsl, javadoc 2025-03-23 16:16:59 +00:00
Vladimir Levin
9399bfd816
feat(caddy): add parser and queries (#7588)
---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2025-03-23 16:04:41 +00:00
nvim-treesitter-bot[bot]
b454febfd9 bot(readme): update 2025-03-23 15:53:44 +00:00
Robert Muir
652da0b40f
feat(javadoc): add parser and queries (#7749)
Previously java was configured to use doxygen parser for documentation
comments, but javadocs are not doxygen. Inline tags have a different
syntax, block tags are not recognized, and doxygen creates a lot of
errors during highlighting.

Add parser for javadoc comments, with queries for highlights and
injections.
2025-03-23 16:44:12 +01:00
nvim-treesitter-bot[bot]
20a7e40203 bot(lockfile): update swift 2025-03-23 06:51:29 +00:00
nvim-treesitter-bot[bot]
e70cb73e94 bot(lockfile): update mlir 2025-03-22 06:52:45 +00:00
nvim-treesitter-bot[bot]
5f38dffb6a bot(lockfile): update lua, markdown, markdown_inline, vim 2025-03-21 16:31:09 +00:00
nvim-treesitter-bot[bot]
b10436b9fb bot(lockfile): update gleam, glimmer_javascript, glimmer_typescript, lalrpop, problog, prolog, roc 2025-03-21 08:16:13 +00:00
dcho
bc728ecf25 Use order instead of priority 2025-03-21 08:58:45 +01:00
dcho
d0a56e3677 fix(python): prioritize builtin functions 2025-03-21 08:58:45 +01:00
Christian Clason
c8c7924cc3 ci(update): block wit (ABI 15) 2025-03-21 08:29:36 +01:00
nvim-treesitter-bot[bot]
ff553df2f4 bot(lockfile): update meson, scala, superhtml 2025-03-20 06:55:08 +00:00
Veesh Goldman
f09a2215b8
* feat(perl): highlight hash keys as @variable.member in various contexts
also, injections for s///e should fully re-parse
2025-03-19 09:48:48 +01:00
nvim-treesitter-bot[bot]
98a3fdd5d9 bot(lockfile): update query, vimdoc 2025-03-19 06:55:59 +00:00
Riley Bruins
835f5c11b8 fix(c): highlight "." as @punctuation.delimiter
Aligns C with the other language highlights
2025-03-18 18:10:41 +01:00
nvim-treesitter-bot[bot]
f8aaf5ce4e bot(lockfile): update fortran, glimmer_javascript, glimmer_typescript, powershell 2025-03-18 06:57:37 +00:00
nvim-treesitter-bot[bot]
d76a8b6e1b bot(lockfile): update commonlisp, cuda, glsl, superhtml, ziggy, ziggy_schema 2025-03-17 06:55:26 +00:00
John-Philip Taylor
da88ea477c
fix(vhdl): capture "|" as @operator (#7744) 2025-03-16 14:38:03 +01:00
nvim-treesitter-bot[bot]
845356a256 bot(lockfile): update dtd, xml, ziggy, ziggy_schema 2025-03-16 06:52:19 +00:00
Riley Bruins
99ea6c5d43 feat(typst): highlight language name as @label 2025-03-15 13:57:13 +01:00
nvim-treesitter-bot[bot]
2586ea65fa bot(lockfile): update swift 2025-03-15 06:53:24 +00:00
nvim-treesitter-bot[bot]
8b79cddc70 bot(lockfile): update gitcommit, tiger, typoscript 2025-03-14 06:54:41 +00:00
Salomon Popp
683816f147
fix(python): don't highlight parameter name as builtin (#7732) 2025-03-13 09:21:55 +01:00
nvim-treesitter-bot[bot]
178a68b7ff bot(lockfile): update cmake, liquid, meson, tera, v, vhdl 2025-03-13 08:12:34 +00:00
Christian Clason
d96c52565c ci(update): block bp (ABI 15) 2025-03-13 08:59:53 +01:00
Caleb White
548ed98f8a
feat(blade): add laravel blade parser and queries (#7693) 2025-03-12 18:47:19 +01:00
Novus Nota
6d1a8e6fdb
feat(tact): update parser and queries (#7731) 2025-03-12 18:26:07 +01:00
Salomon Popp
1a314a58d6
fix(python): highlight function calls correctly (#7728) 2025-03-12 09:22:33 +01:00
nvim-treesitter-bot[bot]
db8689da4a bot(lockfile): update cmake, erlang, ini, jinja, jinja_inline, nu, swift, ziggy, ziggy_schema 2025-03-12 06:56:07 +00:00
Salomon Popp
cf0eabc16c
fix(python): don't highlight attribute name as builtin (#7712)
* fix(python): don't highlight attribute name as builtin

* fix(python): highlight `@variable.member` correctly for member access context

* test: add test

* test: expand test

* docs: update comment

* refactor: change order, remove priority override

* style: remove extra newline
2025-03-11 08:48:33 +01:00
Omar Valdez
833405d5a9
feat(bibtex): highlight URLs and DOIs (#7725) 2025-03-11 08:48:09 +01:00
nvim-treesitter-bot[bot]
108302da0e bot(lockfile): update erlang, jinja, jinja_inline, nix, nu, roc, superhtml, tera, ziggy, ziggy_schema 2025-03-11 06:55:03 +00:00
Omar Valdez
38959800c2
fix(bibtex): use more appropriate captures (#7721) 2025-03-10 09:40:32 +01:00
nvim-treesitter-bot[bot]
feab1f19f8 bot(lockfile): update asm, jinja, jinja_inline, vhdl 2025-03-10 06:47:46 +00:00
Christian Clason
afe977dadd feat(roc)!: bump parser and queries
Adapt to https://github.com/faldor20/tree-sitter-roc/pull/30

Also synchronize queries with upstream and add indents
2025-03-09 19:26:47 +01:00
nvim-treesitter-bot[bot]
f06adcf572 bot(readme): update 2025-03-09 17:56:04 +00:00
uncenter
f840ab9f72
feat(tera): add parser and queries 2025-03-09 18:44:59 +01:00
nvim-treesitter-bot[bot]
59573f9616 bot(lockfile): update ocaml, ocaml_interface, ocamllex 2025-03-09 10:06:14 +00:00
may
ffd284c470 fix(rust): inject regex into RegexBuilder instead of ByteRegexBuilder 2025-03-08 20:13:17 +01:00
ginnyTheCat
f0c17dc859
fix(rust): inject html and json in macro invocations (#7715) 2025-03-08 17:49:06 +00:00
nvim-treesitter-bot[bot]
ee8e149a4f bot(lockfile): update ocaml, ocaml_interface 2025-03-08 06:49:54 +00:00
nvim-treesitter-bot[bot]
71ac531a63 bot(lockfile): update gleam, rust 2025-03-07 06:56:26 +00:00
Louis Pilfold
f22181a62c
feat(gleam): "echo" keyword (#7710) 2025-03-06 10:27:20 -08:00
patricorgi
16e8e19771
feat(snakemake): add rules to locals (#7698) 2025-03-06 18:47:57 +01:00
nvim-treesitter-bot[bot]
794cf2f630 bot(lockfile): update angular, meson, mlir, rust, scala, unison 2025-03-06 06:54:36 +00:00
nvim-treesitter-bot[bot]
55c5c762fe bot(lockfile): update dtd, mlir, slim, xml 2025-03-05 06:53:31 +00:00
Riley Bruins
2b0760dca2 feat(jsx): commentstring query 2025-03-04 09:49:57 +01:00
nvim-treesitter-bot[bot]
a5a2845a86 bot(lockfile): update cmake, elixir, ocaml, ocaml_interface, powershell, requirements, superhtml, ziggy, ziggy_schema 2025-03-04 08:36:41 +00:00
Christian Clason
c641ca8e05 ci(update): block rescript (ABI 15) 2025-03-04 09:25:23 +01:00
Riley Bruins
1adcd57119 feat(markdown): fold sublists 2025-03-03 09:44:46 +01:00
nvim-treesitter-bot[bot]
bf6028e00c bot(lockfile): update cmake, elixir, fortran, fsharp, rust, vhdl 2025-03-03 06:58:07 +00:00
nvim-treesitter-bot[bot]
186f35e168 bot(lockfile): update cmake, jinja, jinja_inline, nu 2025-03-02 10:30:19 +00:00
Christian Clason
8bf733ccce ci(update): block templ (ABI 15) 2025-03-02 11:16:59 +01:00
nvim-treesitter-bot[bot]
c1efc9a905 bot(lockfile): update dart, djot, meson, mlir 2025-03-01 11:05:56 +00:00
Christian Clason
f56d2f6765 ci(update): block typespec (ABI 15) 2025-03-01 11:55:29 +01:00
Christian Clason
f37b1668a6 ci(update): block verilog (ABI 15) 2025-03-01 11:15:34 +01:00
nvim-treesitter-bot[bot]
99487eb34a bot(lockfile): update php, php_only, rust, v 2025-02-28 08:37:39 +00:00
nvim-treesitter-bot[bot]
8bc635a25f bot(readme): update 2025-02-27 09:16:43 +00:00
Bert Baron
376a46ccec
feat(kdl): parser and queries (#7657) 2025-02-27 09:54:26 +01:00
Paul Hansen
28f76678ca
fix(kdl): highlight query order (#7688)
This just fixes the highlighting queries so everything
isn't highlighted as a variable due to the order of the queries
meaning several queries were ignored.

I also changed the node names to be highlighted as `@tag` since KDL is an
xml-like format so `@tag` seemed more appropriate than type and it differentiates it
from the type annotations.

This does NOT update to the latest KDL version 2, that would need
grammar changes. It does "mostly" work with
KDL 2 though (notably unquoted strings seem to throw the grammar off.).
2025-02-27 09:53:58 +01:00
Omar Valdez
00e797ea25 feat(typescript): highlight abstract methods 2025-02-27 09:53:22 +01:00
Andreas Hartmann
a83032cee1 feat(make): fold define statements. 2025-02-27 09:53:09 +01:00
nvim-treesitter-bot[bot]
89eed3572d bot(lockfile): update fortran, nix, tlaplus 2025-02-27 06:54:26 +00:00
Raafat Turki
8f87d28442
feat(sql): add folds (#7686) 2025-02-26 17:36:48 +01:00
Caleb White
081a99b3be feat(php): add support for new relative_name node 2025-02-26 17:01:57 +01:00
Christian Clason
93ce9feb4f feat(markdown): completely conceal codeblock fences on nightly
Required to make https://github.com/neovim/neovim/pull/31324 work with
nvim-treesitter.
2025-02-25 14:07:31 +01:00
Alex Manning
f0ff9f0e5d fix(gleam): indent on unqualified import rather than import 2025-02-25 11:20:39 +01:00
Andreas Hartmann
3b013b9ed4 feat(typst): add more folds
for the following language constructs:

- 'for' blocks
- 'if/else' expressions
- raw markup blocks (```)
- `content`
2025-02-25 11:18:08 +01:00
Omar Valdez
9fcb3f7aa2 feat(just): improve attribute highlights
- Default attribute highlight
- Highlight more builtin attributes
- Highlight special attribute arguments
2025-02-25 10:47:31 +01:00
nvim-treesitter-bot[bot]
36c78ee572 bot(lockfile): update styled 2025-02-25 08:57:11 +00:00
Christian Clason
225419160b ci(update): block git_config (ABI 15) 2025-02-25 09:46:10 +01:00
nvim-treesitter-bot[bot]
e6d02ec9ef bot(lockfile): update nu, rst, swift 2025-02-24 06:54:05 +00:00
nvim-treesitter-bot[bot]
f2bd62c656 bot(lockfile): update nu, vhdl 2025-02-23 11:14:03 +00:00
Christian Clason
c08aa2fe3f ci(update): block devicetree (ABI 15) 2025-02-23 12:01:29 +01:00
nvim-treesitter-bot[bot]
5774e7d3da bot(lockfile): update enforce, liquid, mlir, nix, nu 2025-02-22 06:54:10 +00:00
Yorick Peterse
d0ba96c3dc feat(inko): add support for "for" loops
These will be introduced as part of the 0.19.0 release. This commit
updates the lockfile as well as the relevant queries to accommodate the
new expression and "in" now being a keyword.
2025-02-21 21:37:27 +01:00
Hank Jackson
4cf2da5c3a
feat(liquid): capture (front_matter) and inject yaml (#7672) 2025-02-21 09:29:03 +01:00
nvim-treesitter-bot[bot]
0cfe75d2a2 bot(lockfile): update liquid, swift 2025-02-21 06:53:25 +00:00
Philip Zander
bf18d4dc8d feat(pascal): Add asm language injection for Pascal 2025-02-20 18:19:40 +01:00
Daniil Leontev
d2ff400641
feat(promql): do not use regex for string labels (#7669)
In Prometheus, label values are treated as strings when used with the
`=` and `!=` operators, and as regular expressions when used with the
`=~` and `!~` operators.

Injecting and then highlighting all label values as regex leads to a
situation where entirely valid **string** label values containing regex
special characters are mistakenly parsed and highlighted as regex. This
results in syntax errors, causing labels to be highlighted incorrectly.

For example, in `foo{bar=~"[a-z]{1,3}"}`, `{` and `}` are regex special
characters, so regex highlighting is expected. However, in
`foo{path="/foo/{id}"}`, `{` and `}` are just part of the string and
have no special meaning, so the whole value should be highlighted as a
string.
2025-02-20 12:17:32 +01:00
nvim-treesitter-bot[bot]
a15dd9280f bot(lockfile): update pascal, v 2025-02-20 09:37:01 +00:00
Robert Muir
cb8e810a1e feat(java): add injections for markdown documentation comments
Since Java 23, java documentation supports markdown.
It is supported by a '///' line comment followed by mandatory
white space: https://openjdk.org/jeps/467
2025-02-20 00:22:01 +01:00
Chris Grieser
36bbf51842
feat(yaml): capture "boolean strings" (#7512)
See for example: https://www.bram.us/2022/01/11/yaml-the-norway-problem/
values based on: https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy

Parser targets YAML 1.2, which has stricter promotions.
2025-02-19 18:37:18 +01:00
Michael Parque
c32b59a8fd
fix(css): do not fold top-level blocks (#7562)
Using (block) makes the fold behavior only work on the line that the
block starts not the start line of the statement, which is unideal when
the preceding statement spans multiple lines. instead, use all top-level
statements explicitly from https://github.com/tree-sitter/tree-sitter-css/blob/master/grammar.js
2025-02-19 18:12:46 +01:00
Yuki Ito
e5588abcfa
feat(gomod): support tool directive (#7649) 2025-02-19 17:28:07 +01:00
Christian Clason
b9a3588ee8 fix(earthfile): adapt to new default branch (with external scanner) 2025-02-19 15:02:54 +01:00
nvim-treesitter-bot[bot]
2c4c8c10ed bot(lockfile): update mlir, swift 2025-02-19 09:57:11 +00:00
Christian Clason
1a6e42bb8c ci(update): block nickel (ABI 15) 2025-02-18 09:16:17 +00:00
nvim-treesitter-bot[bot]
8c41b8b366 bot(lockfile): update fsharp, razor 2025-02-18 09:16:17 +00:00
Yorick Peterse
95648f9154
feat(inko)!: remove the "class" keyword (#7663)
This keyword is deprecated as of 0.18.1 (released on February 12, 2025)
and is being removed as part of the upcoming 0.19.0 release.

BREAKING CHANGE: replace with `type`.
2025-02-17 23:54:32 +01:00
zc he
2cade9e3d1
feat(nu): new attribute syntax and add folds.scm (#7650) 2025-02-16 16:47:42 +01:00
Christian Clason
b08ae25c47 feat(parsers)!: drop org
The parser has neither queries nor a listed maintainer here and hasn't
seen updates in two years.
2025-02-16 13:53:28 +01:00
nvim-treesitter-bot[bot]
38e46a6d7a bot(lockfile): update v 2025-02-16 06:49:56 +00:00
nvim-treesitter-bot[bot]
00a513f87e bot(lockfile): update c_sharp, enforce, erlang, mlir, nu 2025-02-15 09:39:43 +00:00
nvim-treesitter-bot[bot]
80e6de9d24 bot(lockfile): update julia, vhs 2025-02-14 06:52:41 +00:00
nvim-treesitter-bot[bot]
6d957c22cb bot(lockfile): update apex, sflog, soql, sosl, superhtml 2025-02-13 06:54:33 +00:00
nvim-treesitter-bot[bot]
e411cf2c8a bot(lockfile): update apex, perl, sflog, soql, sosl 2025-02-12 08:30:25 +00:00
nvim-treesitter-bot[bot]
6108ba7a13 bot(lockfile): update typst, v 2025-02-11 08:30:11 +00:00
ginnyTheCat
a840137349 feat(sparql): add regex injection 2025-02-10 09:32:30 +01:00
Omar Valdez
6402fcb1e0 feat(typescript): highlight awaited functions with type parameters 2025-02-10 09:32:11 +01:00
nvim-treesitter-bot[bot]
b39070f94d bot(lockfile): update c_sharp, http, idl, perl 2025-02-10 06:53:35 +00:00
Christian Clason
da89532f03 ci(update): block t32 (ABI 15) 2025-02-09 12:15:07 +01:00
nvim-treesitter-bot[bot]
119a6f9e25 bot(lockfile): update c, mlir, printf 2025-02-09 06:51:13 +00:00
Amaan Qureshi
3973f53d7a fix(razor): mark npm as required for generating from source 2025-02-08 19:40:12 +01:00
nvim-treesitter-bot[bot]
48f7ce34ef bot(lockfile): update erlang, gleam, jinja, jinja_inline, ziggy, ziggy_schema 2025-02-08 10:01:37 +00:00
nvim-treesitter-bot[bot]
1f36863a4e bot(readme): update 2025-02-08 09:51:26 +00:00
loongtao.zhang
cbd48fac13
feat(jinja): add parser and queries (#7573)
Signed-off-by: loongtao.zhang <loongtao.zhang@outlook.com>
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2025-02-08 10:38:50 +01:00
simonvic
e8ccc339a3
feat(enforce): add parser and queries (#7626) 2025-02-08 10:38:13 +01:00
Omar Valdez
6bc2c0fde8 feat(hyprlang): bash injection for bindings with descriptions 2025-02-08 10:11:56 +01:00
nvim-treesitter-bot[bot]
62911c78a8 bot(lockfile): update asm, cpp, elixir, templ 2025-02-07 06:55:02 +00:00
nvim-treesitter-bot[bot]
824bf8455f bot(lockfile): update erlang, vhs
lock sql parser (ABI 15)
2025-02-06 07:43:26 +00:00
zc he
9e0b5e7f0d
feat(nu)!: added some new operators, removed deprecated keyword register (#7620) 2025-02-05 13:58:55 +01:00
nvim-treesitter-bot[bot]
cced713b49 bot(lockfile): update erlang, fsharp 2025-02-05 06:54:40 +00:00
Kieran Siek
55ae574195 Fix panic!, assert*!, and dbg! macro queries. 2025-02-04 23:49:34 +01:00
Riley Bruins
53a6b3993f feat(formatter): support formatting missing nodes
This commit makes missing nodes take formatting identical to that of
regular named nodes, with the only exception being that a newline will
not be prepended to a node name. E.g. this pattern:

```query
(MISSING identifier)
```

will *not* be changed to:

```query
(MISSING
  (identifier))
```
2025-02-04 09:56:51 +01:00
Riley Bruins
7194ff9511 fix(formatter): prefer #-prefixed predicates
This prevents the formatter for appending a space after the "." in a
predicate prefix, and changes it to a "#" to match all other occurrences
in the codebase.
2025-02-04 09:56:39 +01:00
nvim-treesitter-bot[bot]
285ec45123 bot(lockfile): update cue, erlang, janet_simple 2025-02-04 06:53:36 +00:00
nvim-treesitter-bot[bot]
4e701776f8 bot(lockfile): update c, query, rst, swift, vhdl 2025-02-03 06:52:29 +00:00
Riley Bruins
73b68cb943 feat(query): highlights for dot-prefixed predicates 2025-02-02 17:53:25 +01:00
Riley Bruins
ca0e04ac31 feat(query): highlights for missing nodes 2025-02-02 17:48:21 +01:00
Christian Clason
16a51977dc Revert "ci(update): block vhdl (ABI 15)"
This reverts commit 1545e964e2.
2025-02-02 15:17:50 +01:00
Christian Clason
1545e964e2 ci(update): block vhdl (ABI 15) 2025-02-02 15:00:38 +01:00
nvim-treesitter-bot[bot]
2497d9558d bot(lockfile): update desktop, matlab, perl, query, scala 2025-02-02 06:51:12 +00:00
Dimitris Dimitropoulos
4988b70680
feat(typst): capture multilevel headings (#7595) 2025-02-01 20:45:10 +01:00
Tristan Knight
39bf51ff68
feat(razor): add parser and queries (#7545) 2025-02-01 20:06:26 +01:00
nvim-treesitter-bot[bot]
bcd0b26607 bot(lockfile): update bash, desktop, haskell, julia, nix, objc, typst 2025-02-01 08:47:04 +00:00
nvim-treesitter-bot[bot]
7e3942ceca bot(lockfile): update c, c_sharp, cpp, css, djot, dtd, earthfile, go, html, java, javascript, json, lua, nix, ocaml, ocaml_interface, ocamllex, php, php_only, python, ruby, scala, tsx, typescript, xml 2025-01-31 06:52:49 +00:00
Omar Valdez
110bdf91e3
fix(typescript): don't highlight default values as parameters (#7599) 2025-01-30 18:32:50 +01:00
Jonas Hietala
ffa526e5aa
feat(djot): add latex injection (#7603) 2025-01-30 12:22:43 +01:00
nvim-treesitter-bot[bot]
019e8cb7b3 bot(lockfile): update cpp, djot, gotmpl, heex, helm, solidity 2025-01-30 08:28:48 +00:00
Christian Clason
10f7a506ef fix(ci): fixup (ignore new artifact name) 2025-01-30 09:16:25 +01:00
Christian Clason
aeaac6a208 fix(ci): fixup 2025-01-30 09:10:34 +01:00
Christian Clason
7d28f8afc4 fix(ci): update to changed neovim release name 2025-01-30 08:53:22 +01:00
nvim-treesitter-bot[bot]
13f4346876 bot(lockfile): update cpp, godot_resource, leo 2025-01-29 06:50:19 +00:00
Jonas Hietala
80c7af6d04
feat(djot)!: update to breaking parser changes (#7594) 2025-01-28 21:58:52 +01:00
nvim-treesitter-bot[bot]
043d5fb150 bot(lockfile): update gotmpl, gren, helm, nu 2025-01-28 06:51:06 +00:00
Christian Clason
2206739829 ci(install): adapt to new Neovim release artefact names
Old name can be removed after 0.10.4 release
2025-01-27 17:09:08 +01:00
nvim-treesitter-bot[bot]
61a385d74f bot(lockfile): update perl 2025-01-27 06:53:17 +00:00
nvim-treesitter-bot[bot]
d34e62afd3 bot(lockfile): update cuda, janet_simple 2025-01-26 06:51:42 +00:00
Minh Tran
f3d7c0dafc
fix(verilog): capture (non_integer_type) as @type.builtin 2025-01-25 09:52:24 +01:00
nvim-treesitter-bot[bot]
dce7208593 bot(lockfile): update bash, c, c_sharp, cpp, css, elixir, embedded_template, go, html, java, javascript, jsdoc, json, nginx, php, php_only, prisma, python, regex, rust, scfg, tsx, typescript, v 2025-01-25 06:50:02 +00:00
nvim-treesitter-bot[bot]
51562d44fc bot(lockfile): update bash, c, c_sharp, cpp, css, embedded_template, fortran, go, html, java, javascript, jsdoc, json, php, php_only, python, regex, rust, tsx, typescript 2025-01-24 06:51:43 +00:00
nvim-treesitter-bot[bot]
6587a58868 bot(lockfile): update fortran, hack, superhtml, yaml, ziggy, ziggy_schema 2025-01-23 06:54:03 +00:00
Baraa Homsi
4862ab0aca
fix(nix): shorter sub-attribute function highlight query (#7579) 2025-01-22 07:58:01 -08:00
nvim-treesitter-bot[bot]
0c94de7e97 bot(lockfile): update erlang, groovy, janet_simple, kotlin, rst, slim 2025-01-22 06:53:06 +00:00
nvim-treesitter-bot[bot]
07bd1b53bf bot(readme): update 2025-01-21 09:25:45 +01:00
Théo Reichel
1c67567464
feat(slim): add parser and queries (#7425) 2025-01-21 09:25:08 +01:00
nvim-treesitter-bot[bot]
65c466178e bot(lockfile): update erlang, hyprlang, solidity, t32 2025-01-21 06:50:51 +00:00
Gabriel Holodak
0fb02ac5c3 fix(install): use std=c11 2025-01-20 08:50:52 +01:00
Gabriel Holodak
82939d5941 fix(install): preserve command return code on Windows
`:TSInstallSync` relies on the `:system()` command to set
`v:shell_error` when an error code is returned during installation. On
Windows, the error code was always overwritten by `popd`'s return code.
2025-01-20 08:50:52 +01:00
Jaehwang Jung
8acafab2bc fix: node selection at line start that ends injected region 2025-01-20 08:49:31 +01:00
Jaehwang Jung
e8c5242f53 fix(inc-selection): handle injections
* Parse injections before starting selection.
* Make node_incremental climb up the LanaguageTree step by step.
  Previously it only considered the root parser and the bottommost
  parser. Now it works well with document with deeper injections, e.g.,
  ```lua
  vim.cmd[=[
  echo 'hello' 'world!'
  lua << EOF
  vim.cmd[[echo 'hello' 'world!']]
  EOF
  ]=]
  ```
2025-01-20 08:49:31 +01:00
nvim-treesitter-bot[bot]
47b333e63d bot(lockfile): update hyprlang, query, sourcepawn, templ, vhdl, xresources 2025-01-20 06:52:37 +00:00
Omar Valdez
7edaaf9887
feat(css): highlight @keyframes name (#7569) 2025-01-19 19:29:24 -08:00
Baraa Homsi
4d93fae5a3
fix(nix): highlight functions when part of a set (#7547)
* feat(nix): Fix function highlights when part of a set

* fix(nix): Highlight only the last identifier node in functions

* fix(nix): Higher precedence for builtins compared to functions and member vars
2025-01-19 19:03:13 -08:00
Omar Valdez
1c77042243 feat(hyprlang): bash injection for hypridle variables 2025-01-19 21:28:06 -05:00
Omar Valdez
87b1f25098 feat(hyprlang): add missing highlights 2025-01-19 21:07:52 +01:00
Omar Valdez
645d14f40f feat(hyprlang): bash injections for exec keybindings 2025-01-19 12:29:44 -05:00
nvim-treesitter-bot[bot]
4423f30539 bot(lockfile): update fish 2025-01-19 06:48:30 +00:00
Christian Clason
5da195ac3d ci: use new issue types 2025-01-17 10:46:06 +01:00
nvim-treesitter-bot[bot]
b952a0ab6c bot(lockfile): update erlang, heex, janet_simple, lalrpop 2025-01-17 06:52:06 +00:00
Christian Clason
fd59f98441 fix(idris): correct keyword captures
Fixup for #7274
2025-01-16 17:45:38 +01:00
Serhii Khoma
8758abeb4d
feat(idris): add parser and queries (#7274) 2025-01-16 17:34:37 +01:00
nvim-treesitter-bot[bot]
a67a312e7b
bot(lockfile): update earthfile, gotmpl, heex, helm, vhs (#7557)
Co-authored-by: nvim-treesitter-bot[bot] <157957100+nvim-treesitter-bot[bot]@users.noreply.github.com>
2025-01-16 09:33:47 +01:00
nvim-treesitter-bot[bot]
f0c928dbe9 bot(lockfile): update facility, fortran, gotmpl, helm, ocaml, ocaml_interface 2025-01-15 06:50:45 +00:00
Guilherme Soares
984214ef8e
feat(gotmpl): highlight "=" operator (#7553) 2025-01-14 08:20:51 +01:00
nvim-treesitter-bot[bot]
e122b11d83 bot(lockfile): update apex, gap, groovy, matlab, nix, sflog, soql, sosl 2025-01-14 06:51:29 +00:00
Álan e Sousa
c7dc251cdd fix(matlab): indentation of arguments statement 2025-01-13 18:05:45 +01:00
nvim-treesitter-bot[bot]
dc9bf52c1f bot(lockfile): update apex, dockerfile, editorconfig, gomod, mlir, odin, sflog, soql, sosl, xresources 2025-01-13 06:55:14 +00:00
nvim-treesitter-bot[bot]
097fb77312 bot(lockfile): update css, fortran, gomod, ocaml, ocaml_interface, roc 2025-01-12 06:53:36 +00:00
someone13574
29f96aafe1
fix(verilog): add ifndef highlight (#7548) 2025-01-11 23:12:54 +01:00
JSaugsburg
9ef2e37e1b
feat(awk): highlight more builtin functions 2025-01-11 14:31:24 +01:00
Brian Cardarella
e1e2ad1448
feat(elixir): add highlight for LVN sigils 2025-01-11 10:44:04 +01:00
nvim-treesitter-bot[bot]
5780226a4f bot(lockfile): update apex, mlir, sflog, soql, sosl 2025-01-11 06:50:53 +00:00
nvim-treesitter-bot[bot]
306dd6e9dc bot(lockfile): update koto 2025-01-10 08:14:32 +00:00
Igor
057990eb24 feat(http): fold queries 2025-01-10 09:06:34 +01:00
nvim-treesitter-bot[bot]
6df6e80417 bot(lockfile): update ocaml, ocaml_interface 2025-01-09 06:54:20 +00:00
Ian Hobson
8ca76960ae feat(koto): Update highlighting for 0.15 2025-01-08 13:54:35 +01:00
nvim-treesitter-bot[bot]
10a9464a82 bot(lockfile): update groovy, python 2025-01-08 06:52:08 +00:00
nvim-treesitter-bot[bot]
622a4a6ba7 bot(lockfile): update c_sharp, nickel 2025-01-07 07:11:13 +00:00
nvim-treesitter-bot[bot]
958af94dd8 bot(lockfile): update diff, just, ocaml, ocaml_interface, swift, xresources 2025-01-06 06:53:29 +00:00
nvim-treesitter-bot[bot]
556ac68cd3 bot(lockfile): update mlir, rbs, snakemake 2025-01-05 06:49:48 +00:00
joker1007
57713d079c fix(rbs): fix highlight queries of rbs that is missing some definitions 2025-01-04 16:13:26 +01:00
nvim-treesitter-bot[bot]
fae21737be bot(lockfile): update julia, koto, v 2025-01-04 06:50:10 +00:00
Robert Horvath
6935286b4e fix(leo): intentation fix of parenthesis 2025-01-03 19:17:21 +01:00
nvim-treesitter-bot[bot]
cfbc1c0e0f bot(lockfile): update godot_resource, properties 2025-01-03 06:52:25 +00:00
Caleb White
6cb4098d51 fix(php): properly highlight grouped imported functions and constants 2025-01-02 19:13:44 +01:00
nvim-treesitter-bot[bot]
fc687f38d4 bot(lockfile): update gdscript, qmljs 2025-01-02 06:52:25 +00:00
nvim-treesitter-bot[bot]
e947d35bbf bot(lockfile): update gdscript, swift 2025-01-01 06:54:11 +00:00
vanaigr
5f78e98924 fix(bash): offset injection content 2024-12-31 10:49:30 +01:00
nvim-treesitter-bot[bot]
0a0e2e354b bot(lockfile): update fsharp 2024-12-31 06:54:36 +00:00
Shaun Attfield (shaun@xomen)
4b22291348 fix(xml): properly indent closing tags
Confusing as it is,
https://github.com/heurist/nvim-treesitter/blob/master/CONTRIBUTING.md?plain=1#L394
says:

```query
@indent.dedent      ; dedent children when matching this node
@indent.branch      ; dedent itself when matching this node
```

@indent.branch is therefore the approriate choice for de-indenting.
2024-12-30 17:55:55 +01:00
Robert Horvath
1087b183a7 fix(leo): indent } now properly dedents 2024-12-30 17:55:35 +01:00
Robert Horvath
f0f48e0290 feat(leo): highlights casting and record expressions added 2024-12-30 17:55:35 +01:00
Serhii Khoma
f87c8956ae
feat(ipkg): add parser and queries (#7277)
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-12-30 08:48:20 -08:00
Derek Stride
a295ba13d2
feat(ruby): add injection for debugger command strings (#7480) 2024-12-30 11:14:03 +01:00
nvim-treesitter-bot[bot]
34d78baa86 bot(lockfile): update editorconfig, nu, sql, templ, vento, vhdl, xresources 2024-12-30 06:54:56 +00:00
ObserverOfTime
7e0fcf0d45
fix(ssh_config): highlight "always" (#7507) 2024-12-29 10:58:56 +01:00
nvim-treesitter-bot[bot]
22c86af7c8 bot(lockfile): update c, leo, nu, ssh_config 2024-12-29 06:54:09 +00:00
nvim-treesitter-bot[bot]
5d18ef22dc bot(lockfile): update tsx, typescript 2024-12-28 06:53:44 +00:00
nvim-treesitter-bot[bot]
eb3e850acf bot(lockfile): update gap, gaptst, scala 2024-12-27 10:47:27 +00:00
nvim-treesitter-bot[bot]
17678b00fa bot(lockfile): update astro 2024-12-26 06:52:26 +00:00
nvim-treesitter-bot[bot]
ac6a72a6f8 bot(lockfile): update heex, verilog 2024-12-25 06:52:42 +00:00
Yorick Peterse
096babebf6 feat(inko): highlight the "type" keyword
This keyword will be released in 0.18.0 and deprecate the "class"
keyword, which in turn will be removed in 0.19.0.
2024-12-24 17:37:57 +01:00
nvim-treesitter-bot[bot]
50947387c2 bot(lockfile): update bp, gnuplot, just, xresources 2024-12-24 06:52:18 +00:00
Christian Clason
b4897f5a84 ci(update): unblock gnuplot 2024-12-23 16:10:41 +01:00
nvim-treesitter-bot[bot]
8119950998 bot(lockfile): update kconfig, luau, odin, python, regex, v 2024-12-23 06:53:16 +00:00
nvim-treesitter-bot[bot]
caba7ef355 bot(lockfile): update bicep, java, puppet, python, verilog, zig 2024-12-22 10:19:10 +00:00
Amaan Qureshi
4d5a8e7006 feat(kconfig): adapt queries to parser changes 2024-12-22 11:06:48 +01:00
nvim-treesitter-bot[bot]
2a75d8065c bot(lockfile): update koto, nu, powershell 2024-12-21 06:52:01 +00:00
nvim-treesitter-bot[bot]
2405274937 bot(lockfile): update java 2024-12-20 06:54:55 +00:00
nvim-treesitter-bot[bot]
fa915a30c5 bot(lockfile): update kotlin, poe_filter, rust, slint 2024-12-19 06:54:36 +00:00
nvim-treesitter-bot[bot]
102bc74e09 bot(lockfile): update hoon, nu 2024-12-18 06:54:48 +00:00
zc he
981ca7e353
fix(nu): perf issue of highlight.scm (#7475) 2024-12-17 16:50:36 -08:00
phanium
c47d8d27d0
fix(lua): remove duplicate nvim_command (#7477) 2024-12-17 11:32:17 +01:00
nvim-treesitter-bot[bot]
d20db847aa bot(lockfile): update apex, fortran, nu, scala, sflog, soql, sosl, templ 2024-12-17 06:56:54 +00:00
nvim-treesitter-bot[bot]
1d0a8b91d0 bot(lockfile): update c, editorconfig, objc, powershell, scala, snakemake, t32, templ, vhdl, xresources 2024-12-16 09:51:56 +00:00
Mae Brooks
ad5ea0bbed
fix(gren): adapt queries to parser changes (#7472)
`case of` -> `when is`
2024-12-16 10:37:35 +01:00
Vincent Rischmann
54a29bf99d
feat(zig): improve indents (#7471) 2024-12-15 22:29:54 +01:00
Riley Bruins
5cf3434c69 feat(go): string regex highlights 2024-12-15 12:02:42 +01:00
Riley Bruins
89ecadd2b1 fix(go): properly apply injections in strings 2024-12-15 12:02:42 +01:00
nvim-treesitter-bot[bot]
7fee2c55e0 bot(lockfile): update apex, sflog, soql, sosl 2024-12-15 06:53:45 +00:00
nvim-treesitter-bot[bot]
cfbbdd5eff bot(lockfile): update solidity, v 2024-12-14 06:53:54 +00:00
nvim-treesitter-bot[bot]
33d2717387 bot(lockfile): update http, nu, scala 2024-12-13 07:02:33 +00:00
nvim-treesitter-bot[bot]
2a496fa4e8 bot(lockfile): update elm, liquidsoap, scala, slint, sql, templ 2024-12-12 07:40:55 +00:00
Heber
c97f14eed1
feat(soql): update parser and queries (#7461) 2024-12-12 08:31:38 +01:00
nvim-treesitter-bot[bot]
5874cac1b7 bot(lockfile): update hoon, markdown, markdown_inline, nu, roc, typespec 2024-12-11 08:58:12 +00:00
nvim-treesitter-bot[bot]
337b503688 bot(lockfile): update elixir, powershell 2024-12-10 07:15:45 +00:00
phanium
c5c9f234b3
feat(sxhkd): add bash injection for (command) (#7456) 2024-12-10 08:08:02 +01:00
nvim-treesitter-bot[bot]
0c26a5c4bc bot(lockfile): update astro, swift, xresources 2024-12-09 06:56:13 +00:00
nvim-treesitter-bot[bot]
3b8dee4293 bot(lockfile): update godot_resource, templ 2024-12-08 06:53:46 +00:00
nvim-treesitter-bot[bot]
894cb3cebb bot(lockfile): update nu, t32, typespec 2024-12-07 09:14:04 +00:00
nvim-treesitter-bot[bot]
53e20aa728 bot(readme): update 2024-12-06 17:51:03 +00:00
Alexandr Martirosyan
be17791f86
feat(circom): add parser and queries 2024-12-06 18:41:37 +01:00
nvim-treesitter-bot[bot]
c56507f6a1 bot(lockfile): update c_sharp, powershell, t32 2024-12-06 06:55:44 +00:00
Fredrik Ekre
acada1a685 fix(julia): fix incorrect documentation query
This patch fixes an inprecise `@string.documentation` query introduced
in https://github.com/nvim-treesitter/nvim-treesitter/pull/7391. The
pattern `(string_literal) . (call_expression)` matches also for example
`"hello"` in `foo("hello", bar())`. Similarly to
https://github.com/nvim-treesitter/nvim-treesitter/pull/7436, this patch
limits the pattern to top-level statements.
2024-12-05 15:04:15 +01:00
nvim-treesitter-bot[bot]
046b8e9361 bot(lockfile): update python, starlark, teal 2024-12-05 06:56:11 +00:00
Yorick Peterse
0aaf146590 feat(inko): highlight the "copy" keyword
This keyword is added as part of the upcoming 0.18.0 release.
2024-12-04 15:39:04 +01:00
Fredrik Ekre
b0fc560c75 fix(julia): fix incorrect documentation query
This patch fixes an inprecise `@string.documentation` query introduced
in https://github.com/nvim-treesitter/nvim-treesitter/pull/7391.
Specifically, the pattern `(string_literal) . (identifier)` matches also
for example `"hello"` in

```julia
foo("hello", world)
@info "hello" world
```

To fix this, this patch limits the pattern to top-level statements.
2024-12-04 11:59:55 +01:00
nvim-treesitter-bot[bot]
3edea87978 bot(lockfile): update dtd, inko, powershell, xml, yaml 2024-12-04 06:55:09 +00:00
nvim-treesitter-bot[bot]
b31188671d bot(lockfile): update apex, sflog, soql, sosl, superhtml, swift, t32, toml, vhdl 2024-12-03 06:58:27 +00:00
nvim-treesitter-bot[bot]
69170c9314 bot(lockfile): update apex, editorconfig, elixir, ledger, markdown, markdown_inline, sflog, soql, sosl, styled, swift, xresources 2024-12-02 07:45:02 +00:00
Riley Bruins
2444c8052f feat(gomod): punctuation, toolchain highlights
Reference file:

```gomod
module github.com/klauspost/reedsolomon

go 1.21

require github.com/klauspost/cpuid/v2 v2.2.8

require golang.org/x/sys v0.24.0 // indirect

retract (
	v1.12.2 // https://github.com/klauspost/reedsolomon/pull/283
	v1.11.6 // https://github.com/klauspost/reedsolomon/issues/240
	[v1.11.3, v1.11.5] // https://github.com/klauspost/reedsolomon/pull/238
	v1.11.2 // https://github.com/klauspost/reedsolomon/pull/229
)
```
2024-12-02 08:38:30 +01:00
nvim-treesitter-bot[bot]
70d44dad70 bot(lockfile): update editorconfig, swift, t32 2024-12-01 06:56:14 +00:00
Riley Bruins
454354e599 fix(nu): highlight all occurrences of "use" 2024-11-30 09:29:45 +01:00
nvim-treesitter-bot[bot]
f6f159a293 bot(lockfile): update fortran, mlir, nix, nu, typespec 2024-11-30 06:54:48 +00:00
flippette
427a90ae70
feat(rust): highlight "gen" and "raw" keywords (#7419) 2024-11-29 19:38:12 +01:00
Fredrik Ekre
60b4c15e7c feat(julia): highlight interpolation operator
This patch adds `$` to the `@punctuation.special` capture group within
`(string_interpolation)` (e.g. `"hello $name"`) and
`(interpolation_expression)` (e.g. `:(hello $name)`) nodes.
2024-11-29 08:12:56 +01:00
nvim-treesitter-bot[bot]
a0a1d7bb50 bot(lockfile): update nu, sql, typespec 2024-11-29 06:55:21 +00:00
Yorick Peterse
4d035005d3 feat(inko): highlight "inline" keyword
The parser added support for the "inline" keyword in a few places. This
ensures a highlight is present for the keyword.
2024-11-28 17:52:02 +01:00
AtomToast
02f8777252
feat(zig): add locals queries (#7401) 2024-11-28 08:28:51 +01:00
nvim-treesitter-bot[bot]
afa0d2a9d0 bot(lockfile): update solidity, sql 2024-11-28 06:57:28 +00:00
JoranHonig
8d4fdc5e47
fix(solidity): remove spurious operators in highlight queries (#7412) 2024-11-27 11:04:28 +01:00
nvim-treesitter-bot[bot]
cc292c869f bot(lockfile): update t32 2024-11-27 06:54:45 +00:00
nvim-treesitter-bot[bot]
28591731d8 bot(lockfile): update gleam, scala 2024-11-26 06:55:02 +00:00
nvim-treesitter-bot[bot]
d14bc4bd15 bot(lockfile): update c_sharp, editorconfig, go, nu, rust, templ, xresources 2024-11-25 06:56:02 +00:00
zhangwwpeng
7930b5f983
fix(verilog): update queries (#7400)
1. Add "string" as a keyword
2. Fix issue where non-type.builtin fields are captured when using (data_type) as type.builtin
3. Add generate label
2024-11-24 10:44:23 +01:00
nvim-treesitter-bot[bot]
b3752a311a bot(lockfile): update c_sharp, chatito, gpg, hoon, nasm, pem, poe_filter 2024-11-24 06:52:20 +00:00
Christian Clason
efb2e9c607 docs(parser): add maintainer for julia 2024-11-23 11:24:39 +01:00
Fredrik Ekre
3f377c0739 fix(julia): treat :: as operator in type contexts
This patch captures `::` as `@operator` within
`(unary_typed_expression)` and `(typed_expression)`. These should be the
only two cases that the parser can emit when encountering `::` in the
source, but as a fallback it is still captured as `@punctuation` in all
other cases.

The reasons for capturing `::` as an operator are i) the close relation
with the other type-operators `<:` and `>:` and ii) the fact that it is
treated as an operator by the Julia parser, just like `<:` and `>:`.
2024-11-23 11:10:05 +01:00
net-solution
94853ae932 fix(astro): highlight self-closing component tags 2024-11-23 10:43:46 +01:00
nvim-treesitter-bot[bot]
305c265bdb bot(lockfile): update fortran, nu, r 2024-11-23 09:41:10 +00:00
Fredrik Ekre
e05c280659 fix(julia): misc fixes to type highlighting
This patch fixes two issues related to `@type` capturing (split out from
https://github.com/nvim-treesitter/nvim-treesitter/pull/7392):

 - Capture the RHS of `<:` and `>:` as `@type` in `(unary_expression)`s
   similarly to what is already done for `(binary_expression)`s with
   these operators.
 - Capture children of `(curly_expression)`s inside of
   `(where_expression)`s as `@type` similarly how they are handled in
   `(parametrized_type_expression)`.
2024-11-23 10:40:13 +01:00
Fredrik Ekre
28a5dc06a8 fix(julia): fix macro identifier highlight query
This fixes the macro identifier highlight query after the breaking
changes in https://github.com/tree-sitter/tree-sitter-julia/pull/153.
See also
https://github.com/tree-sitter/tree-sitter-julia/pull/158/commits/9f2fb3b9a8c73ef0d2ec005c97f91274b492d48d.
2024-11-22 23:48:19 +01:00
Tomas Sandven
731fbe9ac3 feat(robot): highlight query improvements
- Highlight "ELSE" in inline_if_statement
- Use @string.documentation for "Documentation" settings
- Add `@spell` capture to "Documentation" settings
2024-11-22 23:19:26 +01:00
Fredrik Ekre
fcd2a5fea9 fix(julia): capture docstrings in more cases
This patch enables `@string.documentation` capturing, and markdown
injection, for strings attached to `(call_expression)` and
`(identifier)` nodes. For example

```julia
"docs"
foo(::Int, ::Float64)

"docs"
bar
```
2024-11-22 14:07:51 +01:00
Fredrik Ekre
2d816bb49e fix(julia): fix injection queries
This patch fixes the julia `(string_literal)` injection queries after
the breaking changes in
https://github.com/tree-sitter/tree-sitter-julia/pull/153. The queries
are simplified by the fact that string content is now directly available
as a separate `(content)` child node.
2024-11-22 13:33:54 +01:00
Riley Bruins
2d5c122af9 feat(http): more comprehensive highlights 2024-11-22 08:56:14 +01:00
nvim-treesitter-bot[bot]
eff88f4e8b bot(lockfile): update nu, perl, robot, scala, sql, teal 2024-11-22 06:56:44 +00:00
Riley Bruins
1249b4cfce
fix(jsdoc): only highlight slashes in paths (#7387)
Otherwise the final slash in a doc comment `*/` will also be
highlighted.
2024-11-21 17:00:11 -08:00
Omar Valdez
8a74ac9aea feat(python): highlight modules 2024-11-21 16:48:16 +01:00
Omar Valdez
fb12c7f8a3 feat(bash): highlight redirections 2024-11-21 16:47:55 +01:00
Omar Valdez
cd2acc803b feat(vim): highlight prepend operator 2024-11-21 09:02:13 +01:00
nvim-treesitter-bot[bot]
14f5b15ef9 bot(lockfile): update ledger, nu, robot 2024-11-21 06:55:47 +00:00
nvim-treesitter-bot[bot]
a3a732107f bot(lockfile): update arduino, just, ledger, mlir, nu, php, php_only, r, sql 2024-11-20 06:54:48 +00:00
nvim-treesitter-bot[bot]
c50981479e bot(lockfile): update desktop, editorconfig, just, nu, v, xresources 2024-11-19 07:58:31 +00:00
PrestonKnopp
37427012d1 feat(gdscript): add new export annotations 2024-11-18 08:26:49 +01:00
nvim-treesitter-bot[bot]
20b86032f0 bot(lockfile): update editorconfig, gdscript, json, just, nu, pug, templ, vhdl, xresources 2024-11-18 06:56:40 +00:00
nvim-treesitter-bot[bot]
1c0cbdef44 bot(lockfile): update dart, julia, nu, ocaml, ocaml_interface, perl, sql, xresources 2024-11-17 06:53:40 +00:00
nvim-treesitter-bot[bot]
20e10ca691 bot(lockfile): update julia, sql 2024-11-16 06:52:24 +00:00
Yi Ming
13c7caf8a6 fix(zig): begin indent at struct_declaration 2024-11-15 10:09:16 +01:00
nvim-treesitter-bot[bot]
06611c75fe bot(lockfile): update nix, nu, r, teal 2024-11-15 06:59:36 +00:00
nvim-treesitter-bot[bot]
6389ceb175 bot(lockfile): update gren, typst, v 2024-11-14 06:55:27 +00:00
zetashift
e1e3108cd2 feat(unison): inject markdown for doc blocks 2024-11-13 09:09:53 +01:00
zetashift
88ed26a7e6 feat(unison): add fold queries 2024-11-13 09:09:53 +01:00
zetashift
c5be87ad3e refactor(unison): update to latest treesitter grammar 2024-11-13 09:09:53 +01:00
nvim-treesitter-bot[bot]
fba111f707 bot(lockfile): update dtd, mlir, nix, v, vhdl, xml 2024-11-13 06:52:44 +00:00
nvim-treesitter-bot[bot]
7646c1c12a bot(lockfile): update bash, cpp, go, html, idl, latex, sway, swift, t32, templ 2024-11-12 07:27:23 +00:00
nvim-treesitter-bot[bot]
bb06afa3f1 bot(lockfile): update agda, bash, c, c_sharp, cpp, css, editorconfig, embedded_template, foam, go, haskell, html, java, javascript, jsdoc, json, julia, mlir, ocaml, ocaml_interface, php, php_only, python, ql, query, regex, ruby, rust, scala, t32, templ, tsx, typescript, xresources 2024-11-11 07:52:02 +00:00
Christian Clason
d105f2cb7b feat(julia): update parser and queries 2024-11-11 08:40:34 +01:00
Riley Bruins
a069bb62a8
fix: formatter idempotency for nested groupings (#7345)
Currently, for something like `(((((node))))) @cap`, the formatter will
produce `((node)) @cap`, and then after another pass it will produce
`(node) @cap`. This commit makes it so that all extraneous parentheses
are removed on the first pass.
2024-11-11 11:59:21 +09:00
nvim-treesitter-bot[bot]
8e40904e49 bot(lockfile): update bash, c_sharp, cpp, earthfile, editorconfig, embedded_template, go, html, java, javascript, jsdoc, json, nix, nu, python, regex, rust, t32 2024-11-10 10:14:46 +00:00
nvim-treesitter-bot[bot]
0603b3e3d2 bot(lockfile): update desktop, earthfile, mlir, nix, nu, v, xresources 2024-11-09 06:52:07 +00:00
nvim-treesitter-bot[bot]
425b589683 bot(lockfile): update inko, nu, udev 2024-11-08 07:07:56 +00:00
Riley Bruins
eab2005cb5 fix(regex): more accurate highlights for named backreferences
Highlight both surrounding angle brackets, and only apply the operator
highlight to the actual \k operator.
2024-11-07 22:06:35 +01:00
nvim-treesitter-bot[bot]
c91122d201 bot(lockfile): update nu, runescript, superhtml, swift 2024-11-07 10:25:39 +00:00
nvim-treesitter-bot[bot]
0722f23886 bot(readme): update 2024-11-06 22:15:19 +00:00
Christian Clason
98b3825999 docs(parser): mark julia as unmaintained 2024-11-06 23:05:20 +01:00
ganhaque
ea3a37a975
fix(wgsl): indent call expression params (#7309) 2024-11-06 10:09:14 -08:00
nvim-treesitter-bot[bot]
b5cda6d731 bot(readme): update 2024-11-06 17:17:43 +00:00
David Lysenko
7c5a4632c4
feat(runescript): add parser and queries (#7305) 2024-11-06 17:09:38 +00:00
nvim-treesitter-bot[bot]
4b9a83f601 bot(lockfile): update gitattributes, nix, nu, printf, properties, tcl 2024-11-06 09:11:04 +00:00
Christian Clason
8b15ce58e4 ci(update): skip julia but for real 2024-11-06 10:00:29 +01:00
Christian Clason
f284ca27b5 ci(update): skip julia 2024-11-06 09:55:44 +01:00
Riley Bruins
0d3426a2e8 fix(wgsl): indent first parameter of function definition 2024-11-06 09:24:39 +01:00
nvim-treesitter-bot[bot]
7dc8aabe86 bot(readme): update 2024-11-05 14:34:09 +00:00
Abhishek Singh
604aa5a7c8
feat(nu): add parser and queries (#7267) 2024-11-05 15:25:42 +01:00
nvim-treesitter-bot[bot]
509d38fee8 bot(lockfile): update dhall, printf, regex, ziggy, ziggy_schema 2024-11-05 06:52:54 +00:00
nvim-treesitter-bot[bot]
dfd3207ed4 bot(readme): update 2024-11-04 08:38:00 +01:00
Riley Bruins
8fadb18430 feat: sway programming language 2024-11-04 08:36:41 +01:00
Riley Bruins
d3d4c1411c fix(cooklang): apply correct filetype
`Cooklang` files are recognized as `cook` in vim. This prevents the parser
from attaching since it is looking for `cooklang` files, so we have to
specify the `filetype` here.
2024-11-04 08:19:28 +01:00
nvim-treesitter-bot[bot]
dbf90fbfa6 bot(lockfile): update dart, devicetree, dhall, idl, ssh_config, xresources 2024-11-04 06:54:39 +00:00
Riley Bruins
01a92da438 fix(rust): highlight parameters with ref in definition 2024-11-03 11:46:40 +01:00
Riley Bruins
98b46a647e feat(regex): highlights for lazy quantifiers, \k
Highlights the "?" following .* and the \k backreference operator in a
pattern like the following: title=(?<quote>["'])(.*?)\k<quote>
2024-11-03 11:35:27 +01:00
nvim-treesitter-bot[bot]
3abe66556f bot(lockfile): update awk, nix, styled, vhdl 2024-11-03 06:52:05 +00:00
Riley Bruins
9565149634 chore: recognize busted functions
Now writing indent tests is easier because the language server
recognizes the necessary functions
2024-11-02 19:46:21 +01:00
nvim-treesitter-bot[bot]
38c12cb9ac bot(lockfile): update awk, desktop, groovy, nix, ruby, xresources 2024-11-02 06:53:00 +00:00
Shengyu Zhang
b065b59196
fix(rst): capture (adornment) node as @markup.heading (#7302)
Node alias "adornment" is used as title's overline and underline:
5120f6e592/grammar.js (L112)
2024-11-01 09:51:17 +01:00
nvim-treesitter-bot[bot]
fb2d41ec59 bot(lockfile): update cylc, superhtml 2024-11-01 06:56:16 +00:00
Elliot Fontaine
92d2501d69
feat(cylc): add parser and queries (#7225) 2024-10-31 17:56:58 +01:00
nvim-treesitter-bot[bot]
f9e9370a6f bot(lockfile): update editorconfig, gleam, heex, superhtml 2024-10-31 06:53:36 +00:00
nvim-treesitter-bot[bot]
1c111e3e8f bot(lockfile): update beancount, desktop, tlaplus, vala 2024-10-30 09:38:06 +01:00
Riley Bruins
f26b5fb2ed feat(thrift): small improvements
Less capture duplication by separating queries, include folds, move
`@variable.member` to `@property`
2024-10-30 08:39:10 +01:00
Omar Valdez
0e65a9f272 feat(bash): highlight more builtin commands
Commands:
- `.`
- `:`
- `true`
- `false`
2024-10-30 08:38:06 +01:00
Christian Clason
39016abc99 ci(update): skip gnuplot, unskip djot 2024-10-29 09:08:39 +01:00
nvim-treesitter-bot[bot]
278dd927e4 bot(lockfile): update c, fortran, koto 2024-10-29 07:46:37 +00:00
nvim-treesitter-bot[bot]
de70388626 bot(lockfile): update editorconfig, just, swift 2024-10-28 06:54:21 +00:00
Riley Bruins
00d2190683 fix(rust): regex injections, highlights
**Problem:** Rust's regex injections were not applied since the string
content is behind a `(string_content)` node, and the injections were
applied to the parent node without the `include-children` directive.

**Solution:** Apply the injections to the string content. Also highlight
them accordingly.
2024-10-27 11:51:33 +01:00
nvim-treesitter-bot[bot]
a8b7da35e5 bot(lockfile): update javascript, mlir, templ, tlaplus 2024-10-27 06:51:35 +00:00
nvim-treesitter-bot[bot]
46a6587a23 bot(readme): update 2024-10-26 08:16:29 +00:00
Riley Bruins
674100c1fc fix(formatter): simplify code, remove odd line break 2024-10-26 10:07:30 +02:00
Omar Valdez
0a9108a7e4
feat(desktop): desktop parser and queries (#7282) 2024-10-26 10:06:22 +02:00
nvim-treesitter-bot[bot]
1d7c55f0bd bot(lockfile): update superhtml 2024-10-26 06:52:20 +00:00
Omar Valdez
48fc5d1dfe feat(bash): highlight special shell variables 2024-10-25 17:16:00 +03:00
nvim-treesitter-bot[bot]
f6c5a58e3b bot(lockfile): update koto, t32 2024-10-25 06:55:05 +00:00
Christian Clason
d740b0ad92 docs(readme): mark Nvim 0.10 as required 2024-10-25 08:48:16 +02:00
nvim-treesitter-bot[bot]
377039daa2 bot(lockfile): update elixir, fortran, koto, vimdoc 2024-10-24 06:55:24 +00:00
Riley Bruins
649f6a1636
fix(rust): separate import folds from others (#7279) 2024-10-24 05:16:55 +00:00
Christian Clason
9210b9a4fa fix(predicates): remove upstreamed predicates and directives
Problem: Overriding upstreamed predicates replaces optimized versions on
Nvim 0.11.

Solution: Now that nvim-treesitter requires Nvim 0.10, simply remove the
upstreamed predicates and directives.
2024-10-23 09:38:19 +02:00
nvim-treesitter-bot[bot]
cfc6f2c117 bot(lockfile): update editorconfig, erlang, sql 2024-10-23 06:53:29 +00:00
nvim-treesitter-bot[bot]
bab7b0f20b bot(lockfile): update erlang, gitcommit, lua, markdown, markdown_inline 2024-10-22 07:07:51 +00:00
ObserverOfTime
a5c7a3f6b4 fix(xml,dtd): adapt to parser changes 2024-10-22 08:56:17 +02:00
nvim-treesitter-bot[bot]
df20c04969 bot(lockfile): update swift, tlaplus, vimdoc, xresources 2024-10-21 06:54:35 +00:00
Omar Valdez
18cf02f5ef
feat(c): use @constant.macro for macro identifiers (#7266) 2024-10-20 10:53:45 -07:00
nvim-treesitter-bot[bot]
d53df0c987 bot(readme): update 2024-10-20 08:19:39 +00:00
Omar Valdez
3ba21f96a4
feat(xresources): add parser and queries (#7260) 2024-10-20 10:10:30 +02:00
nvim-treesitter-bot[bot]
9a94cc23cb bot(lockfile): update devicetree, editorconfig, json, markdown, markdown_inline, svelte 2024-10-20 06:50:51 +00:00
nvim-treesitter-bot[bot]
a3ca2e6056 bot(lockfile): update gitcommit, regex 2024-10-19 06:52:16 +00:00
nvim-treesitter-bot[bot]
68b2bdd99d bot(lockfile): update wgsl_bevy 2024-10-18 06:52:29 +00:00
nvim-treesitter-bot[bot]
03452942df bot(lockfile): update gitcommit, scala, superhtml, textproto 2024-10-17 06:54:36 +00:00
nvim-treesitter-bot[bot]
92725df622 bot(lockfile): update elixir, fsharp, glimmer_javascript, glimmer_typescript, gren, java, php, php_only, scala, t32 2024-10-16 06:56:00 +00:00
Amaan Qureshi
ed438691df fix(xml): remove unused rules 2024-10-16 08:35:54 +02:00
Amaan Qureshi
8944dc64ef fix(tlaplus): remove unused rules 2024-10-16 08:35:54 +02:00
Amaan Qureshi
6115c3664c fix(starlark): remove unused rules 2024-10-16 08:35:54 +02:00
Amaan Qureshi
d912ede290 fix(sql): remove unused rules 2024-10-16 08:35:54 +02:00
Amaan Qureshi
07d4f138cb fix(soql): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
584d96b46b fix(scala): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
37163336e2 fix(re2c): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
6940055133 fix(prql): remove unused rules 2024-10-16 08:35:54 +02:00
Amaan Qureshi
439fedf446 fix(ocaml_interface): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
1a506b6007 fix(nqc): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
f209410513 fix(dart): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
c729bb2487 fix(bitbake): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
25f11725d6 fix(astro): remove unused rule 2024-10-16 08:35:54 +02:00
Amaan Qureshi
cbc0d1d96e fix(apex): remove unused rule 2024-10-16 08:35:54 +02:00
henrykvdb
b139d21726
feat(verilog)!: use systemverilog parser and queries (#7170) 2024-10-16 08:35:35 +02:00
nvim-treesitter-bot[bot]
596b16da17 bot(readme): update 2024-10-16 01:23:37 +00:00
Mae Brooks
d0f567251b
feat(gren): gren parser and queries (#7237) 2024-10-15 18:14:39 -07:00
Igor
da92610392 feat(typst): fold sections 2024-10-15 20:43:35 +02:00
Omar Valdez
39904fd016 don't capture tables as headings 2024-10-15 09:16:44 +02:00
Omar Valdez
96290ae7ea refactor(toml): highlight queries 2024-10-15 09:16:44 +02:00
nvim-treesitter-bot[bot]
ca7993e606 bot(lockfile): update agda, bash, c, c_sharp, cmake, cpp, css, diff, editorconfig, eds, elixir, embedded_template, gitcommit, go, gotmpl, haskell, helm, hlsl, html, java, javascript, jsdoc, julia, just, ledger, php, php_only, python, ql, qmljs, regex, ruby, rust, slang, templ, tsx, typescript, verilog 2024-10-15 07:11:03 +00:00
Riley Bruins
a8052a8819 fix(diff): delta highlights override punctuation 2024-10-15 08:33:05 +02:00
Riley Bruins
049d42a31e feat(regex): better count quantifier highlights 2024-10-15 08:32:44 +02:00
Nikolai Devolder
8672843527 Fix(auto_install): Install parser if Filetype already known
If setup function was called after `FileType` autocommand triggers
the installation of parser was not done.

This commit checks if filetype is already know before adding the autocommand.
2024-10-14 16:45:21 +02:00
Amaan Qureshi
2953b6ae78 fix(slang): adapt to parser changes 2024-10-14 16:45:00 +02:00
Jonáš Dujava
245ffff7ac
fix(latex): capture nameless color change (#7243)
Color can be changed by directly passing color `model` and `spec`,
so make the `name` field optional.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-10-14 15:33:36 +02:00
nvim-treesitter-bot[bot]
5a2ff8b7ca bot(lockfile): update mlir, nix, perl, pioasm 2024-10-12 06:50:48 +00:00
nvim-treesitter-bot[bot]
19079207ba bot(lockfile): update editorconfig, meson, nix, phpdoc, teal 2024-10-11 06:54:24 +00:00
Heber
84bdd59c03
fix(apex): update parser and queries (#7230) 2024-10-10 20:57:54 +00:00
nvim-treesitter-bot[bot]
9b1e607298 bot(lockfile): update editorconfig, kotlin, mlir, nix, swift, tact 2024-10-10 06:53:46 +00:00
Novus Nota
9d2acd4997
feat(tact): update parser and queries (#7196) 2024-10-09 09:21:33 +02:00
nvim-treesitter-bot[bot]
009e981c30 bot(lockfile): update superhtml, v 2024-10-09 06:52:41 +00:00
nvim-treesitter-bot[bot]
86c10df7ef bot(lockfile): update cmake, llvm, perl, vhdl 2024-10-08 06:58:57 +00:00
Riley Bruins
18adcafad0 fix(dart): more highlight coverage, import folds 2024-10-08 08:43:26 +02:00
nvim-treesitter-bot[bot]
45e0d66246 bot(lockfile): update apex, mlir, nix, sflog, soql, sosl, superhtml, swift, templ, typst 2024-10-07 06:59:21 +00:00
nvim-treesitter-bot[bot]
4f04fb7027 bot(readme): update 2024-10-06 09:55:25 +00:00
Tim Culverhouse
1bcdd79088 feat(superhtml): add superhtml parser and queries
SuperHTML is a templating language used by the zine static site
generator.
2024-10-06 11:47:42 +02:00
nvim-treesitter-bot[bot]
da7e9751f1 bot(lockfile): update latex, nix, ruby 2024-10-06 08:58:01 +00:00
Heber
7821feb7e7
fix(apex): update parser and highlights 2024-10-05 16:35:26 +00:00
nvim-treesitter-bot[bot]
5bcc338c3d bot(lockfile): update erlang, mlir, nix, unison 2024-10-05 09:29:05 +00:00
nvim-treesitter-bot[bot]
45386764cc bot(lockfile): update nix, php, php_only, slint, unison 2024-10-04 06:55:20 +00:00
nvim-treesitter-bot[bot]
cc2c11c403 bot(lockfile): update fsharp, wit 2024-10-03 06:53:12 +00:00
ricardo.demeterko
98a33cc524 feat(angular): update highlight query 2024-10-02 15:37:24 +02:00
nvim-treesitter-bot[bot]
3af8476530 bot(lockfile): update erlang, mlir, nickel, nix, php, php_only, readline, scala, styled 2024-10-02 06:51:46 +00:00
Christian Clason
da61d31a3d fix(parsers): don't register rmd and quarto for markdown 2024-10-01 21:03:52 +02:00
nvim-treesitter-bot[bot]
ef52e44bb2 bot(lockfile): update java, mlir, nix, slint, textproto, ziggy, ziggy_schema 2024-10-01 06:54:41 +00:00
Christian Clason
707e352df6
fix(parsers): register explicit filetypes unconditionally (#7202)
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-09-30 17:06:47 -07:00
nvim-treesitter-bot[bot]
df0f8cb58e bot(readme): update 2024-09-30 21:42:15 +00:00
Tim Culverhouse
58c702c4d5 feat(ziggy-schema): Add ziggy-schema parser and queries
Ziggy-schema is the schema definition file format for a ziggy file.
2024-09-30 23:33:44 +02:00
Tim Culverhouse
1a6fa428b8 feat(ziggy): add ziggy parser and queries
[Ziggy](https://github.com/kristoff-it/ziggy) is a data serialization
format used in the zine static site generator.
2024-09-30 23:33:44 +02:00
nvim-treesitter-bot[bot]
d1e1f17cea bot(lockfile): update swift, tact, tlaplus, v 2024-09-30 06:54:36 +00:00
Christian Clason
140f534ce9 fix(parsers): adapt to upstream change in Nvim 0.11
In Nvim 0.11, `vim.treesitter.lang.get_lang(filetype)` falls back
to `filetype` by default, so filetypes no longer have to be registered
for languages with the same name.
2024-09-29 18:26:14 +02:00
Nikolaj Sidorenco
707313b80a
feat(fsharp): add parser and queries (#7166) 2024-09-29 11:08:21 +02:00
nvim-treesitter-bot[bot]
1f2059f293 bot(lockfile): update arduino, elixir, templ, tlaplus 2024-09-29 06:54:37 +00:00
Riley Bruins
36b78d112b fix(markdown): don't set link metadata twice
Otherwise the same link will be opened twice when the cursor is on the
link text itself.
2024-09-28 19:02:26 +02:00
nvim-treesitter-bot[bot]
84836f08ef bot(lockfile): update koto, nix 2024-09-28 06:51:27 +00:00
nvim-treesitter-bot[bot]
f027762845 bot(lockfile): update devicetree, fortran, gleam, inko, markdown, markdown_inline, nix, ocaml, ocaml_interface, tact, templ 2024-09-27 06:53:37 +00:00
Riley Bruins
679883ad31
feat(gleam,luau): use @keyword.type captures (#7181) 2024-09-26 09:09:41 +02:00
nvim-treesitter-bot[bot]
a1b791604b bot(lockfile): update re2c 2024-09-26 06:52:25 +00:00
nvim-treesitter-bot[bot]
0c8a582e47 bot(lockfile): update odin 2024-09-25 06:55:22 +00:00
Kai Moschcau
6511cd984a
fix(jsdoc): disable spelling for identifiers (#7172) 2024-09-24 09:26:55 +02:00
nvim-treesitter-bot[bot]
160b1714ec bot(lockfile): update angular, powershell 2024-09-24 06:53:48 +00:00
nvim-treesitter-bot[bot]
621f5901f0 bot(lockfile): update apex, c, cpp, ocaml, ocaml_interface, sflog, soql, sosl, zig 2024-09-23 06:53:37 +00:00
Veesh Goldman
20b5cbfa92
feat(perl): support more modern syntax 2024-09-22 14:15:38 -04:00
nvim-treesitter-bot[bot]
2b2635551c bot(lockfile): update d, ocaml, ocaml_interface, supercollider 2024-09-22 06:52:26 +00:00
nvim-treesitter-bot[bot]
929ca9c76e bot(lockfile): update cpp, d, http, v 2024-09-21 06:50:09 +00:00
Riley Bruins
b8ad0473f4 fix(markdown): broader link recognition
**Problem:** Neovim's `gx` will not work when the cursor is on the first
`[` of an inline Markdown link.

**Solution:** Set the `url` metadata property on the link parent node,
rather than just the link label node
2024-09-20 21:35:08 +02:00
nvim-treesitter-bot[bot]
1fbc25fc11 bot(lockfile): update elm, lalrpop, v 2024-09-20 06:53:29 +00:00
Omar Valdez
188b1a6d01
feat(highlights): capture wildcard patterns as @character.special (#7153) 2024-09-20 08:15:01 +02:00
nvim-treesitter-bot[bot]
2b2ac30232 bot(lockfile): update editorconfig, fortran, nix, perl 2024-09-19 06:53:15 +00:00
Riley Bruins
63c532fde5 feat(swift): fold queries 2024-09-19 08:43:58 +02:00
Riley Bruins
12e339e370 feat(swift): add many missing highlights 2024-09-19 08:43:44 +02:00
Omar Valdez
45ee50d02b feat(htmldjango): improve punctuation highlighting
In Django templates `{{` and `{%` are interpolations, so they should be
highlighted as @punctuation.special.

Don't highlight quotes as delimiters (consistency) and add missing comma
delimiter.
2024-09-19 08:42:52 +02:00
nvim-treesitter-bot[bot]
3c6af36794 bot(lockfile): update d, fortran, go, inko, nix, r, tlaplus 2024-09-18 07:41:18 +00:00
nvim-treesitter-bot[bot]
4d94c24d6c bot(lockfile): update d, http, nix 2024-09-17 06:50:08 +00:00
Jerome Dalbert
cad9ff2fbc feat(ruby): detect shebang directive 2024-09-17 04:13:38 +02:00
nvim-treesitter-bot[bot]
b9002f6fe6 bot(lockfile): update apex, sflog, soql, sosl, swift 2024-09-16 06:52:30 +00:00
Heber
5c42228e58
feat(apex): update parser and highlights (#7151) 2024-09-16 08:15:57 +02:00
nvim-treesitter-bot[bot]
b7160e87aa bot(lockfile): update hurl, v 2024-09-15 06:49:50 +00:00
Riley Bruins
399062d072 fix(lua): remove duplicate ellipsis highlight 2024-09-14 23:36:35 +02:00
nvim-treesitter-bot[bot]
583395810e bot(lockfile): update r 2024-09-14 06:50:27 +00:00
nvim-treesitter-bot[bot]
e0338f2b74 bot(lockfile): update glsl, hlsl, scala, slang 2024-09-13 06:52:53 +00:00
nvim-treesitter-bot[bot]
4af16a10b7 bot(lockfile): update gomod, latex, markdown, markdown_inline, perl, scala 2024-09-12 06:52:50 +00:00
Jerome Dalbert
66a7655a5e feat(ruby): improve identifiers highlighting 2024-09-12 08:51:30 +02:00
Juhan
b6a6d8997c
feat(gleam): add @local.scope capture for block (#7128) 2024-09-11 14:01:11 +02:00
Christian Clason
d22166e3d8 ci: bump create-pull-request to v7 2024-09-11 09:20:04 +02:00
nvim-treesitter-bot[bot]
2871a4a657 bot(lockfile): update markdown, markdown_inline 2024-09-11 06:52:05 +00:00
Amaan Qureshi
6a3c6a42a6
fix(rust): comment marker should not be @operator (#7135) 2024-09-10 17:47:17 +00:00
Christian Clason
c436d45eee Revert "ci(update): bump create-pull-request to v7 and sign commits"
This reverts commit c9003a3cb1.
2024-09-10 10:20:29 +02:00
Christian Clason
c9003a3cb1 ci(update): bump create-pull-request to v7 and sign commits 2024-09-10 08:19:14 +00:00
nvim-treesitter-bot[bot]
f8bbb820a8 bot(lockfile): update elixir, gleam, lua, markdown, markdown_inline, perl, scala, swift 2024-09-10 06:51:01 +00:00
Jonas Dujava
13ee7f8844 feat(latex): capture conditionals
Generically, macros/commands in LaTeX starting on `if` are either
directly conditionals, or have similar purpose/funcionality.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-09-10 08:23:48 +02:00
nvim-treesitter-bot[bot]
4770d9a1a7 bot(lockfile): update earthfile, racket, scheme, svelte 2024-09-08 06:47:57 +00:00
Riley Bruins
58030e6d6f fix(formatter): adapt formatter for nightly
After Neovim pull #30193, the formatter was broken due to changes in the
way node data is passed to predicates.
2024-09-07 17:31:18 +02:00
nvim-treesitter-bot[bot]
00f128dd73 bot(lockfile): update elixir, erlang, groovy, r, svelte, swift 2024-09-07 06:50:25 +00:00
Avi Areman
ccbaee5954 feat(mermaid): indents and folds 2024-09-07 00:21:07 +09:00
nvim-treesitter-bot[bot]
093b29f2b4 bot(lockfile): update julia, kotlin, tcl 2024-09-06 06:50:12 +00:00
nvim-treesitter-bot[bot]
bfe74a4899 bot(lockfile): update arduino, awk, bash, c, cpp, css, cuda, go, groovy, haskell, hlsl, html, http, javascript, jsdoc, json, julia, liquid, norg, ocaml, ocaml_interface, php, php_only, phpdoc, python, ql, regex, ruby, rust, scala, slang, tcl, templ, tsx, typescript, v, wing 2024-09-05 13:36:22 +00:00
Christian Clason
3826d0c42a fix(query): explicitly opt-in to legacy behavior 2024-09-04 15:13:41 +02:00
Omar Valdez
5b8b126de0
fix(highlights): section headings in ini, git_config editorconfig (#7108)
Section headers should be `@markup.heading` in ini-like grammars and `@string.special.path` in editorconfig.
2024-09-03 10:24:16 +02:00
Amaan Qureshi
a1573a9135 feat(javascript): update parser and queries 2024-09-02 10:04:37 +02:00
Riley Bruins
e090c5b22d feat(wing): add many missing highlights
...as well as some fold and injection queries.
2024-09-02 09:55:48 +02:00
nvim-treesitter-bot[bot]
bbf1f3e546 bot(lockfile): update arduino, c_sharp, dart, embedded_template, gleam, ini, java, racket, scheme, vhdl 2024-09-02 07:52:52 +00:00
Reinis Cirpons
2d8f0f37c4
feat(gap): add gap and gaptst parser and queries (#7110) 2024-09-01 22:13:10 +02:00
Jonas Dujava
4e47268c6d feat(latex): set url attribute for hyperlinks
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-09-01 17:26:13 +02:00
nvim-treesitter-bot[bot]
aa339f6ab6 bot(lockfile): update http, styled, swift 2024-09-01 06:50:11 +00:00
Riley Bruins
749df30887 feat(query): highlight supertype "/" delimiters 2024-08-31 18:42:53 -04:00
nvim-treesitter-bot[bot]
c7920f2bc5 bot(readme): update 2024-08-31 17:23:24 +00:00
NullVoxPopuli
628f53e4cb
feat(glimmer): add glimmer-javascript and glimmer-typescript (#7064) 2024-08-31 19:15:40 +02:00
Omar Valdez
0b61eb4923
fix(ini): highlight setting value as @string (#7104)
Values are not typed in INI files and are interpreted as literal strings.
2024-08-31 19:14:13 +02:00
Seongmin Lee
b33a34e883
fix(http): update injections queries (#7078) 2024-08-31 18:52:23 +02:00
nvim-treesitter-bot[bot]
64cc1ef764 bot(lockfile): update http, kotlin, perl, templ 2024-08-31 06:49:06 +00:00
Christian Clason
fd9663acca
fix(query): explicitly opt-in to legacy behavior (#7101) 2024-08-30 06:57:07 -07:00
Gregory Anders
95933209d4 feat(markdown): set url attribute on image links 2024-08-30 15:07:13 +02:00
nvim-treesitter-bot[bot]
9ac3931bf6 bot(lockfile): update http, ini, leo 2024-08-30 08:35:48 +00:00
Omar Valdez
c15385281c
fix(c_sharp): remove duplicated queries (#7099) 2024-08-30 10:26:22 +02:00
Amaan Qureshi
ba921c9aef feat!: switch upstream Zig parser
The new parser is faster, does not lag while editing, correctly parses
the entire Zig code base, and is much easier to write queries for.
2024-08-30 00:49:33 -04:00
nvim-treesitter-bot[bot]
585860a186 bot(lockfile): update angular, mlir 2024-08-29 06:53:16 +00:00
gh-liu
7a64148896 feat(diff): add folds 2024-08-28 10:05:37 +02:00
nvim-treesitter-bot[bot]
39490604b0 bot(lockfile): update editorconfig, fortran, php, php_only 2024-08-28 08:00:49 +00:00
r001
5071ca777c
fix(leo): update queries (#7086)
* small bugfixes of variables, records, and struct highlighting

* lockfile.json update

* fixed @constant bug, and added self.address, and network.id as builtins to highlight

* fixed associated function calls
2024-08-28 16:51:27 +09:00
Christian Clason
2eb50352c0 ci: bump stylua-action to v4 2024-08-27 14:29:54 +02:00
nvim-treesitter-bot[bot]
aaa119cb1c bot(lockfile): update go, janet_simple, mlir, nix, python, slint, sql, v 2024-08-27 07:33:44 +00:00
Riley Bruins
7499f73794 feat(ruby): string/punctuation highlight improvements 2024-08-26 09:39:01 +02:00
Riley Bruins
54becf661a feat(make): highlight more special characters 2024-08-26 09:38:30 +02:00
r001
d0c5116fa0
feat(leo): add string literals (#7084) 2024-08-26 09:37:52 +02:00
nvim-treesitter-bot[bot]
86a9b67f1a bot(lockfile): update asm, gotmpl, helm, leo, perl 2024-08-26 06:50:11 +00:00
r001
f9b76256c3
feat(leo): async keyword (#7083)
* async keyword added

* lockfile update
2024-08-25 21:24:54 -07:00
Riley Bruins
397982d197 chore: remove r locals executable status 2024-08-25 22:50:39 +02:00
Dimitris Dimitropoulos
39023b61d2 feat(matlab): capture comment sections
Signed-off-by: Dimitris Dimitropoulos <dimitris.dimitropoulos00@gmail.com>
2024-08-25 22:42:41 +02:00
LeviOP
bef7ec6f7a feat(proto): add indents 2024-08-25 10:39:07 +02:00
nvim-treesitter-bot[bot]
081dfa6e0f bot(lockfile): update comment, perl, qmljs, swift, tact, vhs 2024-08-25 06:47:21 +00:00
Novus Nota
e085c614fc feat(tact): update parser and queries 2024-08-24 15:17:09 +02:00
nvim-treesitter-bot[bot]
0f6be79962 bot(lockfile): update java, nix, perl, pod 2024-08-24 07:53:04 +00:00
nvim-treesitter-bot[bot]
04401b5dd1 bot(lockfile): update angular, apex, cuda, http, norg, sflog, soql, sosl, swift 2024-08-23 06:49:21 +00:00
Tobias Schmitz
8724e7d028 feat(rust): add highlight for shorthand_field_identifier 2024-08-22 09:11:55 -04:00
nvim-treesitter-bot[bot]
6ed65c3a1d bot(lockfile): update perl 2024-08-22 06:49:56 +00:00
nvim-treesitter-bot[bot]
0b8b78f9d0 bot(lockfile): update cuda, glimmer, javascript, matlab, styled, templ 2024-08-21 07:19:40 +00:00
Alejandro
0fd6d32482
feat(http): switch to new parser version (#7063) 2024-08-21 09:08:45 +02:00
Christian Clason
6699eae8ba Revert "ci: skip updates for javascript"
This reverts commit a7a3b9c10e.
2024-08-20 19:49:18 +02:00
nvim-treesitter-bot[bot]
cfd2095e66 bot(lockfile): update groovy, matlab 2024-08-20 06:50:36 +00:00
Christian Clason
1e860567fb chore: remove obsolete CODEOWNERS 2024-08-19 09:54:50 +02:00
nvim-treesitter-bot[bot]
26e7fdb243 bot(lockfile): update c, comment, cpp, embedded_template, kotlin, latex, php, php_only, ruby, scala, templ 2024-08-19 07:13:43 +00:00
Caleb White
ec8776ed9e
feat(php): php 8.4 support (#6741)
* chore(php): update maintainers

* feat(php): update php rules, highlight imported functions/consts

* feat(php): indent inside property hooks

* chore: update php and php_only revision
2024-08-18 12:30:04 +02:00
nvim-treesitter-bot[bot]
24ddf60d68 bot(lockfile): update go, html, json, python, rust, swift, vhs 2024-08-18 10:13:34 +00:00
Yorick Peterse
6d74da7f0a
fix(inko): add highlight for boolean patterns (#7050) 2024-08-17 23:04:32 +02:00
nvim-treesitter-bot[bot]
63e1337f1b bot(lockfile): update c, cpp, css, go, idl, nix, python, ruby 2024-08-17 09:16:55 +00:00
nvim-treesitter-bot[bot]
59cc5f3565 bot(lockfile): update jsonnet, liquid, matlab, nickel, nix 2024-08-16 06:47:53 +00:00
nvim-treesitter-bot[bot]
bfb50de9cb bot(lockfile): update erlang, goctl, liquid, nix 2024-08-15 06:49:41 +00:00
Hank Jackson
3de418e73d
feat(liquid): add highlights (#7035) 2024-08-14 14:08:32 +02:00
nvim-treesitter-bot[bot]
db92f60ed0 bot(lockfile): update angular 2024-08-14 06:52:49 +00:00
nvim-treesitter-bot[bot]
047ce49ccf bot(lockfile): update groovy, liquid, scala, templ 2024-08-13 06:50:48 +00:00
Omar Valdez
e5a05ba5e2
fix(ini): Fix injection in comments (#7033) 2024-08-11 17:56:24 +02:00
nvim-treesitter-bot[bot]
079af15600 bot(lockfile): update apex, dart, nix, sflog, soql, sosl 2024-08-11 06:48:56 +00:00
nvim-treesitter-bot[bot]
8a966f32c9 bot(lockfile): update sflog 2024-08-10 08:36:10 +00:00
nvim-treesitter-bot[bot]
4d0da6b5ac bot(readme): update 2024-08-10 08:14:07 +00:00
Xi Xiao
9a0db40403
feat(sflog): add sflog (Salesforce debug log) parser and highlights
Co-authored-by: xi xiao <tdxiaoxi2@gmail.com>
2024-08-10 10:05:48 +02:00
nvim-treesitter-bot[bot]
c8f8dd1551 bot(lockfile): update apex, asm, devicetree, idl, julia, soql, sosl, sql 2024-08-10 06:47:21 +00:00
Steve Vermeulen
176e446473
fix(install): vim.uv compatibility shim for 0.9 2024-08-09 13:06:51 +00:00
nvim-treesitter-bot[bot]
3d1f5e7df8 bot(lockfile): update idl, scala 2024-08-09 06:50:01 +00:00
Kyle Minshall
a8535b2329
fix(install): correct arguments for string.format 2024-08-08 15:35:07 +00:00
nvim-treesitter-bot[bot]
2e01c7104c bot(lockfile): update hlsl, idl, nix, pascal, scala, sql, systemtap 2024-08-08 06:53:35 +00:00
DragonBillow
da7b1189ea feat(idl): update highlights
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-08-08 15:53:03 +09:00
Paul Evans
3e0feeb062
feat(perl): update highlights and folds 2024-08-07 13:30:44 +00:00
Oliver Thomas
88aad97312 feat(snakemake): update highlights and indents 2024-08-07 10:18:56 +02:00
nvim-treesitter-bot[bot]
e28614cb1a bot(lockfile): update idl, scala 2024-08-07 06:49:37 +00:00
Sergio Alejandro Vargas
9e66d5c72d fix(julia): macro definition docstrings
Inject markdown in macro definition docstrings.
2024-08-07 00:34:56 +02:00
nvim-treesitter-bot[bot]
c79b068f39 bot(lockfile): update apex, beancount, idl, snakemake, soql, sosl 2024-08-06 06:51:07 +00:00
nvim-treesitter-bot[bot]
1aad04ecde bot(lockfile): update apex, hlsplaylist, muttrc, nix, soql, sosl, tmux, zathurarc 2024-08-05 08:13:48 +00:00
Riley Bruins
558c7ad7bf fix(lua): proper indent after multiline string arg 2024-08-05 10:07:41 +02:00
nvim-treesitter-bot[bot]
d7353a6b72 bot(lockfile): update perl, typespec 2024-08-04 06:47:24 +00:00
Christian Clason
a7a3b9c10e ci: skip updates for javascript 2024-08-03 11:25:48 +02:00
nvim-treesitter-bot[bot]
ddbcc38d46 bot(lockfile): update cuda, hlsl, kotlin, slang, typespec, vim 2024-08-03 09:25:27 +00:00
Riley Bruins
09bad640e4 fix(query): proper indentation after quantifiers 2024-08-02 22:45:14 +09:00
nvim-treesitter-bot[bot]
8453015093 bot(lockfile): update kotlin, nix, perl 2024-08-02 07:37:14 +00:00
DimensionalDot
110a50e371
feat(ecma): inject sql template methods 2024-08-02 09:28:35 +02:00
Omar Valdez
d13f0183ba
feat(highlights): capture wildcard imports as @character.special 2024-08-01 10:24:40 +02:00
nvim-treesitter-bot[bot]
c67881c265 bot(lockfile): update gomod, groovy, powershell, roc 2024-08-01 06:50:08 +00:00
Andrey Chalkin
fcf79acfd1
feat(powershell): added data section name highlights 2024-08-01 08:40:44 +02:00
再生花
929e4739cc
fix(format): field_def inside grouping 2024-08-01 08:40:23 +02:00
Oliver Thomas
65310b64ee fix: prevent double indent from pipes 2024-07-31 11:23:46 +02:00
nvim-treesitter-bot[bot]
8e569bc4b5 bot(lockfile): update http, hurl, matlab, sql, swift 2024-07-31 07:00:56 +00:00
belltoy
9f8c99e980 feat(vrl): Add vrl parser and queries 2024-07-30 22:08:38 +02:00
nvim-treesitter-bot[bot]
cc69a061fe bot(lockfile): update d, just, kotlin, wit 2024-07-30 07:08:33 +00:00
nvim-treesitter-bot[bot]
a7ba147b4b bot(lockfile): update d, kotlin, problog, prolog, rescript 2024-07-29 07:19:42 +00:00
ObserverOfTime
8dbab59773 feat(powershell): highlight shebang 2024-07-29 09:07:47 +02:00
nvim-treesitter-bot[bot]
2d5133f674 bot(lockfile)!: update d, latex
adapt d injections to breaking grammar change
2024-07-28 09:50:54 +00:00
Omar Valdez
45b3f7a8cf fix(strace): Fix comment injection 2024-07-28 11:44:13 +02:00
Omar Valdez
51bba660a8 refactor(queries): Remove quotes from properties in set! directive 2024-07-28 11:43:41 +02:00
Jonas Dujava
88aa09e6e9 feat(latex): capture left/right math delimiters
Capture math delimiters provided by commands such as
`\left` and `\right`.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-28 11:16:09 +02:00
Richard Macklin
ed871c970a
docs(install): fix typo 2024-07-28 11:15:13 +02:00
Riley Bruins
f97e0de005
feat: add rescript parser and queries (#6671) 2024-07-27 17:34:30 +02:00
Riley Bruins
7cec6219c4 fix(query): properly apply predicate injections
I think these have been broken since the query parser update. Basically
the inner node for the string content was preventing injections because
include-children was not set.
2024-07-27 17:17:26 +02:00
Omar Valdez
2b4881286a feat(luap): Make class captures similar to regex captures 2024-07-27 13:31:21 +02:00
Omar Valdez
886b496763 feat(query): Highlight key in set! directive 2024-07-27 13:29:09 +02:00
nvim-treesitter-bot[bot]
1899c8c8ec bot(lockfile): update groovy, idl, latex, php, php_only, sql, systemverilog 2024-07-27 08:55:11 +00:00
Jonas Dujava
e265fec94c fix(latex): environment name should be label
Environment names are captured as `@label` in `(begin)` and `(end)`
nodes, and so should they be when we are defining environments.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-26 14:11:34 +02:00
nvim-treesitter-bot[bot]
e0faad4a9e bot(lockfile): update gleam, idl, sql 2024-07-26 07:16:40 +00:00
nvim-treesitter-bot[bot]
63be47f203 bot(lockfile): update erlang, janet_simple, latex, m68k, matlab 2024-07-25 07:25:39 +00:00
Gregory Anders
96c5cb2334 feat(vimdoc): set url attribute for URLs 2024-07-24 21:42:13 +02:00
nvim-treesitter-bot[bot]
c760e4037c bot(lockfile): update heex, perl, sql 2024-07-24 07:21:42 +00:00
Dheepak Krishnamurthy
a0732ca9f0 feat(julia): Add syntax highlighting for markdown and bash prefixed_string_literals 2024-07-24 09:14:14 +02:00
Gregory Anders
b1e88723ee feat(html): set url attribute for HTML URLs 2024-07-24 09:13:19 +02:00
Gregory Anders
205102f372 feat(markdown): set url attribute on plain URLs
Setting the url attribute on actual URLs will cause Nvim to use the OSC
8 sequence on the entire URL, which enables terminal emulators to detect
the URL even when it is wrapped.

The (uri_autolink) node must use an #offset! directive to strip the
surrounding <> characters from the URL.
2024-07-24 09:13:12 +02:00
nvim-treesitter-bot[bot]
9d252d0021 bot(lockfile): update editorconfig, latex 2024-07-23 07:50:43 +00:00
Jonas Dujava
3fa183e34e feat(latex): improve parameters
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-23 09:35:25 +02:00
nvim-treesitter-bot[bot]
820b14a34c bot(lockfile): update git_rebase, perl, sourcepawn, sql, typst 2024-07-23 07:12:51 +00:00
Jonas Dujava
803e5bd14d fix(latex): more @nospell
Apply `@nospell` to command/label names, paths, etc.
Where appropriate, turn spelling off for the whole node.

Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-23 09:00:11 +02:00
Riley Bruins
49452ab703 fix(zig): add some missing highlights 2024-07-23 08:59:50 +02:00
Christian Clason
5f5077f8f7 fix(parsers): powershell maintainer 2024-07-22 23:16:28 +02:00
Andrey Chalkin
c5b3560306
feat: add powershell language 2024-07-22 23:14:45 +02:00
Jonáš Dujava
4ee9f12ff5
refactor(latex): deduplicate captures, reorder 2024-07-22 23:12:18 +02:00
Jean-Sebastien Trottier
debf5816ee fix(install): abort installation using git in active git session
Problem: Installing a parser using git in an active git session (e.g.,
when editing a commit message) can corrupt the corresponding repository.

Solution: Check for typical environment variables first and abort
installation if found.
2024-07-22 13:11:11 +02:00
DragonBillow
468f6ed66b fix(idl): fix break changes
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-07-22 12:40:27 +02:00
qvalentin
4075376a25 feat(gotmpl,helm): add locals (wip) 2024-07-22 12:33:22 +02:00
qvalentin
dfd047d15f feat(gotmpl,helm): add fold queries 2024-07-22 12:33:22 +02:00
nvim-treesitter-bot[bot]
aca4432ef6 bot(lockfile): update idl, latex 2024-07-22 08:18:05 +00:00
Tyler Miller
2883d0c03f
fix(lua): use @property for keys in table literals (#6956)
`@property` should be used for key-value pairs, while `@variable.member`
is used for field-access/index-expressions. Using different captures
also provides the benefit of allowing the two to be highlighted
differently.
2024-07-21 18:12:27 -07:00
Jonas Dujava
002537a3e3 feat(latex): simplify captures of font changing
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-22 00:07:52 +02:00
Oliver Thomas
733fa85db2 feat(snakemake): add wildcard flag 2024-07-21 11:15:51 +02:00
nvim-treesitter-bot[bot]
aba69e495b bot(lockfile): update c, cpp, cuda, glsl, snakemake, svelte, swift, tsx, typescript 2024-07-21 09:03:06 +00:00
Jonáš Dujava
625e7e58d0
feat(latex): capture & as @punctuation.delimiter
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-21 10:53:59 +02:00
nvim-treesitter-bot[bot]
667b9dbbfa bot(lockfile): update beancount, gleam, idl 2024-07-20 08:39:02 +00:00
Tyler Miller
e8d74461da fix(gitignore): hl/capture non-special pattern chars
Capture regular, non-special characters (as `@string.special.path`)
allowing them to be highlighted.
2024-07-20 10:32:01 +02:00
Omar Valdez
b3c54c3188
feat(bash): readline injections (#6947)
* feat(bash): Readline injections

* Update queries/bash/injections.scm

Co-authored-by: Riley Bruins <ribru17@hotmail.com>

---------

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-07-19 21:53:27 -07:00
Jonas Dujava
4e387dd478 feat(latex): capture placeholder as variable
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-19 17:20:44 +02:00
Jonas Dujava
d9ea5035d4 feat(latex): add additional include highlights
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-07-19 14:53:39 +02:00
nvim-treesitter-bot[bot]
0ffe627223 bot(lockfile): update cuda, idl 2024-07-19 06:51:51 +00:00
hrzlgnm
de8d91d0ef
docs(utils): fix deprecation notice
Co-authored-by: Valentin Batz <vbatz@linetco.com>
2024-07-18 18:54:05 +02:00
nvim-treesitter-bot[bot]
d78ab90f8e bot(lockfile): update angular, djot, slint, vhdl 2024-07-18 15:56:49 +00:00
Christian Clason
35fa869b53 feat(latex): injections for luacode, asy{def} environments 2024-07-18 17:46:01 +02:00
nvim-treesitter-bot[bot]
874b99065b bot(lockfile): update djot, fortran, scala 2024-07-18 06:58:33 +00:00
John-Philip Taylor
355af0c8ce
feat: add vhdl parser and queries 2024-07-18 08:46:12 +02:00
Riley Bruins
c80d0d9ca9
fix(filetype): add missing shorthands for Perl, Uxn Tal 2024-07-18 08:44:56 +02:00
wzy
0758155d4d
feat(parsers): register python for gyp files 2024-07-17 16:59:58 +00:00
Christian Clason
dd7bb795c4 docs(readme): recommend builtin foldexpr 2024-07-17 18:04:33 +02:00
Christian Clason
804a6473df fix(install): pass --show-error to curl 2024-07-17 16:42:26 +02:00
Christian Clason
f649c2ff75 fix(php): correct line endings 2024-07-17 15:45:25 +02:00
nvim-treesitter-bot[bot]
7a38515741 bot(lockfile): update facility, idl, templ 2024-07-17 08:25:51 +00:00
Riley Bruins
14dff71d38 feat(wit): add folds, missing highlights
References:

https://github.com/liamwh/tree-sitter-wit/blob/main/grammar.js
79f3646325/crates/extension_api/wit/since_v0.0.4/extension.wit
436ad58923/wit/mqtt.wit
a068bfe064/crates/wasi-nn/wit/wasi-nn.wit
2024-07-17 09:48:23 +02:00
Vladimir Levin
067415e971
feat: add nginx 2024-07-17 09:47:59 +02:00
Dennis van den Berg
0d5e1214a5 feat: add indentation queries for angular 2024-07-17 09:52:47 +09:00
Dennis van den Berg
276c343b6b feat!: update angular parser to new major
BREAKING CHANGE: This changes the capture groups for all Control Flow
statements.
2024-07-17 09:52:47 +09:00
Dennis van den Berg
03883041b2 feat: change angular filetype to vim's htmlangular 2024-07-17 09:52:47 +09:00
Bryan Kenote
3076b9a98a
fix(facility): add highlight for event keyword 2024-07-16 19:03:58 +02:00
Riley Bruins
4836c1df65 fix(lua): indent functions before they are closed
Fixes #6786
2024-07-16 13:17:36 +02:00
Grace Petryk
f16a775830
feat(python): Improved python indentation (#6859)
* feat: improve python indentation

* use lua-match

* revert concatenated_string changes, handle function def hanging indents

* lint

* add delimiters to param query

* add test cases
2024-07-16 20:13:41 +09:00
Vincent Rischmann
a8c1f36d2c
feat(templ): add folds 2024-07-16 10:19:41 +02:00
nvim-treesitter-bot[bot]
d9aa422863 bot(lockfile): update angular, facility, idl, ocaml, ocaml_interface, templ 2024-07-16 07:50:46 +00:00
nvim-treesitter-bot[bot]
a6b2f4ecc8 bot(lockfile): update earthfile, python, swift 2024-07-15 07:08:37 +00:00
nvim-treesitter-bot[bot]
7f4ac67877 bot(lockfile): update erlang, groovy, typst 2024-07-13 09:07:25 +00:00
nvim-treesitter-bot[bot]
972aa544ef bot(lockfile): update http, idl, nim 2024-07-12 09:18:03 +00:00
nvim-treesitter-bot[bot]
465840f8c1 bot(lockfile): update idl, scfg 2024-07-11 08:07:11 +00:00
Christian Clason
4068e1c096 fix(scfg): switch to github mirror 2024-07-10 23:05:24 +02:00
zhaown
656ac24233
feat(goctl): add indents 2024-07-10 18:36:01 +02:00
DragonBillow
d5969c481e
feat(idl): update parser and queries (#6901)
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-07-10 14:05:13 +02:00
nvim-treesitter-bot[bot]
e9ec8b4658 bot(lockfile): update idl, swift 2024-07-10 07:39:34 +00:00
Christian Clason
a64ce9f989 feat(parser): register common short-hand as filetypes
Problem: Cannot use short-hands for @injection.language (e.g., `py` for
Python).

Solution: Register common short-hand as filetypes for some languages.

List taken from https://github.com/helix-editor/helix/blob/master/languages.toml

Also remove deprecation custom filetype->parser mapping.
2024-07-10 09:30:41 +02:00
nvim-treesitter-bot[bot]
c1ad655b6a bot(lockfile): update c_sharp, liquid, mlir, tsx, typescript 2024-07-09 07:28:58 +00:00
再生花
53c79ddc28
fix(php): do not indent after class/enum decl 2024-07-09 10:12:29 +09:00
Wadii Hajji
ebdffa78bd
fix(ruby): highlight "&." as @punctuation.delimiter (#6887) 2024-07-08 06:58:24 -07:00
nvim-treesitter-bot[bot]
66ec1b3c4e bot(lockfile): update editorconfig, fortran, hare, idl, mlir, nim, php, php_only, python, squirrel, tlaplus 2024-07-08 08:51:38 +00:00
nvim-treesitter-bot[bot]
55b30b908e bot(readme): update 2024-07-08 08:46:31 +00:00
Christian Clason
b149008257 fix(parsers): keep .git suffix for gitlab urls 2024-07-08 10:37:00 +02:00
Karl Yngve Lervåg
64f6f0ab4e fix(hurl): multiline injection query needs injection.combined
fixes: #6882, https://github.com/pfeiferj/tree-sitter-hurl/issues/10
2024-07-07 18:42:25 +02:00
Liam Woodleigh-Hardinge
b7c0dbbe7d
fix(wit): highlight <> as brackets (#6879) 2024-07-07 08:57:06 -07:00
nvim-treesitter-bot[bot]
adf6730dc5 bot(readme): update 2024-07-07 15:38:13 +00:00
Christian Clason
b32fb41284 fix(parsers): drop .git suffix from URLs 2024-07-07 17:29:49 +02:00
zhaown
f9aa4f060e
feat: add goctl parser and queries 2024-07-07 17:27:21 +02:00
Pete Matsyburka
ad43c7f19e
feat(ruby): highlights for special methods (#6735) 2024-07-08 00:24:57 +09:00
Riley Bruins
a8c082b4f5
feat(jsx): apply HTML-based highlight improvements (#6867) 2024-07-05 22:46:34 +09:00
Phạm Huy Hoàng
74dc34a7fa fix(go): narrow down } usage 2024-07-05 22:35:19 +09:00
Abhinav Natarajan
2d917106d1 fix(indent): indent empty lines correctly
fix(indent):
2024-07-05 22:35:19 +09:00
Riley Bruins
55a13862cd feat(nix): indentation queries 2024-07-05 15:13:25 +02:00
nvim-treesitter-bot[bot]
ee29084ce6 bot(lockfile): update editorconfig, javascript, wit 2024-07-05 07:33:32 +00:00
Christian Clason
f197ce27d9 docs(readme): update outdated information 2024-07-05 09:30:49 +02:00
Riley Bruins
f7c05e3e05
fix(html): correct the link label highlight (#6866)
Unlike the `href` attribute, the inner text of the `a` tag is the label
of the link, not the actual URL.
2024-07-05 11:09:26 +09:00
Riley Bruins
f0dbe18000 feat(jsdoc): add missing highlights 2024-07-04 19:54:22 -04:00
nvim-treesitter-bot[bot]
f2f828c5e9 bot(readme): update 2024-07-04 19:25:04 +02:00
Omar Valdez
5d1646893a
feat: editorconfig parser and queries 2024-07-04 20:23:44 +03:00
nvim-treesitter-bot[bot]
acc1708b96 bot(lockfile): update c_sharp, erlang 2024-07-04 06:47:34 +00:00
Riley Bruins
fa611f612a
fix(ecma): indent single-line if statements (#6846)
Fixes #5898.
2024-07-04 11:13:16 +09:00
Christian Clason
caf275382f fix(prolog): switch to github mirror 2024-07-03 13:31:26 +02:00
nvim-treesitter-bot[bot]
8a04f1aaa9 bot(lockfile): update idl, rbs, v 2024-07-03 10:11:53 +00:00
DragonBillow
fe5c581ed5
feat(idl): update idl parser and queries (#6854) 2024-07-03 12:00:51 +02:00
Christian Clason
7adae51ff3 fix(turtle): update parser and queries
also update changed user names
2024-07-03 10:20:49 +02:00
Kai Moschcau
f1a4a75005
feat(gotmpl,helm): raise highlight priorities (#6712) 2024-07-03 16:59:18 +09:00
Derek Gustafson
0209151fd2
feat(elm): add folds queries 2024-07-03 09:49:13 +02:00
Stefano Volpe
6cd4ce6cab
feat: add prolog and problog parser and queries (#6810) 2024-07-02 16:57:30 +02:00
Omar Valdez
e0d6c7643d feat(diff): Highlight comments 2024-07-02 09:08:51 +02:00
nvim-treesitter-bot[bot]
495c93b0d4 bot(lockfile): update git_rebase, gitcommit 2024-07-02 06:48:06 +00:00
DragonBillow
ffd7725102 feat(idl): add indents
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-07-01 16:25:07 +02:00
Bruno BELANYI
699766a0b9
feat(bp): update parser and queries (#6843) 2024-07-01 14:19:08 +00:00
nvim-treesitter-bot[bot]
4ee5fdd666 bot(readme): update 2024-07-01 12:09:54 +02:00
DragonBillow
020c5bc03f
fix(idl): fix author name (#6840) 2024-07-01 10:06:12 +00:00
nvim-treesitter-bot[bot]
5d2473d05c bot(lockfile): update angular, diff, dtd, idl, ocaml, ocaml_interface, scala, xml 2024-07-01 09:47:53 +00:00
DragonBillow
1e546c0f5e feat(idl): update highlight
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-07-01 11:37:38 +02:00
nvim-treesitter-bot[bot]
7ff0b8d3d2 bot(readme): update 2024-06-30 08:22:26 +00:00
Vladimir Levin
acea74c514
feat: robots.txt support 2024-06-30 11:12:36 +03:00
nvim-treesitter-bot[bot]
533da572ae bot(lockfile): update http, matlab, scala 2024-06-30 06:46:25 +00:00
nvim-treesitter-bot[bot]
e70472794d bot(readme): update 2024-06-30 06:10:32 +00:00
Riley Bruins
58733401e3
chore: add maintainer for r (#6833) 2024-06-30 15:00:04 +09:00
Riley Bruins
f0e3b5c5fe fix(r): resolve highlight regressions 2024-06-29 09:26:53 +02:00
nvim-treesitter-bot[bot]
fa19150d00 bot(lockfile): update templ, zig 2024-06-29 06:45:57 +00:00
Phạm Huy Hoàng
3e535e826d fix(r): adapt indent queries
- Anchor parameter query. There's no need for multiple indent.align
  captures
- Narrow down binary_operator indent.begin. From tree-sitter-r corpus
  and highlight tests, this seems to be appropriate.
2024-06-28 18:13:12 +02:00
nvim-treesitter-bot[bot]
c11d49cbef bot(lockfile): update idl, xcompose 2024-06-28 08:13:40 +00:00
Vladimir Levin
f8d27e1abf
fix: use terraform parser for terraform-vars 2024-06-28 10:08:49 +02:00
ObserverOfTime
ec6307e5b0 refactor(python): merge docstring queries 2024-06-28 10:06:52 +02:00
Turiiya
cf7baac35a
fix(v): anchor comment highlight query
* fix(v): use `source_file` as parent node for comment highlight query

* fix: correctly recognize doc comment
2024-06-28 12:33:06 +09:00
nvim-treesitter-bot[bot]
984604288d bot(lockfile): update erlang, janet_simple, m68k 2024-06-27 13:55:35 +00:00
nvim-treesitter-bot[bot]
8caffadee1 bot(readme): update 2024-06-27 15:34:19 +02:00
Christian Clason
5373c90c55 feat(r)!: update parser and queries 2024-06-27 15:31:41 +02:00
gbprod
173515a5d2 feat(gitcommit): remove overflow rule
This commit remove the highlight of the overflow node in gitcommit syntax
introduced [by this PR](https://github.com/nvim-treesitter/nvim-treesitter/pull/6222).
This node will be removed when [this PR](https://github.com/gbprod/tree-sitter-gitcommit/pull/68)
will be merge.
2024-06-27 09:21:30 +02:00
nvim-treesitter-bot[bot]
c723b87ef6 bot(lockfile): update gitcommit, hyprlang, m68k, sparql 2024-06-27 06:51:06 +00:00
Turiiya
53b32a6aa3 feat(v): add shebang query 2024-06-26 10:54:01 +02:00
nvim-treesitter-bot[bot]
d467f7d561 bot(lockfile): update janet_simple, roc, swift 2024-06-26 06:59:40 +00:00
Christian Clason
09700b88b4 feat(tact): update parser and queries 2024-06-25 09:59:32 +02:00
nvim-treesitter-bot[bot]
0c7a0ddaf4 bot(lockfile): update just, nickel, ralph 2024-06-25 07:33:54 +00:00
nvim-treesitter-bot[bot]
d4a888ae3c bot(lockfile): update systemverilog 2024-06-24 08:46:54 +00:00
nvim-treesitter-bot[bot]
cebb7e7c5b bot(lockfile): update hcl, luau, terraform 2024-06-24 07:56:56 +00:00
nvim-treesitter-bot[bot]
9d80c1497e bot(readme): update 2024-06-23 18:38:03 +02:00
zhangwwpeng
b5b64ac9fb
feat: add systemverilog support (#6775) 2024-06-23 18:36:01 +02:00
Christian Clason
0941c1147a fix(latex): correct lockfile hash 2024-06-23 17:48:31 +02:00
Jonas Dujava
c233773abf feat(latex): improve hyperlinks
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
2024-06-23 16:40:32 +02:00
Christian Clason
55d5772a6c feat(latex): highlight hyperlinks 2024-06-23 12:16:51 +02:00
Riley Bruins
9581d86f97 fix(verilog): various touch-ups 2024-06-23 12:12:42 +02:00
nvim-treesitter-bot[bot]
a8904e7f83 bot(lockfile): update cuda, glsl, hlsl, janet_simple, latex, scala, slang, wgsl_bevy 2024-06-23 09:54:52 +00:00
nvim-treesitter-bot[bot]
122b4d3db1 bot(lockfile): update erlang, janet_simple, nix 2024-06-22 09:19:57 +00:00
nvim-treesitter-bot[bot]
b967bbc27b bot(lockfile): update roc, ruby 2024-06-21 08:11:38 +00:00
nvim-treesitter-bot[bot]
7b04b398f8 bot(lockfile): update cmake, earthfile, idl, mlir 2024-06-20 07:00:34 +00:00
sogaiu
66ae8748fd
feat(janet): update highlights (#6789)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2024-06-19 22:27:34 +09:00
nvim-treesitter-bot[bot]
53881422f6 bot(lockfile): update djot, tsx, typescript 2024-06-19 07:34:55 +00:00
Riley Bruins
4bbd2e72f8 fix(cooklang): add some missing highlights 2024-06-18 14:18:56 -04:00
nvim-treesitter-bot[bot]
2e9c346aef bot(lockfile): update cpp, hcl, swift, terraform 2024-06-18 06:58:07 +00:00
Sarath Addanki
c29989f5d7
apex: highlights: change the constant variable order to recognize it (#6779) 2024-06-17 23:29:06 +09:00
Louis Pilfold
09953e394b
fix(gleam): remove incorrect builtin highlight (#6757) 2024-06-17 07:23:06 -07:00
Jannik Buhr
f7edd3f5f6
fix(markdown): conceal nbsp entity as space (#6778) 2024-06-17 11:04:00 +02:00
nvim-treesitter-bot[bot]
382c80b575 bot(lockfile): update corn, earthfile, hcl, janet_simple, rbs 2024-06-17 07:42:13 +00:00
nvim-treesitter-bot[bot]
71a8e8b4b6 bot(lockfile): update earthfile, hyprlang, janet_simple, svelte, twig, v 2024-06-16 09:34:09 +00:00
Riley Bruins
4d112977c7 feat(corn): more highlights, comment injections 2024-06-15 13:04:52 -04:00
Riley Bruins
c911f19d91 feat(scala): add some missing highlights 2024-06-15 13:03:22 -04:00
nvim-treesitter-bot[bot]
9916da1bfd bot(lockfile): update qmljs, v 2024-06-15 12:14:54 +00:00
Christian Clason
47994d7e89 feat(roc): switch to active upstream 2024-06-15 13:57:36 +02:00
Christian Clason
921763b23d feat(hyprlang): update parser and queries 2024-06-15 13:38:40 +02:00
Riley Bruins
9d68e876cc feat: more comment injections 2024-06-15 10:40:34 +02:00
nvim-treesitter-bot[bot]
8dd40c7609 bot(lockfile): update snakemake, zig 2024-06-14 06:56:05 +00:00
Riley Bruins
bb0eb73014 fix(markdown): capture entire heading line 2024-06-14 08:35:26 +02:00
Riley Bruins
e5af2d7fdc
fix(gitcommit): correct the file path capture (#6765) 2024-06-14 14:07:43 +09:00
Oliver Thomas
cdc613c630 feat(snakemake): add rule_inheritance to folds 2024-06-13 15:12:19 -04:00
nvim-treesitter-bot[bot]
9636d5a3f4 bot(lockfile): update rego, solidity 2024-06-13 08:34:45 +00:00
Charles Chiu
26171d8f10 chore: clean duplicate node 2024-06-12 10:25:02 +02:00
nvim-treesitter-bot[bot]
f29c2d9867 bot(lockfile): update liquid 2024-06-12 06:46:15 +00:00
Omar Valdez
9a7ad2ff7a
feat(htmldjango): highlight keyword arguments for tags (#6660) 2024-06-10 19:07:48 -07:00
Colin Bruins
eb59a3df50
feat(swift): highlight shebang lines 2024-06-10 13:05:10 -04:00
Riley Bruins
94f9a46b37
feat(rust): fold block expressions (#6754) 2024-06-10 09:44:00 -07:00
Johannes R. L. Dickenson
3b5704440f
fix(commonlisp): correctly highlight quotes (#6565) 2024-06-10 08:15:41 -07:00
nvim-treesitter-bot[bot]
b47dde81a0 bot(lockfile): update doxygen 2024-06-10 06:47:35 +00:00
Omar Valdez
da7ea8f335 feat(markdown_inline): No spell for emails and HTML entities 2024-06-10 08:38:59 +02:00
Caleb White
9ebc589329 fix(php): remove recursive member_call_expression indent branch 2024-06-09 10:09:43 +02:00
nvim-treesitter-bot[bot]
3fc41e145c bot(lockfile): update kdl, luap, sourcepawn, swift, vimdoc 2024-06-09 06:45:31 +00:00
nvim-treesitter-bot[bot]
c1e1e24b64 bot(lockfile): update erlang, php, php_only, sql, swift 2024-06-08 06:46:07 +00:00
nvim-treesitter-bot[bot]
c5cbd3ec74 bot(lockfile): update eds, koto, php, php_only 2024-06-07 06:50:20 +00:00
Λlisue (Ali sue・ありすえ)
3a74b58310
docs(readme): fix example of the parser install directory (#6737) 2024-06-06 15:56:50 +02:00
nvim-treesitter-bot[bot]
fc9ee79f64 bot(lockfile): update cmake, elixir, pymanifest, requirements, sql 2024-06-06 07:32:22 +00:00
nvim-treesitter-bot[bot]
49e4e2b4b6 bot(lockfile): update earthfile, nickel 2024-06-05 06:46:42 +00:00
Christian Clason
69e41a2c14 feat(vimdoc): update parser and queries 2024-06-04 22:14:45 +02:00
seanbreckenridge
5a8e9644c4
feat(jq): update builtin functions (#6726) 2024-06-04 12:02:35 +02:00
nvim-treesitter-bot[bot]
048c14140c bot(lockfile): update cpp, djot 2024-06-04 08:33:36 +00:00
Arstoien
512e2122e0
feat: add ralph (#6675)
https://github.com/alephium/tree-sitter-ralph
2024-06-04 09:49:26 +02:00
nvim-treesitter-bot[bot]
121bf634fe bot(lockfile): update arduino, earthfile, koto, rego, slint, sql, teal, typespec 2024-06-04 07:47:01 +00:00
Christian Clason
a80fe081b4 feat(predicates)!: rename has-type to kind-eq to align with Helix
No point in having a different name for the same predicate.
2024-06-02 12:07:58 +02:00
nvim-treesitter-bot[bot]
deb76a224a bot(lockfile): update styled 2024-06-02 06:46:25 +00:00
nvim-treesitter-bot[bot]
979beffc1a bot(lockfile): update c, fennel, janet_simple, rego, slint 2024-06-01 06:48:35 +00:00
Riley Bruins
f9773e4a5e
test: fix tests broken after 0.10 update (#6714) 2024-06-01 12:33:56 +09:00
nvim-treesitter-bot[bot]
b7d50e59b1 bot(lockfile): update earthfile, idl, javascript 2024-05-31 06:45:56 +00:00
player01osu
f770df9c8c fix(odin): highlight types with underscores 2024-05-30 22:25:35 -04:00
nvim-treesitter-bot[bot]
5c924407cf bot(lockfile): update idl, julia, nickel, sourcepawn 2024-05-30 06:46:49 +00:00
nvim-treesitter-bot[bot]
b91ae14fc3 bot(lockfile): update cuda, gleam, glsl, hlsl, ini, slang, zathurarc 2024-05-29 07:33:57 +00:00
Christian Clason
5aadae3f54 fix(koto): update parser and queries 2024-05-29 09:17:04 +02:00
nvim-treesitter-bot[bot]
ea2b137f35 bot(lockfile): update inko, nickel, solidity, swift, zathurarc 2024-05-28 06:46:02 +00:00
nvim-treesitter-bot[bot]
aa02427dfe bot(lockfile): update eds, solidity 2024-05-27 06:49:20 +00:00
nvim-treesitter-bot[bot]
245da4eb2e bot(lockfile): update c, earthfile, query, solidity 2024-05-26 10:11:59 +00:00
Amaan Qureshi
d551bc70d5
fix(cpp): update parser and queries (#6687) 2024-05-26 12:00:26 +02:00
Christian Clason
ba149fa3b1 fix(solidity): re-enable unbroken operators 2024-05-26 11:59:56 +02:00
Amaan Qureshi
488e39a8f1 feat(query): adapt to upstream changes 2024-05-26 00:24:03 +02:00
Christian Clason
d3acd105bd ci(lint): make sure query parser is installed from this repo
Problem: format-queries.lua in CI uses the bundled query parser from
Neovim, meaning breaking changes are not reflected in tests.

Solution: Install nvim-treesitter in the lint workflow and use it to
install the query parser.
2024-05-26 00:24:03 +02:00
nvim-treesitter-bot[bot]
78e11ab7ce bot(lockfile): update earthfile, javascript, luau, mlir, perl, query, starlark 2024-05-25 06:47:01 +00:00
nvim-treesitter-bot[bot]
6d56c5f404 bot(lockfile): update ada, erlang, glsl, mlir, ruby, slang, wgsl_bevy 2024-05-24 06:45:42 +00:00
Bruno BELANYI
298a9dd4f8
feat(bp): add support for Android Blueprint (#6626) 2024-05-23 17:30:26 +02:00
nvim-treesitter-bot[bot]
3e454836ce bot(lockfile): update ada, clojure, mlir, templ 2024-05-23 06:46:40 +00:00
nvim-treesitter-bot[bot]
30de5e7e94 bot(lockfile): update idl, rasi, ruby, templ 2024-05-22 06:45:17 +00:00
Amaan Qureshi
14db0433e1 feat(luau): update queries from upstream 2024-05-21 22:46:38 -04:00
Omar Valdez
7add411eba
feat(bash): Highlight declaration and unset command parameters (#6634) 2024-05-22 11:03:22 +09:00
nvim-treesitter-bot[bot]
73fb37ed77 bot(lockfile): update earthfile, idl, inko, janet_simple, luau, odin, perl, requirements 2024-05-21 06:46:18 +00:00
nvim-treesitter-bot[bot]
7c9c5bed83 bot(lockfile): update javascript, liquidsoap, odin 2024-05-20 06:45:45 +00:00
DragonBillow
d184407e33
feat(queries): update idl hightlight (#6625)
Signed-off-by: DragonBillow <DragonBillow@outlook.com>
2024-05-20 11:47:12 +09:00
nvim-treesitter-bot[bot]
ccfa76d4cb bot(lockfile): update php, php_only, swift 2024-05-19 06:44:36 +00:00
nvim-treesitter-bot[bot]
1eabe69bfa bot(lockfile): update earthfile, gotmpl, helm, hlsl, slang, sourcepawn, tlaplus 2024-05-18 06:46:08 +00:00
Christian Clason
00a8cfd562 fixup: adapt to Nvim 0.11 deprecations 2024-05-17 19:52:02 +02:00
Christian Clason
7b6aefa69a fixup: adapt to Nvim 0.11 deprecations 2024-05-17 17:59:40 +02:00
Christian Clason
3d268f9db4 fix: adapt to Nvim 0.11 deprecations 2024-05-17 17:16:44 +02:00
milanglacier
19ac9e8b5c
fix(injection): lower-case language name for markdown strings 2024-05-17 08:34:52 +00:00
nvim-treesitter-bot[bot]
4b8ea9fea6 bot(lockfile): update earthfile, erlang, janet_simple 2024-05-17 07:04:50 +00:00
Christian Clason
4d9fb7d8b0 ci: Nvim 0.10 macos artifact name 2024-05-17 08:57:04 +02:00
nvim-treesitter-bot[bot]
8012b55eee bot(lockfile): update clojure, earthfile, erlang, idl, tlaplus, tsx, typescript 2024-05-16 06:42:10 +00:00
nvim-treesitter-bot[bot]
aa0c7dd296 bot(lockfile): update idl, sourcepawn 2024-05-15 06:46:14 +00:00
Hilmar Wiegand
c26cfc75bc feat(typespec): add support for typespec 2024-05-14 19:38:17 +02:00
nvim-treesitter-bot[bot]
f224fef9d2 bot(lockfile): update idl, php, php_only, wit 2024-05-14 06:46:04 +00:00
Riley Bruins
3aa2e2f374 feat(diff): more comprehensive highlights 2024-05-14 08:27:46 +02:00
Tomasz N
cd626dc48e
feat(php): indent after default_statement 2024-05-14 00:07:42 -04:00
Riley Bruins
14cd8c5db1 feat(slint): highlight enum members as constants 2024-05-14 00:05:51 -04:00
Caleb White
6f54846f2b feat(php): add highlights for scoped_property_access 2024-05-14 00:05:03 -04:00
Riley Bruins
925490e34d feat(zig): misc improvements 2024-05-14 00:04:28 -04:00
Riley Bruins
d5a1c2b0c8 feat: standardize and document export keywords
Many export keywords are captured as `@keyword.import`. This commit
makes it so they are all captured like that, and mentions it in the
documentation.
2024-05-13 09:16:31 +02:00
nvim-treesitter-bot[bot]
0d2c80b4d0 bot(lockfile): update c_sharp, cuda, glsl, hlsl, mlir, solidity, sourcepawn 2024-05-12 08:48:12 +00:00
Christian Clason
c4f65272a9 fix(solidity): disable broken operators 2024-05-12 08:10:03 +00:00
Amaan Qureshi
6587d8e694 feat(c_sharp): update parser & queries 2024-05-11 15:26:30 -04:00
nvim-treesitter-bot[bot]
fa1515b015 bot(lockfile): update dtd, go, idl, javascript, tact, xml 2024-05-11 07:27:23 +00:00
nvim-treesitter-bot[bot]
d6dcfe8887 bot(lockfile): update c, dockerfile, dtd, mlir, templ, typst, xml 2024-05-10 06:54:15 +00:00
Riley Bruins
707b0dcf76 feat(query): pattern injections for new predicates 2024-05-09 11:11:40 +02:00
nvim-treesitter-bot[bot]
1b2f006703 bot(lockfile): update comment, yaml 2024-05-09 08:39:21 +00:00
Yorick Peterse
9e1cda4e71 fix(inko): indent call nodes
This ensures that when you add a new call line in the middle of a call
chain, the line is indented like so:

    foo
      .bar
      .new_line_here
      .baz

Instead of it being indented like so:

    foo
      .bar
    .new_line_here
      .baz
2024-05-09 00:33:22 -04:00
Riley Bruins
1be5aa99e3 feat(rust): underscore match arms, parameters 2024-05-08 08:34:42 -04:00
nvim-treesitter-bot[bot]
3607d9c59c bot(lockfile): update angular, gleam, haskell, idl, javascript, kotlin, odin, ql, tlaplus 2024-05-08 06:52:33 +00:00
Laytan Laats
acefffae27 feat(odin): more lenient towards different function naming convention
PR originally made and merged upstream here: https://github.com/tree-sitter-grammars/tree-sitter-odin/pull/15
2024-05-07 15:11:49 -04:00
Ananda Umamil
db03443582
fix(ecma): template string injections (#6590) 2024-05-07 10:14:15 -07:00
Marc Jakobi
da0efd7398
fix(haskell): update queries and tests for rewritten parser (#6580) 2024-05-07 07:27:44 +00:00
nvim-treesitter-bot[bot]
0319e6eef5 bot(lockfile): update bash, json, lalrpop, phpdoc, qmljs, query, tsx, typescript 2024-05-07 07:12:25 +00:00
Christian Clason
268611e3ec fix(query): update to support supertypes 2024-05-06 13:53:27 +02:00
nvim-treesitter-bot[bot]
20b9a9845d bot(lockfile): update arduino, css, embedded_template, idl, javascript, jsdoc, mlir, perl, php, php_only, regex, ron, ruby, rust, smali, squirrel, swift, tablegen, templ, tsx, typescript, typst, uxntal, yuck 2024-05-06 07:15:07 +00:00
Omar Valdez
fc7657a071
feat(c): inject printf in concatenated strings 2024-05-05 23:16:26 -04:00
Riley Bruins
4b70dde727 feat(lalrpop): highlight touchups, folds 2024-05-06 00:34:10 +02:00
nvim-treesitter-bot[bot]
73fdd31377 bot(lockfile): update css, html, inko, kotlin, swift, tact 2024-05-05 09:27:11 +00:00
Christian Clason
4e21361e15 fix(php): update parser and queries 2024-05-04 10:33:10 +02:00
Riley Bruins
c579d186be fix(markdown): align link with image highlights 2024-05-04 10:19:41 +02:00
nvim-treesitter-bot[bot]
fed32362ad bot(lockfile): update bass, c_sharp, cooklang, haskell, php, php_only, ql, r, solidity, tact, toml 2024-05-04 08:13:57 +00:00
Yorick Peterse
4ae2b452e9
fix(inko): highlighting of numeric call names (#6566)
Inko allows for syntax such as `some_value.42.to_string`, where `42` is
a method name. Similar to other languages that allow this (e.g. Rust),
these numeric names should be highlighted as numbers instead of
identifiers.

To fix this, the query to highlight call names is adjusted to only
highlight "name" and "constant" nodes as the function group, ensuring
the remaining possible node ("integer") continues to use the same group
as regular numbers.
2024-05-03 13:06:54 -07:00
Novus Nota
440f177277
feat: add support for Tact (#6554) 2024-05-03 18:42:51 +02:00
Jakub Donovan
cbf9090a4c
feat(ecma) fold array (#6564) 2024-05-03 15:01:37 +02:00
nvim-treesitter-bot[bot]
96defe1cbd bot(readme): update 2024-05-03 12:02:34 +02:00
nvim-treesitter-bot[bot]
b157b0d412 bot(lockfile): update nasm 2024-05-03 09:54:33 +00:00
Christian Clason
b659a6c2c3 feat(toml): switch to upstream fork 2024-05-03 11:41:49 +02:00
Yorick Peterse
7441b82fe5 feat(inko): add support for Inko 2024-05-03 11:32:15 +02:00
nvim-treesitter-bot[bot]
c0c32abc51 bot(lockfile): update javascript, just, mlir, slint, templ 2024-05-03 08:10:07 +00:00
Brayden Zee
b1f3f02027
fix(java): compact constructor highlights (#6531) 2024-05-02 14:27:26 -07:00
nvim-treesitter-bot[bot]
99d3e799b4 bot(lockfile): update c_sharp, just, liquidsoap, templ 2024-05-02 07:33:30 +00:00
DimensionalDot
9d5cee38b3
feat(ecma): inject async template functions 2024-05-02 01:10:43 -04:00
Levi Frandsen
bbc67f736e fix(html_tags): stop indenting void elements 2024-05-01 17:15:55 +02:00
Kai Moschcau
ead283734b feat(latex, query, tablegen, thrift): disable spelling in shebangs 2024-05-01 15:01:48 +02:00
Kai Moschcau
57476501e2 feat(perl): deactivate spelling in shebangs 2024-05-01 15:01:48 +02:00
Kai Moschcau
e99b79c9c1 feat(perl): activate spelling in comments 2024-05-01 15:01:48 +02:00
Kai Moschcau
60c2b084c2 feat(awk,cmake,python,r,starlark): deactivate spelling in shebangs 2024-05-01 15:01:48 +02:00
Kai Moschcau
46cac01880 feat(bash,fish): deactivate spelling in shebangs 2024-05-01 15:01:48 +02:00
Omar Valdez
c371992bcd feat(git_config): Highlight escape sequences 2024-05-01 08:35:40 -04:00
Riley Bruins
9a47a523e3 feat: import statement folds for common languages 2024-05-01 10:00:01 +02:00
Riley Bruins
f58cae6c22 feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
nvim-treesitter-bot[bot]
f0a1a13316 bot(lockfile): update angular, cpp, djot, html, json5, mlir, python, solidity, supercollider, yaml 2024-05-01 09:57:05 +02:00
Lucas Lopes
1a4274c9e1
feat(svelte): add javascript injection (#6540) 2024-05-01 00:10:19 +09:00
Dennis van den Berg
121d0c4c67
feat(angular): Add support for ICU expressions. (#6288) 2024-04-30 19:14:54 +09:00
nvim-treesitter-bot[bot]
30ed7031af bot(lockfile): update angular, apex, earthfile, fennel, soql, sosl, supercollider, wit, yaml 2024-04-30 09:00:33 +02:00
nvim-treesitter-bot[bot]
160e5d52c8 bot(lockfile): update dart, idl, swift, usd 2024-04-29 09:37:45 +02:00
Andrey Sidorov
c3ab6a5903
make sass to be highlighted in vue files (#6526) 2024-04-29 13:39:02 +09:00
nvim-treesitter-bot[bot]
19f69a5b43 bot(lockfile): update blueprint, idl, python, qmljs, rbs, slang 2024-04-28 16:21:19 +00:00
Liam Woodleigh-Hardinge
223f8dd2e4
fix(wit): update parser and queries (#6528) 2024-04-28 16:13:51 +00:00
Christian Clason
dbbaa3f66e fix(latex): update parser and queries 2024-04-28 11:58:06 +02:00
nvim-treesitter-bot[bot]
eab58e9bff bot(lockfile): update apex, bitbake, cairo, chatito, commonlisp, csv, doxygen, fsh, func, psv, slang, smithy, soql, sosl, tsv, verilog 2024-04-28 09:02:44 +00:00
nvim-treesitter-bot[bot]
a95de26cd7 bot(readme): update 2024-04-28 10:56:06 +02:00
DragonBillow
37ac5f1f9f
feat: add idl 2024-04-28 04:26:39 -04:00
nvim-treesitter-bot[bot]
0883ff0565 bot(lockfile): update cuda, dtd, glsl, hlsl, koto, slang, wgsl_bevy, xml 2024-04-27 08:29:11 +00:00
wzy
ab3b3ff010
feat(gitconfig): add more injections 2024-04-26 21:42:35 -04:00
NullVoxPopuli
01963961b5
feat(glimmer): highlight builtin tags 2024-04-26 21:42:06 -04:00
Omar Valdez
75beaf3632
feat(toml): highlight escape sequences 2024-04-26 21:40:35 -04:00
Omar Valdez
466da58e5b
feat(css): highlight square brackets 2024-04-26 21:40:20 -04:00
nvim-treesitter-bot[bot]
3ef8d25df2 bot(lockfile): update earthfile, mlir, rust, unison 2024-04-26 07:11:59 +00:00
Ian Hobson
19c6b0c4c9
feat: add koto
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-04-25 09:43:41 -04:00
Omar Valdez
df111f886c
feat(rasi): Highlight captures similar to CSS (#6507) 2024-04-25 12:05:06 +02:00
Riley Bruins
28a914eb57 fix(php): parameter and operator touch-ups 2024-04-25 12:04:50 +02:00
Silas Groh
876111c8df
feat(asm): update queries from upstream (#6505)
adds support for TC assembly
2024-04-25 08:49:58 +02:00
nvim-treesitter-bot[bot]
e245f09197 bot(lockfile): update asm, djot, mlir, unison, vhs 2024-04-25 06:48:27 +00:00
Riley Bruins
f0e91fd9b9 feat(qml): add back ecma inheritance
Fixed after the grammar dependencies were updated. This time inheritance
is given to the injections queries also.
2024-04-25 08:23:59 +02:00
nvim-treesitter-bot[bot]
b04ccbd0e0 bot(lockfile): update astro, dart, gleam, liquidsoap, tlaplus 2024-04-24 09:18:22 +02:00
nvim-treesitter-bot[bot]
dc71d94fe2 bot(lockfile): update djot, fennel, mermaid, query, tlaplus, vim, vimdoc 2024-04-23 09:40:20 +02:00
nvim-treesitter-bot[bot]
c1d1b4084e bot(lockfile): update djot, fennel, hlsplaylist, muttrc, swift, tlaplus, tmux, typst, wit, zathurarc 2024-04-22 15:45:05 +00:00
Alexei Mozaidze
46f8778fbf
feat(fennel)!: update parser and queries (#6460) 2024-04-22 11:57:55 +02:00
nvim-treesitter-bot[bot]
075b7594ca bot(lockfile): update arduino, djot, hlsplaylist, muttrc, readline, swift, templ, tmux, unison, zathurarc 2024-04-22 07:11:11 +00:00
Tomasz N
1e20226231
feat(php): fold consecutive imports (#6482)
* feat(php): fold consecutive imports

* Inslude possible comment too

* Format query

* Revert respecting comments
2024-04-21 12:09:52 -07:00
Vir Chaudhury
28aebb7308 feat(astro): add backtick string injections
This also updates a highlight to be more accurate
and bumps the lockfile to fix a few bugs.
2024-04-21 19:03:43 +02:00
nvim-treesitter-bot[bot]
9b1c2096e0 bot(lockfile): update astro, djot, earthfile 2024-04-21 08:19:11 +00:00
virchau13
ea4f6d5175
feat(astro): update injections to match parser rewrite (#6478) 2024-04-20 15:31:54 +02:00
nvim-treesitter-bot[bot]
a005f6fec9 bot(lockfile): update bicep, capnp, cpon, firrtl, hare, luau, po, pony, puppet, ron, smali, squirrel, tablegen, templ, thrift, v, yuck 2024-04-20 13:02:25 +00:00
nvim-treesitter-bot[bot]
eb93c3b2fb bot(lockfile): update astro, earthfile, javascript, norg, ssh_config, wing 2024-04-20 08:50:23 +00:00
ObserverOfTime
d8bf42b262 feat(dockerfile): adapt for parser update 2024-04-20 09:31:58 +03:00
Riley Bruins
bc80862298 fix(vimscript): miscellaneous fixups
- Highlights the `abort` keyword
- Moves `is(not)?` from `@operator` to `@keyword.operator`
- Highlights the `->` operator
2024-04-19 19:12:26 +02:00
nvim-treesitter-bot[bot]
fea5808a58 bot(lockfile): update earthfile, http, javascript, sql, tlaplus, unison, wit 2024-04-19 07:34:56 +00:00
Alejandro
dd0c118596
feat(http): update queries to parser changes (#6467) 2024-04-19 09:24:29 +02:00
Guilherme Soares
baaae36ac7
feat(templ): add highlights (#6464) 2024-04-19 15:00:32 +09:00
nvim-treesitter-bot[bot]
208d504421 bot(lockfile): update earthfile, hlsplaylist, muttrc, nim, norg, tmux, unison, v, zathurarc 2024-04-18 06:52:31 +00:00
Sergio A. Vargas
3e10cffbb2
Julia outer keyword (#6461) 2024-04-17 20:59:37 +02:00
nvim-treesitter-bot[bot]
b350369740 bot(lockfile): update earthfile, groovy, norg, scala, slint, templ, v 2024-04-17 06:46:52 +00:00
Colin Kennedy
037c6af78f
fix(python): captures inner string contents with spell 2024-04-17 04:23:55 +00:00
Riley Bruins
4c84b83108 fix(r): highlight comma separators 2024-04-16 23:03:20 -04:00
nvim-treesitter-bot[bot]
7099c9e531 bot(lockfile): update diff, dtd, scala, slint, vimdoc, wing, wit, xml 2024-04-16 06:43:49 +00:00
Liam Woodleigh-Hardinge
2a95ff1476
feat(wit): Add wit parser (#6428)
feat: Add injections.scm

fix: reverse order of matching

Co-authored-by: 再生花 <hoangtun0810@gmail.com>

fix: lua match for functions

doc: Resolve conflict

fix: Amend incorrect alphabetical order
2024-04-15 11:01:56 +00:00
nvim-treesitter-bot[bot]
1ba86026f7 bot(lockfile): update cpp, cuda, glsl, hlsl, http, julia, norg, slang, unison, v 2024-04-15 09:39:31 +02:00
Mark McCulloh
40e8c92f99
fix(wing): update to new repo (#6446) 2024-04-14 15:53:37 +00:00
Sergio A. Vargas
d2f4c78303
fix(julia): adapt queries to grammar changes (#6429) 2024-04-14 14:23:46 +02:00
Christian Clason
86ac7e9274 ci: replace node with upstream action 2024-04-14 14:10:56 +02:00
Christian Clason
497208692f fix(compile): add /utf-8 flag on win+cl 2024-04-14 14:08:51 +02:00
Christian Clason
bfa217af76 Revert "ci(tests): drop flaky wing parser tests"
This reverts commit f08a9d97f7.

(Fixed by skipping bindings when generating.)
2024-04-14 13:36:22 +02:00
Christian Clason
9a39ec072a fix(install): do not generate bindings when generating parser
These are irrelevant for us and may lead to conflicts with committed
outdated bindings (e.g., wing).
2024-04-14 13:36:22 +02:00
Christian Clason
78bfee7ddb ci(tests): use nvim nightly for win+cl 2024-04-14 13:34:44 +02:00
nvim-treesitter-bot[bot]
65ce6fde2d bot(lockfile): update arduino, cuda, dtd, glsl, hlsl, http, norg, slang, slint, sql, swift, templ, tlaplus, unison, wing, xml, yaml 2024-04-14 11:06:54 +00:00
Christoph Sax
f22f024e78
feat(t32): update queries from upstream (#6440)
Adds support for new node type `elif_block`.
2024-04-14 12:58:21 +02:00
Christoph Sax
2c6ab9a09c feat(t32): use filetype "trace32" 2024-04-14 12:51:05 +02:00
Christian Clason
f08a9d97f7 ci(tests): drop flaky wing parser tests 2024-04-13 20:04:38 +02:00
JoranHonig
3e1d836e0e fix(solidity): adapt queries to parser changes 2024-04-13 20:04:38 +02:00
Dennis van den Berg
ef267f0c28
fix: add highlights for static member expression (#6393) 2024-04-12 14:11:01 +02:00
nvim-treesitter-bot[bot]
7e6b044be8 bot(lockfile): update bash, cpp, earthfile, mermaid, muttrc, pascal, racket, scheme, tcl, v, wing 2024-04-12 08:14:41 +00:00
nvim-treesitter-bot[bot]
b0ac1135fe bot(readme): update 2024-04-11 23:09:12 +02:00
Gaëtan Lehmann
6ae470fd8f
feat: add earthfile parser (#6395)
---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-04-11 23:06:52 +02:00
Bruno BELANYI
5c4892b055
fix(textproto): use 'pbtxt' filetype (#6427)
This is the actual name of the detected filetype.
2024-04-11 18:03:22 +02:00
nvim-treesitter-bot[bot]
b7339ffb9a bot(lockfile): update svelte, v, wing 2024-04-11 07:22:50 +00:00
Laytan
2bad828b48
fix(odin): updates queries from upstream (#6425) 2024-04-10 19:46:25 +09:00
nvim-treesitter-bot[bot]
8253aac419 bot(lockfile): update arduino, asm, go, odin, styled, typst, v, wing, yaml 2024-04-10 11:23:53 +02:00
Amaan Qureshi
3af2d894d4 fix(go): update queries from upstream
also bump templ to match
2024-04-10 11:07:30 +02:00
Amaan Qureshi
d90e11756d
fix(solidity): update queries from upstream (#6424) 2024-04-10 07:22:05 +00:00
Guilherme Soares
c16f66cca0
feat(java): add when operator (#6420) 2024-04-09 12:25:02 -07:00
nvim-treesitter-bot[bot]
fbe76211f4 bot(lockfile): update arduino, c_sharp, dart, elixir, glsl, java, json, mlir, rust, swift, v, wing 2024-04-09 09:13:33 +00:00
Riley Bruins
e9321bb914
feat(nix): misc cleanups + comment injection (#6418)
* fix(nix): highlight strings within interpolations

* feat(nix): move `derivation` to function.builtin

* fix(nix): removes all `priority` workarounds

* feat(nix): arbitrary injections using `#` comments
2024-04-09 14:20:26 +09:00
neuromagus
46b587eb38
fix(c_sharp): highlight raw_string_literal 2024-04-08 17:54:47 -04:00
nvim-treesitter-bot[bot]
11a3584b81 bot(lockfile): update c, commonlisp, cuda, dart, glsl, gstlaunch, hlsl, javascript, roc, slang, t32, v, wgsl_bevy 2024-04-07 03:14:22 -04:00
Amaan Qureshi
53c48a9229 fix(rust): update queries from upstream 2024-04-07 02:58:11 -04:00
nvim-treesitter-bot[bot]
a2d6678bb2 bot(lockfile): update c, cuda, glsl, hlsl, javascript, python, rust, slang, tlaplus, typst, v, wing 2024-04-06 12:10:58 +02:00
David Guevara
e6cd337e30
fix(bash): fix printf injection queries (#6405) 2024-04-05 10:01:19 +02:00
Christian Clason
00debd1fb1 feat(lua): add exec_lua injection for nvim tests 2024-04-05 09:20:31 +02:00
nvim-treesitter-bot[bot]
8183bfa75e bot(lockfile): update c, cpp, latex, rust, wing 2024-04-05 09:00:32 +02:00
ganhaque
1b050206e4
fix(rust): indentation in multi-line tuple pattern (#6402)
* fix(rust): indentation in multi-line tuple pattern

* test(indent): rust - add test for tuple pattern indent
2024-04-04 15:12:31 +00:00
Omar Zeghouani
8f444c9fcb chore: update downstream fish highlights 2024-04-04 12:22:50 +02:00
ganhaque
5489e2150f fix(rust): indentation in multi-line for expression
Fix indentation when the for loop expression is on multiple lines

Example:

previous:

```rust
for (
    abc,
    def
) in thing.iter() {
        // ...
    }
```
new:

```rust
for (
    abc,
    def
) in thing.iter() {
    // ...
}
```
2024-04-04 09:50:27 +02:00
ganhaque
4d4b63692f fix(rust): indentation in tuple type patterns 2024-04-04 09:50:27 +02:00
nvim-treesitter-bot[bot]
bf80e253a8 bot(lockfile): update angular, gitcommit, nix, roc, rst, templ, tlaplus, v, wing 2024-04-04 09:49:26 +02:00
Stephan Seitz
cc0e29727a highlights(cuda): add support for __managed__
See https://github.com/tree-sitter-grammars/tree-sitter-cuda/pull/68
2024-04-03 11:11:01 +02:00
nvim-treesitter-bot[bot]
be4d6e858f bot(lockfile): update cuda, dtd, fish, glsl, hlsl, markdown, markdown_inline, slang, solidity, templ, tlaplus, wing, xml, yaml 2024-04-03 09:58:47 +02:00
nvim-treesitter-bot[bot]
54cf9180a3 bot(lockfile): update commonlisp, dart, glsl, godot_resource, roc, slang, v, wgsl_bevy, wing 2024-04-02 03:00:59 -04:00
Mitchell Hanberg
d31eb5442d feat(elixir): add stab_clause to folds 2024-04-01 16:49:49 -04:00
nvim-treesitter-bot[bot]
30492e7e1c bot(lockfile): update cuda, hlsl, latex, roc 2024-04-01 14:30:58 +00:00
Christian Clason
c51d503868 docs(readme): update roadmap link 2024-04-01 15:06:16 +02:00
Christian Clason
e4ba167af0 fix(latex)!: adjust to dropped parser.c 2024-04-01 14:52:14 +02:00
Jonas Hietala
25ed904c75
feat(djot): update queries (#6375)
- Adjust some highlights to fit context better
- Conceal inline content
- Add locals
- Add folds
2024-04-01 13:42:12 +02:00
Riley Bruins
0bfa0be5e4 fix(nix): highlight ellipsis as builtin parameter
This maintains consistency with a lot of other languages that also have
ellipses as parameter types, which we typically highlight as
`@variable.parameter.builtin`
2024-04-01 11:39:38 +02:00
Riley Bruins
3c996dc9fa feat(nix): misc. operator/punctuation highlights 2024-04-01 11:39:38 +02:00
nvim-treesitter-bot[bot]
ee2785ba6a bot(lockfile): update gdscript, rst, swift, v 2024-04-01 11:20:03 +02:00
nat-418
905fedfa28 feat(roc): add new parser tree-sitter-roc 2024-04-01 11:19:45 +02:00
nvim-treesitter-bot[bot]
1d1d92e94a bot(lockfile): update djot, snakemake, v 2024-03-31 14:32:41 +00:00
Seb Tomasini
ff79725428
fix(uninstall): use correct path separator on windows (#6369) 2024-03-31 11:37:53 +02:00
Oliver Thomas
6e0b031ebb feat(snakemake): add indentation queries 2024-03-30 12:46:43 +01:00
nvim-treesitter-bot[bot]
5127a84407 bot(lockfile): update beancount, liquid, ocaml, ocaml_interface, v, vento, wing 2024-03-30 11:16:35 +00:00
vsajko
c65413f2ac
fix(python): add staticmethod to builtin decorators 2024-03-30 01:30:13 +02:00
Hank Jackson
f84887230a
feat(liquid): add new parser tree-sitter-liquid (#6359)
(templating language)
2024-03-29 09:47:26 +01:00
nvim-treesitter-bot[bot]
29f176c257 bot(lockfile): update mlir, v, wing 2024-03-29 09:45:25 +01:00
nvim-treesitter-bot[bot]
23ba63028c bot(lockfile): update elixir, groovy, tmux, wing, yaml 2024-03-28 08:27:27 +01:00
Jaehwang Jung
07a404570f fix(c): don't highlight preproc_arg
`preproc_arg` is used for the body of `#define` macro definition, which
is not appropriate to highlight with `@function.macro`. In addition,
this region has an injection to C, so it will get highlights anyway.
2024-03-27 14:48:11 +01:00
Caleb White
aa8d8bc600 fix(php): capture break as keyword.repeat 2024-03-27 08:29:44 +01:00
Caleb White
ac1742436c chore(php): move keywords to top of queries 2024-03-27 08:29:44 +01:00
Caleb White
4ebf4ca4fa chore(php): trim down tests 2024-03-27 08:29:44 +01:00
Caleb White
7d938c1c72 fix(php): fix use_{as,instead_of}_clause highlights 2024-03-27 08:29:44 +01:00
Caleb White
1c9a94bd60 fix(php): add missing keyword highlights, fix static keyword 2024-03-27 08:29:44 +01:00
Caleb White
3400788705 feat(php): add highlight tests 2024-03-27 08:29:44 +01:00
nvim-treesitter-bot[bot]
68ba579eb6 bot(lockfile): update djot, hlsplaylist, html, meson, muttrc, query, svelte, tlaplus, tmux, v, vue, wing, zathurarc 2024-03-27 08:26:44 +01:00
Christian Degnbol Madsen
839dec615a feat(julia): broadcast pipe
Add support for capturing function call after a broadcasted pipe.
Currently works for unbroadcasted pipe.
There might be a better more complicated way to do this, since this will capture the broadcasting dot as part of the `@_pipe` capture.
2024-03-26 22:57:50 -04:00
Amaan Qureshi
3d473a4d5d fix(rust): indentation in tuple struct patterns 2024-03-26 22:34:53 -04:00
Riley Bruins
7f31793159
feat(markdown): yaml, toml metadata highlights (#6360) 2024-03-26 17:19:51 +02:00
nvim-treesitter-bot[bot]
1c3fb9eac2 bot(lockfile): update djot, dtd, hyprlang, perl, tlaplus, v, wing, xml 2024-03-26 08:26:08 +01:00
Wojciech Kulik
aa31b8d4cc fix(swift): highlights 2024-03-25 18:49:52 +01:00
nvim-treesitter-bot[bot]
20042941df bot(readme): update 2024-03-25 13:43:42 +00:00
Christian Clason
cf737c341d fix(smali): move to github mirror 2024-03-25 14:36:17 +01:00
datwaft
965f2e7239 style: format query 2024-03-25 10:57:51 +02:00
datwaft
7051a72755 feat(lua): add injections for vim.filetype.add 2024-03-25 10:57:51 +02:00
Joshua Haas
33c9db832b
fix(install): remove extra space during cd (#6355)
breaks xonsh
2024-03-25 08:40:35 +01:00
nvim-treesitter-bot[bot]
8d9736cf3e bot(lockfile): update arduino, djot, haskell, mlir, norg, v, wing 2024-03-25 08:38:49 +01:00
michaelPotter
aa6323e834 feat(bash): align substitutions with expansions
The bash manual[1] considers command and process substitutions to be
forms of expansions, so they should be highlighted the same as other
expansions. This is traditionally how they have been highlighted in the
past too.

[1] https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html
2024-03-24 20:53:58 -04:00
nvim-treesitter-bot[bot]
5e4f959d59 bot(lockfile): update d, djot, hurl, java, markdown, markdown_inline, ocaml, ocaml_interface, swift, t32, v, vimdoc 2024-03-24 17:12:18 +09:00
Christian Clason
8532b1d941 fix(liquidsoap): move scanner to C 2024-03-23 23:01:40 +01:00
nvim-treesitter-bot[bot]
b009aba903 bot(lockfile): update djot, gitcommit, gnuplot, just, latex, php, php_only, v 2024-03-23 08:56:48 +00:00
nvim-treesitter-bot[bot]
a951dcb7ec bot(lockfile): update djot, lalrpop, markdown, markdown_inline, wing 2024-03-22 17:31:12 +00:00
Christian Clason
e2ba4d2af1 feat(tlaplus): move to C scanner 2024-03-22 18:21:36 +01:00
nvim-treesitter-bot[bot]
6e7b41106e bot(readme): update 2024-03-22 08:11:27 +00:00
Noah Bogart
2205694d43 feat: add djot support (#6326)
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-03-22 09:02:35 +01:00
nvim-treesitter-bot[bot]
829f36b0b7 bot(lockfile): update hoon, just, v, wing 2024-03-22 08:35:53 +01:00
Phạm Huy Hoàng
722617e672 refactor(format): drop extra indentation for field 2024-03-21 15:51:26 +01:00
Amaan Qureshi
c28396de30 feat(rust): improve indents 2024-03-21 06:48:53 -04:00
nvim-treesitter-bot[bot]
3a92c540dd bot(readme): update 2024-03-21 09:40:54 +00:00
Tomas Sandven
cf685ce85f Add "just" parser 2024-03-21 10:32:09 +01:00
nvim-treesitter-bot[bot]
f60b33c1e5 bot(lockfile): update asm, c, d, html, svelte, v, wing 2024-03-21 06:47:08 +00:00
Amaan Qureshi
4d76587eec fix(rust): dedent on macro definition end 2024-03-20 19:22:23 -04:00
Levi
3686029591
fix(graphql): end indent after block 2024-03-21 00:00:44 +09:00
Omar Valdez
93a9632b63 feat(sql): highlight fields in column definition 2024-03-20 12:06:16 +01:00
TLW
19b726f9ce
feat(install): add blob filter to git clone command (#6325) 2024-03-20 08:53:05 +01:00
nvim-treesitter-bot[bot]
5c1830262b bot(lockfile): update asm, cmake, glimmer, php, php_only, typst, vimdoc, wing 2024-03-20 08:47:21 +01:00
Noah
03f650705c
Update Clojure highlights to be metadata aware (#6213) 2024-03-19 22:10:41 +01:00
nvim-treesitter-bot[bot]
567a76780c bot(lockfile): update asm, erlang, gleam, html, http, v, wing 2024-03-19 06:42:41 +00:00
Matthew Taylor
2014f8285e
feat: add vento support (#6261) 2024-03-18 10:00:22 +01:00
nvim-treesitter-bot[bot]
e6d80e5efd bot(lockfile): update arduino, cmake, dtd, http, mlir, ocaml, ocaml_interface, slint, swift, vimdoc, wing, xml 2024-03-18 15:51:48 +09:00
gi1242
6a2572c9ed fix(latex): Fold \iffalse..\fi comments 2024-03-17 19:46:21 -04:00
NTBBloodbath
c4e0f290d7 feat(http): switch to new parser version
fix(http): use `@variable.member` for fields

fix(http): keep the comment injection

fix(http): keep `method` capture as `@function.method`

docs(README.md): update HTTP parser maintainers list

feat(http): remove redundant captures

cleanup(http): remove unneedeed highlighting captures
2024-03-18 00:46:59 +02:00
nvim-treesitter-bot[bot]
bb3dd60ebc bot(lockfile): update c_sharp, glimmer, hyprlang, meson, mlir, ocaml, ocaml_interface, swift, v
adapt to ocaml grammar location change
2024-03-17 11:11:05 +00:00
Caleb White
143ca5ce17
feat(php): improve indents in return statements & chained methods 2024-03-16 20:50:13 -04:00
Luckas
df3e6a24ac feat(hyprlang): add bash injections 2024-03-16 20:47:03 -04:00
Riley Bruins
3c7a0e9d94 feat(rust): move pub to @keyword.modifier
Also consolidates most of the captures
2024-03-16 20:45:29 -04:00
ObserverOfTime
5b8458c5aa fix(htmldjango): update highlights 2024-03-16 14:40:59 +00:00
nvim-treesitter-bot[bot]
53891f1492 bot(lockfile): update devicetree, dtd, htmldjango, perl, racket, scheme, v, wing, xml 2024-03-16 14:40:59 +00:00
Jaehwang Jung
f5062ebc8d feat(verilog): @keyword.modifier for lifetime 2024-03-16 20:51:16 +08:00
Jaehwang Jung
8f5513a1f2 feat(rust,lalrpop): @attribute for lifetimes
`@keyword` is only for language-defined keywords.
2024-03-16 20:51:16 +08:00
Jaehwang Jung
5d75359a9a feat(highlights)!: remove non-keyword @type.qualifier
* blueprint: Don't specially highlight template_name_qualifier. This is
  similar to inheritance base class. Other languages don't highlight
  them specially.
* eds: `@type` for all `*Type` keys
* chatito: `@attribute` for variation
2024-03-16 20:51:16 +08:00
Jaehwang Jung
dccf31f9b1 feat(highlights)!: @keyword.storage@keyword.modifier 2024-03-16 20:51:16 +08:00
Jaehwang Jung
998b230a77 feat(highlights)!: keyword @type.qualifier@keyword.modifier 2024-03-16 20:51:16 +08:00
nvim-treesitter-bot[bot]
f878828584 bot(readme): update 2024-03-15 17:31:39 +09:00
Amaan Qureshi
b8f07b30ef feat(yaml)!: switch upstream parser 2024-03-15 03:55:22 -04:00
nvim-treesitter-bot[bot]
16398a6c35 bot(lockfile): update gitcommit, mlir, rnoweb, swift, vimdoc, wing 2024-03-15 15:36:05 +08:00
Luckas
904f373fc4
feat(dot): add indents queries
* feat(dot): add indents queries

* add: tests

* fix: test
2024-03-15 09:18:33 +09:00
Christian Clason
3ae78f376c fix(vimdoc): adapt to breaking Neovim change
Problem:
cb46f6e467 (diff-edf997b0c2d42d31828800641ac1f5a46487fe24a0d46ccf70bcd58a14f3868f)
introduced a regression on how `#set!` behaves with several matches in a
single pattern, breaking conceals in, e.g., taglinks.

Solution: Separate taglink etc. patterns into concealed marker and
contents. Also add URL support for concealed markdown links.
2024-03-14 18:54:22 +08:00
nvim-treesitter-bot[bot]
497fe685ff bot(lockfile): update angular, awk, heex, html, kotlin, markdown, markdown_inline, sql, swift, wing 2024-03-14 17:15:19 +08:00
Mark Skelton
35c1a32b26
* feat(ecma): styled injection for css and keyframes 2024-03-13 23:02:55 +09:00
nvim-treesitter-bot[bot]
76f699dcc8 bot(lockfile): update kotlin, scala 2024-03-13 16:55:29 +09:00
nvim-treesitter-bot[bot]
fec37b6f97 bot(lockfile): update angular, bash, c, cmake, cue, java, javascript, kotlin, lua, php, php_only, python, racket, ruby, rust, scala, scheme, slint, solidity, tlaplus, tsx, typescript, wing 2024-03-13 03:26:20 +00:00
ObserverOfTime
6576041660 feat(vimdoc): highlight modeline 2024-03-13 11:09:54 +08:00
再生花
e73c775aa9 feat(swift): add init/deinit indents
Signed-off-by: Phạm Huy Hoàng <hoangtun0810@gmail.com>
2024-03-13 11:09:42 +08:00
ObserverOfTime
8d3176cfbc fix(scripts): actually skip lockfile updates 2024-03-12 09:55:48 +02:00
Tobias S
9d39f00a95
fix(php): highlight property access using nullsafe operator, move @property to @variable.member 2024-03-11 18:07:15 -04:00
Chad Condon
b781fd0582
fix(c): improve doxygen comment matching (#6278) 2024-03-11 19:02:53 +02:00
nvim-treesitter-bot[bot]
488bec0325 bot(lockfile): update arduino, beancount, ocaml, ocaml_interface 2024-03-10 04:16:33 -04:00
nvim-treesitter-bot[bot]
7ff51f53b0 bot(lockfile): update swift, vim, wing 2024-03-09 16:07:57 +09:00
nvim-treesitter-bot[bot]
57205313dd bot(lockfile): update mlir, wing 2024-03-08 12:52:37 +01:00
Christian Clason
b4553bef58 fix(nickel): update highlights to grammar change 2024-03-08 12:38:27 +01:00
Kai Moschcau
9775d5d7c7
fix(luadoc): @nospell identifiers and keywords 2024-03-07 12:52:02 +02:00
Riley Bruins
a0f18ee98c feat(markdown): highlight link label delimiter 2024-03-07 12:50:12 +02:00
nvim-treesitter-bot[bot]
51d7c36e5f bot(lockfile): update python, wing 2024-03-07 16:54:20 +09:00
nvim-treesitter-bot[bot]
c09932bd2d bot(lockfile): update cue, gitcommit, wing 2024-03-06 09:18:51 +01:00
nvim-treesitter-bot[bot]
cc6b108ea1 bot(lockfile): update gleam, php, php_only, swift, wing 2024-03-05 09:21:40 +01:00
Dennis van den Berg
212b7a504c
fix(angular): typo in capture name (#6249) 2024-03-04 13:05:53 +00:00
nvim-treesitter-bot[bot]
70f03829af bot(lockfile): update puppet, swift, t32, wing 2024-03-04 09:43:02 +00:00
Charles
e479db627c
fix(sourcepawn) update queries to grammar change (#6247) 2024-03-04 09:33:25 +00:00
Phạm Huy Hoàng
63ca90eaa3 feat(swift): add will/didSet indent
Fixes CI error in PR.6237
2024-03-04 00:05:45 +09:00
Christian Clason
3d08cdd741 fix(comment): remove duplicate 'FIXME' 2024-03-03 16:03:26 +01:00
nvim-treesitter-bot[bot]
8a9bef9327 bot(readme): update 2024-03-03 12:16:39 +00:00
qvalentin
9e1f3c3369 feat: add gotemplate and helm parser support 2024-03-03 13:09:20 +01:00
nvim-treesitter-bot[bot]
f8d4e5c1ba bot(lockfile): update arduino, gpg, sourcepawn, ssh_config, vue, wing 2024-03-03 10:32:54 +00:00
Omar Valdez
00bd760a0e
feat(csharp): highlight excape sequences (#6229) 2024-03-03 11:24:46 +01:00
Wu Zhenyu
533ad655ad feat: map automake to make 2024-03-03 12:14:44 +02:00
Christian Clason
99ddf57353
feat(highlights)!: enforce documented captures (#6232)
Problem: Allowing undocumented "secret" (sub)captures makes it harder
to write comprehensive colorschemes and catch inconsistent captures.

Solution: Only allow captures listed in CONTRIBUTING.md. Add useful
(cross-language) subcaptures and drop language-specific or too niche
ones.

Follow-up: Adding further `*.builtin` captures and changing queries to
use them.

Language-specific subcaptures should instead be added in user config or
a custom language plugin.
2024-03-03 11:00:11 +01:00
Christian Clason
22c5a0d833 ci: teach bot about conventional commits 2024-03-03 10:39:15 +01:00
nvim-treesitter-bot[bot]
e3e5ff4ebd Update README 2024-03-02 16:01:13 +00:00
Christian Clason
ada920f2a4
feat(vue): switch to new parser (#6233)
* feat(vue): switch to new parser

---------

Co-authored-by: Phạm Huy Hoàng <hoangtun0810@gmail.com>
2024-03-02 16:54:16 +01:00
nvim-treesitter-bot[bot]
a47540fd73 Update parsers: vimdoc 2024-03-02 09:18:10 +00:00
nvim-treesitter-bot[bot]
cbaad1951e Update parsers: sourcepawn 2024-03-02 09:39:31 +01:00
nvim-treesitter-bot[bot]
c2a265156d Update parsers: beancount, requirements, v, wing 2024-03-01 07:47:30 +00:00
Christian Clason
30a41f52f9 ci: bump create-pull-request to v6 2024-03-01 08:43:57 +01:00
Christian Clason
3ad0e410f8 fix(astro): update to scanner rewrite 2024-03-01 08:37:50 +01:00
Riley Bruins
8e349b1ea9 feat(gitcommit): highlight overflow in commit body 2024-03-01 08:30:00 +01:00
Phạm Huy Hoàng
62b0bb4f24 feat(format): extra newline after modeline 2024-02-29 23:05:30 +09:00
nvim-treesitter-bot[bot]
84daea50b1 Update parsers: angular, gitcommit, vimdoc, wing 2024-02-29 12:08:19 +00:00
GodOfAvacyn
06b5fda797
feat: add support for gdshader (#6153)
Godot shading language

---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-02-29 11:30:33 +01:00
nvim-treesitter-bot[bot]
4349af8a6e Update parsers: chatito, gitattributes, gitcommit, gpg, groovy, hlsl, mermaid, pem, poe_filter, properties, pymanifest, requirements, ssh_config, udev, wing, xcompose 2024-02-29 15:45:33 +09:00
Brian Ryall
4a8901b0d5 feat(beancount): refactor scanner to c 2024-02-29 12:35:31 +09:00
nvim-treesitter-bot[bot]
d2f58c0b65 Update parsers: dtd, gitattributes, hyprlang, tcl, wing, xml 2024-02-28 19:10:05 +00:00
Christian Clason
c5b19f66e0 fix(typst): adapt queries to breaking parser update 2024-02-28 20:01:01 +01:00
Phạm Huy Hoàng
15d521c923 fix(purescript): comment out utf-8 char 2024-02-28 15:55:15 +01:00
nvim-treesitter-bot[bot]
31d0648055 Update parsers: angular, javascript, nim, perl, python, typst, wing 2024-02-28 09:02:57 +00:00
nvim-treesitter-bot[bot]
db12bd416e Update parsers: fidl, haskell, nickel, python, solidity, wing 2024-02-27 09:00:02 +00:00
Riley Bruins
18aa5ae3fd feat(c): local label highlights 2024-02-26 07:41:41 -05:00
nvim-treesitter-bot[bot]
fad40f2010 Update parsers: arduino, php, php_only, wing 2024-02-26 09:08:07 +00:00
Christian Clason
6e2b56cbe7 feat(cooklang): update to scanner rewrite 2024-02-25 17:10:36 +01:00
Amaan Qureshi
6f1f407d71 feat(rust): add more regex injection queries 2024-02-25 09:05:08 -05:00
nvim-treesitter-bot[bot]
ede5b461c9 Update parsers: gpg, properties, pymanifest, requirements, rust, ssh_config, swift, udev, v 2024-02-25 10:00:47 +00:00
Preston Knopp
9896ef5f70
feat(gdscript): update parsers and queries. (#6176)
* feat(gdscript): add highlight for (pattern_guard "when")

* feat(gdscript): update (type) highlights and support typed array

* feat(gdscript): add highlight to attribute subscript ident

* feat(gdscript): only apply @ constructor to init ident

* feat(gdscript): replace greedy (parameters) match with independent match

* feat(gdscript): add (typed_default_parameter) highlight

* feat(gdscript): add (constructor_definition) indent

* feat(gdscript): update big wall of built-in identifiers
2024-02-25 02:21:19 +09:00
nvim-treesitter-bot[bot]
c06292fdc6 Update parsers: c, fennel, gitattributes, json, nim, pem, poe_filter, printf, readline, sourcepawn, wing, xcompose 2024-02-24 08:47:04 +00:00
Christian Clason
adf72368f6 feat(nickel): adapt to scanner rewrite 2024-02-23 18:33:25 +01:00
ObserverOfTime
e105b5e67d feat(properties): update parser & queries 2024-02-23 17:37:22 +02:00
chaopeng
e159a531e5 fix(fidl): remove requires_generate_from_grammar 2024-02-23 15:39:19 +01:00
nvim-treesitter-bot[bot]
f148c8a766 Update parsers: arduino, cmake, dtd, fidl, mlir, perl, slint, sourcepawn, wing, xml 2024-02-23 09:00:30 +00:00
再生花
31641d72a4
feat(format-scripts): linewrap predicates
"format-ignore".kick()
2024-02-23 10:42:01 +02:00
Karl Hiner
a29058fe8b
feat(faust): better highlighting of function calls, built-in variables, and member access 2024-02-23 15:41:28 +09:00
nvim-treesitter-bot[bot]
9ecf980277 Update README 2024-02-23 12:12:26 +09:00
巢鹏
a8d2b54e28
feat: add fidl parser 2024-02-23 11:57:07 +09:00
JD Rudie
19bf991be2 feat(c-sharp): add enum member declaration highlight query 2024-02-22 16:53:11 +01:00
nvim-treesitter-bot[bot]
1398b1ba46 Update parsers: cmake, dtd, faust, fennel, gdscript, html, lua, php, php_only, rust, sourcepawn, typst, vim, wing, xml 2024-02-22 09:18:43 +01:00
ObserverOfTime
ebf0532d42 feat(chatito): update queries 2024-02-21 23:25:11 +02:00
gbprod
ca46eb3ac9 fix(highlights): highlight @type in phpdoc
Currently, phpdoc types that are not union type are not highlighted, this change
allows to apply `@type` group to all types.
2024-02-21 15:47:01 +01:00
nvim-treesitter-bot[bot]
977d94975d Update README 2024-02-21 14:47:41 +01:00
Alexei Mozaidze
7d1bab6546
feat(fennel)!: switch to maintained parser (#6132)
Change the Fennel parser to a simpler and more consistent one, along with updating all the queries.
2024-02-21 13:44:01 +00:00
Christian Clason
71ae32c187 docs(template): use builtin commands 2024-02-21 14:37:51 +01:00
Wu Zhenyu
d1484a1507 feat: improve queries/muttrc/highlights.scm 2024-02-21 10:51:20 +01:00
Riley Bruins
455f6586ba
feat(query): indents that reflect the formatter (#6154)
* feat(query): indents that reflect the formatter

Indentation queries that reflect the query formatter. Only applicable if `lispoptions=expr:1`
2024-02-21 18:47:09 +09:00
Stephan Seitz
01cdcfb216 highlights(slang): add support for where 2024-02-21 07:59:09 +01:00
nvim-treesitter-bot[bot]
c4c1f516ec Update parsers: cuda, dtd, gdscript, hlsl, readline, slang, sourcepawn, wing, xml 2024-02-21 01:44:10 -05:00
LamprosPitsillos
6bd108a6f1
feat(typst): add raw block injections
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2024-02-20 08:46:58 -05:00
Riley Bruins
7eeb26e69c feat(ecma): folding for function arguments 2024-02-20 07:47:26 -05:00
nvim-treesitter-bot[bot]
d87074a06b Update parsers: gdscript, hlsplaylist, html, muttrc, wing, zathurarc 2024-02-20 09:18:23 +00:00
Christian Clason
ea3ddedd83 fix(meson): adapt to renamed node 2024-02-20 10:10:11 +01:00
dundargoc
1f6bd57192 ci: remove mergify.yml as it's no longer used 2024-02-20 09:57:10 +01:00
Phạm Huy Hoàng
917d696592 fix(scripts): add missing \n for nested grouping 2024-02-20 10:36:49 +09:00
Christian Clason
4b27f87fef fix(scripts): format-queries defaults to cwd 2024-02-20 09:59:02 +09:00
wzy
e04ce8bcec
feat: add tmux parser 2024-02-19 14:26:32 -05:00
dundargoc
5b3e9861a2 ci: simplify cache key
Also ensure new matrix fields are automatically added to cache key.
2024-02-19 17:46:07 +01:00
dundargoc
9bc21966f2 fix: typos 2024-02-19 17:45:54 +01:00
Amaan Qureshi
3a7b5a9fb4 feat(svelte)!: switch upstream parser 2024-02-19 08:11:17 -05:00
nvim-treesitter-bot[bot]
b3e53e9423 Update parsers: c, cpp, elm, html, markdown, markdown_inline, swift, vimdoc 2024-02-19 10:11:51 +01:00
nvim-treesitter-bot[bot]
4704d7ad60 Update README 2024-02-19 16:16:42 +09:00
Christian Clason
f857a96774
fix(bass): revert to upstream parser (#6131) 2024-02-19 00:56:42 -05:00
Bruno BELANYI
d10e856c11 feat(beancount): add comment injection 2024-02-19 08:18:15 +09:00
Amaan Qureshi
8e1df60b13 chore(puppet): update queries 2024-02-18 10:10:55 -05:00
Phạm Huy Hoàng
fef26b5eee
fix(format): fix nested grouping indentation (#6128) 2024-02-18 23:13:39 +09:00
Christian Clason
5e4b657181 fix(typst): add lockfile entry 2024-02-18 14:03:25 +01:00
nvim-treesitter-bot[bot]
34cb6a474f Update README 2024-02-18 12:35:32 +01:00
Raafat Turki
13e4e75079 fix(typst): remove unneeded (blob) @markup.raw capture 2024-02-18 06:22:47 -05:00
Raafat Turki
4640135fdf fix(typst): nest @markup.raw.block capture
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-02-18 06:22:47 -05:00
Raafat Turki
3f2f770aad fix(typst): nest @variable.member highlight capture
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-02-18 06:22:47 -05:00
Raafat Turki
bdff1ab16b style(typst): group fold clauses 2024-02-18 06:22:47 -05:00
Raafat Turki
9772dd19a5 style(typst): merge @punctuation.bracket clauses 2024-02-18 06:22:47 -05:00
Raafat Turki
097d6ffd5c fix(typst): move comment query to the bottom 2024-02-18 06:22:47 -05:00
Raafat Turki
f85b205e83 style(typst): format queries 2024-02-18 06:22:47 -05:00
Raafat Turki
06d575ead4 fix(typst): prevent highlighting entire function calls 2024-02-18 06:22:47 -05:00
Raafat Turki
c76e7e2a28 fix(typst): correct highlight captures 2024-02-18 06:22:47 -05:00
Raafat Turki
b3847b9551 feat(typst): add comment injection 2024-02-18 06:22:47 -05:00
Raafat Turki
4cb1595f5b feat(typst): add #show to fold and indent queries 2024-02-18 06:22:47 -05:00
Raafat Turki
2ba58a424c feat(typst): add highlight queries 2024-02-18 06:22:47 -05:00
Raafat Turki
ab3ec330ec feat: add typst parser 2024-02-18 06:22:47 -05:00
Raafat Turki
87bc770e60 style: format queries 2024-02-18 06:22:47 -05:00
Raafat Turki
c920b668f8 feat: add typst queries 2024-02-18 06:22:47 -05:00
Riley Bruins
5d9e12ccf4 fix(bash): unordered concatenation highlights 2024-02-18 06:19:20 -05:00
nvim-treesitter-bot[bot]
f75a5b4e14 Update parsers: d, swift, wgsl_bevy 2024-02-18 10:50:43 +01:00
Riley Bruins
42acc3f6e7 refactor(ecma): delimiter highlight consolidation 2024-02-17 21:47:19 -05:00
Christian Clason
17d68ac13c feat(rust): add doc comments 2024-02-17 13:24:12 +01:00
Riley Bruins
eb1914bb10 feat(latex): more text func highlights 2024-02-17 10:58:27 +01:00
nvim-treesitter-bot[bot]
47d013d025 Update parsers: c, javascript, rust, wing 2024-02-17 02:02:51 -05:00
Riley Bruins
504fe10432 feat(ecma): highlight label identifiers 2024-02-16 14:04:48 -05:00
nvim-treesitter-bot[bot]
581e87ba4e Update parsers: glsl, hlsl, hlsplaylist, muttrc, purescript, query, wing, zathurarc 2024-02-16 08:53:24 +01:00
Stephan Seitz
d49a8f82f1 highlights(slang): add support for associatedtype 2024-02-15 19:10:49 -05:00
nvim-treesitter-bot[bot]
bdaa6b817a Update parsers: agda, bash, c, c_sharp, cpp, css, devicetree, dtd, embedded_template, go, haskell, html, java, javascript, jsdoc, json, julia, kotlin, ocaml, ocaml_interface, php, php_only, python, ql, regex, ruby, rust, scala, slang, sql, tsx, typescript, verilog, wing, xml, zathurarc 2024-02-15 09:16:29 +00:00
Christian Clason
1ea4a0afd5 fix(haskell): comment out unsafe utf8 node 2024-02-15 09:16:29 +00:00
Wu Zhenyu
e32ebdc01d feat: change some ft, lang pairs
mysql comes from $VIMRUNTIME/syntax/mysql.vim
expect comes from $VIMRUNTIME/syntax/expect.vim
2024-02-15 09:39:38 +01:00
Wu Zhenyu
e4a1cc6e8e feat: add the muttrc parser 2024-02-15 09:39:10 +01:00
gi1242
69e4b99f13
fix(latex): update bibstyle queries (#6102)
Match grammar.js from commit 0d598bb95ffe3ba63403979d0d32158210974ca5 in
latex-lsp/tree-sitter-latex

Co-authored-by: gi1242 <gi1242+nvim-treesitter@gmail.com>
2024-02-15 07:59:28 +00:00
Riley Bruins
d96bf9d522
fix(python): better try-except indentation (#6097) 2024-02-15 00:39:59 +07:00
Wu Zhenyu
5a5cabd712 feat: add the hlsplaylist parser 2024-02-14 16:06:13 +01:00
nvim-treesitter-bot[bot]
883c72cddc Update parsers: tcl, wing 2024-02-14 09:49:17 +01:00
Gartox
7e9139db68 feat(lalrpop): highlight annotation macros
Lalrpop support putting annotation like `#[precedence(level = "1")]`.
This commit aims to highlight `precedence` with the `function.macro`
highlight group, like rust does with its proc macros.
2024-02-13 18:13:53 -05:00
nvim-treesitter-bot[bot]
f6342874b1 Update parsers: c, chatito, dtd, lalrpop, properties, query, slint, wing, xml, zathurarc 2024-02-13 17:09:40 +00:00
Phạm Huy Hoàng
1c72e797ba fix(yuck): comment out start-of-line parens 2024-02-13 17:58:36 +01:00
Jaehwang Jung
2b6020247d fix(cpp): add back comment injection 2024-02-13 13:16:00 +01:00
nvim-treesitter-bot[bot]
4416d21466 Update README 2024-02-13 09:40:56 +00:00
nvim-treesitter-bot[bot]
1843594962 Update parsers: arduino, bash, chatito, dtd, gitattributes, gpg, pem, poe_filter, printf, properties, pymanifest, rasi, requirements, scala, ssh_config, swift, udev, wing, xcompose, xml, zathurarc 2024-02-13 09:33:50 +00:00
Christian Clason
02ff2220d3 fix(xml): adapt to repo layout change 2024-02-13 09:33:50 +00:00
nvim-treesitter-bot[bot]
10d79b5dbb Update parsers: properties, scala, slang, wing, zathurarc 2024-02-12 09:45:14 +01:00
Sean Boult
10e8dffb79
feat(jsx): spell check text nodes (#6083) 2024-02-12 06:51:12 +07:00
Turiiya
b52b298669 chore(v): update lockfile 2024-02-11 14:36:19 +01:00
Turiiya
0aa7131044 chore(v): update repository url 2024-02-11 14:36:19 +01:00
Jongwook Choi
9860fceb73 fix: use augroup for auto_install autocmds
Problem: The FileType autocmd to automatically install parsers on a new
filetype (introduced in #3130) did not have augroup. As a result, when
`ts_configs.setup{ }` is called multiple times (for some reason),
duplicated installation requests will be made.

Solution: Use augroup with `clear = true`.
2024-02-11 11:21:29 +01:00
nvim-treesitter-bot[bot]
96f190f7a1 Update parsers: bash, cpp, dart, gitattributes, hyprlang, ruby, wing, zathurarc 2024-02-11 13:47:39 +07:00
dundargoc
6444286cbf ci: fix invalid workflow
Context variables aren't always available, so we can't rely on them for
e.g. environment variables.

Also merge all install scripts into `script/ci-install.sh`, that way it
can be called the same way regardless of system.
2024-02-10 19:49:14 +01:00
dundargoc
143a342bd8 ci: use windows-latest over windows-2022
It's convenient to not need to manually update the runner version.
2024-02-10 15:25:01 +01:00
Amaan Qureshi
05962ae14a chore(bash): update parser and highlights 2024-02-10 06:58:38 -05:00
Ananda Umamil
baf4581159 feat(ecma): highlight decorator and destructuring 2024-02-10 10:02:27 +01:00
nvim-treesitter-bot[bot]
817ca60370 Update parsers: arduino, bash, beancount, cpp, dtd, luadoc, slint, wing, xml 2024-02-10 13:47:19 +07:00
Riley Bruins
841dde702c fix(readline): more descriptive version number hl 2024-02-09 18:25:33 -05:00
Riley Bruins
8ec79c4785 fix(readline): proper indents while editing 2024-02-09 18:25:33 -05:00
nvim-treesitter-bot[bot]
aa805bf22f Update README 2024-02-09 18:30:46 +01:00
Christian Clason
b8840a426e feat(tcl): add parser and queries 2024-02-09 18:29:39 +01:00
nvim-treesitter-bot[bot]
51d15ef5da Update README 2024-02-09 17:14:21 +00:00
Amaan Qureshi
6b93dcd15a
chore(vue): adapt to scanner rewrite (#6068) 2024-02-10 02:05:52 +09:00
Charles
95036477c1
feat: add sourcepawn parser and queries (#5865) 2024-02-10 00:40:01 +09:00
nvim-treesitter-bot[bot]
3dbea103d8 Update README 2024-02-09 20:58:19 +07:00
Tobias Hunger
0f3183dda8
feat(slint)!: change to the official parser (#6027)
This change replaces the slint parser written and maintained by @jrmoulton
with the official one hosted in the slint-ui organization on github.

A huge thank you to @jrmoulton for all his work on the tree-sitter
parser!

---------

Co-authored-by: jrmoulton <jaredmoulton3@gmail.com>
2024-02-09 13:46:57 +00:00
nvim-treesitter-bot[bot]
f0d43eff13 Update parsers: ruby 2024-02-09 12:05:51 +00:00
nvim-treesitter-bot[bot]
4b00de5633 Update parsers: asm, faust, readline, ruby, wing 2024-02-09 10:19:33 +00:00
Christian Clason
8812089919 fix(unison): adapt to breaking parser change 2024-02-09 11:10:00 +01:00
Christian Clason
8262ccf990 fixup: it's fine 2024-02-09 10:45:13 +01:00
Christian Clason
de4a651da7 ci: pin tree-sitter-cli version in npm install
This prevents bad tags from messing up CI
2024-02-09 10:33:35 +01:00
Luckas
bc07e58f42
feat: add hyprlang parser & queries (#5852)
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2024-02-09 10:19:46 +01:00
nvim-treesitter-bot[bot]
01c159826e Update README 2024-02-09 08:57:56 +00:00
wzy
cab95b2f96
feat: add tree-sitter-asm parser (#5946) 2024-02-09 09:50:46 +01:00
Amaan Qureshi
6d1ab048d2 chore(ruby): adapt to scanner rewrite 2024-02-09 09:50:04 +01:00
Amaan Qureshi
76700e147b feat(d)!: switch upstream parser to gdamore/tree-sitter-d 2024-02-08 18:59:04 -05:00
Riley Bruins
cbf0dfd92f
feat(readline): add parser tree-sitter-readline (#6058) 2024-02-08 21:03:21 +02:00
Karl Hiner
b444afa1da
feat(faust): add tree-sitter-faust (#6043) 2024-02-08 10:54:33 +01:00
nvim-treesitter-bot[bot]
3e71d65447 Update parsers: groovy, haskell, javascript, svelte, templ, wing 2024-02-08 09:24:42 +00:00
Anthony Shi
5973b617a9
fix(kotlin): remove slow highlight and local pattern (#5954)
This is a parser bug that needs to be fixed; temporary workaround to
remove the ~0.5s delay on opening highlight and locals queries.
2024-02-06 13:51:50 +01:00
Dennis van den Berg
3722d5d772
fix(angular): nullish coalescing operator in Angular templates (#6052) 2024-02-06 10:30:01 +01:00
Riley Bruins
127cf25737 feat(latex): pre-compiled header highlights, tests
Also moves comment highlights to the very end to make them more
future-proof.
2024-02-06 10:29:09 +01:00
Riley Bruins
8d6192baa9 fix(latex): give comments higher precedence
This commit also moves things around to give text better precedence in
the case of `textit` and `textbf`.
2024-02-06 10:29:09 +01:00
nvim-treesitter-bot[bot]
7bba891bae Update parsers: angular, bash, gitcommit, glsl, hlsl, php, php_only, templ, wing 2024-02-06 09:14:58 +00:00
Calum Smith
0d14299a9d highlight(jsx,tsx): character references (a.k.a. entities) 2024-02-05 18:37:12 +01:00
Maria José Solano
4fbf150a16 fix(inc-selection): handle deleting non-existing keymaps 2024-02-03 10:34:08 +01:00
Maria José Solano
140a486abe refactor(inc-selection): simplify keymap and add error message 2024-02-03 10:34:08 +01:00
Ilia Ilinykh
1cda98132a
feat(java): inject printf in String.formatted (#6045)
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html#formatted(java.lang.Object...)
2024-02-02 20:00:03 +01:00
Michael Strobel
a536ecad57 fix(php): add missing spaceship operator <=> 2024-02-02 19:59:00 +02:00
nvim-treesitter-bot[bot]
b7e1a6c2cd Update parsers: embedded_template, fennel, javascript, php, php_only, qmljs, ruby 2024-02-02 15:15:28 +00:00
nvim-treesitter-bot[bot]
9512582775 Update parsers: bicep, cpp, gitcommit, kdl, php, php_only, wing 2024-02-02 07:33:54 +00:00
Amaan Qureshi
8b99311ca1 chore(bicep): update queries and add scanner 2024-02-02 08:24:59 +01:00
Amaan Qureshi
d2b4563230 chore(kconfig): update highlights 2024-02-02 00:39:01 -05:00
Ilya Ilyinykh
e7ea07e42c fix(go): fix eq to any-of 2024-02-01 19:21:09 +01:00
Ilya Ilyinykh
f2119df35c feat(go): printf injections
https://pkg.go.dev/fmt#pkg-index
https://pkg.go.dev/fmt#Fscanf
https://pkg.go.dev/fmt#Appendf
https://pkg.go.dev/fmt#Sscanf
https://pkg.go.dev/testing#T.Skipf
https://pkg.go.dev/testing#F.Logf

The problem covered here:
https://github.com/nvim-treesitter/nvim-treesitter/issues/2917
2024-02-01 19:21:09 +01:00
Levi Frandsen
7e4e92432d fix(svelte): correct formatting 2024-02-01 23:35:57 +07:00
Levi Frandsen
129f8b9742 fix(svelte): correct indents, add key block
resolves #6028
2024-02-01 23:35:57 +07:00
Amaan Qureshi
5fca7ae496 chore(bicep): update highlights 2024-02-01 04:10:16 -05:00
nvim-treesitter-bot[bot]
13599375c3 Update parsers: bitbake, groovy, haskell, kconfig, luadoc, starlark, wing 2024-02-01 06:43:51 +00:00
Amaan Qureshi
515b00598a chore(qmljs): temporarily remove the ecma inherit 2024-01-31 22:31:50 -05:00
Amaan Qureshi
90327d9e73 chore(typescript,tsx): update parser and queries 2024-01-31 22:31:50 -05:00
Amaan Qureshi
6da205148f chore(ecma,jsx): update parser and queries 2024-01-31 22:31:50 -05:00
Christian Clason
364b86ec8e ci: use M1 for macOS
GH Actions runners use M1 hardware for `macos-14` now. Since macOS is
one of the slowest platforms for parser compilation, switching should
give us not only ARM coverage but also shorter CI times.
2024-01-31 15:19:51 +01:00
nvim-treesitter-bot[bot]
45cde459b5 Update parsers: apex, phpdoc, rbs, soql, sosl, wing 2024-01-31 09:25:31 +01:00
Maria José Solano
ba64547834
fix(incremental-selection): second attempt at fixing command (#6014) 2024-01-30 22:34:46 +01:00
Phạm Huy Hoàng
5f950cdcb8 fix(format): handle list with 300 nodes 2024-01-30 22:59:27 +07:00
Christian Clason
e9602f4119 fix(format): improve error message 2024-01-30 09:57:54 +01:00
Christian Clason
569d5dfadb ci: use nvim-treesitter-bot as author 2024-01-30 09:01:30 +01:00
kyazdani42
59a295f76a Update parsers: angular, beancount, liquidsoap, markdown, markdown_inline, purescript, wing 2024-01-30 07:58:07 +00:00
Christian Clason
e24dab6696 ci: use nvim-treesitter-bot as committer 2024-01-29 10:14:42 +01:00
kyazdani42
4ea1a4ffa8 Update parsers: groovy, php, php_only 2024-01-29 06:49:06 +00:00
Murtaza
d4dac523d2
feat(groovy)!: switch to more complete parser (#5957)
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2024-01-28 22:17:50 +01:00
clason
95987ee2d6 Update parsers: query 2024-01-28 16:19:27 +01:00
Christian Clason
b5736698be ci: use token for automated PRs
* Use a Github App token to allow CI to run automatically
(Following
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens)

* Enable automerge

* make lint workflow only run once on PRs to master
2024-01-28 16:15:57 +01:00
GitHub
6f586875e3 Update parsers: awk, haskell, php, php_only 2024-01-28 10:10:43 +01:00
Maria José Solano
458ce4d16c fix(incremental-selection): use cmd instead of :lua for command 2024-01-27 22:51:26 +01:00
Github Actions
b4138891b3 Update README 2024-01-27 12:20:22 +01:00
Dennis van den Berg
2fb2100fed
feat(angular)!: switch to parser supporting v17 (#5779) 2024-01-27 12:17:25 +01:00
GitHub
589fa77c23 Update parsers: astro, bitbake, c, cpp, dtd, gnuplot, json, php, php_only, wing, xml 2024-01-27 10:43:11 +01:00
Christian Clason
cf13c96050 fix(jsdoc): add scanner.c 2024-01-27 10:30:03 +01:00
Riley Bruins
e0edcbb1d2 fix(make): highlight order-only prerequisite pipe 2024-01-26 19:07:19 -05:00
Amaan Qureshi
ed82d82b77 chore(Odin): update highlights 2024-01-26 12:52:24 -05:00
Christian Clason
efda19a54a feat(tests): allow check-queries to take list of parsers
`./scripts/check-queries.lua foo bar baz`
2024-01-26 13:32:10 +01:00
Dai López
ffb19d5dee
feat(gnuplot): added gnuplot parser and queries (#5594)
* feat(gnuplot): added gnuplot parser and queries

---------

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-01-26 13:30:43 +02:00
Amaan Qureshi
4bc1f9a4eb feat(kconfig): add new operator 2024-01-26 03:15:41 -05:00
GitHub
7b9973fca9 Update parsers: kconfig, php, php_only, wing 2024-01-26 08:40:38 +01:00
Amaan Qureshi
b7fd3d1db4 fix(lua): inject luadoc into comments immediately beginning with a | 2024-01-26 02:14:15 -05:00
Riley Bruins
0b697429c9 fix(git_config): highlight parent relative path 2024-01-26 00:58:05 -05:00
Jongwook Choi
cb79d24461 feat(python): allow comments before module docstring
Example:

  ```python
  #!/usr/bin/env/python
  # some comment before module docstring
  # Copyright (c) LICENSE foo bar

  """module docstring."""
  ```

Python indeed recognizes it:

  ```
  $ python -c 'import testfile; print(testfile.__doc__)'
  module docstring.
  ```
2024-01-25 23:28:11 +01:00
Leftas
ce4adf11cf Fix find_usages 2024-01-25 19:24:18 +01:00
Christian Clason
cc908cfcd7 fix(dart): replace slow indent with simpler strategy
Pattern for dedenting else blocks is painfully slow (~20% of total test
time), so replace with `@indent.auto` for the whole `if_statement` for
now.
2024-01-25 13:12:53 +01:00
GitHub
fb91060f59 Update parsers: cpp, csv, disassembly, elixir, kconfig, luau, matlab, php, php_only, psv, tsv, wing 2024-01-25 10:00:53 +01:00
Christian Clason
22025469b5 fix: bump phpdoc parser and query 2024-01-25 09:47:20 +01:00
Riley Bruins
314fe31dc7 fix(jsx): proper tag and builtin tag distinction 2024-01-25 09:11:48 +01:00
Amaan Qureshi
1d83fc08d4 fix: format disassembly 2024-01-25 10:00:01 +09:00
Colin Kennedy
4362b04a29
feat: add tree-sitter-disassembly 2024-01-24 19:25:40 -05:00
Miles Frain
2c1eb02e92 feat(bash) Highlight concatenated words as strings 2024-01-25 00:15:02 +01:00
Amaan Qureshi
10903b13d8 chore(luau): update highlights and parser 2024-01-24 18:14:03 -05:00
ObserverOfTime
1bee80469d feat(vim): highlight keycodes 2024-01-24 20:19:55 +01:00
ObserverOfTime
8166080035 feat(yuck): add missing injections
And builtin variable highlights
2024-01-24 13:47:19 +01:00
ObserverOfTime
d23192fb17 fix(godot_resource): improve highlights
And add a comment injection
2024-01-24 13:47:19 +01:00
ObserverOfTime
aa0c60ca5a fix(highlights): clean up tag highlights 2024-01-24 13:47:19 +01:00
Riley Bruins
c62874656e feat(latex): operator highlights for _ and ^ 2024-01-24 13:25:42 +01:00
Riley Bruins
f72d9169f2 fix(latex): better environment precedence 2024-01-24 13:25:42 +01:00
Christian Clason
023a8ee9a2 ci: bump cache to v4 2024-01-24 10:30:08 +01:00
Amaan Qureshi
ae7ceaadad chore(c_sharp): highlight tweaks 2024-01-24 01:45:42 -05:00
Amaan Qureshi
a938e98cb4 chore(luadoc): update parser & highlights 2024-01-24 01:30:11 -05:00
Amaan Qureshi
527eb602ff chore(rust): update highlights 2024-01-24 01:29:48 -05:00
Amaan Qureshi
55562407b6 chore(python): update member lua pattern 2024-01-24 15:21:39 +09:00
Jędrzej Boczar
37c808b8ce
fix(devicetree): Adapt to upstream node changes (#5961) 2024-01-24 13:33:52 +09:00
Phạm Huy Hoàng
41128a7724 fix(rust): Follow upstream injections
tree-sitter-rust and helix both have `injection.include-children` for
the pattern in this PR. So it's best to changed to match the intended
results
2024-01-24 12:18:32 +09:00
Riley Bruins
177a775fd8 feat(git_config): shell command alias injections 2024-01-23 12:10:49 +02:00
GitHub
ab23464393 Update parsers: c, html, luadoc, php, php_only, rust, swift, wing 2024-01-23 17:32:52 +09:00
James Trew
cd4e090994 fix(locals): index matches with split capture names 2024-01-22 17:09:27 +01:00
GitHub
97997c928b Update parsers: phpdoc, templ, wing, zathurarc 2024-01-22 16:13:48 +09:00
wzy
94bd4bcc5b
feat: add the zathurarc parser (#5948) 2024-01-21 19:42:30 +02:00
Phạm Huy Hoàng
e0420e73c9 fix(wgsl_bevy): Correct formatter mistake
Old version of `format-queries` incorrectly took away a space, creating
a wrong capture.

This is a fixup for that.
2024-01-22 00:49:31 +09:00
Phạm Huy Hoàng
77e298e4de chore: format queries 2024-01-21 23:55:02 +09:00
Phạm Huy Hoàng
76ca66db38 fix(format-scripts): remove parens if possible 2024-01-21 23:55:02 +09:00
Sergey Slipchenko
051193acba
fix(jsdoc): add nospell to type and tag_name 2024-01-21 16:04:34 +02:00
Christian Clason
6806d7a783 docs(contributing): typos and examples 2024-01-21 12:04:42 +01:00
Veesh Goldman
5d5eba78a7 feat(perl): add more highlights 2024-01-21 10:53:32 +01:00
GitHub
4e0d1dd91f Update parsers: gleam, perl, templ, wing 2024-01-21 16:21:14 +09:00
Christian Clason
5cc5627487 fix(comments)!: consolidate note captures
Distinguishing `hint` and `info` is too confusing; it's enough to have
`error`, `warning`, `todo`, and `note`.
2024-01-20 17:52:50 +01:00
tk-shirasaka
64b3d5e569
feat: add the php_only parser included in tree-sitter-php (#5876)
Add parser  `php_only` for PHP files without HTML embedded.
Make queries for combined parser `php` inherit from `php_only` (no extensions needed).

---------

Co-authored-by: shirasaka <tk.shirasaka@gmail>
2024-01-20 12:34:49 +00:00
Christian Clason
a8fa3047b5 fix(highlights): use markup.raw.delimiter for fences 2024-01-20 13:04:29 +01:00
Phạm Huy Hoàng
aeed349c04 feat: folds for git config files 2024-01-20 19:46:45 +09:00
Riley Bruins
88261266de
fix(markdown_inline): prioritize link URI (#5935) 2024-01-20 19:00:37 +09:00
Amaan Qureshi
1ce6000a95 fix(rust): add const_item to folds 2024-01-20 18:50:31 +09:00
Pham Huy Hoang
c41d38b70e fix(rust): Add back 1 indent for macro rules (#5834) 2024-01-20 18:50:31 +09:00
Jędrzej Boczar
6548bb64c1 feat(meson): add indents.scm 2024-01-20 10:48:56 +01:00
Phạm Huy Hoàng
d198a75e2c
Fixup format (#5934)
* fix(format): newline between top-level field defs

* fixup: newline between node and comment

* fixup: optimize pattern
2024-01-20 18:47:56 +09:00
Riley Bruins
f5a839d1e8 fix(markdown): remove @none from code fences 2024-01-20 10:24:57 +01:00
GitHub
134a86f9ff Update parsers: bash 2024-01-20 10:21:53 +01:00
Riley Bruins
1eb22367b9 feat(html): comment injections 2024-01-20 12:54:01 +09:00
Zeb Nicholls
4a4dbe1cb1
fix(python): add support for typed (kw)args (PEP 484) (#5875) 2024-01-19 16:21:57 +00:00
GitHub
757b4f6afb Update parsers: printf, scala 2024-01-19 17:20:43 +01:00
ObserverOfTime
505a0e74cb fix(css): make the highlights more sensible 2024-01-19 16:58:37 +01:00
ObserverOfTime
fa38f4e6f9 fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01:00
ObserverOfTime
2f38c36294 fix(highlights): improve consistency 2024-01-19 16:58:37 +01:00
ObserverOfTime
4cd951d703 feat(git_config): add missing injections 2024-01-19 16:58:37 +01:00
Amaan Qureshi
8c629a9327 chore(rust): tweak injections, add json macro injection 2024-01-19 16:58:37 +01:00
Christian Clason
76b85583e1 docs: update CONTRIBUTING.md with formatting 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
57a8acf0c4 chore: query formatting 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
79975d6557 ci: add query lint job 2024-01-19 16:58:37 +01:00
Pham Huy Hoang
edee83272e refactor: manual pre-cleanup
Moving comments, adding `format-ignore` to lines that will be better
with it
2024-01-19 16:58:37 +01:00
Pham Huy Hoang
15de22a2e1 feat: query formatting script
Usage:
- nvim -l scripts/format-queries.lua /path/to/file.scm
- nvim -l scripts/format-queries.lua /path/to/dir

fixup: add `format-ignore` directive to query/highlights.scm
2024-01-19 16:58:37 +01:00
Christian Clason
fc0fceb43a test(queries): print ALL errors at end 2024-01-19 16:58:37 +01:00
Christian Clason
1ae9b0e455 feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.

Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.

Specifically:

* tree-sitter "standard capture names"
  (3f44b89685/highlight/src/lib.rs (L20-L72)):

  - `@parameter` -> `@variable.parameter`
  - `@field` -> `@variable.member`
  - `@namespace` -> `@module`
  - `@float` -> `@number.float`
  - `@symbol` -> `@string.special.symbol`
  - `@string.regex` -> `@string.regexp`
  - `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
  - `@text.title` -> `@markup.heading`
  - `@text.literal` -> `@markup.raw`
  - `@text.reference` -> `@markup.link`
  - `@text.uri` -> `@markup.link.url` (in markup links)
  - `@string.special` -> `@markup.link.label` (non-url links)
  - `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)

* Helix captures
  (https://docs.helix-editor.com/master/themes.html#syntax-highlighting):

  - `@method` -> `@function.method`
  - `@method.call` -> `@function.method.call`
  - `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
  - `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
  - `@text.uri` -> `@string.special.url` (outside markup)
  - `@preproc` -> `@keyword.directive`
  - `@define` -> `@keyword.directive`(`.define`?)
  - `@storageclass` -> `@keyword.storage`
  - `@conditional` -> `@keyword.conditional`
  - `@debug` -> `@keyword.debug`
  - `@exception` -> `@keyword.exception`
  - `@include` -> `@keyword.import`
  - `@repeat` -> `@keyword.repeat`

* cleanup

  - remove some redundant `@conceal` (but still allow it for conceal-only patterns)
  - remove obsolete `@error` (syntax linting is out of scope for this repo)
  - sort, cleanup capture list in `CONTRIBUTING.md`
2024-01-19 16:58:37 +01:00
Christian Clason
10dd49958c chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
ObserverOfTime
17fae3f4a3 feat(injections): add printf format strings 2024-01-19 16:58:37 +01:00
Christian Clason
5b90ea2aba feat(locals)!: switch to upstream captures 2024-01-19 16:58:37 +01:00
Christian Clason
f197a15b0d revert "fix(config)!: always install parsers bundled with nvim" 2024-01-19 16:45:58 +01:00
GitHub
090880c0f1 Update parsers: scala, wing 2024-01-19 16:06:06 +09:00
Christian Clason
5037721ec5 fixup: proper union of tables 2024-01-18 17:08:20 +01:00
GitHub
503d0ccdee Update parsers: gitcommit, markdown, markdown_inline, vimdoc, wing 2024-01-18 08:17:20 +01:00
Christian Clason
07c8c3d84f fixup: empty ensure_installed 2024-01-17 11:07:20 +01:00
Christian Clason
7b326a0962 fixup: don't extend _with_ 'all' 2024-01-17 11:01:24 +01:00
GitHub
94cb036ba7 Update parsers: gleam, gomod, wing 2024-01-17 09:44:06 +01:00
Christian Clason
97ba59c6f5 fixup: ensure_installed can be 'all' 2024-01-16 19:05:28 +01:00
Christian Clason
fe89bf1719 fix(config)!: always install parsers bundled with nvim 2024-01-16 18:24:59 +01:00
GitHub
842507a578 Update parsers: perl, todotxt 2024-01-16 08:11:50 +01:00
Christian Clason
59d4c14a1a feat!: bump minimum Nvim version to 0.9.2
required for empty injection fix
2024-01-15 13:02:20 +01:00
Bartek Łuka
295ab1da52 fix: link type in pattern matching correctly 2024-01-15 13:01:37 +01:00
GitHub
0746b1a13d Update parsers: awk 2024-01-15 09:08:43 +01:00
GitHub
fcf843bf14 Update parsers: erlang, php, templ, wing 2024-01-14 15:27:06 +01:00
GitHub
8cd2b23017 Update parsers: templ, tlaplus 2024-01-07 13:28:41 +01:00
Christian Clason
f6483d1194 fix(php): adjust to parser refactor 2024-01-07 13:12:04 +01:00
GitHub
5032f9952a Update parsers: ada, ruby 2024-01-06 11:31:09 +01:00
Calum Smith
49f1b9a7ef highlights(html): character references (a.k.a. entities) 2024-01-05 16:58:46 +01:00
Christian Clason
9288d9b505 ci: bump actions to latest 2024-01-05 12:54:30 +01:00
GitHub
adf423a493 Update parsers: astro, php, ruby, templ, wing 2024-01-05 11:05:48 +01:00
Zhuofeng Wang
e277ca9dec fix(markdown_inline): latex highlight injection (#5397)
The `injection.include-children` is needed in markdown_inline parser.
2024-01-05 10:58:35 +01:00
Riley Bruins
8ae4080c5b fix(latex): highlight text functions 2024-01-04 20:07:31 +01:00
GitHub
0da349ed30 Update parsers: ada, ocaml, ocaml_interface, sql, wing 2024-01-03 18:26:58 +01:00
GitHub
3ef514b10b Update parsers: scala, templ, v, wing 2024-01-03 11:31:39 +01:00
Christian Degnbol Madsen
65ef62092e fix(julia): add missing capture of ":" in selected import
If writing a selected import, e.g. `using BSON: @load`, the colon isn't currently captured.
This change captures it as `@punctuation.delimiter`.
2024-01-02 11:43:08 +01:00
GitHub
e49f1e8ef3 Update parsers: nim, templ, wing 2023-12-30 11:08:24 +01:00
GitHub
362ebd3a21 Update parsers: perl, rst, v, wing 2023-12-29 11:05:47 +01:00
GitHub
7a2c6211d6 Update parsers: perl, scala, wing 2023-12-28 12:26:00 +01:00
GitHub
7d0b4756ab Update parsers: nickel, nix, scala, v, wing 2023-12-27 11:32:57 +01:00
GitHub
27f68c0b6a Update parsers: haskell, templ 2023-12-24 16:15:19 +09:00
Riley Bruins
374966b25c
fixup(luau): align @string.regex to the injections (#5829) 2023-12-24 14:00:32 +09:00
Riley Bruins
cd4de5f7b1 fix: cleanup luap injection queries 2023-12-23 22:26:02 +01:00
Riley Bruins
92572c0dfd feat: more @string.regex highlights 2023-12-23 22:26:02 +01:00
GitHub
c4da794564 Update parsers: elm, wing 2023-12-23 11:18:04 +01:00
Riley Bruins
1c619f5f20
feat(luap): highlights more consistent with regex (#5819) 2023-12-23 11:40:10 +02:00
Christian Degnbol Madsen
454c3a9ba8
fix(julia): pipe function highlight (#5815)
In Julia when piping into a function the function should be highlighted as a function call, and not a variable.
2023-12-22 12:24:04 +02:00
GitHub
d5842ebca8 Update parsers: apex, scala, soql, sosl, tlaplus, wing 2023-12-22 16:11:09 +09:00
Jędrzej Boczar
d496c5e08e
fix(cpp): incorrect indent of class with opening { on new line (#5811) 2023-12-22 05:49:13 +09:00
Christian Clason
d2d3df8613
vimdoc: add note, warning, deprecated (#5817) 2023-12-21 22:29:31 +09:00
Ahnaf Rafi
c153019e11 Add @nospell annotation to label definitions and references 2023-12-21 10:55:50 +01:00
GitHub
23cc2cd85c Update parsers: beancount, wing 2023-12-21 15:57:33 +09:00
Marc Jakobi
732c8cb0b4 highlights(haskell): add fail to exception highlights 2023-12-20 13:08:06 +01:00
Marc Jakobi
96e01877b8 highlights(haskell): namespaced string quasiquote 2023-12-20 13:07:44 +01:00
GitHub
cdb2ec999c Update parsers: gleam, styled, v, wing 2023-12-20 16:36:55 +09:00
Github Actions
0dfbf5e48e Update README 2023-12-19 14:04:53 +01:00
Mark Skelton
a0b815497b
feat: add tree-sitter-styled (#5735)
* Add styled parser

* Add queries

* Update highlights

* Remove unnecessary highlights

* Update injections to use the styled grammar

* Remove requires npm
2023-12-19 21:53:00 +09:00
Pham Huy Hoang
79dcd0e24c
fix: remove 0-length range usage in indent.lua (#5805) 2023-12-19 19:42:30 +09:00
GitHub
251c855236 Update parsers: elm, gomod, v, wing 2023-12-19 10:04:53 +01:00
Riley Bruins
24be1534db fix(rust): highlight inline attributes properly 2023-12-18 11:47:01 -05:00
aMOPel
edacfa2eed
fix(nim): minor improvements to queries and parser (#5784)
* fix(nim): bump parser again to include minor fix

* fix(nim): shifting around for precedence

* fix(nim): added new fields from recent parser version,
improved support for (conditional_declaration) and (variant_declaration)
2023-12-19 01:32:06 +09:00
GitHub
25ddfde8d7 Update parsers: elm, haskell, templ, wing 2023-12-17 11:11:38 +01:00
GitHub
5a713474e3 Update parsers: erlang, nim, v, wing 2023-12-16 10:18:52 +01:00
Vincent Rischmann
000f71842b
feat(gomod): highlight the toolchain directive (#5795) 2023-12-15 21:01:31 +02:00
GitHub
194b3f0047 Update parsers: erlang, haskell, nim, wing 2023-12-15 10:47:05 +01:00
Christian Clason
9bc1f1e640 fix(v): adapt to removed scanner.c 2023-12-15 10:24:32 +01:00
ObserverOfTime
ab818bf5a2 fix(python): restrict typed parameter highlight
Only the name is a parameter and not the value
2023-12-14 13:05:40 -05:00
ObserverOfTime
2583eb351b fix(python): highlight variadic lambda parameters 2023-12-14 13:05:40 -05:00
GitHub
30b5bdca1b Update parsers: v, wing 2023-12-14 15:02:25 +01:00
GitHub
42381aae7c Update parsers: nim, slang, wing 2023-12-13 08:04:38 +01:00
GitHub
78d75bce03 Update parsers: gomod, haskell, hoon, nim, slang, sql, v, wing 2023-12-12 09:34:21 +01:00
GitHub
a6c655629c Update parsers: nim, v, wing 2023-12-11 10:30:11 +01:00
r001
b6b9ca448b
indents added new language highlights added (#5777) 2023-12-10 16:16:24 +09:00
ObserverOfTime
7958ff9ec7 feat(poe_filter): add new Import statement 2023-12-09 17:18:16 +02:00
ObserverOfTime
1b5bbb54b3 fix(vim): highlight 'scriptencoding' command 2023-12-09 11:12:07 +01:00
GitHub
401ef01feb Update parsers: nickel, v 2023-12-09 10:49:14 +01:00
gbprod
bd55179893
feat(gitcommit): add highlight group for subject_prefix (#5774) 2023-12-09 12:36:17 +09:00
GitHub
180e1ca385 Update parsers: gitcommit, gleam, rbs, sql, wing 2023-12-08 10:48:23 +01:00
GitHub
f861bc6148 Update parsers: gleam, wing 2023-12-07 15:50:05 +09:00
GitHub
c203884c80 Update parsers: liquidsoap, rbs, vhs, wing 2023-12-05 09:24:48 +01:00
ObserverOfTime
3065a928fc fix(java): move attributes after constants 2023-12-04 20:41:28 -05:00
GitHub
67536f4057 Update parsers: elixir, qmljs, wing 2023-12-04 08:25:54 +01:00
GitHub
0791b5ebb5 Update parsers: elm 2023-12-03 11:38:09 +01:00
GitHub
80a16deb51 Update parsers: rbs 2023-12-01 15:51:11 +09:00
Tomohiro Hashidate
b41bbcbb9a
feat: add rbs parser support (#5745) 2023-12-01 01:22:29 +09:00
aMOPel
36f81e698e
feat(nim): added some captures and fixed some bugs (#5664)
* fix(nim): literals in pragmas in types would be falsly highlighted as `@variable`

* style(nim): removed trailing whitespace

* fix(nim): identifiers in (type_expression (pragma_expression)) would be
captured as `@type`

* fix(nim): changed generic parameters when declaring from @type to @parameter

* feat(nim): added @constant capture for (identifier)s x, y in
`array[x..y, type]`

* feat(nim): added @function.call capture for (identifier)s in second
argument to `varargs[type, routine]`
2023-12-01 00:21:43 +09:00
Marc Jakobi
1e64838ff5 fix(luarocks): enable automatic runtime path detection 2023-11-30 10:59:23 +01:00
Marc Jakobi
00f9b1ffed fix(luarocks): don't copy runtime data to share/ 2023-11-30 10:59:23 +01:00
GitHub
93750d3881 Update parsers: c_sharp, foam, slang, v, wing 2023-11-30 07:47:50 +01:00
Riley Bruins
e9acd01a4a
fix(markdown): revert bullet conceals due to spacing issues (#5742) 2023-11-30 09:36:07 +09:00
Riley Bruins
8f16c39f5b feat(make): highlight phony prerequisites as functions 2023-11-29 12:31:42 +02:00
Riley Bruins
fb101ed49d feat(make): give targets the function highlight 2023-11-29 12:31:42 +02:00
Stephan Seitz
10432e6b0f parsers: add tree-sitter-slang 2023-11-29 00:54:24 -08:00
GitHub
b04f990f92 Update parsers: css, facility, foam, wing 2023-11-29 16:38:11 +09:00
Bryan Kenote
bf982eb7dc
feat: add facility 2023-11-28 12:24:43 -05:00
GitHub
582a92ee12 Update parsers: erlang, wing 2023-11-28 09:41:19 +01:00
HumblePresent
ba588ee0cf fix(cpp): remove @field for identifiers with _ prefix (#5731) 2023-11-27 18:18:38 -05:00
Github Actions
b8fbd13277 Update README 2023-11-27 15:34:04 +01:00
virchau13
8189d91cf8
astro: add custom component highlighting (#5728) 2023-11-27 22:11:28 +09:00
Tomas Sandven
482a2f15d3 Fix robot parser metadata in parsers.lua 2023-11-27 09:36:47 +01:00
Github Actions
b056e4227b Update README 2023-11-26 15:26:31 +01:00
Christian Clason
52b25c9a3f fixup: parser requires generate (ABI) 2023-11-26 15:24:26 +01:00
Christian Clason
de5197871e fixup: lint 2023-11-26 15:24:26 +01:00
Christian Clason
274370e703 fixup: use any-of instead of vim-match 2023-11-26 15:24:26 +01:00
Christian Clason
1e74c34b66 feat: add angular parser and queries 2023-11-26 15:24:26 +01:00
sheepwall
9d91101f71
twig queries: add combined injections (#5721)
Co-authored-by: August Svensson <august.svensson@metabytes.se>
2023-11-26 20:12:06 +09:00
GitHub
eafc0c2194 Update parsers: swift, wing 2023-11-26 10:51:07 +01:00
GitHub
d8a71826a2 Update parsers: dtd, ssh_config, wing, xml 2023-11-25 10:44:33 +01:00
GitHub
649d137371 Update parsers: erlang, ssh_config, wing 2023-11-24 09:26:54 +01:00
Patrick Haun
71bdf97bf6
feat(hocon): add fold query (#5710) 2023-11-23 15:42:00 +02:00
GitHub
6d45b34697 Update parsers: sql, wing 2023-11-23 09:06:35 +01:00
Riley Bruins
2a5f6c9eb7 fix(css): tweak operator keyword highlights 2023-11-22 19:11:45 -05:00
GitHub
cd583cfb5b Update parsers: devicetree, v, wing 2023-11-22 08:43:59 +01:00
Riley Bruins
7da3cb6323 feat(regex): any_character, start end assertion hl differentiation 2023-11-21 07:13:51 -05:00
ObserverOfTime
6b24db0c8f feat: add properties parser 2023-11-21 13:13:26 +02:00
GitHub
670e7aa843 Update parsers: devicetree, wing 2023-11-21 10:22:33 +01:00
Riley Bruins
1610b1aafb
feat(python): @string.regex capture, injection improvements (#5697)
* feat(python): `@string.regex` capture, injection improvements

* fix(python): match regex only for first argument of re module

* chore(python): remove unneeded capture

Co-authored-by: Santos Gallegos <stsewd@proton.me>

* fix(python): only highlight string content itself as regex

---------

Co-authored-by: Santos Gallegos <stsewd@proton.me>
2023-11-21 01:26:18 +09:00
GitHub
3da5cfb4a2 Update parsers: commonlisp, cuda, glsl, hlsl, pod, smithy, tlaplus, v, wing 2023-11-20 08:39:48 +01:00
Amaan Qureshi
d876296476
feat: add Linkerscript (#5693) 2023-11-19 18:10:52 +09:00
Riley Bruins
b016211057 feat(lua): folds for parameter, argument lists 2023-11-19 10:45:33 +02:00
GitHub
e96a9b4577 Update parsers: cpp, php, rust, wing 2023-11-19 16:52:23 +09:00
Riley Bruins
f2de95e30a
feat(markdown): conceals for bullets, block quotes
* feat(markdown): conceals for bullets, block quotes

* fix: remove conceals for block quotes, change list minus to em dash

* fix(markdown): allow empty bullets to be concealed
2023-11-19 10:20:51 +09:00
ObserverOfTime
f9999888eb feat(jq): add locals queries
and highlight function calls
2023-11-18 19:03:19 -05:00
ObserverOfTime
f1fc7c2e76 feat(xml,dtd): add locals queries 2023-11-18 19:03:19 -05:00
ObserverOfTime
9e5a34c2b9 feat(gitattributes): add locals queries 2023-11-18 19:03:19 -05:00
ObserverOfTime
2bd2c4ce23 feat(ssh_config): add locals queries 2023-11-18 19:03:19 -05:00
ObserverOfTime
78740f1895 feat(udev): add locals queries 2023-11-18 19:03:19 -05:00
ObserverOfTime
6498be930e feat(xcompose): add locals queries 2023-11-18 19:03:19 -05:00
Marc Jakobi
5240574bcb
feat(haskell): tweak highlights
* add cases for `qualified_variable`

* add function defined in terms of composition
2023-11-18 19:02:29 -05:00
GitHub
0df364926d Update parsers: hcl, terraform, wing 2023-11-18 14:15:16 +01:00
GitHub
2b12560bc3 Update parsers: c, cpp, cuda, glsl, liquidsoap, purescript, python, rust, sql, ssh_config, t32, templ, v, wing 2023-11-18 12:36:46 +01:00
Pham Huy Hoang
a9f4a916aa chore(apex): update apex queries 2023-11-18 11:30:28 +01:00
Amaan Qureshi
557561fbc1 chore(rust): update queries from upstream 2023-11-17 13:32:09 +01:00
Pham Huy Hoang
8199529bc4 chore(apex): Update queries 2023-11-17 18:09:15 +09:00
Github Actions
73287b794d Update README 2023-11-16 22:17:41 +01:00
Vincent Rischmann
da6646c3e5
feat: add templ
---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-11-16 16:12:55 -05:00
GitHub
8b9f996602 Update parsers: cpp, wing 2023-11-15 09:06:01 +01:00
GitHub
c0da2013d1 Update parsers: objdump, sql, wing 2023-11-14 09:34:53 +01:00
GitHub
2241f81d74 Update parsers: gleam, hcl, hlsl, ini, leo, markdown, markdown_inline, purescript, sql, terraform, tlaplus 2023-11-13 20:21:38 +01:00
Github Actions
31381e3885 Update README 2023-11-13 20:06:12 +01:00
Mark McCulloh
17e77749c1
fix(wing): update parser and queries, add maintainer (#5671) 2023-11-13 19:04:27 +00:00
Riley Bruins
075a64addc feat: highlight regular latex text to maintain consistency with boldfaced and italic text 2023-11-11 10:14:43 +01:00
GitHub
42053b9db3 Update parsers: bitbake, groovy, janet_simple, liquidsoap, markdown, markdown_inline, pymanifest, requirements, sql, wing 2023-11-11 16:17:28 +09:00
Amaan Qureshi
c543ffae1c fix(ecma): prioritize builtins 2023-11-10 19:08:12 -05:00
Amaan Qureshi
f53e6e82df fix(cpp): highlight constexpr 2023-11-10 16:08:46 -05:00
ObserverOfTime
d4fb7557ba feat: add xcompose parser 2023-11-10 14:10:20 -05:00
ObserverOfTime
04a9a90c2a fix(htmldjango): improve highlights 2023-11-10 15:22:40 +02:00
GitHub
208504c707 Update parsers: go, gpg, poe_filter, ssh_config, tlaplus, udev, v, wing 2023-11-10 11:30:42 +02:00
ObserverOfTime
b09d645098 fix(kotlin): improve highlights
Co-authored-by: Anthony Shi <69449791+anthony-S93@users.noreply.github.com>
2023-11-10 11:15:30 +02:00
GitHub
8996612bfb Update parsers: arduino, bitbake, chatito, dtd, erlang, gitattributes, gleam, kotlin, purescript, v, wing, xml 2023-11-09 01:55:03 -05:00
Github Actions
7b26b08588 Update README 2023-11-08 17:11:42 +01:00
postsolar
bf18ff20ae
feat(purescript): add parser and queries (#5626) 2023-11-08 18:07:02 +02:00
Github Actions
44d1684db3 Update README 2023-11-08 10:17:00 +01:00
Willem-J-an
629cae1f0f
feat(kusto): add kusto parser and highlights (#5632)
* feat(kusto): add kusto parser and highlights

* feat(kusto): improve highlights

* Update queries/kusto/highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* chore(kusto): remove unneeded filetype

---------

Co-authored-by: Willem Jan Noort <noortw01@heiway.net>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-11-08 09:11:19 +00:00
GitHub
ec09e52d41 Update parsers: janet_simple, wing 2023-11-08 08:27:30 +01:00
Amaan Qureshi
eacb5e9468 chore(bitbake): update highlights from upstream 2023-11-08 08:08:17 +01:00
ObserverOfTime
9a746b4b6a feat: add udev rules parser 2023-11-07 12:17:38 +02:00
github-actions[bot]
e903dd54e9
Update parsers: janet_simple, perl, swift, wing (#5634)
Co-authored-by: GitHub <noreply@github.com>
2023-11-07 08:37:19 +00:00
github-actions[bot]
96f55f3043
Update parsers: awk, janet_simple, markdown, markdown_inline, wing (#5633)
Co-authored-by: GitHub <noreply@github.com>
2023-11-06 06:49:36 +00:00
Pham Huy Hoang
80f66cdef1
injections(vue): inject typescript instead of js (#5577)
Interpolations (`{{valid js code}}`) and directive attributes
(`<element :directive="valid js code"`) can also be typescript code,
hence we can inject typescript instead of javascript here and still
be ok with highlights (bar some syntax differences between ts and js)
2023-11-06 11:04:13 +09:00
GitHub
a82bba45fb Update parsers: awk, gleam, janet_simple, markdown, markdown_inline, wing 2023-11-05 13:59:39 +01:00
Ramkumar Ramachandra
b3d2c36254 mlir: update highlights.scm, parser 2023-11-05 13:36:18 +01:00
GitHub
bef2c24e23 Update parsers: dart, forth, gleam, rego, wing 2023-11-04 16:43:15 +09:00
Brian Albert Monroe
c5a7533113
fix(rnoweb): add highlights query (#5622)
Add a placeholder highlights query files for rnoweb to enable treesitter highlighting
2023-11-03 22:51:41 +09:00
Veesh Goldman
a689957480 pod: fix highlights 2023-11-03 14:23:40 +02:00
Veesh Goldman
fca784da0e perl: fix highlights for builtins 2023-11-03 14:23:40 +02:00
GitHub
f3c2710584 Update parsers: janet_simple, sql, ssh_config, wing 2023-11-03 09:48:54 +01:00
Derek Stride
1920285ec1 fix(sql): update queries from upstream 2023-11-02 19:39:34 +01:00
GitHub
43161c860e Update parsers: liquidsoap, nim, perl, sql, twig, unison, wing 2023-11-02 19:39:34 +01:00
Azad
198015cca1
fix(query): stricter match for extends directive (#5604) 2023-11-02 19:02:41 +09:00
Amaan Qureshi
051ce73fcd chore(odin): update highlights from upstream 2023-11-01 20:08:04 -04:00
GitHub
efec7115d8 Update parsers: htmldjango, nim_format_string, wing 2023-10-31 15:57:05 +09:00
Github Actions
a8c14d68b0 Update README 2023-10-30 12:37:14 +01:00
aMOPel
aeb5ad8ae1
feat(nim): added nim parser and queries (#5556)
* feat(nim): added nim parser and queries

* correct scanner.cc to scanner.c

Co-authored-by: Christian Clason <c.clason@uni-graz.at>

* fix(nim): corrected capture for @function.macro

* feat(nim highlights): added @field capture for discriminator field in
object variant

* bumped parser version, adapted highlights.scm and condensed
injections.scm

* improved nim_format_string highlights.scm

* bump nim parser version again

* removed overlap between queries for generalized strings in
injections.scm

* improved formattin] in nim_format_string/injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* corrected asm parser name in injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* improved formatting in highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* removed @error capture from highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* improved wording in comment in highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* removed priority from (dot_expression left: @none) capture, since it's
at the end of the file anyways

* removed comments listing unused captures

* reverted @error capture in nim_format_string/highlights.scm back to
@none

* condensed string alternatives in injections.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* condensed string alternatives in injections.scm (second part)

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

* added comment to explain reasoning behind priority use

* swapped order of @punctuation.delimiter and @operator to get rid of
superfluous comment

* moved macro and template keywords to @preproc capture

* removed priorities in highlights.scm and shifted @parameter capture
behind @type capture

* improved formatting in locals.scm

* added queries for missing cases of @definition.namespace capture in
locals.scm

* removed some trailing whitespace

* added @namespace queries for highlights.scm

* bumped parser version again

* removed superfluous @type capture

* removed `@type`s `has-ancestor` and removed `(_ (_ ...` structures,
but added priorities

* added missing @constant capture to some queries in highlights.scm

* fixed priority numbers so they work when injecting nim (in markdown)

* added @none captures back to injection targets

* added (assembly_statement) injection query

* added indent queries

* removed indents.scm again

* added some missing queries for dot_generic_call, concept_declaration and
pragma_statement

---------

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-30 20:35:51 +09:00
Amaan Qureshi
6f8387f05d fix(rust): add foreign_mod_item to folds 2023-10-30 04:30:30 -04:00
GitHub
f9c422a121 Update parsers: gleam, strace, wing 2023-10-30 09:13:16 +01:00
Veesh Goldman
c36681bb49 feat: bump perl 2023-10-29 20:56:01 +01:00
Ronan Arraes Jardim Chagas
d2fe87062d Add more tests for assignments 2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
a741b5dd0d Improve curly expression alignment 2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
3d6c0af936 Fix tests 2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
fc3bfd8f89 Add initial tests for Julia language indentation 2023-10-29 01:37:31 +02:00
Ronan Arraes Jardim Chagas
639c22c52c Improve indentation in Julia language
This commit improves the indentation in the function declaration,
function call, and in the assignment expressions.
2023-10-29 01:37:31 +02:00
GitHub
bf0a96568a Update parsers: gitattributes, t32, wing 2023-10-27 23:04:54 +09:00
Ronan Arraes Jardim Chagas
a07ce2155b
Fix indent. of curly expressions and of ],} in BOL (#5580) 2023-10-27 21:53:58 +09:00
Ronan Arraes Jardim Chagas
1e58a81450
Fix Julia indentation after end and with parenthesis at the beginning of line (#5579) 2023-10-27 12:28:44 +00:00
ObserverOfTime
3954741f26 chore(sql): add scanner 2023-10-26 14:48:05 -07:00
GitHub
2e6961ff9d Update parsers: glsl, perl, php, sql, t32, wing 2023-10-26 14:48:05 -07:00
Pham Huy Hoang
107e61afb7 refactor: Remove all (ERROR) @error captures
As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.

Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.

For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
2023-10-25 18:18:50 +02:00
GitHub
44762abc90 Update parsers: kotlin, wing 2023-10-25 16:44:10 +09:00
Github Actions
4199be485c Update README 2023-10-24 09:51:50 +02:00
Teddytrombone
16af5ef490
feat(typoscript) Added parser and queries for TypoScript (#5564)
* Added configuration for TypoScript

* Removed duplicated code; Applied folding suggestion

* Applied suggestions

* Update queries/typoscript/highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-24 07:48:33 +00:00
github-actions[bot]
9dca0a176d
Update parsers: liquidsoap, wing (#5568)
Co-authored-by: GitHub <noreply@github.com>
2023-10-24 07:16:19 +00:00
Riley Bruins
74ea25f95d
feat(lua): highlight variadic expressions as builtin parameters (#5567) 2023-10-24 11:19:12 +09:00
Veesh Goldman
84544f5cd3
chore(perl): update parser 2023-10-23 14:40:18 -04:00
r001
0b50cf1592
fix(leo): highlights fixes (#5563)
* make sure affine_group has priority, so parens and comma will not be miscolored; added `annotation` as @attribute

* `then` is not used as conditional, so moved to keywords

* finalize function highlight added

* differentiate between constant and variable variable identifiers
2023-10-23 19:15:49 +09:00
GitHub
5c08a5301c Update parsers: leo, liquidsoap, perl, wing 2023-10-23 09:10:38 +02:00
Colin Kennedy
0179a89656
feat: add objdump to the supported languages (#5548) 2023-10-22 12:05:20 +03:00
GitHub
07dbb3845c Update parsers: gn, leo, liquidsoap 2023-10-22 16:19:32 +09:00
Amaan Qureshi
6cb93819c9 feat: add GN (Generate Ninja) 2023-10-22 01:17:15 -04:00
github-actions[bot]
2f15204510
Update README (#5558) 2023-10-22 02:02:45 +00:00
r001
99988f6eb7
feat: leo parser and queries (#5542) 2023-10-22 10:23:02 +09:00
Tomasz N
ce2a9fb89a
fix(phpdoc): disable spell checking of attribute names (#5015) 2023-10-22 10:21:51 +09:00
Github Actions
6f2ef910c2 Update README 2023-10-21 20:49:58 +02:00
Veesh Goldman
bb3f8f40b1 feat(perl)!: switch to tree-sitter-perl org's parser 2023-10-21 14:41:22 -04:00
Veesh Goldman
7c67a1a923 feat(pod): add tree-sitter-perl org's POD parser 2023-10-21 14:41:22 -04:00
Meet Mangukiya
cffa252f5e feat: add solidity folds 2023-10-21 14:40:19 -04:00
GitHub
f636d58c8d Update parsers: haskell 2023-10-21 10:53:20 +02:00
Benedikt Reinartz
8963bc8a91
feat(erlang): add missing keyword 'begin' 2023-10-21 00:00:18 -04:00
Raafat Turki
8ac3e313f5
feat(prisma): folding queries (#5541) 2023-10-21 12:04:23 +09:00
aMOPel
6e4a770799
docs: improve description of @type.definition capture
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-10-20 15:59:56 -04:00
Hugo
486bb0e557
feat: register APKBUILD files as bash 2023-10-20 15:58:08 -04:00
GitHub
4a68f0778c Update parsers: liquidsoap, php 2023-10-20 23:19:55 +09:00
Pham Huy Hoang
605a650924
chore(wing): update queries from upstream (#5549) 2023-10-20 14:02:49 +00:00
Hugo
1bfefd1f98
docs: add hint on configuring custom filetypes (#5552)
I thought that this functionality was not possible but there's actually
an API for it. This seems like a useful place for others to find more
information on it.
2023-10-20 20:03:50 +09:00
GitHub
eb3faef3a4 Update parsers: sql, wing 2023-10-19 09:31:13 +02:00
GitHub
afa103385a Update parsers: dart, wing 2023-10-18 09:20:17 +02:00
GitHub
9c4fc86b67 Update parsers: c, cuda, glsl, hlsl, sql, wing 2023-10-17 15:54:33 +09:00
github-actions[bot]
49e71322db
Update parsers: awk, c, gstlaunch, sql, t32, wing (#5530)
Co-authored-by: GitHub <noreply@github.com>
2023-10-16 06:50:13 +00:00
Github Actions
43694a240c Update README 2023-10-15 15:03:01 -04:00
Robert Jackson
4c9da29cbd
fix(scala): add for_expression locals
This change does two main things:

1. Indicate that `(for_expression)`'s introduce a `@scope` (this
   is the scope for the enumerators to be used within the loop).
2. Indicate that the `(identifiers)` within the `(enumerators)` are
   `@definition.var`s.

---

For the following example snippet:

```scala
val fruits = List("apple", "banana", "avocado", "papaya")

val countsToFruits = fruits.groupBy(fruit => fruit.count(_ == 'a'))

for ((count, fruits) <- countsToFruits) {
  println(s"with (fruits) 'a' × $count = $fruits")
}
```

The `count` and `fruits` identifiers are new definitions introduced by
the `for` expressions scope.
2023-10-15 18:43:34 +00:00
Robert Jackson
dba7d120e5
fix(scala): ensure function_definition is in parent scope 2023-10-15 18:40:36 +00:00
Stephan Seitz
159272a809
feat: add gstreamer pipeline syntax (gstlaunch) 2023-10-15 18:38:16 +00:00
zetashift
7eadc8715d
fix(unison): improve highlight queries 2023-10-15 18:36:15 +00:00
Alexander Sieg
6608e2c868
fix(elixir): highlight functions without parenthesis (#5511)
Elixir does not require parenthesis after the function name for a
valid function definition.
2023-10-15 18:35:08 +00:00
Carlos Afonso
981b13b886 refactor: improve readability 2023-10-15 14:34:32 -04:00
Carlos Afonso
bf87a16712 fix(php): fix indentation for in between braces 2023-10-15 14:34:32 -04:00
Riley Bruins
28e1361d4a fix(markdown): set block quote priority within allowed range 2023-10-15 14:34:08 -04:00
Riley Bruins
ea5f5fddad fix(markdown): give code blocks higher priority than block quotes 2023-10-15 14:34:08 -04:00
Robert Jackson
262e9b1e86 fix(scala): Mark (lambda_expression) without bindings as @defintition.parameters
When you have a lambda expression like:

```scala
val fruits = List("apple", "banana", "avocado", "papaya")

val countsToFruits = fruits.groupBy(fruit => fruit.count(_ == 'a'))

for ((count, fruits) <- countsToFruits) {
  println(s"with (fruits) 'a' × $count = $fruits")
}
```

The `fruit => fruit.count(_ == 'a')` lambda expression (note: without
wrapping parenthesis) does not create a `(binding)` node. Its syntax
tree is:

```
    (lambda_expression) ; [5:18 - 47]
     parameters: (identifier) ; [5:18 - 22]
     (call_expression) ; [5:27 - 47]
      function: (field_expression) ; [5:27 - 37]
       value: (identifier) ; [5:27 - 31]
       field: (identifier) ; [5:33 - 37]
      arguments: (arguments) ; [5:38 - 47]
       (infix_expression) ; [5:39 - 46]
        left: (wildcard) ; [5:39 - 39]
        operator: (operator_identifier) ; [5:41 - 42]
        right: (character_literal) ; [5:44 - 46]
```

That example just _happens_ to be **exactly** one of the example from
https://www.scala-lang.org/ ([see
playground](https://scastie.scala-lang.org/S0bkCiXkQiuOMXnlhWn46g)) 😁.
2023-10-15 14:33:21 -04:00
Marc Jakobi
d33dbdab01 feat(haskell): highlights improvements
- Consider functions with only one value on the rhs as variables
- Applied composition: `(f . g) <param>` -> `@function.call`
- View patterns
- `@field` in record update expression
- type_tuple and type_list as variables
- quantifier for `exp_apply (<rhs>)+ (variable)`
- type_tuple and type_list as variables
- Treat signatures with only one value on the rhs as variables
  (except for `IO a`) -> Fixes #5505.
- Remove redundant anchors from signature function queries.
- Move signature function queries to give them higher priority
- Scoped function types
- Add signature query to function with parameters query
2023-10-15 14:32:51 -04:00
Munif Tanjim
f8fcb0da06 fix(typescript): do not highlight undefined as variable 2023-10-15 13:15:22 +03:00
GitHub
f213fae3dd Update parsers: beancount, wing 2023-10-15 16:40:00 +09:00
nsfisis
ad02fbcdfc
fix(php): highlight never as @type.builtin (#5522) 2023-10-14 21:04:06 +09:00
GitHub
eefea35865 Update parsers: liquidsoap, t32, wing 2023-10-14 15:52:13 +09:00
Ibrahim Delice
0d5c611e3f
feat(java): highlight var as @type.builtin 2023-10-13 18:12:18 -04:00
Ibrahim Delice
b59a1fa075
fix(java): move @ to @attribute 2023-10-13 21:08:05 +00:00
Kevin Durbin
168972a0d5 fix(injections): fix injection for hurl for new injection syntax 2023-10-13 17:42:03 +02:00
Marc Jakobi
783e5fc307
feat(nix): some highlight improvements
- functions
- builtin functions with prefix
- add test file
2023-10-12 19:04:55 +00:00
GitHub
49f7194e4c Update parsers: wing 2023-10-12 16:11:16 +09:00
GitHub
e5198778db Update parsers: bash, dockerfile, groovy, python, swift, wing 2023-10-11 09:30:40 +02:00
Marc Jakobi
0eb1a0ad1c
fix(haskell): prevent segfault due to anchorless queries (#5502) 2023-10-10 17:12:36 +09:00
GitHub
34e6ace726 Update parsers: beancount, vimdoc, wing 2023-10-10 09:09:18 +02:00
Github Actions
1d1c32b64b Update README 2023-10-09 15:39:22 +02:00
Noah
95364251e5
chore(clojure): update maintainer 2023-10-09 15:38:26 +02:00
ObserverOfTime
dfd4fb330f
feat: add nasm parser (#5475)
* feat: add nasm parser

* chore: update highlights

---------

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-10-09 11:28:28 +03:00
GitHub
51372f1d4e Update parsers: swift, wing 2023-10-09 15:57:57 +09:00
GitHub
a102053352 Update parsers: wing 2023-10-08 10:45:15 +02:00
GitHub
957f3f8c15 Update parsers: erlang, kotlin, wing 2023-10-07 16:55:02 +09:00
Mathew Polzin
3a2cc3161e
feat(authzed): add parser and highlight queries. (#5426)
* feat(authzed): add parser and highlight queries

* Update queries/authzed/highlights.scm

use `any-of` for list of alternative words.

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* add injections queries file.

* Update queries/authzed/highlights.scm

* tweak whitespace

* fix errors with capture names.

* style(authzed): reformat highlights

* add self as maintainer

* Update lua/nvim-treesitter/parsers.lua

Co-authored-by: Christian Clason <c.clason@uni-graz.at>

* Add to lockfile and readme

* feat(authzed): Updates to queries and lockfile around newest Authzed parser changes.

* Update queries/authzed/highlights.scm

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* Update queries/authzed/highlights.scm

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

* unnest here similarly to recommended elsewhere

* Update highlights.scm

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

---------

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-10-07 10:43:35 +09:00
GitHub
10bfa4826f Update parsers: cuda, elm, erlang, glimmer, glsl, hlsl, java, tsx, typescript, usd, wing 2023-10-06 10:26:35 +02:00
Pham Huy Hoang
4e758a89a5 fix(json5): update queries from upstream 2023-10-06 10:07:20 +02:00
Pham Huy Hoang
db7adb21e6
java(highlights): add missing import class pattern (#5483) 2023-10-06 12:22:53 +09:00
Marc Jakobi
6276cd9d41
fix(haskell): highlight fixes (#5470)
* fix(haskell): highlight fixes + merge qualified/unqualified queries

* fix(haskell): lambda params + add exp_record to function.call args

* style: apply PR suggestions
2023-10-05 20:04:46 +03:00
GitHub
dd72cfadec Update parsers: c, comment, glimmer, json, liquidsoap, rst, sql, tsx, typescript, wing 2023-10-05 08:52:58 +02:00
Github Actions
f51d56c261 Update README 2023-10-04 17:42:23 +02:00
Romain Beauxis
691fdc61a1
feat: add liquidsoap
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
2023-10-04 10:58:10 -04:00
Amaan Qureshi
eb96ca52a7 fix(c): add missing folds 2023-10-04 06:36:59 -04:00
GitHub
06fa0a0234 Update parsers: wing 2023-10-04 08:50:47 +02:00
Jaehwang Jung
812c2dd8fe feat(query): use @function.call for predicate 2023-10-03 17:54:10 +02:00
Jaehwang Jung
9e52d8fda3 feat(ocaml): use @function.call where appropriate 2023-10-03 17:54:10 +02:00
GitHub
32cc79b633 Update parsers: apex, bash, html, kotlin, norg, php, soql, sosl, sql, wing 2023-10-03 08:56:00 +02:00
Marc Jakobi
d96c216c54
feat(haskell): highlights improvements + tests (#5466) 2023-10-02 10:49:12 +00:00
GitHub
faeb88e4ce Update parsers: wing 2023-10-02 08:52:24 +02:00
figsoda
811e8ba4f3 injections(nix): dynamic language injection via comments 2023-10-01 18:36:24 +02:00
github-actions[bot]
776e4d341b
Update parsers: vim, wing (#5463)
Co-authored-by: GitHub <noreply@github.com>
2023-10-01 07:36:51 +00:00
GitHub
dd4e2dbc00 Update parsers: wing 2023-09-30 10:04:13 +02:00
GitHub
16ea2969ea Update parsers: wing 2023-09-29 11:40:47 +02:00
GitHub
cc2f94ed1d Update parsers: dockerfile, ssh_config, t32, wing 2023-09-28 18:49:02 +02:00
Marc Jakobi
cb139d880b chore(haskell): add mrcjkb as maintainer 2023-09-27 17:18:14 +02:00
Marc Jakobi
ec0e344f6e feat(highlights): some haskell additions
- Re-add (module) @namespace
- Exception handling
- Debugging
- `otherwise` = boolean `True`
- `qq` string quasiquotes
- Documentation comments (draft)
- Function/lambda parameters
- Remove recently added @ (already defined as an operator)
2023-09-27 17:18:14 +02:00
GitHub
d6c9c85e14 Update parsers: git_config, gleam, wing 2023-09-27 08:57:09 +02:00
zeroknots
86d0b2b1c0
solidity: Update highlights.scm (#5453)
https://soliditylang.org/blog/2021/04/21/custom-errors/

error keyword was introduced in 0.8.4
2023-09-27 15:08:46 +09:00
Enzo L F
a255654459
feat(julia): added missing String and AbstractString builtin types (#5440)
* feat(julia): added missing String and AbstractString builtin types

* feat(juia): added all public built-in types in Core and Base

* feat(julia): removed private types from built-in type list
2023-09-27 11:50:57 +09:00
GitHub
b5873bacb4 Update parsers: erlang, wing 2023-09-26 09:35:04 +02:00
Marc Jakobi
f3fb301b26 feat(highlights): some haskell improvements 2023-09-25 13:01:31 +02:00
GitHub
73fbc807eb Update parsers: haskell, scala, wing 2023-09-25 08:51:11 +02:00
ghostbuster91
3a251ac1b4 Use scala parser for sbt filetype 2023-09-25 08:13:14 +02:00
github-actions[bot]
0960322686
Update parsers: cuda, glsl, scala, ssh_config (#5441)
Co-authored-by: GitHub <noreply@github.com>
2023-09-24 07:27:59 +00:00
github-actions[bot]
af6b3ecea9
Update parsers: wing (#5439) 2023-09-23 16:23:56 +09:00
GitHub
fc93fa5c07 Update parsers: bitbake, python, rust, wing 2023-09-22 08:48:29 +02:00
GitHub
b7f2dd5dfb Update parsers: bash, t32, wing 2023-09-21 09:00:15 +02:00
GitHub
c29d973c40 Update parsers: luadoc, scala, ssh_config, wing 2023-09-20 08:55:49 +02:00
nedia
9409160748
feat(dart): add base, final & sealed class modifier highlights 2023-09-19 09:30:17 +00:00
Christian Clason
42d0fb31bd fix(haskell_persistent): adapt to scanner rewrite 2023-09-19 10:07:39 +02:00
GitHub
1ccbf82a9c Update parsers: awk, haskell_persistent, scala, ssh_config, wing 2023-09-19 10:07:39 +02:00
PorterAtGoogle
b4f6dd7298
feat(textproto): Add Textproto parser and queries (#5402)
* Add textproto parser and queries

* remove extra newline

* Apply suggestions from code review

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>

---------

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-09-19 01:26:02 +09:00
github-actions[bot]
f9034812d8
Update README (#5419)
Co-authored-by: Github Actions <actions@github>
2023-09-18 18:26:55 +09:00
ObserverOfTime
c0f4363b72 feat: add ssh config 2023-09-18 11:38:56 +03:00
GitHub
6f3f89a6dd Update parsers: agda, wing 2023-09-18 08:51:21 +02:00
Github Actions
c0170e1e2c Update README 2023-09-18 07:51:17 +02:00
ShootingStarDragons
6a865af171 chore: switch agda upstream 2023-09-18 07:42:58 +02:00
Maria José Solano
eb0f975bf2 feat(markdown): conceal triple backticks and HTML entities 2023-09-17 23:16:53 +02:00
Github Actions
9dd3e07609 Update README 2023-09-17 19:16:00 +02:00
Xi Xiao
280cf6fddd
feat: add parsers and queries for apex, sosl, soql (#5396) 2023-09-17 20:00:21 +03:00
Christian Segundo
dac6efbaff fix(dockerfile): bash injection on run instructions 2023-09-17 16:32:21 +02:00
Jaehwang Jung
58c8682290 fix: trees() may not be list-like 2023-09-17 11:11:15 +02:00
GitHub
1233138586 Update parsers: php 2023-09-17 10:51:39 +02:00
Pham Huy Hoang
794266a4ed
injections(lua): add vim highlights to api funcs (#5404)
Add vim injections for `vim.api.nvim[_buf]_create_user_command` and
`vim.api.nvim_create_autocmd`
2023-09-16 19:08:08 +09:00
github-actions[bot]
c617560e1b
Update parsers: lalrpop, wing (#5403)
Co-authored-by: GitHub <noreply@github.com>
2023-09-16 07:00:41 +00:00
Christian Clason
bf8b089eec fix(lua): fix luadoc injections 2023-09-15 14:55:34 +02:00
Christian Segundo
831dbb619e fix(yaml): promql injections block 2023-09-15 12:53:44 +02:00
GitHub
48b237fd3f Update parsers: cue, nickel, wing 2023-09-15 15:52:33 +09:00
Christoph Sax
5ec4217567 fix(t32): update indent queries & test
The latest release of the grammar changes the handling of consecutive
line breaks. This breaks the existing test for indents.

This commit updates the indent queries and fixes the associated test.
2023-09-14 20:07:02 +02:00
GitHub
25c591611e Update parsers: t32, wing 2023-09-14 09:58:52 +02:00
GitHub
9ab4e9cc89 Update parsers: glsl, hlsl, wing 2023-09-13 09:12:49 +02:00
Github Actions
31d30b3eba Update README 2023-09-13 09:10:28 +02:00
osthomas
2461e5ac21
feat: add Snakemake 2023-09-12 21:29:22 -04:00
Jaehwang Jung
9567185621 feat: @spell on comments 2023-09-12 17:34:58 +02:00
Jaehwang Jung
905e782e80 perf(comment): remove spell capture
Problem:
Comment highlight query produces too many @spell captures.

Solution:
Remove the query. This is fine because comment parser is only used in
injection and the parent language has @spell for comment.
2023-09-12 17:34:58 +02:00
GitHub
0ba881b7a2 Update parsers: gleam, vhs, wing 2023-09-12 08:48:28 +02:00
Pham Huy Hoang
bfb4601f48
refactor: remove include-children from queries (#5226)
These `include-children` were to alleviate an issue with empty range language tree, which has been fixed for Neovim nightly/Neovim 0.9.2
2023-09-12 08:36:50 +02:00
L Lllvvuu
15d327fe63 fix!: backport ac9e755 from main
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Closes: neovim/neovim#25088
2023-09-11 10:00:25 +02:00
GitHub
991ae3da02 Update parsers: strace 2023-09-11 09:41:31 +02:00
Alex Pinkus
96a5024198
feat(swift): update parser and queries
Co-authored-by: Alex Pinkus <pinkus@amazon.com>
2023-09-10 19:38:36 +02:00
Github Actions
d5f57cd479 Update README 2023-09-10 14:44:43 +02:00
Beartama
4c1a76ec23
feat: add EDS 2023-09-10 08:38:10 -04:00
Loong
b6492f41c4 fix(julia): fix highlighting end keyword 2023-09-09 22:42:53 +02:00
GitHub
c13e28f894 Update parsers: llvm, wing 2023-09-09 08:51:04 +02:00
GitHub
dfcfdb0e7b Update parsers: dart, lua, sql, t32, wing 2023-09-08 09:12:07 +02:00
Munif Tanjim
80b4fa7970 fix(lua): highlights for attribute 2023-09-07 03:36:55 -04:00
GitHub
adfebcfe75 Update parsers: elm, wing 2023-09-07 09:18:59 +02:00
GitHub
cc56e1f093 Update parsers: ada, hoon, wing 2023-09-06 08:48:56 +02:00
GitHub
95d02cdafe Update parsers: julia, wing 2023-09-05 09:23:47 +02:00
GitHub
30604fd7dd Update parsers: blueprint, devicetree, java, wing 2023-09-04 09:05:15 +02:00
Tavish Pegram
9d637b7ae8
Feat: Add unison (#5340)
* Add unison

* Trivial change to force prepush hook

* Undo change

* PR Feedback - remove appended text in query after variable, update lockfile, remove main branch specification in parser

* Replacing captures with only ones in the contributing.md

* Fix typo

* Generate from grammar

* First group of suggested changes

* Update gt operator

* Remove outer parens

* Remove maybe.c

* Add comment injection
2023-09-03 15:05:18 -04:00
Yuri Socher Bichibichi
17b943e7c5 docs: fix typo in README.md 2023-09-02 17:54:11 +03:00
GitHub
e60057b389 Update parsers: gpg, requirements, wing 2023-09-02 02:56:58 -04:00
GitHub
691d73287a Update parsers: csv, kconfig, nqc, psv, racket, scala, scheme, tsv, wing 2023-09-01 09:19:08 +02:00
Amaan Qureshi
f8c2825220 feat: add Kconfig 2023-08-31 14:19:23 -04:00
Tobias S
8e9cc89955
fix(ecma_injections): limit function names to alphanumeric characters only 2023-08-31 22:41:07 +09:00
Amaan Qureshi
9361484fa4 feat(doxygen): update queries from upstream 2023-08-31 14:02:31 +03:00
Amaan Qureshi
f0f115e926 feat: add NQC 2023-08-31 05:25:29 -04:00
GitHub
4a9adef710 Update parsers: fortran, wing 2023-08-31 08:50:24 +02:00
Amaan Qureshi
920b37260e feat(bash): update parser and queries 2023-08-30 14:36:10 -04:00
GitHub
7f6ff292e3 Update parsers: hack, rust, tiger, wing 2023-08-30 02:48:54 -04:00
GitHub
6def3eea22 Update parsers: ada, java, wing 2023-08-29 09:44:11 +02:00
GitHub
d94e1ad957 Update parsers: bash, gleam, wing 2023-08-28 02:58:49 -04:00
Stephan Seitz
08c830f625 folds(typescript): add enum_declaration
Fixes #5325
2023-08-27 16:01:05 -04:00
Amaan Qureshi
d0b17cc0b9 feat(doxygen): update parser and queries 2023-08-27 04:21:42 -04:00
Kevin Svetlitski
1705a3e486
feat(vim): add the builtin sign command (#5322) 2023-08-27 10:43:10 +03:00
Noah
e942c720ac
fix(clojure): fix field highlighting (#5319) 2023-08-27 10:25:43 +03:00
GitHub
dfbba919dd Update parsers: bash, doxygen, wing 2023-08-27 02:52:54 -04:00
GitHub
cb74c1c5ae Update parsers: commonlisp, glsl, wing 2023-08-26 05:35:04 -04:00
Amaan Qureshi
3be738312b
fix(bash): update queries from upstream (#5321) 2023-08-26 09:06:54 +00:00
Amaan Qureshi
a4f4fcdd3e feat: add Doxygen 2023-08-26 04:58:36 -04:00
Jeroen Op 't Eynde
4d41d9bfb0
feat(jsonnet): update parser and queries 2023-08-25 13:55:22 -04:00
GitHub
bae2c1824f Update parsers: bash, javascript, rust, wing 2023-08-25 16:09:33 +09:00
Matthias Q
33958915fe
highlights(sql): add t-sql specific data types (#5311) 2023-08-25 09:23:38 +09:00
Amaan Qureshi
ed2c6da5a0 feat(bash): add missing highlights 2023-08-24 17:17:53 -04:00
ObserverOfTime
31f608e47b feat(bash): fold heredocs 2023-08-24 12:11:16 +03:00
ObserverOfTime
103ecdf758 fix(bash): fix injections 2023-08-24 12:11:16 +03:00
ObserverOfTime
1ff7985a74 feat(bash): improve highlights 2023-08-24 12:11:16 +03:00
GitHub
99eef501a3 Update parsers: bash, dart, heex, java, wing 2023-08-24 16:29:01 +09:00
Amaan Qureshi
8ecf630b8e fix(dart): update queries from upstream 2023-08-24 03:08:45 -04:00
Amaan Qureshi
c58694685d feat: add re2c 2023-08-24 02:52:48 -04:00
ObserverOfTime
05fe2c38a3 refactor: replace some match & vim-match usages 2023-08-23 16:57:18 +03:00
GitHub
9ea7559ea9 Update parsers: ada, bash, java, matlab, wing 2023-08-23 15:52:18 +09:00
GitHub
ceaea55e0c Update parsers: bash, forth, hurl, wing 2023-08-23 12:31:24 +09:00
Pham Huy Hoang
2ee71c1a2f
fix(lua): use include-children instead (#5299)
The root issue is fixed with neovim 0.9.2. But the current stable
version is neovim 0.9.1, so partially reverts the commit to make it
compatible with the current stable version.
2023-08-22 09:53:11 +09:00
Damir Vandic
46dee161d3
fix: HEEx partial expression injections
Fixes #5296
2023-08-21 17:22:34 -04:00
Amaan Qureshi
7c935d6bd5 feat: add Forth 2023-08-21 05:04:42 -04:00
GitHub
620b60b5ba Update parsers: css, glsl, jsdoc, scala, sql, wing 2023-08-21 02:57:42 -04:00
Amaan Qureshi
a185f8ebae feat: add strace 2023-08-20 14:52:06 -04:00
GitHub
43b2153d26 Update parsers: arduino, bash, julia, rust, wing 2023-08-20 03:29:08 -04:00
ObserverOfTime
34b2f7803b ci: fix update lockfile workflow 2023-08-20 10:11:11 +03:00
ObserverOfTime
8fa7ce35af chore: ignore ci artifacts 2023-08-19 11:10:21 +03:00
Gustavo Ordaz
add1864bbf feat(swift): improve highlights 2023-08-18 04:48:40 -04:00
ObserverOfTime
1a4116aef1 ci: update workflows 2023-08-18 11:09:57 +03:00
ObserverOfTime
f8bc6c69d7 ci: add shebangs to scripts 2023-08-18 11:09:57 +03:00
Pham Huy Hoang
4613314b1f feat(java): add highlights to string interpolation 2023-08-18 03:10:30 -04:00
GitHub
5a476c7c27 Update parsers: cuda, gpg, hlsl, java, javascript, php, scala, wing 2023-08-18 15:56:00 +09:00
TheLeoP
bbb92b2b8e
fix(lua): luap injection (#5275)
* fix(lua): luap injection

* test(lua): check for incorrect hlgroup of injected luap

* chore(lua): injections styling

* chore(lua): ignore luacheck for test.lua
2023-08-18 02:17:04 +00:00
Amaan Qureshi
3073b093d0 chore(csv,psv,tsv): update parser to fix numbers 2023-08-17 22:01:19 -04:00
Cezary Drożak
4ffdc4c985 feat: update jsonnet queries 2023-08-17 21:46:33 -04:00
Amaan Qureshi
17d3398b5b feat: add CSV, PSV, & TSV 2023-08-17 11:15:54 -04:00
Amaan Qureshi
977e932726 feat: add BitBake 2023-08-17 11:14:32 -04:00
ObserverOfTime
f7bb866405 feat: add gpg config parser 2023-08-17 11:24:41 +03:00
Github Actions
04cab345e9 Update README 2023-08-17 07:51:55 +02:00
Tomas Sandven
087166aae1
feat(robot): update parser, queries and maintainer
* Update tree-sitter-robot version and maintainer

* Improve query code style

* Update tree-sitter-robot revision
2023-08-17 00:27:51 -04:00
Amaan Qureshi
0e27391e90 feat(python): update parser & highlights 2023-08-16 20:28:11 -04:00
Guilherme Soares
a3b2e0dcdb
feat(c_sharp): add missing highlights
Added:
 * `??` and `??=` as operators
 * `alias` as keyword
 * `when` as conditional
2023-08-16 17:44:47 -04:00
Sergio A. Vargas
3fbf513829
feat(julia): spell-check docstrings
Enable spell checking of docstrings without markdown injections.
2023-08-16 16:30:59 -04:00
TheLeoP
922c396b26 fix(python): right content for regex injection 2023-08-16 12:25:51 -04:00
sogaiu
59f06b3b33 feat(janet): update highlights 2023-08-16 12:23:18 -04:00
Munif Tanjim
5f01ffd478 fix(lua): injections for comment and luadoc 2023-08-16 16:17:13 +02:00
GitHub
7c27beddda Update parsers: cmake, cpp, ispc, java, lua, robot, wing 2023-08-16 10:43:19 +02:00
Pham Huy Hoang
294f753ed3
fix(ecma): fix no injections for innerHTML (#5258) 2023-08-16 16:58:25 +09:00
Amaan Qureshi
64d1696d6d fix(python,starlark): update parsers & add escape_interpolation 2023-08-16 03:23:24 -04:00
dvic
11d79aa0f7 Fix HEEx directive injections 2023-08-15 11:13:33 +02:00
GitHub
93ee00cd9d Update parsers: arduino, cuda, glsl, hlsl, objc, promql, wing 2023-08-14 09:06:35 +02:00
Amaan Qureshi
b5f2030312 chore(c-family): inject all preproc args again 2023-08-13 18:57:23 -04:00
Amaan Qureshi
e0f4782978 feat(c): mention how to highlight K&R functions 2023-08-13 18:57:23 -04:00
Amaan Qureshi
8fbc841df8 chore: update c & cpp 2023-08-13 18:57:23 -04:00
Matthieu Coudron
bc52938ddd ci: dont hardcode the rockspec version 2023-08-13 15:01:04 +02:00
Matthieu Coudron
baed6439e2 ci: fix luarocks tag release process
bumped version of the action

Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
2023-08-13 11:26:59 +02:00
GitHub
64a7e20be2 Update parsers: bash, c, cuda, wing 2023-08-13 11:05:21 +02:00
ObserverOfTime
4e35ae6f71 feat: add pymanifest parser 2023-08-13 10:42:09 +03:00
ObserverOfTime
5b3dd8cff1 feat: add xml & dtd parsers 2023-08-13 10:34:57 +03:00
Christian Clason
800b2f388b fixup: php injections 2023-08-12 17:45:44 +02:00
Christian Clason
b223402ba9 fix(directive): make downcase work on captures 2023-08-12 17:34:15 +02:00
ObserverOfTime
71532e7776 feat(bash): add heredoc injection 2023-08-12 17:34:15 +02:00
ObserverOfTime
d8e625df2d fix(php): heredocs injections & highlights 2023-08-12 17:34:15 +02:00
Pham Huy Hoang
39f07cd375 injections(query): add gsub pattern (#4897) 2023-08-12 17:34:15 +02:00
lnay
efe06e3057 Add extra language injections for latex (#4896)
Add python injections to contents of `sagetex` defined environments, similarly to how `pycode` currently treated.
2023-08-12 17:34:15 +02:00
CalebW
246f4cc20c Add PHP heredoc and nowdoc injections (#4866) 2023-08-12 17:34:15 +02:00
Pham Huy Hoang
78b54eb7f6 chore(injections)!: update injection syntax to 0.9
Since 0.9, @lang syntax is still available as fallback but will soon be deprecated.
Because of that, new syntax should be adopted once 0.9 becomes the
baseline requirements for nvim-treesitter

- update health check
- update doc
2023-08-12 17:34:15 +02:00
Christian Clason
2aa9e9b0e6 feat!: bump required Nvim version to 0.9.1 2023-08-12 17:34:15 +02:00
GitHub
63260da18b Update parsers: teal, wing 2023-08-12 11:14:29 +02:00
Amaan Qureshi
fa414da96f chore: update cpp 2023-08-11 14:38:50 -04:00
Amaan Qureshi
41f35eac4f fix(c-family): inject into preproc args in preproc defs when it spans multiple lines only 2023-08-11 14:38:50 -04:00
Amaan Qureshi
acd9d2115d feat(c): update highlights 2023-08-11 14:38:50 -04:00
github-actions[bot]
15129f6d70
Update parsers: arduino, ispc (#5229)
Co-authored-by: GitHub <noreply@github.com>
2023-08-11 08:55:54 +00:00
github-actions[bot]
f3cf4a9a6c
Update parsers: cpp, cuda, glsl, hlsl, objc, vim, wing (#5228)
Co-authored-by: GitHub <noreply@github.com>
2023-08-11 08:01:11 +00:00
Borys Lykah
c981ea0684 fix: rename filetype for haskell persistent to match vim 2023-08-11 01:26:54 -04:00
ObserverOfTime
898f9c13d6 feat: add requirements parser 2023-08-10 23:17:56 +03:00
Yuki Ito
d92bfe2cbd feat(go): add max and min to @function.builtin 2023-08-10 11:18:57 -04:00
Amaan Qureshi
251fe95efd
fix: update preproc injections for arduino, cuda, glsl, hlsl 2023-08-10 16:43:45 +02:00
Amaan Qureshi
3d3b335ace fix(cpp): update injections from C 2023-08-10 16:09:50 +02:00
GitHub
477a5d76a2 Update parsers: arduino, c, chatito, cpp, cuda, gitattributes, jsonnet, pem, wing 2023-08-10 09:43:40 +02:00
GitHub
80cee52d44 Update parsers: htmldjango, scala, sql, wing 2023-08-09 09:57:20 +02:00
Lewis Russell
ae88851cac feat: add .luarc.json 2023-08-08 14:03:02 +01:00
GitHub
a9ce9fb7cc Update parsers: wing 2023-08-08 09:11:17 +02:00
Matthias Queitsch
2f5b4a65dc feat(sql): add missing keywords 2023-08-07 22:19:57 +01:00
ShellCode33
d9e75a1736 queries/*/highlights.scm : remove @spell for strings 2023-08-07 16:39:40 +01:00
Lewis Russell
d9be302f74
fix(spell): do not spell check certain types of strings (#5203)
- Document that only certain kinds of strings are spell checked, and
  reasons why they may not.

- Remove spell checking for bash strings.
2023-08-07 13:42:24 +01:00
GitHub
2051c8603d Update parsers: wing 2023-08-07 09:03:06 +02:00
GitHub
8d5e5dc40a Update parsers: julia, wing 2023-08-05 09:56:32 +02:00
GitHub
6c93c86272 Update parsers: chatito, jsonnet, pem, racket, scheme, wing 2023-08-04 08:46:47 +02:00
ObserverOfTime
131f665f90 feat(perl): improve highlights 2023-08-03 15:45:39 +03:00
GitHub
1e5576fa01 Update parsers: awk, cuda, diff, elm, foam, gleam, gomod, hlsl, ini, java, perl, proto, racket, rst, scheme, sql, t32, wing 2023-08-03 08:48:27 +02:00
Amaan Qureshi
80aee02921 fix(gleam): update queries from upstream changes 2023-08-02 23:02:54 +02:00
Github Actions
bec1ceee16 Update README 2023-08-02 14:11:39 -04:00
Trey Wood
8968a3a541
feat!: change upstream proto parser and improve highlights 2023-08-02 13:54:53 -04:00
Christian Clason
4c4d586a05 fix(t32): correct gitlab URL 2023-08-01 09:47:37 +02:00
Amaan Qureshi
8e70f17f71 fix(perl): update highlights from upstream changes 2023-08-01 09:13:09 +02:00
Christoph Sax
4fd6d9dc17 refactor(t32): remove revision pinning 2023-08-01 05:44:28 +02:00
Chinmay Dalal
82c9486539 fix(fennel): capture method calls as @method.call 2023-07-31 06:47:45 -04:00
Github Actions
1c79da3300 Update README 2023-07-30 19:32:32 +02:00
Christoph Sax
0fe8fa0bcf feat(t32): update tests to new node types 2023-07-30 19:29:33 +02:00
Christoph Sax
536c8a3880 feat(t32): re-enable tests
- Switch to GitLab mirror repository
- Lock grammar version 2.2.0
- Revert "fix(tests): mark t32 as allowed to fail"
  This reverts commit ba223ceecc.
- Revert "fix(tests): remove t32 tests"
  This reverts commit 97957a547b.
2023-07-30 19:29:33 +02:00
Christoph Sax
2fb7359828 feat(t32)!: update queries for new HLL node types
- Lock grammar to version 2.1.1
- Update query for syntax hightlighting
- fix missing locals query
- reduce number of "(identifier) @variable" highlight queries
- revert to capture @function.builtin for PRACTICE call expressions
2023-07-30 19:29:33 +02:00
Matthias Queitsch
e8648569d8 feat(sql): add new keywords 2023-07-30 10:45:04 +02:00
GitHub
ee107fc759 Update parsers: fortran, glsl, hoon, matlab, wing 2023-07-29 11:11:01 +02:00
Christian Clason
97957a547b fix(tests): remove t32 tests
t32 parser is hosted on Codeberg, which has frequent outages that block
unrelated CI. Revert this commit if and when uptime has improved.
2023-07-29 10:56:17 +02:00
Christian Clason
ba223ceecc fix(tests): mark t32 as allowed to fail 2023-07-29 10:41:51 +02:00
Matthias Queitsch
db0ccd920b feat(prql): change func to let for prql 0.9.x 2023-07-28 18:41:16 +02:00
GitHub
5e27645a2b Update parsers: c, cuda, fortran, haskell, heex, luap, ocamllex, php, prql, python, verilog, wing 2023-07-28 03:11:19 -04:00
Matthias Q
205b9e9bb8
feat(sql, prql): update sql highlights, update prql to v0.9.x compatiblity 2023-07-28 02:58:19 -04:00
Amaan Qureshi
6aababfca4 chore: update C, improve preproc_arg highlights 2023-07-27 07:29:33 -04:00
Amaan Qureshi
f590e13d6d fix(c): only inject in preproc function calls/definitions 2023-07-27 05:40:44 -04:00
GitHub
c2eae58ce2 Update parsers: cairo, elixir, elm, go, hack, kotlin, matlab, perl, poe_filter, promql, python, racket, robot, scala, t32, wgsl_bevy, wing 2023-07-27 10:48:01 +02:00
Amaan Qureshi
f09bcffe0c fix(hoon): add scanner file 2023-07-27 10:30:07 +02:00
Amaan Qureshi
11610e0631 fix(pug): adapt to scanner rewrite 2023-07-27 10:23:36 +02:00
Michael Hoffmann
0b0e460180 fix(promql): bump parser, fix queries
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
2023-07-27 10:22:14 +02:00
Amaan Qureshi
ad3805f5c3
fix(c)!: update C, CPP parsers and queries
also update derived parsers (arduino, cuda, glsl, hlsl, ispc, objc)
2023-07-27 09:51:13 +02:00
Amaan Qureshi
203981d288 fix(hcl, terraform): adapt to scanner rewrite 2023-07-27 09:13:19 +02:00
Amaan Qureshi
25158a8b39 fix(r): adapt to scanner rewrite 2023-07-27 08:51:34 +02:00
Hugo
736a672afe
feat: add scfg 2023-07-25 16:49:09 -04:00
Stephan Seitz
4920a4e732 highlights(wgsl_bevy): add support for naga_oil features
Bevy has switched to https://github.com/bevyengine/naga_oil which allows
new syntax constructs.
2023-07-25 22:22:35 +02:00
pseudometa
74a7da4e4b
feat(comment): highlight more comment tags 2023-07-25 09:03:54 -04:00
Amaan Qureshi
48df8efa25 chore(puppet): update queries from upstream 2023-07-24 23:38:46 -04:00
Amaan Qureshi
7c1e944311 fix(fortran): adapt to scanner rewrite 2023-07-24 21:51:32 +02:00
Sergio Alejandro Vargas
5be3ddeadd fix(julia): symbol highlighting
Update the `@symbol` capture to enable highlighting symbols
differently from variables.

See https://github.com/tree-sitter/tree-sitter-julia/issues/110
2023-07-24 21:33:47 +02:00
Christian Clason
7b04e8b67e Update lockfile.json: elvish, erlang, markdown, markdown_inline, matlab, ocaml, ocaml_interface, robot, tsx, typescript, wing 2023-07-22 14:15:46 +02:00
Christian Clason
a8ac8419c4 fix(regex): bump to latest commit 2023-07-21 12:33:02 +02:00
Constantine Bulany
4115fad9fd
fix(yaml): typo in promql injection (#5130) 2023-07-20 01:41:50 +09:00
Github Actions
9fa6806b88 Update README 2023-07-18 23:29:20 +02:00
OK Ryoko
461d841771
feat: add SystemTap (#5097) 2023-07-18 22:55:06 +03:00
Github Actions
19b29f7cb0 Update README 2023-07-18 09:06:04 +02:00
Michael Hoffmann
b64ea2ec44 feat(promql,yaml): add parser and yaml injections
Signed-off-by: Michael Hoffmann <mhoffm@posteo.de>
2023-07-18 03:03:11 -04:00
Amaan Qureshi
a2c3a7319f fix(menhir): adapt to scanner rewrite 2023-07-18 08:52:45 +02:00
Matthias Q
e75b795f00
feat(sql): update queries for newly added keywords 2023-07-18 02:39:36 -04:00
Ananda Umamil
44211e7f6e
feat(typescript): highlight decorators, default case, global declaration 2023-07-17 14:19:28 -04:00
Github Actions
f6c52eb839 Update README 2023-07-17 14:30:50 +02:00
Tobias Frilling
1bd95ec90a fix(parsers): ownership transfer of elvish
I've transferred the ownership of the elvish grammer to @elves, which is the org that develops elvish.
2023-07-17 14:21:46 +02:00
Github Actions
180399295d Update README 2023-07-17 10:21:48 +02:00
Emmanuel Bustos Torres
dd6964575e
feat: add Robot Framework parser and highlights 2023-07-17 10:21:10 +02:00
GitHub
1e3b986650 Update parsers: arduino, c, elixir, ocaml, ocaml_interface, wing 2023-07-17 09:53:25 +02:00
Bugala Piotr
7caa976154 feat(groovy): Add more support for groovy syntax. Fix for groovy multiline comment highlighting. 2023-07-17 03:36:03 -04:00
Amaan Qureshi
51ea343f70 fix(uxntal): move @variable query higher 2023-07-16 12:23:25 +03:00
GitHub
12d970f8ae Update parsers: capnp, elixir, java, perl, puppet, regex, sql, tsx, typescript, uxntal, wing 2023-07-15 12:21:44 +02:00
GitHub
39f10b0b14 Update parsers: c, capnp, cuda, glsl, hlsl, java, julia, perl, sql, swift, tablegen, wing 2023-07-14 09:03:13 +02:00
GitHub
a51236f068 Update parsers: nix, phpdoc, python, tsx, typescript, wing 2023-07-13 08:56:02 +02:00
GitHub
575f5a4b1f Update parsers: gitattributes, go, ocaml, ocaml_interface, ocamllex, python, wing 2023-07-12 16:06:44 +02:00
Amaan Qureshi
823e67a1c9 chore: update JSX from upstream 2023-07-12 15:51:15 +02:00
Amaan Qureshi
08aabb145f chore: update Regex from upstream 2023-07-12 15:51:15 +02:00
Long Wang
b4b94ec387 feat(julia): highlight docstrings before short function definitions 2023-07-11 21:40:37 +02:00
github-actions[bot]
3af1220e18
Update README
Co-authored-by: Github Actions <actions@github>
2023-07-11 06:32:36 +00:00
Jacob Pfeifer
d186a9e95a
feat: add Hurl
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>

---------

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-07-11 02:18:26 -04:00
Christian Clason
330da0ff07 ci: bump actions to latest 2023-07-11 08:14:21 +02:00
GitHub
e811a62e2f Update parsers: bash, c, css, html, json, objc, php, python, sql, wing 2023-07-11 07:35:54 +02:00
Sergio A. Vargas
90581acf87
feat(ecma): highlight regex flags 2023-07-10 14:13:17 -04:00
GitHub
f2efc5f357 Update parsers: astro, awk, ocaml, ocaml_interface, wing 2023-07-10 09:38:07 +02:00
Amaan Qureshi
d2f2aa8a2f fix(ocamllex): adapt to scanner rewrite 2023-07-10 09:08:52 +02:00
GitHub
572a15f171 Update parsers: awk, julia, wing 2023-07-09 11:39:22 +02:00
Christian Clason
62e29fc03e fix(ocaml): adapt to scanner rewrite 2023-07-09 11:25:59 +02:00
GitHub
d9104a1d10 Update parsers: arduino, cairo, nix, ocaml, ocaml_interface, verilog, wing 2023-07-08 11:38:25 +02:00
Sergio Alejandro Vargas
dcf46d07cc Update Julia queries 2023-07-08 11:24:01 +02:00
Github Actions
11c685b354 Update README 2023-07-08 10:33:52 +02:00
Amaan Qureshi
f45ea99454 feat: add Cairo 2023-07-08 04:29:57 -04:00
ObserverOfTime
ec7db4ba3f feat(pug): improve syntax highlighting 2023-07-07 16:14:01 -04:00
GitHub
1ef286e5b0 Update parsers: dockerfile, groovy, kotlin, racket, scheme, sql, wing 2023-07-07 09:42:59 +02:00
Piotr Bugała
4cc1b342f6
feat(groovy): update highlights from upstream (#5076)
Groovydoc multiline comment support.
2023-07-07 09:58:44 +03:00
Stephen Huan
e1ab5391e5
feat(nix): highlight hpath_expressions as @string.special 2023-07-06 03:07:07 -04:00
GitHub
be47e13a24 Update parsers: mermaid, wing 2023-07-06 03:05:47 -04:00
Amaan Qureshi
1bf573896c fix(hlsl): adapt to scanner rewrite 2023-07-05 22:27:27 +02:00
Amaan Qureshi
928ad5276c fix(cuda): adapt to scanner rewrite 2023-07-05 22:27:27 +02:00
Derek Stride
1a915819d8
feat(sql): update highlights from upstream 2023-07-05 16:05:56 -04:00
GitHub
0b81ed9f18 Update parsers: sql, wing 2023-07-05 09:57:34 +02:00
Amaan Qureshi
2d78445087 fix(foam): update queries from upstream 2023-07-05 03:41:15 -04:00
Github Actions
896f2c7622 Update README 2023-07-04 11:12:22 +02:00
Amaan Qureshi
46b1ad3de2 refactor(v)!: update upstream repository 2023-07-04 11:08:07 +02:00
GitHub
c9bb5a5a7f Update parsers: hoon, matlab, v, wing 2023-07-04 09:15:12 +02:00
GitHub
c42a8f96d3 Update parsers: arduino, beancount, matlab, sql, t32, wing 2023-07-03 09:32:13 +02:00
Repetitive
254f3da683 fix(markdown_inline): don't spellcheck shortlinks 2023-07-02 14:22:27 +02:00
GitHub
af25e8b7e0 Update parsers: matlab, t32, wing 2023-07-02 10:48:52 +02:00
Christian Clason
3fde1587d0 fix(html): distinguish <hX> levels 2023-07-01 13:49:28 +02:00
Pham Huy Hoang
58d4b924eb fix: add force to all predicates/directives
So that when any of them are upstreamed, there will not be an issue with
re-adding directives anymore
2023-07-01 12:34:30 +02:00
Ananda Umamil
aab2274e2c
feat(javascript): highlight parameter destructuring patterns 2023-07-01 05:25:05 -04:00
GitHub
3c42a6400e Update parsers: go, matlab, wing 2023-07-01 02:55:48 -04:00
GitHub
393bc5bec5 Update parsers: awk, foam, html, matlab, nickel, python, scala, wing 2023-06-30 19:47:53 +02:00
GitHub
0522bbe90d Update parsers: hoon, python, tsx, typescript, wing 2023-06-30 08:50:15 +02:00
ObserverOfTime
adbabe9b5c chore: remove scheme & racket maintainer 2023-06-29 19:35:58 -04:00
urbit-pilled
04dda34cb7
feat: add Hoon language support
---------

Co-authored-by: urbit-pilled <urbit-pilled>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-06-29 19:26:44 -04:00
Dian Fay
849645e893
feat(sql): json operator highlights 2023-06-29 19:25:34 -04:00
Amaan Qureshi
8d2eb35c5b fix(bash): adapt to scanner rewrite 2023-06-29 16:29:51 +02:00
Beartama
4c3912dfa8
indents(cmake): dedent brackets, else, endwhile
* feat(cmake): dedent for all closing brackets

* feat(cmake): indent an argument according to its previous peer

* fix(cmake); fix typo, add dedent `endwhile`
2023-06-29 20:26:23 +09:00
Github Actions
e89fd9f963 Update README 2023-06-29 12:41:35 +02:00
Glib Shpychka
f460cc8ee7
feat(wing): add parser (#5021)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-06-29 10:34:46 +00:00
GitHub
99a7e8d268 Update parsers: gitcommit, html, kotlin 2023-06-29 09:09:05 +02:00
Matthias Q
ea637db974
highlights(sql): add filter keyword 2023-06-29 14:54:33 +09:00
Uy Ha
e7f2b1276b fix(cmake): end indentation after normal_command node 2023-06-28 18:35:25 +02:00
Uy Ha
e68ad094cd feat(cmake): update cmake parser, adapt highlight.scm, and add indents.scm 2023-06-28 18:35:25 +02:00
GitHub
f04f137acb Update parsers: c, groovy, html 2023-06-28 09:02:52 +02:00
Pham Huy Hoang
949edb8c52
indents(fish): Add "end" and "case" (#5029) 2023-06-28 15:56:44 +09:00
ObserverOfTime
43fab6423c feat(pem): add parser 2023-06-28 07:07:05 +03:00
Github Actions
beda622736 Update README 2023-06-27 20:07:22 +02:00
ShootingStarDragons
016cba16a0 feat: add groovy support 2023-06-27 20:01:29 +02:00
GitHub
bad9f5bf5b Update parsers: foam, hack, vimdoc 2023-06-27 09:39:15 +02:00
GitHub
d49ba798c9 Update parsers: elm, vimdoc 2023-06-26 09:32:39 +02:00
Amaan Qureshi
4ba25e973c fix(elm): adapt to scanner rewrite 2023-06-26 09:12:55 +02:00
Dian M Fay
b75f79bc5f fix(sql): compound_statement -> block
a little more reorganizing; we've copied the indents file into
tree-sitter-sql and it tests okay there.
2023-06-25 17:31:24 +02:00
GitHub
069cbad8d2 Update parsers: haskell, matlab 2023-06-25 11:33:00 +02:00
Christian Clason
3590c0d30d fix(html): adapt to scanner rewrite 2023-06-25 11:21:34 +02:00
Amaan Qureshi
c667877ab5 fix(hack): adapt to scanner rewrite 2023-06-25 04:09:32 -04:00
ObserverOfTime
20a6c66b76 feat(awk): highlight builtin variables & shebang 2023-06-25 08:15:25 +03:00
Stephen Huan
13c72dddb7 fix(haskell_persistent): add to lockfile.json 2023-06-24 22:43:13 -04:00
Github Actions
0c5661e5fe Update README 2023-06-24 21:10:04 +02:00
Borys Lykah
e9984bb744
feat: add support for haskell persistent library 2023-06-24 15:00:47 -04:00
GitHub
68c619f2e3 Update parsers: matlab, racket 2023-06-24 09:50:42 +02:00
Amaan Qureshi
b08aa95eee fix(racket): adapt to scanner rewrite 2023-06-24 09:25:10 +02:00
Amaan Qureshi
18983e3a82 fix(python): adapt to scanner rewrite 2023-06-24 01:11:57 +02:00
Matthias Queitsch
f26596386f highlights(sql): remove keyword_group_concat after refactor 2023-06-23 20:04:47 +02:00
GitHub
f03db67aa4 Update parsers: markdown, markdown_inline, matlab, ocaml, ocaml_interface 2023-06-23 17:23:50 +02:00
GitHub
fdaf9f3f98 Update parsers: arduino, c_sharp, pony, sql 2023-06-23 09:40:58 +02:00
Matthias Queitsch
ae04153314 highlights(sql): fix order for invocation 2023-06-22 18:18:42 +02:00
Chinmay Dalal
cbd54ebb8d fix(zig): capture function calls as @function.call 2023-06-22 04:10:38 -04:00
GitHub
b723c30e5f Update parsers: arduino, c_sharp, cpp, lalrpop, matlab, scala, twig 2023-06-22 09:33:16 +02:00
Dian M Fay
40ac56c493 fix(sql): invocation 2023-06-22 08:39:42 +02:00
Dian M Fay
38372dcda4 fix(sql): field alias moved to term 2023-06-22 08:39:42 +02:00
Dian M Fay
cabbda88c9 fix(sql): table_alias -> alias 2023-06-22 08:39:42 +02:00
Dian M Fay
57a753186b fix(sql): update lockfile 2023-06-22 08:39:42 +02:00
Dian M Fay
3db1a461b9 fix(sql): table_reference -> object_reference 2023-06-22 08:39:42 +02:00
Christian Clason
e58bbe83f9 lint(locals): use #set! to keep query linter happy 2023-06-22 08:39:17 +02:00
Amaan Qureshi
c9d5812ba3 fix(markdown): elm injection no longer segfaults 2023-06-21 19:13:51 +02:00
Chinmay Dalal
b26b11f971 fix(fennel): capture function calls as @function.call 2023-06-21 11:20:58 -04:00
homedirectory
39b9f45a64 java highlights: annotation type declaration and AT interface keyword 2023-06-21 10:46:53 +02:00
GitHub
e015524926 Update parsers: c_sharp, firrtl, gdscript, julia, lua, luau, matlab, squirrel, starlark 2023-06-21 09:08:58 +02:00
Amaan Qureshi
c3ad1fc21e fix(php): adapt to scanner rewrite 2023-06-21 08:18:35 +02:00
Amaan Qureshi
1897926700 fix(gdscript): adapt to scanner rewrite 2023-06-20 15:12:59 -04:00
Amaan Qureshi
19385830ab fix(firrtl): adapt to scanner rewrite 2023-06-20 10:02:58 +02:00
GitHub
a74317ffaa Update parsers: elixir, matlab, sql 2023-06-20 09:28:12 +02:00
Amaan Qureshi
a1c29a9d1d fix(org): adapt to scanner rewrite 2023-06-20 09:13:29 +02:00
Amaan Qureshi
c8f5919b66 fix(starlark): adapt to scanner rewrite 2023-06-20 09:09:44 +02:00
Amaan Qureshi
4a8efcffc4 fix(elixir): adapt to scanner rewrite 2023-06-20 08:58:57 +02:00
Matthias Q
517a79c848
feat(sql): add new keywords for optimization statements and renames 2023-06-19 13:09:47 -04:00
ObserverOfTime
70f161b1dd fix(arduino): adapt to scanner rewrite 2023-06-19 10:45:56 +02:00
Christian Clason
e3330c67f1 fix(cpp): adapt to scanner rewrite 2023-06-19 09:54:05 +02:00
Github Actions
9f87ac1ed1 Update README 2023-06-19 09:45:25 +02:00
Álan Crístoffer
df3f47a508 feat(matlab)!: replace parser 2023-06-19 09:43:25 +02:00
GitHub
3f6c2de149 Update parsers: comment, luadoc 2023-06-19 09:43:05 +02:00
Akmadan23
c005b8a880 feat(bash): add various shell builtins 2023-06-19 02:36:16 -04:00
Uy Ha
fdddbff576 chore: update cmake
The new commit crashes when opening some CMake files
2023-06-18 17:23:34 +02:00
GitHub
d0d57ce5e7 Update parsers: comment, rst 2023-06-18 03:06:56 -04:00
GitHub
840e5d7178 Update parsers: arduino, haskell 2023-06-17 12:59:12 +02:00
GitHub
41f78130fd Update parsers: c_sharp, cmake, comment, commonlisp, corn, erlang, v 2023-06-17 10:09:48 +02:00
Amaan Qureshi
e2c162b09f chore: update cmake files 2023-06-17 09:59:41 +02:00
Santos Gallegos
1b9f704eb8 fix(comment): use #any-of? predicate 2023-06-16 21:21:40 +02:00
github-actions[bot]
150a4c9fa4
Update parsers: scala (#4953)
Co-authored-by: GitHub <noreply@github.com>
2023-06-16 06:56:41 +00:00
github-actions[bot]
10b0da9f93
Update parsers: c, c_sharp, cpp, cuda, racket, scala (#4951)
Co-authored-by: GitHub <noreply@github.com>
2023-06-15 07:17:06 +00:00
GitHub
5822a8c688 Update parsers: c_sharp, dart, vhs 2023-06-14 09:16:51 +02:00
Stephan Seitz
150be01d47 highlights(commonlisp): include all symbols defined by the ANSI standard
Before, those symbols were available via https://github.com/theHamsta/nvim-treesitter-commonlisp.
Since then `#any-of?` has become more efficient via tables and clojure also added all builtin functions
(72cbda75a9/queries/clojure/highlights.scm (L169-L278)).

The list I'm adding is defined by the 1994 ANSI standard that has
not changed since. This is why I don't expect any changes or maintenance burden due to adding that list.

Fixes https://github.com/theHamsta/tree-sitter-commonlisp/issues/18
2023-06-13 22:12:45 +02:00
github-actions[bot]
2847aac9d4
Update parsers: astro, haskell, ruby, scala (#4947)
Co-authored-by: GitHub <noreply@github.com>
2023-06-13 07:20:54 +00:00
Vadim Kazakov
0ae494269a
feat: add more support for glimmer (#4935)
* add indents, locals and folds
2023-06-13 00:54:30 +09:00
github-actions[bot]
111a3f4611
Update parsers: latex, racket (#4943)
Co-authored-by: GitHub <noreply@github.com>
2023-06-12 07:35:58 +00:00
github-actions[bot]
9c9e12f033
Update parsers: scala (#4940)
Co-authored-by: GitHub <noreply@github.com>
2023-06-11 07:38:24 +00:00
github-actions[bot]
f9d701176c
Update parsers: commonlisp, racket, ruby, scala (#4937)
Co-authored-by: GitHub <noreply@github.com>
2023-06-10 09:26:21 +02:00
Noah
7be9ebd06a
feat(clojure): add update-keys & update-vals 2023-06-09 16:07:45 -04:00
David Zeng
51dfcfdfde
feat(dart): improve locals query (#4922) 2023-06-09 12:48:24 +03:00
Chris Kipp
5944fc821a
feat(scala): sync highlights with latest upstream (#4926)
This accounts for a correction in interpolations and also adding support
for `self_type`.

This is a follow-up to #4920.
2023-06-09 10:15:06 +02:00
pseudometa
e040eda997
feat(comment): Add some common comment tags (#4909)
see also: https://github.com/stsewd/tree-sitter-comment/issues/22
2023-06-09 10:14:08 +02:00
github-actions[bot]
7dd2f83764
Update parsers: commonlisp, dart, scala (#4934)
Co-authored-by: GitHub <noreply@github.com>
2023-06-09 06:49:49 +00:00
Amaan Qureshi
2c59e0ff3d refactor(ecma): triple dot should be an operator 2023-06-09 01:58:28 +09:00
Amaan Qureshi
99606fdb71 feat(typescript): update highlights 2023-06-09 01:58:28 +09:00
Hoang Nguyen
71bb1da621
feat(jsonnet): add "for" & "function", update operator highlights
`expr` -> `operator` doesn't exist in the node tree anymore after
505f5bd900
2023-06-08 10:13:26 -04:00
github-actions[bot]
2883a9cf86
Update parsers: commonlisp, lua, ruby, scala (#4927)
Co-authored-by: GitHub <noreply@github.com>
2023-06-08 07:10:04 +00:00
Munif Tanjim
a954f789aa
feat(lua): update highlights query for functions (#4919) 2023-06-08 00:12:54 +02:00
Amaan Qureshi
46ddea9dec
fix(dart): update indents from upstream (#4924) 2023-06-07 20:10:54 +02:00
github-actions[bot]
33eb472b45
Update parsers: ada, erlang, go, lua, scala (#4917)
Co-authored-by: GitHub <noreply@github.com>
2023-06-07 07:16:37 +00:00
Domas Poliakas
ab3bf7d956
fix(scala): add block_comment 2023-06-06 14:36:09 +00:00
Frank Bearoff
1b5a7334bb
feat(bash): highlight until as @repeat 2023-06-05 12:32:53 -04:00
Christian Clason
a034c7aa25
fix(highlights): lower priority for codeblocks with injections (#4905) 2023-06-05 14:09:44 +02:00
github-actions[bot]
2d6e73ab2f
Update parsers: comment, commonlisp, cuda, markdown, markdown_inline, rst (#4907)
Co-authored-by: GitHub <noreply@github.com>
2023-06-05 07:43:40 +00:00
Pham Huy Hoang
9ec2a6bbda
tests: fix failed tests (#4901)
fix failed tests for tiger, t32 and wgsl
2023-06-05 09:52:36 +09:00
github-actions[bot]
e54c8873ef
Update parsers: comment, usd (#4904)
Co-authored-by: GitHub <noreply@github.com>
2023-06-04 15:59:36 +09:00
Pham Huy Hoang
1281601cb4
feat: add indents for annotation defs (#4828)
- Add indent for `@interface` and `@Annotation(...)`
- Add notes for indent queries
2023-06-04 13:28:41 +09:00
Will Ruggiano
79aedc9675
feat(prisma): highlight views 2023-06-04 00:05:57 -04:00
Ananda Umamil
bee003b880
feat(ecma): convert eligible @keyword.operators 2023-06-04 00:04:40 -04:00
Ananda Umamil
56022e0b05
feat(typescript): highlight is and : in type predicate 2023-06-04 00:04:00 -04:00
Santos Gallegos
48f4f3ead1
feat(comment): add support for URIs
https and https links are recognized now
ref https://github.com/stsewd/tree-sitter-comment/pull/21
2023-06-04 00:03:09 -04:00
Alex Manning
f84de0d6cd
fix(gleam): minor indent fixes 2023-06-04 10:39:20 +09:00
Tyler Miller
5ac8cf8ee5 fix(make/highlights): add define and operators 2023-06-03 23:54:28 +03:00
github-actions[bot]
6847ce4f8c
Update parsers: elixir, racket, scheme (#4899)
Co-authored-by: GitHub <noreply@github.com>
2023-06-03 07:27:31 +00:00
Chris Kipp
2cbe8a4296
highlights(scala): add support for using directives (#4893)
This accounts for the updates in https://github.com/tree-sitter/tree-sitter-scala/pull/273.
2023-06-02 22:13:30 +09:00
Frank
cb6d94ef7b add "select" to @repeat highlight group 2023-06-02 01:45:12 -07:00
GitHub
264dd35fd0 Update parsers: cue, glsl, hlsl, latex, scala 2023-06-02 08:56:04 +02:00
GitHub
56c63529c0 Update parsers: scala, t32 2023-06-01 08:51:00 +02:00
Pieter Goetschalckx
a6063b22c9
highlights(ocaml): update operators (#4878)
* Update ocaml highlights

* Don't capture operator twice
2023-06-01 10:28:00 +09:00
GitHub
62146fe415 Update parsers: c, cpp, cuda, gitcommit, glsl, go, hlsl, scala, supercollider
skip dart updates from now on
2023-05-31 19:08:20 +02:00
Christian Clason
23dfae4db8 ci: bump tree-sitter CLI to v0.20.8 2023-05-30 10:44:31 +02:00
GitHub
13d0354890 Update parsers: corn, scala 2023-05-30 10:23:38 +02:00
Pau Ruiz Safont
06aa932bb8
chore: update ocamllex
* Update parsers: ocamllex

Update its highlight to make it compatible with the new parser

* highlights(ocamllex): follow newest changes from upstream

The upstream grammar added highlights in the latest version, change our
highlight so they reflect better the intention of the grammar's author
2023-05-30 00:13:17 -04:00
Amaan Qureshi
6de5ceba03
fix(go): properly highlight chan/map (#4875) 2023-05-30 00:09:37 -04:00
Amaan Qureshi
905877e75f chore: update skipped langs in ci 2023-05-29 19:30:19 +02:00
Amaan Qureshi
754b509f26
chore: update Gleam 2023-05-29 11:13:36 -04:00
Github Actions
1d670b0c90 Update README 2023-05-29 10:27:42 +02:00
Jake Stanger
dc38ff85d9
feat: add language support for corn (#4864)
Adds queries and a parser mapping for the [Corn](https://github.com/jakestanger/corn)
configuration language.
2023-05-29 17:26:28 +09:00
GitHub
e23d5493cf Update parsers: php, scala 2023-05-28 11:53:44 +02:00
GitHub
a76db88548 Update parsers: cue, erlang, haskell, ispc, nickel, ocaml, ocaml_interface, ocamllex, php, phpdoc, scala, scheme, slint, smali 2023-05-27 10:44:32 +02:00
Noah
ab3fb2a285
refactor: update Clojure queries
Instead of relying on regex for matching (which matches custom symbols),
explicitly list each of the variations in `@variable.builtin, `@conditional`,
`@function.macro`.

Add `@variable.builtin` for the builtin repl variables `*1`, `*2`, `*3`, and
`*e`, which are occasionally used in tests and comments.

Move `ex-info`, `ex-cause`, `ex-data`, and `ex-message` to `@functions.builtin`.

Add missing `clojure.core` functions to `@functions.builtin` at the bottom to
minimize diff. Includes functions from 1.12-alpha2 release as well.
2023-05-26 18:15:22 -04:00
Yuki Ito
ec97c5ec72
fear(go): add clear to @function.builtin 2023-05-26 09:51:51 -04:00
Pham Huy Hoang
5781c94703
feat: markdown indents (#4862) 2023-05-26 08:08:06 +00:00
Matthias Q
dae928b3bb
indents(sql): initial support (#4857)
* indents(sql): initial support

* indents(sql): fix queries and lua style
2023-05-25 05:53:14 +00:00
GitHub
9bef726044 Update parsers: c, cuda, scala, t32 2023-05-24 14:22:56 +02:00
Pham Huy Hoang
ad75d3c4bd fix(indent): return early if query doesn't exist 2023-05-24 13:57:08 +02:00
Matthias Queitsch
b8ddb83d60 highlights(sql): add keyword overwrite 2023-05-23 21:08:50 -04:00
mohsen
f2778bd1a2 highlights(go): add some highlights
- added missing operators
- added iota constant
- added comparable type
- edited  go keyword types
2023-05-21 20:04:40 +02:00
Christian Clason
741260618d highlights(query): prefer lua-match 2023-05-21 19:22:05 +02:00
GitHub
18c393108e Update parsers: cuda, glsl, hlsl, ispc, objc, ocaml, ocaml_interface 2023-05-21 09:50:59 +02:00
Github Actions
1557f5cb9a Update README 2023-05-20 22:04:29 -04:00
fab4100
8e817bebf9
feat: add Intel Implicit SPMD Program Compiler (ISPC)
* Add ISPC parser config

* Add ISPC queries

* Update queries/ispc/injections.scm

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>

---------

Co-authored-by: Fabian Wermelinger <fab4100@posteo.net>
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-05-20 21:52:54 -04:00
fab4100
8e59b4919d
fear(cpp): highlight brackets in template_parameter_list 2023-05-20 14:41:54 -04:00
GitHub
3d5fe8caf8 Update parsers: c, gitcommit, scala, sql 2023-05-20 10:02:48 +02:00
Amaan Qureshi
cbfb03bba5 chore(objc): update folds 2023-05-20 03:52:08 -04:00
Amaan Qureshi
dad1b7cd66 feat: add Objective-C 2023-05-19 12:24:38 -04:00
GitHub
05df88ebaa Update parsers: dart 2023-05-19 09:19:01 +02:00
Ananda Umamil
a02a06a068 highlights(typescript): : in switch statement 2023-05-18 21:34:42 -04:00
Emilia Simmons
58da7fe93e allow no spaces for extend/inherit comments 2023-05-18 20:01:00 -04:00
Emilia Simmons
0058058386 add multiple ; for highlighting 2023-05-18 20:01:00 -04:00
Emilia Simmons
865483f8d1 fix(query): allow multiline modeline (inherits/extends) 2023-05-18 20:01:00 -04:00
Pham Huy Hoang
1aea2eee29
refactor: add notes for swift
Also add enum_class_body
2023-05-19 00:57:18 +09:00
GitHub
4d0520ee09 Update parsers: c_sharp, erlang, glsl, hlsl, nickel, t32 2023-05-18 10:46:34 +02:00
Christoph Sax
16cce8df58
feat(t32): add indent rules (#4782) 2023-05-18 16:40:13 +09:00
Pham Huy Hoang
102f1b2f55 fixup: use correct require syntax 2023-05-17 15:35:28 +02:00
Christian Clason
fa23ff4bd7 refactor(indent): backport improvements from main
* replace ts_utils.memoize_by_buftick by simpler implementation
* simplify construction of hash map
* prefer Neovim APIs
2023-05-17 15:25:35 +02:00
GitHub
aa44e5fc5f Update parsers: c 2023-05-17 08:50:04 +02:00
Pham Huy Hoang
d2b78324f2 fix indent/fold memleak 2023-05-16 13:25:02 +02:00
GitHub
26230f06b6 Update parsers: dart, gitcommit, usd 2023-05-16 09:44:08 +02:00
Matthias Queitsch
27079f7060 highlights(sql): refactor count to generic invocation 2023-05-15 20:00:22 -04:00
Christian Clason
95850f7964 fix: force upstreamed predicates 2023-05-15 22:31:28 +02:00
Pham Huy Hoang
217467c262 remove unnecessary ft aus
specify specific plugin files to load
2023-05-15 09:59:24 +02:00
Colin Kennedy
4c35c0b75d Added USD as a language + some queries
Added USD highlight unittests

Added USD indentation

Added USD indents.scm file

Added USD indent rules

Simplified USD highlight groups

Added explicit highlight groups

Added newline

Removed after/ftdetect/usda.lua

usd/indents.scm - Added inline comments explaining the nodes

Fixed USD highlight group unittests

Added indentation unittests

Simplified USD `@identifier` highlighting

Added USD documentation highlight group tests

Simplified USD highlight groups

Moved USD `@identifier` and `@namespace` highlights into one place

Removed and simplified tests/query/highlights/usd

Simplified tests/query/highlights/usd more

Removed trailing newline

Combined USD test files

Added `set filetype=usd` to minimal_init.lua
2023-05-15 09:28:11 +02:00
GitHub
3b0c133c31 Update parsers: dart, query 2023-05-15 02:54:45 -04:00
Christian Clason
680807fa6a highlights(markup): distinguish heading level in queries
also add a few queries from Helix and remove controversial
code block conceal in Markdown
2023-05-13 16:50:32 +02:00
GitHub
15300c1a10 Update parsers: bicep, c_sharp, cpon, func, gosum, hare, kdl, lua, luadoc, luap, puppet, smali 2023-05-13 02:50:24 -04:00
Amaan Qureshi
40d373adcd feat: add Odin 2023-05-13 02:49:07 -04:00
Amaan Qureshi
a67a4ab642 feat(func): update highlights 2023-05-13 02:11:04 -04:00
Zheng PiaoDan
dba8c8e781
fix(nickel): wrong indent on line after top level comment (#4792)
* fix(nickel): wrong indent on line after top level comment

Previous incorrect indentation on line after top level comment:

```
# no indent after this comment
  {
  another = 1
}
```

Expected result:

```
# no indent after this comment
{
  another = 1
}
````
2023-05-13 15:03:05 +09:00
Amaan Qureshi
ec0d0ffe51 feat(cpon): update queries 2023-05-13 00:56:40 -04:00
Zheng PiaoDan
32d0baae44
feat: add indents.scm for nickel (#4790) 2023-05-13 02:49:39 +09:00
GitHub
7e1cb38c38 Update parsers: lua, t32 2023-05-12 09:19:01 +02:00
Gregg Jansen van Vüren
39cf5cbcfd
feat(java): add more foldable nodes 2023-05-11 15:27:43 -04:00
GitHub
f5182b51f7 Update parsers: latex, lua 2023-05-11 20:05:21 +02:00
GitHub
957aefe814 Update parsers: cuda, hlsl, t32 2023-05-11 09:10:11 +02:00
GitHub
73c7af9cdb Update parsers: c_sharp 2023-05-10 18:01:39 +02:00
ObserverOfTime
f9cfd40c08 comment: remove user mention highlight 2023-05-10 18:53:57 +03:00
GitHub
78b3a82293 Update parsers: cpp, t32 2023-05-10 08:58:31 +02:00
Amaan Qureshi
6e8ad92031 feat(typescript): add non-null operator 2023-05-09 09:14:28 -04:00
Amaan Qureshi
a79baf0399 fix(typescript): remove duplicate capture 2023-05-09 09:14:28 -04:00
Amaan Qureshi
5182759e17 style(rust): better formatting 2023-05-09 08:33:38 -04:00
Amaan Qureshi
6df6dd2622 feat(rust): distinguish enum members better 2023-05-09 08:33:38 -04:00
GitHub
74779349fc Update parsers: slint 2023-05-09 12:19:17 +02:00
Derek Stride
0ec48923e5
feat(sql): add more keywords 2023-05-08 17:40:33 -04:00
GitHub
402f1b8d3b Update parsers: clojure, glsl, ledger, t32 2023-05-08 09:26:51 +02:00
Pham Huy Hoang
864b4171de
feat: add swift indents (#4756) 2023-05-08 14:53:31 +09:00
github-actions[bot]
b231afbad1
Update parsers: astro, c, haskell, t32 (#4769)
Co-authored-by: GitHub <noreply@github.com>
2023-05-07 08:29:23 +00:00
Amaan Qureshi
12453e0e3d
Update Capnp (#4713)
* feat(capnp): update queries from upstream changes

* test: add tests for capnp

* fix indent queries

* ci: fix capnp indent tests

---------

Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-05-07 00:12:49 +09:00
GitHub
e8081bb162 Update parsers: haskell, vim, vimdoc 2023-05-06 10:48:57 +02:00
haoxian
8646c0d2ea
feat(erlang): add new keyword and operator from OTP25 (#4765) 2023-05-06 08:39:30 +00:00
Stephan Seitz
39a78192fb ci: add tests for #4632
Issue #4632 might be fixed by
https://github.com/UserNobody14/tree-sitter-dart/pull/41
2023-05-05 14:57:51 +02:00
GitHub
f0b50973f3 Update parsers: bash, dart, haskell, http 2023-05-05 08:54:14 +02:00
Iron-E
54741de02c
fix(java): capture type parameter brackets as @punctuation.delimiter
It is currently highlighted as `@operator`
2023-05-04 15:50:31 -04:00
Iron-E
239bb86b54
feat(rust): capture debug macros as @debug
* ref(rust): highlight debug macros as `@debug`

E.g. `dbg!` and `debug_assert!`

* Update queries/rust/highlights.scm

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>

---------

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-05-04 15:49:20 -04:00
Iron-E
31d2f60734
fix(c_sharp): highlight < & > as @punctuation.bracket only in type param lists
This fixes highlighting of `x > 4`, for example
2023-05-04 15:46:41 -04:00
Iron-E
2115c7d585
feat(c_sharp): add capture for ternary operators 2023-05-04 15:37:29 -04:00
github-actions[bot]
01c23a8036
Update parsers: dart, llvm (#4755)
Co-authored-by: GitHub <noreply@github.com>
2023-05-04 07:10:53 +00:00
Pham Huy Hoang
4fe6b4c07f fix: add @combined to markdown html 2023-05-03 16:23:09 -04:00
Benny Powers
bff7115bf8
perf(html): onevent attrs (#4752) 2023-05-03 10:18:03 +00:00
Benny Powers
5e95ecaad0
injections(html): event attributes (#4750)
injections(html): inject javascript into event attributes

Adds javascript injections to HTML `onevent` attributes.
2023-05-03 09:56:13 +00:00
GitHub
1e9e1492ee Update parsers: blueprint, c_sharp, dockerfile, haskell 2023-05-03 02:48:48 -04:00
Amaan Qureshi
e2cf8977fd feat(go): highlight constructors, remove _ as @constant 2023-05-02 07:52:45 -04:00
github-actions[bot]
dd1cd54622
Update parsers: lua (#4746)
Co-authored-by: GitHub <noreply@github.com>
2023-05-02 08:37:14 +00:00
Pham Huy Hoang
b4d2640eab
feat: add indents for ocaml and ocaml interface (#4725) 2023-05-01 20:42:21 +09:00
GitHub
c39b5d3fd7 Update parsers: janet_simple, swift, vimdoc 2023-05-01 04:39:26 -04:00
Pham Huy Hoang
25bdc313c7
fix(lua_inject): remove need for surrounding quote (#4740) 2023-04-30 23:46:03 -04:00
Pham Huy Hoang
da79f9afe6 feat: add py-script injections for html 2023-04-30 23:30:10 -04:00
Github Actions
195a0cda1a Update README 2023-04-30 23:10:32 -04:00
Pham Huy Hoang
ca8a981db3
fix(query): add missing dedent for "]" (#4739) 2023-05-01 03:04:27 +00:00
sogaiu
6fe60587d1 Remove some sections and add some missing things
The original approach was to emulate what was in Clojure's
highlights.scm file, but it appears that there were a number of
questionable items, so some sections were removed.

As a consequence, there were some items that ended up unmentioned.  An
attempt was made to rescue most of these and add some missing items to
a renamed "Special forms and builtin macros" section.

Five items were removed entirely.  These are:

* Single quote
* Tilde
* Pipe
* Comma
* Semicolon

It was unclear where to put these and it's also unclear whether
highlighting them would really be beneficial.  Perhaps what to do, if
anything, will become clear in the future.
2023-04-30 22:06:17 -04:00
sogaiu
b9d183c2c5 Update list of functions 2023-04-30 22:06:17 -04:00
sogaiu
0d61fdae11 Adjust indentation 2023-04-30 22:06:17 -04:00
sogaiu
c780ba9b6c Update list of macros 2023-04-30 22:06:17 -04:00
sogaiu
8db7eeba9d Use 2 semicolons for better editor interop 2023-04-30 22:06:17 -04:00
sogaiu
93b540f917 feat: add janet_simple 2023-04-30 22:06:17 -04:00
github-actions[bot]
54909e8df9
Update parsers: haskell (#4735)
Co-authored-by: GitHub <noreply@github.com>
2023-04-30 08:39:06 +00:00
Amaan Qureshi
7133622c44
fix(starlark): fields should not match uppercase-beginning names (#4734) 2023-04-30 09:56:30 +09:00
Amaan Qureshi
9bfc966769 fix(python): fields should not match uppercase-beginning names 2023-04-29 19:38:30 -04:00
Pham Huy Hoang
1ca9b938c1
Add Python else elif dedent (#4618)
* feat(python): add interactive else/elif dedent

* fixup

* add test
2023-04-29 10:35:35 +02:00
GitHub
358a463c82 Update parsers: erlang, haskell 2023-04-29 03:03:16 -04:00
Amaan Qureshi
b8a0791eb4 refactor(lua): move _VERSION to @constant.builtin, builtin types to @namespace.builtin 2023-04-28 10:29:42 -04:00
Amaan Qureshi
cde306813d feat: add luau 2023-04-28 10:29:42 -04:00
GitHub
2ce3c9080c Update parsers: t32 2023-04-28 02:53:20 -04:00
Kasper Kondzielski
ee64345a37 fix: Correct scope definition for scala
`@scope` included `function_declaration` while is should have included `function_definition` instead. The former one is used to declare abstract functions while the latter one is used to define functions together with their bodies.
2023-04-28 00:34:23 +02:00
github-actions[bot]
08e8b2c08b
Update parsers: kdl, kotlin, t32 (#4720)
Co-authored-by: GitHub <noreply@github.com>
2023-04-27 07:12:29 +00:00
Amaan Qureshi
fe3afeaa73 feat: add puppet 2023-04-26 19:29:01 -04:00
WindSoilder
8ec9a50965
fix: add -f to mv to avoid errors when updating 2023-04-26 18:22:53 -04:00
GitHub
0d7da3bd7d Update parsers: capnp, luap, pony, rust, sql, zig 2023-04-26 02:54:54 -04:00
Amaan Qureshi
b0fe9cea0e
fix(lua): injection eq should be any-of (#4711) 2023-04-26 11:42:06 +09:00
Amaan Qureshi
82bcd8483e fix(solidity): variable should not match last, tidy up highlights 2023-04-25 14:19:44 -04:00
Munif Tanjim
75f911d01f
injections(lua): tweak query to capture string content (#4707) 2023-04-25 16:05:52 +02:00
Amaan Qureshi
87faf372eb fix(python,starlark): builtin types should come after types 2023-04-25 03:04:05 -04:00
Amaan Qureshi
01b42a1a57 feat(python,starlark): highlight type conversions as @function.macro 2023-04-25 03:04:05 -04:00
Amaan Qureshi
5ab25d8a1f fix(python,starlark): update field match pattern 2023-04-25 03:04:05 -04:00
GitHub
39f5d8d89e Update parsers: glimmer, smali, zig 2023-04-25 03:03:26 -04:00
Amaan Qureshi
b39e6bd615 chore(smali): add tests 2023-04-25 02:37:31 -04:00
Amaan Qureshi
9f157094cd feat(smali): update queries from upstream parser 2023-04-25 02:37:31 -04:00
smjonas
1280315db1 injections(lua): highlight vim.api.nvim_exec2 2023-04-24 15:04:34 -04:00
smjonas
72e2e2df86 injections(lua): highlight Lua code in vim.rpcrequest and vim.rpcnotify 2023-04-24 15:04:34 -04:00
github-actions[bot]
77ffc7edbe
Update parsers: devicetree, swift, t32 (#4702)
Co-authored-by: GitHub <noreply@github.com>
2023-04-24 07:02:58 +00:00
Pham Huy Hoang
2083a34dc6
feat(java): add basic folding (#4701) 2023-04-24 15:32:41 +09:00
Cédric Barreteau
455ded2992 Update ledger highlight queries 2023-04-23 12:09:57 -04:00
github-actions[bot]
3f7301789b
Update parsers: htmldjango, ledger, scheme (#4698)
Co-authored-by: GitHub <noreply@github.com>
2023-04-23 09:08:41 +00:00
github-actions[bot]
57d1a58437
Update parsers: json, scheme, t32, tsx, typescript (#4694)
Co-authored-by: GitHub <noreply@github.com>
2023-04-22 08:39:32 +00:00
Amaan Qureshi
85330918f0 perf: remove match where possible 2023-04-21 18:24:17 -04:00
Amaan Qureshi
654216eb04 fix(c): types are optional in sized_type_specifier 2023-04-21 04:55:20 -04:00
Amaan Qureshi
5887528216 docs: update readme maintainers 2023-04-21 04:38:28 -04:00
github-actions[bot]
8b221448a3
Update parsers: erlang, sql, t32 (#4687)
Co-authored-by: GitHub <noreply@github.com>
2023-04-21 08:17:16 +00:00
Amaan Qureshi
b9ed96bb6f feat(c): highlight parenthesized function pointer decl identifiers as @function 2023-04-21 03:26:13 -04:00
Amaan Qureshi
b0338a0565 chore(parsers): update http maintainers 2023-04-20 06:33:25 -04:00
github-actions[bot]
e77fd9af16
Update parsers: gitcommit, html, java, t32 (#4671)
Co-authored-by: GitHub <noreply@github.com>
2023-04-20 10:05:24 +00:00
Amaan Qureshi
c44a63ffdc feat(http): update parser queries from upstream 2023-04-20 05:50:08 -04:00
Pham Huy Hoang
eedc5198a1
tests: fix deprecated tests (#4681) 2023-04-20 15:12:31 +09:00
stefan
481d1eda24
docs: update gitconfig in readme to reflect parser name (#4656) 2023-04-20 03:17:44 +00:00
Amaan Qureshi
831f37635d feat(rust): move some keywords & operators to where they belong 2023-04-19 02:28:00 -04:00
Benny Powers
cdc45ac6ba
feat(markdown): configured aliases for fenced code block languages (#4659)
* feat(markdown): configured aliases for languages

* refactor: use vim.treesitter.match

* refactor: rename local vars

* fix: query syntax
2023-04-18 21:51:14 +09:00
Amaan Qureshi
c79c37927b refactor(smali): refactor queries from upstream 2023-04-17 22:50:34 -04:00
Amaan Qureshi
7ade4d2e77
fix(ecma): comment should be @indent.auto (#4669) 2023-04-18 08:04:04 +09:00
Matthias Queitsch
1185a35705 highlights(prql): replace and and or operators 2023-04-17 14:29:26 -04:00
tzachar
351e43d5ef
fix(compat): add missing get_node_text, required by playground (#4666) 2023-04-17 11:38:41 +02:00
GitHub
9d64a68e1c Update parsers: bash, latex 2023-04-17 09:38:39 +02:00
Serhii Budnik
9d3c14874d fix(ruby): bare_symbol should be @symbol 2023-04-17 02:16:36 -04:00
dundargoc
21f2fb188e fix(checkhealth): use non-deprecated versions if possible 2023-04-16 05:26:14 -07:00
github-actions[bot]
f90a80a5a5
Update parsers: cpp, cuda, elm, hlsl, luadoc, swift (#4657)
Co-authored-by: GitHub <noreply@github.com>
2023-04-16 08:27:05 +00:00
Amaan Qureshi
da7f886ab5 perf(ecma): remove GraphQL comment injection, use lua-match for gql template detection 2023-04-15 20:13:44 -04:00
John Drouhard
dad0864fa3 feat(cpp): improve function.call to support any level of nesting for qualified identifiers 2023-04-15 07:00:14 -07:00
Pham Huy Hoang
f7e8b7420c fix(php_inject): add missing @combined to text 2023-04-14 13:23:37 -04:00
github-actions[bot]
f499a711fa
Update parsers: c_sharp, html, matlab, perl, t32, zig (#4649)
Co-authored-by: GitHub <noreply@github.com>
2023-04-14 11:32:52 +02:00
Pham Huy Hoang
36d4deb294 fix(dart_indent): Fix dart case/default indent
add tests

add tests for fallthrough case

add more tests

keep functional tests
2023-04-14 02:28:42 -07:00
Robert Brunhage
ba6c55b203 chore(dart): remove tests for switch 2023-04-13 02:31:49 -07:00
Robert Brunhage
e9de9cedf0 test(dart): add test cases for open issues 2023-04-13 02:31:49 -07:00
Robert Brunhage
e68b81e7fd fix(dart): review comment 2023-04-13 02:31:49 -07:00
Robert Brunhage
49f6962da4 test(dart): add expected failure file to test 2023-04-13 02:31:49 -07:00
Robert Brunhage
95055abadd chore: fix formatting issue for dart test 2023-04-13 02:31:49 -07:00
Robert Brunhage
34d1e0e360 Update tests/indent/dart_spec.lua
Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-04-13 02:31:49 -07:00
Robert Brunhage
978fb2b7be test(dart): Add an expected failure test 2023-04-13 02:31:49 -07:00
Robert Brunhage
ce3ea7aebe Revert "fix(dart): function argument indents is inconsistent"
This reverts commit ac4020c707.
2023-04-13 02:31:49 -07:00
ObserverOfTime
18f9e1a47f javascript: highlight more builtins
Co-Authored-By: Sergey Berezhnoy <veged@ya.ru>
2023-04-12 13:46:06 -04:00
github-actions[bot]
0efa55ae2e
Update parsers: comment, gitcommit, glimmer, v (#4636)
Co-authored-by: GitHub <noreply@github.com>
2023-04-12 11:31:40 +00:00
Robert Brunhage
ac4020c707 fix(dart): function argument indents is inconsistent 2023-04-11 03:09:53 -07:00
Pham Huy Hoang
a82501244a refactor(html_inject): use lua-match where possible 2023-04-10 11:39:13 -04:00
GitHub
cc360a9beb Update parsers: devicetree, hcl, terraform, vim, zig 2023-04-10 12:07:16 +02:00
Robert Brunhage
2fe7f969c1
fix(dart): try statement wouldn't indent (#4623) 2023-04-10 06:52:50 +00:00
Jaehwang Jung
fa9fe9a95b fix(rust): highlight SNAKE_CASE scoped identifier name as @constant 2023-04-09 08:12:17 -07:00
Jaehwang Jung
a57d2a599b feat(markdown_inline): add @nospell where appropriate 2023-04-08 15:34:06 -07:00
Pham Huy Hoang
9161093fc7 fix(c_indents): fix expression leaking indents 2023-04-08 09:59:21 -07:00
Pham Huy Hoang
474c59dcf1 add test 2023-04-08 09:56:06 -07:00
Pham Huy Hoang
1c7ba3ffcf fix(indent): Make indent ignore trailing spaces/comment
Signed-off-by: Pham Huy Hoang <hoangtun0810@gmail.com>
2023-04-08 09:56:06 -07:00
Jaehwang Jung
e482c9b4e2 feat(cpp): more distinction between function/method declaration and call 2023-04-08 09:40:30 -07:00
Pham Huy Hoang
ab39fe6c86 refactor(html_inject): Use lua-match instead of match 2023-04-08 12:34:08 -04:00
Christian Clason
584ccea56e
vim: switch to parser maintained by Neovim (#4610)
Problem: The current vimscript parser has not been maintained for a while, which was a blocker for packaging the coming Neovim release. 

Solution: Fork parser to https://github.com/neovim/tree-sitter-vim/ and maintain it there from now on.
2023-04-07 15:03:10 +02:00
github-actions[bot]
226c1475a4
Update parsers: sql (#4615)
Co-authored-by: GitHub <noreply@github.com>
2023-04-07 07:29:32 +00:00
GitHub
c85d059c46 Update parsers: c_sharp, gitcommit 2023-04-06 15:05:12 +02:00
Saleh Bakra'a
153818c29b
kotlin: update parser and queries
Update `queries/kotlin/locals.scm` to use the the newly exposed `function_value_parameters` node.
2023-04-06 14:50:38 +02:00
GitHub
411e771d51 Update parsers: sql 2023-04-05 09:04:50 +02:00
GitHub
871f5665d9 Update parsers: svelte, swift, vimdoc 2023-04-04 09:33:54 +02:00
Amaan Qureshi
0a20d1bb63 feat(ecma): use lua-match for jsdoc injections 2023-04-03 11:13:04 -04:00
Chris Kipp
9711139326 docs: add a small note about local queries
This just adds a small note in the CONTRIBUTING section about local
queries and how they differ from those listed upstream.
2023-04-03 01:54:02 -07:00
Carlo Cabrera
6f5a4f6306 feat: use -bundle to build parsers on macOS
This will make the parsers align more closely to the ones bundled with
Neovim, because CMake uses the `-bundle` flag (instead of `-shared`) on
macOS when a library is compiled as a `MODULE`.

See, for example:

    10baf89712/cmake.deps/cmake/TreesitterParserCMakeLists.txt (L6-L9)
2023-04-03 03:38:54 -04:00
GitHub
cbfa7cae1b Update parsers: awk, tiger 2023-04-02 11:17:07 +02:00
ghostbuster91
06075ecd04 fix(scala): Add missing locals definitions for scala 2023-04-01 14:29:43 -04:00
GitHub
ee1d618280 Update parsers: vhs 2023-04-01 16:26:57 +02:00
Christian Clason
93fa5df0a3 chore(help)!: renamed to vimdoc 2023-04-01 16:10:11 +02:00
Trey Wood
2f3113ff6d
fix(ruby): then blocks should not be @conditional, just "then" 2023-03-31 11:43:55 -04:00
Matthias Queitsch
d546bcd1f1 highlights(sql): add full, any and some keywords 2023-03-31 06:13:45 -04:00
GitHub
09275650b8 Update parsers: cue, sql 2023-03-30 09:16:10 +02:00
Trey Wood
5d85bdd883 update sql parser and highlights 2023-03-29 18:29:40 -04:00
dundargoc
1727f63976 docs: fix typos 2023-03-29 18:28:56 -04:00
kawas44
c07c1c5b98 feat(spell): support lisp like languages
Add spell to commonlisp, scheme, racket, clojure and fennel.
2023-03-29 17:48:30 -04:00
GitHub
9850baa958 Update parsers: help, tlaplus, v, vhs 2023-03-29 09:42:02 +02:00
GitHub
5a7a2ad172 Update parsers: erlang, pony, v 2023-03-28 09:37:39 +02:00
GitHub
63e4a3a40a Update parsers: awk, cpp, cuda, glimmer, haskell, hlsl, perl, swift, v 2023-03-27 22:41:54 +02:00
Amaan Qureshi
47615a947a feat(perl): update queries from upstream changes 2023-03-27 13:49:44 -04:00
Github Actions
0a907316fa Update README 2023-03-27 11:04:29 -04:00
Amaan Qureshi
eb1e599251 feat: add FIRRTL 2023-03-27 10:46:59 -04:00
Amaan Qureshi
eadf4f43c6 feat: add Pony 2023-03-27 10:46:35 -04:00
ObserverOfTime
ac13230ddd chore(lockfile): bump arduino 2023-03-27 10:20:38 -04:00
Amaan Qureshi
a9df886c2e chore(lockfile): bump cuda & hlsl 2023-03-27 10:20:38 -04:00
John Drouhard
300ba8d5a5 feat(cpp): simplify namespace query rules now that parser is a bit more consistent 2023-03-27 10:20:38 -04:00
Chris Kipp
25dd24ed0e feat(scala): add in local variables queries
This syncs the queries that were updated in https://github.com/tree-sitter/tree-sitter-scala/pull/196.

Co-authored-by: ghostbuster91 <ghostbuster91@users.noreply.github.com>
2023-03-27 06:48:21 -04:00
Amaan Qureshi
e559b6fb3f feat(kotlin): update queries from upstream changes 2023-03-26 23:17:24 +02:00
Leix b
981f88a0c2
fix(rockspec): add doc folder to rockspec (#4562) 2023-03-26 19:12:51 +02:00
Pham Huy Hoang
c9ef5e58f7 feat(python): add break/continue dedent 2023-03-25 00:31:57 -04:00
Pham Huy Hoang
1ffa019856 feat(python): add match-case indents 2023-03-25 00:31:57 -04:00
Sergey Kacheev
a072d923c7 fix: uninstall function in the install.lua
The get_ensure_installed_parsers function return a table
for the option "all" because uninstall accepts a table
2023-03-24 23:23:02 +01:00
Tom van Dijk
5c3e8dee64 fix: get_range shim for playground 2023-03-24 22:17:04 +00:00
George Harker
cb568af539 use indent.X syntax for captures and properties of set directives
update CONTRIBUTING.md

adjust indents for bass

fix doc capture comment
2023-03-24 13:07:53 -04:00
George Harker
b4fcc61175 split delimiter into open_delimiter and close_delimiter 2023-03-24 13:07:53 -04:00
George Harker
d1333dd7e5 refactor(indent)!: Rework indent, aligned indent
indents now use @indent.X style captures, and indent.PROP for properties to set on those captures, as documented in the help.

Captures are:

indent.auto
indent.begin
indent.end
indent.dedent
indent.branch
indent.ignore
indent.align
indent.zero

Properties are:

indent.immediate
indent.start_at_same_line
indent.open_delimiter
indent.close_delimiter
indent.increment
indent.avoid_last_matching_next

Multiple opening delims on one line and multiple closing on a line are collapsed so as not to over indent,

The final line of @indent.align blocks which must in some cases be treated specially to avoid clashing with the next line is treated the same regardless of whether the @indent.align capture actually uses aligned indentation or just normal indentation. The indent.avoid_last_matching_next property controls this.

Adjust python to use these.

List, set, dict and tuple all use @indent.align which permits both hanging and aligned styles.

Finally, try: on it’s own will indent when typing live but make no guaranteeds about whole-file formatting.

Includes lucario387:fix-align-indent
2023-03-24 13:07:53 -04:00
Lewis Russell
90ead4ed58 fix: shim 0.9 deprecations 2023-03-24 16:05:38 +01:00
Lucario387
c7b9f68d03
feat(vue): add tsx/jsx injection queries (#4550)
* feat(vue): add tsx/jsx injection queries

- add a test

- style: format vue/injections.scm
2023-03-24 14:38:19 +00:00
Amaan Qureshi
17a81d7b35 feat(luadoc): add more annotations 2023-03-24 08:19:13 -04:00
kylo252
1f087c91f5
fix(health): check required neovim version (#4330)
* fix(health): check required neovim version

* fixup(health)!: require v0.8.3 for is_in_node_range

* fixup(readme)!: always prefer latest neovim
2023-03-24 03:36:30 +01:00
Amaan Qureshi
87cf2abeb6 feat(typescript): add various missing function/method captures 2023-03-22 18:03:20 -04:00
Matthias Queitsch
9db3769c4b highlights(sql): bump lockfile 2023-03-22 22:01:21 +01:00
Matthias Queitsch
97a354ff44 highlights(sql): add new keywords for views and defaults 2023-03-22 22:01:21 +01:00
Turiiya
dbdbd71b41 fix(v): add vlang as filetype 2023-03-22 11:48:36 +01:00
Amaan Qureshi
40670af980 feat: add Bass 2023-03-22 06:34:30 -04:00
Anthony Shi
9253ce66f9 fix(python): add object as @type.builtin 2023-03-22 05:27:28 -04:00
GitHub
9b4e8c1b97 Update parsers: glimmer 2023-03-22 02:56:38 -04:00
Benny Powers
19d9af8fb0 feat(html): injections in <script type>
refactor(html): remove superfluous injection query

fix(html): associate "module" type with "javascript"
2023-03-22 02:28:21 -04:00
Benny Powers
972da989bc test: ecma injections 2023-03-22 02:28:21 -04:00
Benny Powers
d228b51cd7 test: html injections 2023-03-22 02:28:21 -04:00
Stephan Seitz
8ae2c8ff49 highlights(proto): make "include"/"package" @include 2023-03-21 07:10:24 -04:00
Zhizhen He
181a580190 fix: revert for solidity 2023-03-21 02:23:52 -04:00
Zhizhen He
a1df50a79f docs: fix typo 2023-03-21 02:23:52 -04:00
GitHub
2e85a7f4f3 Update parsers: glimmer, sql 2023-03-21 07:05:15 +01:00
ObserverOfTime
379305aa7f fix(parsers): alias sh to bash 2023-03-21 00:00:05 +02:00
ObserverOfTime
25b656a4b7 comment(highlights): reduce user mention priority 2023-03-20 04:47:56 -04:00
Amaan Qureshi
bc23db2515 feat: add Luadoc 2023-03-20 04:20:49 -04:00
Amaan Qureshi
581fc14cea queries(lua): add more keywords related to variable/function builtins, debug, and coroutines 2023-03-20 03:13:41 -04:00
Amaan Qureshi
2170a36416 fix(lua): properly highlight labels 2023-03-20 03:13:00 -04:00
Benny Powers
4536156f32
injections(html): input regex patterns (#4521)
* injections(html): input regex patterns

replaces regex part of #2577
2023-03-19 08:32:42 -04:00
Benny Powers
38f878a1cd fix: svg injection in ecma tagged literals 2023-03-19 08:20:16 -04:00
Benny Powers
f15db0b652 style: alternation in template literal query 2023-03-19 08:20:16 -04:00
Benny Powers
1ba94e9f01 fix(ecma): template literal injections
see e3ebc8ec5d (commitcomment-104824257) for explanation

This also assigns the HTML parser for SVG tagged literals, since svg uses the HTML parser
2023-03-19 08:20:16 -04:00
Amaan Qureshi
6a269f197e fix(cpp): nullptr should be @constant.builtin 2023-03-19 08:14:10 -04:00
GitHub
f1a0b815ba Update parsers: qmljs, swift 2023-03-19 11:25:11 +01:00
derekstride
dcb9a89ab4 Use pre-generated parser files for sql grammar 2023-03-16 21:48:28 +01:00
Amaan Qureshi
f3fbc7c9a7 fix: check if repo location exists for local paths 2023-03-16 19:18:26 +01:00
Amaan Qureshi
17c275bfff feat: add LLVM TableGen 2023-03-16 10:58:50 -04:00
Pham Huy Hoang
01e8a51451 feat(python): add "return" patterns to @indent_end
`return ...` is usually the last line of a
function/statement, so mark some possible patterns of `return` with
`@indent_end` to dedent the line after it
2023-03-16 13:41:19 +01:00
Adam Wolski
273d5e9ac5 fix(windows): treat any non-cmd shell as powershell like in selector 2023-03-16 04:23:14 -04:00
Adam Wolski
677dd11c6a fix(windows): fix invalid powershell separator during install 2023-03-16 04:23:14 -04:00
GitHub
e6f9a4b7c3 Update parsers: bash, scala 2023-03-16 09:08:20 +01:00
Pham Huy Hoang
f5ddd8f92e fix(python): add missing @indent_end 2023-03-16 03:46:01 -04:00
George Harker
fa0644667e fix: change folding algorithm to fix Python indents 2023-03-15 22:44:59 +01:00
GitHub
cd436f92f6 Update parsers: elixir, haskell, php, sql 2023-03-15 08:45:15 +01:00
GitHub
89e5fa66cf Update parsers: mlir, rasi 2023-03-14 08:33:56 +01:00
Ramkumar Ramachandra
5c4ea53070 parsers: add tree-sitter-mlir parser
The parser is currently in development, and 60-80% of MLIR files in the
test suite of MLIR, within the Arith, Math, SCF, Tensor, and Linalg
dialects parse successfully.
2023-03-14 01:50:12 +01:00
GitHub
834f1dcb87 Update parsers: scala 2023-03-13 10:59:54 +01:00
GitHub
9c2009ce36 Update parsers: php, scala, swift, thrift, tsx, typescript 2023-03-13 10:41:15 +01:00
Amaan Qureshi
3eae9ded42 feat(thrift): update queries based on upstream changes 2023-03-13 05:24:58 -04:00
August Damiani
5b505f5658 docs: consistent in README 2023-03-12 22:13:31 -04:00
Peter Lamby
e3ebc8ec5d
fix(ecma): inject properly based on "call_expression"
Also add a comment what the query does.
2023-03-12 16:27:40 +00:00
GitHub
a6cc614409 Update parsers: racket, scheme 2023-03-12 10:24:10 +01:00
Amaan Qureshi
079a50f66e refactor!: remove setting the update strategy 2023-03-11 17:52:54 -05:00
Github Actions
a60b2234bc Update README 2023-03-11 17:23:22 -05:00
Amaan Qureshi
0e266bfc29 docs: add missing fields from InstallInfo, update code docs related to installation 2023-03-11 17:05:55 -05:00
Amaan Qureshi
4b04eaa5ce chore: clean up parsers.lua 2023-03-11 17:05:55 -05:00
Amaan Qureshi
11b2d430e6 feat(lua): add more builtin variables per lua_ls 2023-03-11 15:16:46 -05:00
Matthias Vogelgesang
350e7e5e31 highlights(cmake): match digits and @ in unquoted arguments 2023-03-11 13:36:12 -05:00
Ananda Umamil
5d59d18d3e highlights(typescript): infer, template literal type & punctuations 2023-03-11 04:56:44 -05:00
Amaan Qureshi
0ec25f87ee refactor(gitconfig): use lua-match instead of match 2023-03-11 04:47:17 -05:00
GitHub
22d35614ae Update parsers: prql, scheme, sql, yuck 2023-03-11 10:13:19 +01:00
Amaan Qureshi
207a86e4c9 feat: add Hare 2023-03-11 03:45:31 -05:00
Matthias Queitsch
98d63d0da4 highlights(prql): change loop and case highlight 2023-03-10 14:42:22 -08:00
GitHub
cfa9b70ee8 Update parsers: query, sql 2023-03-10 09:43:51 +01:00
Amaan Qureshi
ffa6efa7f5 feat(julia): add tests for new changes 2023-03-10 03:38:23 -05:00
Amaan Qureshi
1012dd957e feat(julia): add builtin functions & types 2023-03-10 03:38:23 -05:00
Amaan Qureshi
8886384244 feat(julia): mark begin & end in an index or range expression as @variable.builtin 2023-03-10 03:38:23 -05:00
Amaan Qureshi
9c7fa77f14 fix(julia): refactor some operators and punctuation 2023-03-10 03:38:23 -05:00
Matthias Queitsch
62ca703a0b highlights(prql): update to prql 0.6.0 2023-03-10 03:30:44 -05:00
Github Actions
dfa2cf702c Update README 2023-03-10 09:01:56 +01:00
Amaan Qureshi
0db1cc348e feat: add gitconfig 2023-03-10 03:00:55 -05:00
Github Actions
d2a7022d5d Update README 2023-03-10 08:52:42 +01:00
Amaan Qureshi
4a4c475617 fix(gleam): update tests reflecting recent changes 2023-03-10 02:41:45 -05:00
Amaan Qureshi
c8c083e8ce fix(gleam): update highlights from upstream 2023-03-10 02:41:45 -05:00
Amaan Qureshi
faa4caa661 chore(gleam): update parser info 2023-03-10 02:41:45 -05:00
Amaan Qureshi
4096d010c5 fix(gleam): add scanner.c to parsers list & update lockfile 2023-03-10 02:41:45 -05:00
Amaan Qureshi
964dc882e9 Partially Revert "fix(ecma): properly capture constants in const declarations"
This partially reverts commit c553e6c560.
2023-03-10 02:38:36 -05:00
Philipp Mildenberger
1de237d10d feat: improve yuck highlighting 2023-03-09 22:43:55 -05:00
Matthias Queitsch
fc1ca10bfb highlights(sql): add new keywords and datatypes 2023-03-08 17:32:22 -05:00
GitHub
d086563c02 Update parsers: squirrel, yuck 2023-03-08 09:27:30 +01:00
Amaan Qureshi
71be7c04d5 feat: add Squirrel 2023-03-07 23:45:54 -05:00
Amaan Qureshi
ba4bce9bb7 feat: add Uxn Tal 2023-03-07 12:49:04 +01:00
GitHub
356c9db347 Update parsers: yuck 2023-03-07 09:39:41 +01:00
Pham Huy Hoang
94f9a56973 indents(vue): Update dedent logic for <template> 2023-03-06 18:11:46 -05:00
Daniel Woznicki
7947a2ccf1
fix: Java indent for multiple line arguments (#4449)
* fix Java indent for multiple line arguments, fixes #4448, add an additional test for methods with arguments on multiple lines

* Satisfy StyLua check

---------

Co-authored-by: Daniel Woznicki <danwoz@nettoolkit.com>
2023-03-06 18:10:31 -05:00
GitHub
980f0816cc Update parsers: markdown, markdown_inline, swift 2023-03-06 08:46:47 +01:00
Pham Huy Hoang
5ac39d10cc indents(vue): fix indents on new line after <template> 2023-03-06 02:32:45 -05:00
Amaan Qureshi
5a87bc98da feat: add @comment.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
3a82b58745 docs: add @comment.documentation 2023-03-05 17:15:32 -05:00
Amaan Qureshi
95bcd6a8fa feat: add @string.documentation where applicable 2023-03-05 17:15:32 -05:00
Amaan Qureshi
51030378eb docs: add @string.documentation 2023-03-05 17:15:32 -05:00
Pham Huy Hoang
d11dd552db injections(html): fix faulty css/js injections
Group queries to reduce duplicate injection tree

use only regex
2023-03-05 22:34:41 +02:00
GitHub
3731cf1c0c Update parsers: zig 2023-03-05 12:35:36 +01:00
GitHub
14fb59e125 Update parsers: c_sharp, luap, perl 2023-03-05 10:38:02 +01:00
ObserverOfTime
1ceaceb9de docs: fix readme names 2023-03-04 20:36:57 +02:00
Github Actions
00b403f190 Update README 2023-03-04 17:33:28 +01:00
Amaan Qureshi
4beba61dde feat(query): differentiate lua-match strings by using luap injections and fix offset matches 2023-03-04 11:32:25 -05:00
Amaan Qureshi
25f99a270a feat(lua): add luap injections 2023-03-04 11:32:25 -05:00
Amaan Qureshi
c9d7918901 feat: add luap 2023-03-04 11:32:25 -05:00
Matthias Queitsch
d4e48be88d highlights(sql): keywords as @storageclass 2023-03-04 06:14:31 -05:00
Matthias Queitsch
d382b41563 highlights(sql): added missing kwds, added @attribute and @type.qualifier kwds 2023-03-04 06:14:31 -05:00
Matthias Queitsch
e3a1ae4c4e highlights(sql): add missing keywords 2023-03-04 06:14:31 -05:00
Amaan Qureshi
376d74006f feat: add cue 2023-03-04 05:08:18 -05:00
Amaan Qureshi
d7cef15b01 feat(ecma): add tests for constants 2023-03-04 05:00:39 -05:00
Amaan Qureshi
c553e6c560 fix(ecma): properly capture constants in const declarations 2023-03-04 05:00:39 -05:00
GitHub
88c490f00f Update parsers: hlsl, yuck 2023-03-04 09:39:46 +01:00
Evan Phoenix
28f84d69e3 fix(go): Indent on type switch case properly 2023-03-03 23:36:51 -05:00
Yochem van Rosmalen
190561df89 v(injections): inject regex for some methods in re module 2023-03-03 15:14:58 -05:00
GitHub
f225f53510 Update parsers: sql, yuck 2023-03-03 16:37:26 +01:00
Amaan Qureshi
3c42fb9d70 refactor(svelte): match certain keywords for conditional and exception 2023-03-03 07:07:52 -08:00
Amaan Qureshi
d2a45aa531 refactor(zig): @type.definition items belong in @keyword, differentiate @boolean from @constant.builtin 2023-03-03 07:07:52 -08:00
Amaan Qureshi
3c8842c79a refactor(ruby): move keywords appropriately 2023-03-03 07:07:52 -08:00
Amaan Qureshi
33ba346e60 feat!: add @keyword.coroutine capture 2023-03-03 07:07:52 -08:00
Amaan Qureshi
1bf4be0441 docs: add @keyword.coroutine 2023-03-03 07:07:52 -08:00
Christian Clason
8212548e33
docs(readme): recommend installing query parser
now bundled in Neovim
2023-03-03 15:49:25 +01:00
GitHub
a0d6c28f89 Update parsers: cpp, cuda, markdown, markdown_inline, racket, sql 2023-03-03 09:38:27 +01:00
Anthony Shi
8894d78f63 Update highlights.scm for Python
Added new keywords "is not" and "not in"
2023-03-02 22:54:45 -05:00
Matthias Queitsch
e9fb90da02 feat(prql): update queries 2023-03-02 15:57:18 -05:00
Christian Clason
07fb134752 markdown!: switch to scanner.c 2023-03-02 18:08:03 +01:00
Github Actions
b31312729e Update README 2023-03-02 08:30:56 +01:00
GitHub
6d96e2b6ac Update parsers: erlang, haskell, qmldir, sql, v 2023-03-02 08:30:42 +01:00
Preston Knopp
36b1038a65
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 <amaanq12@gmail.com>

* 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 <amaanq12@gmail.com>
2023-03-02 07:28:13 +00:00
Jaehwang Jung
b145021499 fix: remove wrong/pointless tostring 2023-03-02 00:30:35 -05:00
Yochem van Rosmalen
252c1011c4 comment(highlights): add @nospell to tags and user mentions 2023-03-01 15:22:10 -05:00
Matthias Q
0572657d4d
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`
2023-03-01 15:21:11 -05:00
GitHub
9dd1b9c097 Update parsers: gdscript, kdl, meson, yuck 2023-03-01 09:37:29 +01:00
Amaan Qureshi
75d98eaac4 feat(kdl): update parser & queries fixing the comment bug 2023-03-01 02:57:26 -05:00
Amaan Qureshi
5b9339f6f4 feat: add PO 2023-03-01 02:56:14 -05:00
Amaan Qureshi
d80c99cab0 fix(qmldir): add to parsers.lua 2023-03-01 09:55:50 +02:00
Amaan Qureshi
ba4ecfe471 feat: add qmldir 2023-03-01 02:28:48 -05:00
Amaan Qureshi
3fe80dbecd feat: add passwd 2023-02-28 17:48:11 -05:00
Christian Clason
f95ffd09ed python(highlights): adapt query to parser change 2023-02-28 20:27:09 +01:00
GitHub
b1b2e9b6d3 Update parsers: markdown, markdown_inline, python, zig 2023-02-28 20:27:09 +01:00
GitHub
bae59318b3 Update parsers: markdown, markdown_inline 2023-02-28 19:43:04 +01:00
GitHub
934113c913 Update parsers: ungrammar 2023-02-28 09:59:33 +01:00
Amaan Qureshi
418caac89d feat(starlark): improve assertion parsing 2023-02-28 02:52:23 -05:00
Amaan Qureshi
316200f77d feat: add matlab 2023-02-28 02:51:00 -05:00
Mitchell Hanberg
f0617c31f4 fix(eex): map eelixir filetype to the eex parser 2023-02-27 23:38:18 -05:00
Amaan Qureshi
5cfb5d7768 feat(fortran): update highlight queries 2023-02-27 20:24:32 -05:00
Uy Ha
e2a9fc8e5c use lua-match where possible 2023-02-27 20:23:53 -05:00
Philipp Mildenberger
b9a7591b6c feat: add yuck 2023-02-27 17:57:04 -05:00
Uy Ha
04b87c7b6e move the catch uppercase query to the top to make it overridable, add back the more useful queries 2023-02-27 14:52:26 -08:00
Uy Ha
28475d5676 add highlighting for elseif 2023-02-27 14:52:26 -08:00
Uy Ha
a5a6590f15 only match unquoted arguments 2023-02-27 14:52:26 -08:00
Uy Ha
cf718048ca simplify cmake highlight queries 2023-02-27 14:52:26 -08:00
GitHub
a9f0b1c2ba Update parsers: c_sharp, fortran, swift 2023-02-27 08:33:51 +01:00
Benny Powers
5070936137 feat(html): lit attr binding interpolation 2023-02-26 18:56:38 +02:00
GitHub
b4d8b7e5a3 Update parsers: clojure, latex, perl 2023-02-26 11:05:02 +01:00
Christian Clason
4f8f4fe4c1 fix: do not recommend removing bundled parsers 2023-02-26 00:21:41 +01:00
Benny Powers
8d2f9903f1 feat(ecma): include outerHTML and innerHTML 2023-02-25 11:17:13 -05:00
Benny Powers
248a87ef65 feat(ecma): add innerHTML injection 2023-02-25 11:17:13 -05:00
GitHub
ad8798795c Update parsers: cpon, javascript, perl, tsx, typescript 2023-02-25 11:13:37 +01:00
Kiyoon Kim
df968afd9d goto_node select last character when in operator-pending mode 2023-02-25 02:26:31 -05:00
Amaan Qureshi
53695580e3 feat(dart): add folds 2023-02-24 16:24:23 -08:00
Philipp Mildenberger
fe80f7c2bb feat: add ungrammar 2023-02-24 18:42:35 -05:00
Nat Williams
20a8f30ace use positive option "allow_duplicates" instead of negative "dedupe" 2023-02-24 14:55:30 -08:00
Nat Williams
3fab7abf6f add statusline option to dedupe or not 2023-02-24 14:55:30 -08:00
Nat Williams
34adfe8e95 update docs for transform_fn
to reflect additional node argument
2023-02-24 14:55:30 -08:00
Nat Williams
22de3532cc also pass the node to the statusline transform fn 2023-02-24 14:55:30 -08:00
Stephen Bolton
a744ed1b27 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.
2023-02-24 17:50:17 -05:00
Amaan Qureshi
028b7dfbdd feat: add bicep 2023-02-24 17:43:13 -05:00
Tomas Sandven
061ee1b98f Fix broken YANG indent tests 2023-02-24 16:39:33 -05:00
Tomas Sandven
06e8a91ce2 Add YANG indentation tests 2023-02-24 16:39:33 -05:00
Amaan Qureshi
e138c066f7 feat(health): sort parser list for clarity 2023-02-24 13:38:20 -08:00
ExpandingMan
2ad12932a2
docs: add small note in README clarifying custom parser installation (#3625) 2023-02-24 16:19:46 -05:00
SzeLamC
68ab44277c
fix(dart): add @indent_end to } (#4167)
* fix dart indentation after }

* add some simple test case
2023-02-24 16:06:31 -05:00
Amaan Qureshi
5c511dd124 feat(solidity): use maintained parser and update highlights accordingly 2023-02-24 13:05:33 -08:00
Matthieu Coudron
b401b7423d ci: bump release workflow
new version adds 'make' support and should fix the release job
2023-02-24 15:27:12 +01:00
Matthieu Coudron
84b047e424 fix(ci): remove double 'uses'
which invalidates the action
2023-02-24 11:18:15 +01:00
Lewis Russell
801ef85f93 feat: use vim.treesitter.language.get_lang/add/register() 2023-02-24 10:09:43 +00:00
Lewis Russell
f15d3b0322 feat!: remove support for used_by in parser configs 2023-02-24 10:09:43 +00:00
GitHub
b33ddcea5f Update parsers: c_sharp, sql, starlark 2023-02-24 10:40:04 +01:00
Amaan Qureshi
a3213e3dd7 fix(go): apply indents in a communication case in a select statement 2023-02-24 01:37:58 -08:00
Github Actions
37e7af1619 Update README 2023-02-24 10:32:14 +01:00
1913 changed files with 80946 additions and 31751 deletions

31
.emmyrc.json Normal file
View file

@ -0,0 +1,31 @@
{
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
"format": {
"externalTool": {
"program": "stylua",
"args": [
"-",
"--stdin-filepath",
"${file}"
]
}
},
"diagnostics": {
"disable": [
"unnecessary-if",
"incomplete-signature-doc"
],
"enables": [
"iter-variable-reassign",
"non-literal-expressions-in-assert",
"missing-global-doc"
]
},
"codeAction": {
"insertSpace": true
},
"strict": {
"typeCall": true,
"arrayIndex": true
}
}

4
.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
runtime/queries/**/*.scm linguist-language=tsq
doc/*.txt linguist-documentation
SUPPORTED_LANGUAGES.md linguist-generated
lua/nvim-treesitter/async.lua linguist-vendored

7
.github/CODEOWNERS vendored
View file

@ -1,7 +0,0 @@
/lua/nvim-treesitter/textobjects/ @theHamsta
/lua/nvim-treesitter/incremental_selection.lua @theHamsta
/lua/nvim-treesitter/fold.lua @vigoux
/lua/nvim-treesitter/highlight.lua @vigoux
/lua/nvim-treesitter/refactor/ @steelsojka

2
.github/FUNDING.yml vendored
View file

@ -1,2 +0,0 @@
open_collective: "nvim-treesitter"
github: "nvim-treesitter"

View file

@ -1,6 +1,6 @@
name: Bug report
description: Create a report to help us improve
labels: [bug]
type: 'bug'
body:
- type: markdown

View file

@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ""
labels: enhancement
type: enhancement
assignees: ""
---

View file

@ -1,5 +1,6 @@
name: Highlighting issue
description: Missing or incorrect highlights or you want to change the way something is highlighted
type: 'bug'
labels: [highlights]
body:
@ -11,10 +12,10 @@ body:
- I have updated my neovim version to latest _master_.
- I have updated my plugin to the latest version.
- I have run `:TSUpdate`.
- I have inspected the syntax tree using https://github.com/nvim-treesitter/playground and made sure
- I have inspected the syntax tree using `:InspectTree` and made sure
that no `ERROR` nodes are in the syntax tree. nvim-treesitter can not guarantee correct highlighting in the
presence of `ERROR`s -- in this case, please report the bug directly at corresponding parser's repository. (You can find all repository URLs in [README.md](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages).)
- I have used `:TSHighlightCapturesUnderCursor` from https://github.com/nvim-treesitter/playground to inspect which highlight groups Neovim is using and that legacy syntax highlighting is not interfering (i.e., what you are observing is actual tree-sitter highlighting).
- I have used `:Inspect` to inspect which highlight groups Neovim is using and that legacy syntax highlighting is not interfering (i.e., what you are observing is actual tree-sitter highlighting).
- type: textarea
attributes:
@ -34,8 +35,8 @@ body:
attributes:
label: Tree-sitter parsing result
description: |
Please provide the output of `:TSPlaygroundToggle` from https://github.com/nvim-treesitter/playground
(screenshot or plain text) with the following options enabled (pressing the key):
Please provide the output of `:InspectTree` (screenshot or plain text)
with the following options enabled (pressing the key):
- `I` (name of the parsed language)
- `t` (toggle injected languages)
- `a` (show anonymous nodes)
@ -66,7 +67,7 @@ body:
description: |
Please provide a screenshot of the current highlighting. Please also tell us the `:h colorscheme` you are using
and how to install it. If applicable, you can also upload a screenshot with the contents of
`:TSHighlightCapturesUnderCursor`.
`:Inspect`.
validations:
required: true

View file

@ -0,0 +1,47 @@
<!--
Before proceeding, make sure you have read https://github.com/nvim-treesitter/nvim-treesitter/blob/main/CONTRIBUTING.md!
Make sure to fill out all fields and read the checklist at the end.
-->
# Name of language
<!-- Link to an official description of the language -->
https://...
Language file extension, if applicable: (e.g. `.zu`)
<details>
<summary>Representative code sample</summary>
```
max. 50 lines
```
</details>
## Parser repo
https://github.com/...
<details>
<summary>Parsed tree for code sample</summary>
```
paste output of tree-sitter parse or :InspectTree here
```
</details>
## Queries
Source of queries: https://github.com/... (or "written from scratch")
<details>
<summary>Screenshots of code sample</summary>
<!-- paste screenshot of code sample using provided queries here -->
</details>
<!--
CHECKLIST: _Before_ submitting, make sure
* `./scripts/install-parsers.lua <language>` works without warnings
* `./scripts/install-parsers.lua --generate <language>` works without warnings
* `make query` works without warning
* `make docs` is run
-->

16
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 3
commit-message:
prefix: "ci"
labels:
- "CI"
groups:
actions:
patterns: ["*"]

37
.github/mergify.yml vendored
View file

@ -1,37 +0,0 @@
pull_request_rules:
- name: Merge lockfile updates
conditions:
- "title=Update lockfile.json"
actions:
review:
type: APPROVE
message: Automatically approving lockfile updates
merge:
method: merge
- name: Prepare for merge
conditions:
- and:
- "-draft"
- "#approved-reviews-by=1"
- "#review-requested=0"
actions:
comment:
message: |
This PR is ready to be merged, and will be in 1 day if nothing happens before.
If you want other people to review your PR, request their reviews.
If you don't want this PR to be merged now, mark it as a Draft.
- name: Merge on approval
conditions:
- and:
- or:
- "#approved-reviews-by>=2"
- and:
- "#approved-reviews-by=1"
- "updated-at>=1 day ago"
- "-draft"
- "#review-requested=0"
actions:
merge:
method: rebase

5
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,5 @@
<!--
Before proceeding, make sure you have read https://github.com/nvim-treesitter/nvim-treesitter/blob/main/CONTRIBUTING.md!
If you are adding a new parser, use this link instead:
<https://github.com/nvim-treesitter/nvim-treesitter/compare/main...my-branch?quick_pull=1&template=new_language.md>
-->

62
.github/workflows/downstream.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: Tests
on:
pull_request:
branches:
- "main"
paths:
- "lua/nvim-treesitter/parsers.lua"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test-downstream:
name: Check downstream queries
runs-on: ubuntu-latest
env:
NVIM: "nvim"
steps:
- uses: actions/checkout@v6
- uses: tree-sitter/setup-action/cli@v2
- name: Install and prepare Neovim
env:
NVIM_TAG: "nightly"
run: |
bash ./scripts/ci-install.sh
- name: Compile parsers
run: $NVIM -l ./scripts/install-parsers.lua --max-jobs=10
- name: Set up ts_query_ls
run: curl -fL https://github.com/ribru17/ts_query_ls/releases/latest/download/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz | tar -xz
- name: Clone textobjects
uses: actions/checkout@v6
with:
repository: nvim-treesitter/nvim-treesitter-textobjects
ref: main
path: .tests/nvim-treesitter-textobjects
sparse-checkout: queries
- name: Check textobjects
working-directory: .tests/nvim-treesitter-textobjects/
run: ../../ts_query_ls check queries/
- name: Clone context
if: always()
uses: actions/checkout@v6
with:
repository: nvim-treesitter/nvim-treesitter-context
ref: master
path: .tests/nvim-treesitter-context
sparse-checkout: queries
- name: Check context
if: always()
working-directory: .tests/nvim-treesitter-context/
run: ../../ts_query_ls check queries/

View file

@ -1,33 +1,50 @@
name: Linting and style checking
name: Lint
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
luacheck:
name: Luacheck
runs-on: ubuntu-latest
lua:
name: Lint Lua files
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Prepare
- name: Format
run: |
sudo apt-get update
sudo apt-get install luarocks -y
sudo luarocks install luacheck
make formatlua
git diff --exit-code
- name: Run Luacheck
run: luacheck .
- name: Lint
run: make checklua
stylua:
name: StyLua
runs-on: ubuntu-latest
queries:
name: Lint query files
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v3
- name: Lint with stylua
uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
- uses: actions/checkout@v6
- name: Format
run: |
make formatquery
git diff --exit-code
- name: Lint
run: make lintquery
readme:
name: Lint docs
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
- name: Check SUPPORTED_LANGUAGES
run: |
make docs
git diff --exit-code

View file

@ -1,18 +0,0 @@
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"

58
.github/workflows/test-core.yml vendored Normal file
View file

@ -0,0 +1,58 @@
on:
workflow_call:
inputs:
type:
type: string
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
check_compilation:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
nvim_tag: [stable, nightly]
name: ${{matrix.nvim_tag}} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }}
steps:
- uses: actions/checkout@v6
- uses: tree-sitter/setup-action/cli@v2
- name: Install and prepare Neovim
env:
NVIM_TAG: ${{ matrix.nvim_tag }}
run: |
bash ./scripts/ci-install.sh
- if: inputs.type == 'build'
name: Compile parsers
run: $NVIM -l ./scripts/install-parsers.lua --max-jobs=10
- if: inputs.type == 'generate'
name: Generate and compile parsers
run: $NVIM -l ./scripts/install-parsers.lua --generate --max-jobs=2
- name: Check parsers
run: $NVIM -l ./scripts/check-parsers.lua
- name: Check queries (nvim)
if: ${{ matrix.os == 'windows-latest' }}
run: $NVIM -l ./scripts/check-queries.lua
- name: Check queries (tsqueryls)
if: ${{ matrix.os != 'windows-latest' }}
run: make checkquery
- name: Run highlight tests
if: ${{ matrix.os != 'windows-latest' }}
run: make tests TESTS=query NVIM_BIN=$NVIM
- name: Run indents tests
if: ${{ matrix.os != 'windows-latest' }}
run: make tests TESTS=indent NVIM_BIN=$NVIM

20
.github/workflows/test-generate.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Tests
on:
pull_request:
types: [unlabeled, labeled, opened, synchronize, reopened]
branches:
- "main"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-generate-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check_compilation:
name: Generate
if: contains(github.event.pull_request.labels.*.name, 'ci:generate') || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/test-core.yml
with:
type: "generate"

View file

@ -1,87 +1,21 @@
name: Test queries
name: Tests
on:
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
workflow_dispatch:
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
group: ${{ github.workflow }}-build-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check_compilation:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022, macos-latest]
cc: [gcc, clang]
nvim_tag: [stable]
exclude:
- os: ubuntu-latest
cc: clang
nvim_tag: stable
- os: macos-latest
cc: gcc
nvim_tag: stable
- os: windows-2022
cc: clang
nvim_tag: stable
include:
- os: windows-2022
cc: cl
nvim_tag: stable
- os: ubuntu-latest
cc: gcc
nvim_tag: nightly
name: Parser compilation
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
NVIM: ${{ matrix.os == 'windows-2022' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }}
ALLOWED_INSTALLATION_FAILURES: ${{ matrix.os == 'windows-2022' && 'rnoweb' }}
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-node@v3
- name: Install tree-sitter CLI
run: npm i -g tree-sitter-cli
- name: Install and prepare Neovim
env:
NVIM_TAG: ${{ matrix.nvim_tag }}
run: |
bash ./scripts/ci-install-${{ matrix.os }}.sh
- name: Setup Parsers Cache
id: parsers-cache
uses: actions/cache@v3
with:
path: |
./parser/
~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/
key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.nvim_tag }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_command_selectors.lua') }}
- name: Compile parsers
run: $NVIM --headless -c "lua require'nvim-treesitter.install'.prefer_git=false" -c "TSInstallSync all" -c "q"
- name: Post compile Windows
if: matrix.os == 'windows-2022'
run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser
- name: Check query files
run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q"
name: Build
uses: ./.github/workflows/test-core.yml
with:
type: "build"

View file

@ -1,65 +0,0 @@
name: Tests
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
check_compilation:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
cc: [gcc]
name: Run tests
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install tree-sitter CLI
run: npm i -g tree-sitter-cli
- name: Test Dependencies
run: |
mkdir -p ~/.local/share/nvim/site/pack/plenary.nvim/start
cd ~/.local/share/nvim/site/pack/plenary.nvim/start
git clone https://github.com/nvim-lua/plenary.nvim
curl -L https://github.com/theHamsta/highlight-assertions/releases/download/v0.1.6/highlight-assertions_v0.1.6_x86_64-unknown-linux-gnu.tar.gz | tar -xz
cp highlight-assertions /usr/local/bin
- name: Install and prepare Neovim
env:
NVIM_TAG: stable
TREE_SITTER_CLI_TAG: v0.20.6
run: |
bash ./scripts/ci-install-${{ matrix.os }}.sh
- name: Setup Parsers Cache
id: parsers-cache
uses: actions/cache@v3
with:
path: |
./parser/
~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/
key: ${{ matrix.os }}-${{ matrix.cc }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_selectors.lua') }}
- name: Compile parsers Unix like
if: ${{ matrix.os != 'windows-latest' && steps.parsers-cache.outputs.cache-hit != 'true' }}
run: |
nvim --headless -c "TSInstallSync all" -c "q"
- name: Tests
run: PATH=/usr/local/bin:$PATH ./scripts/run_tests.sh

View file

@ -1,56 +0,0 @@
name: Update lockfile
on:
schedule:
- cron: "30 6 * * *"
workflow_dispatch:
jobs:
update-lockfile:
name: Update lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Prepare
env:
NVIM_TAG: stable
run: |
wget https://github.com/josephburnett/jd/releases/download/v1.6.1/jd-amd64-linux
mv ./jd-amd64-linux /tmp/jd
chmod +x /tmp/jd
sudo apt install libfuse2
wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage
chmod u+x nvim.appimage
mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start
ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start
- name: Update parsers
env:
SKIP_LOCKFILE_UPDATE_FOR_LANGS: verilog,gleam,nix
run: |
cp lockfile.json /tmp/old_lockfile.json
./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q"
# Pretty print
cp lockfile.json /tmp/lockfile.json
cat /tmp/lockfile.json | jq --sort-keys > lockfile.json
- name: Commit changes
run: |
git config user.name "GitHub"
git config user.email "noreply@github.com"
git add lockfile.json
UPDATED_PARSERS=$(/tmp/jd -f merge /tmp/old_lockfile.json lockfile.json | jq -r 'keys | join(", ")')
echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV
git commit -m "Update parsers: $UPDATED_PARSERS" || echo 'No commit necessary!'
git clean -xf
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}"
branch: update-lockfile-pr
base: ${{ github.head_ref }}
draft: true

60
.github/workflows/update-parsers.yml vendored Normal file
View file

@ -0,0 +1,60 @@
name: Update parsers
on:
schedule:
- cron: "30 6 * * 6"
workflow_dispatch:
env:
BIN_DIR: ${{ github.workspace }}/bin
jobs:
update-parsers:
strategy:
fail-fast: false
matrix:
tier: [1, 2]
name: Update parsers tier ${{ matrix.tier }}
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
with:
ref: main
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ vars.TOKEN_ID }}
private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}
- name: Add $BIN_DIR to PATH
run: echo "$BIN_DIR" >> $GITHUB_PATH
- name: Prepare
env:
NVIM_TAG: nightly
run: |
bash scripts/ci-install.sh
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
(cd "$BIN_DIR"; unzip stylua*.zip)
- name: Update parsers
run: ./scripts/update-parsers.lua --tier=${{ matrix.tier }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
add-paths: lua/nvim-treesitter/parsers.lua
token: ${{ steps.app-token.outputs.token }}
sign-commits: true
commit-message: "bot(parsers): update ${{ env.UPDATED_PARSERS }}"
title: "Update parsers (tier ${{ matrix.tier }}): ${{ env.UPDATED_PARSERS }}"
body: "[beep boop](https://github.com/peter-evans/create-pull-request)"
branch: update-parsers-tier-${{ matrix.tier }}
base: ${{ github.head_ref }}
- name: Enable Pull Request Automerge
if: ${{ matrix.tier == 2 }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr merge --rebase --auto update-parsers-tier-2

View file

@ -1,42 +0,0 @@
name: Update README
on:
push:
branches:
- master
workflow_dispatch:
jobs:
update-readme:
name: Update README
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare
env:
NVIM_TAG: stable
run: |
sudo apt install libfuse2
wget https://github.com/neovim/neovim/releases/download/${NVIM_TAG}/nvim.appimage
chmod u+x nvim.appimage
mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start
ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start
- name: Check README
run: |
git config user.email "actions@github"
git config user.name "Github Actions"
./nvim.appimage --headless -c "luafile ./scripts/update-readme.lua" -c "q" || echo "Needs update"
git add README.md
git commit -m "Update README" || echo 'No commit necessary!'
git clean -xf
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update README
title: Update README
branch: update-readme-pr
base: ${{ github.head_ref }}
draft: true

4
.gitignore vendored
View file

@ -1,4 +1,8 @@
.test-deps
doc/tags
.luacheckcache
/tags
nvim.appimage
nvim-linux-x86_64*
nvim-macos*
nvim-win64*

View file

@ -1,21 +0,0 @@
-- Rerun tests only if their modification time changed.
cache = true
codes = true
exclude_files = {
"tests/indent/lua/"
}
-- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html
ignore = {
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
"411", -- Redefining a local variable.
"412", -- Redefining an argument.
"422", -- Shadowing an argument
"122" -- Indirectly setting a readonly global
}
-- Global objects defined by the C code
read_globals = {
"vim",
}

28
.luarc.json Normal file
View file

@ -0,0 +1,28 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime": {
"version": "LuaJIT"
},
"workspace": {
"library": [
"$VIMRUNTIME",
"${3rd}/busted/library"
],
"ignoreDir": [
".test-deps",
"tests"
],
"checkThirdParty": "Disable"
},
"diagnostics": {
"groupFileStatus": {
"strict": "Opened",
"strong": "Opened"
},
"groupSeverity": {
"strong": "Warning",
"strict": "Warning"
},
"unusedLocalExclude": [ "_*" ]
}
}

View file

@ -1,6 +1,6 @@
column_width = 120
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "None"
quote_style = "AutoPreferSingle"
call_parentheses = "Always"

405
.tsqueryrc.json Normal file
View file

@ -0,0 +1,405 @@
{
"$schema": "https://raw.githubusercontent.com/ribru17/ts_query_ls/refs/heads/master/schemas/config.json",
"parser_install_directories": ["${HOME}/.local/share/nvim/site/parser"],
"supported_abi_versions": {
"start": 13,
"end": 15
},
"parser_aliases": {
"html_tags": "html",
"ecma": "javascript",
"jsx": "javascript"
},
"valid_captures": {
"highlights": {
"variable": "various variable names",
"variable.builtin": "built-in variable names (e.g. `this`)",
"variable.parameter": "parameters of a function",
"variable.parameter.builtin": "special parameters (e.g. `_`, `it`)",
"variable.member": "object and struct fields",
"constant": "constant identifiers",
"constant.builtin": "built-in constant values",
"constant.macro": "constants defined by the preprocessor",
"module": "modules or namespaces",
"module.builtin": "built-in modules or namespaces",
"label": "GOTO and other labels (e.g. `label:` in C), including heredoc labels",
"string": "string literals",
"string.documentation": "string documenting code (e.g. Python docstrings)",
"string.regexp": "regular expressions",
"string.escape": "escape sequences",
"string.special": "other special strings (e.g. dates)",
"string.special.symbol": "symbols or atoms",
"string.special.url": "URIs (e.g. hyperlinks)",
"string.special.path": "filenames",
"character": "character literals",
"character.special": "special characters (e.g. wildcards)",
"boolean": "boolean literals",
"number": "numeric literals",
"number.float": "floating-point number literals",
"type": "type or class definitions and annotations",
"type.builtin": "built-in types",
"type.definition": "identifiers in type definitions (e.g. `typedef <type> <identifier>` in C)",
"attribute": "attribute annotations (e.g. Python decorators, Rust lifetimes)",
"attribute.builtin": "builtin annotations (e.g. `@property` in Python)",
"property": "the key in key/value pairs",
"function": "function definitions",
"function.builtin": "built-in functions",
"function.call": "function calls",
"function.macro": "preprocessor macros",
"function.method": "method definitions",
"function.method.call": "method calls",
"constructor": "constructor calls and definitions",
"operator": "symbolic operators (e.g. `+` / `*`)",
"keyword": "keywords not fitting into specific categories",
"keyword.coroutine": "keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)",
"keyword.function": "keywords that define a function (e.g. `func` in Go, `def` in Python)",
"keyword.operator": "operators that are English words (e.g. `and` / `or`)",
"keyword.import": "keywords for including or exporting modules (e.g. `import` / `from` in Python)",
"keyword.type": "keywords describing namespaces and composite types (e.g. `struct`, `enum`)",
"keyword.modifier": "keywords modifying other constructs (e.g. `const`, `static`, `public`)",
"keyword.repeat": "keywords related to loops (e.g. `for` / `while`)",
"keyword.return": "keywords like `return` and `yield`",
"keyword.debug": "keywords related to debugging",
"keyword.exception": "keywords related to exceptions (e.g. `throw` / `catch`)",
"keyword.conditional": "keywords related to conditionals (e.g. `if` / `else`)",
"keyword.conditional.ternary": "ternary operator (e.g. `?` / `:`)",
"keyword.directive": "various preprocessor directives & shebangs",
"keyword.directive.define": "preprocessor definition directives",
"punctuation.delimiter": "delimiters (e.g. `;` / `.` / `,`)",
"punctuation.bracket": "brackets (e.g. `()` / `{}` / `[]`)",
"punctuation.special": "special symbols (e.g. `{}` in string interpolation)",
"comment": "line and block comments",
"comment.documentation": "comments documenting code",
"comment.error": "error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED`)",
"comment.warning": "warning-type comments (e.g. `WARNING`, `FIX`, `HACK`)",
"comment.todo": "todo-type comments (e.g. `TODO`, `WIP`)",
"comment.note": "note-type comments (e.g. `NOTE`, `INFO`, `XXX`)",
"markup.strong": "bold text",
"markup.italic": "italic text",
"markup.strikethrough": "struck-through text",
"markup.underline": "underlined text (only for literal underline markup!)",
"markup.heading": "headings, titles (including markers)",
"markup.heading.1": "top-level heading",
"markup.heading.2": "section heading",
"markup.heading.3": "subsection heading",
"markup.heading.4": "and so on",
"markup.heading.5": "and so forth",
"markup.heading.6": "six levels ought to be enough for anybody",
"markup.quote": "block quotes",
"markup.math": "math environments (e.g. `$ ... $` in LaTeX)",
"markup.link": "text references, footnotes, citations, etc.",
"markup.link.label": "link, reference descriptions",
"markup.link.url": "URL-style links",
"markup.raw": "literal or verbatim text (e.g. inline code)",
"markup.raw.block": "literal or verbatim text as a stand-alone block ; (use priority 90 for blocks with injections)",
"markup.list": "list markers",
"markup.list.checked": "checked todo-style list markers",
"markup.list.unchecked": "unchecked todo-style list markers",
"diff.plus": "added text (for diff files)",
"diff.minus": "deleted text (for diff files)",
"diff.delta": "changed text (for diff files)",
"tag": "XML-style tag names (and similar)",
"tag.builtin": "builtin tag names (e.g. HTML5 tags)",
"tag.attribute": "XML-style tag attributes",
"tag.delimiter": "XML-style tag delimiters",
"conceal": "captures that are only meant to be concealed",
"spell": "for defining regions to be spellchecked",
"nospell": "for defining regions that should NOT be spellchecked",
"none": "completely disable the highlight"
},
"injections": {
"injection.content": "indicates that the captured node should have its contents re-parsed using another language",
"injection.language": "indicates that the captured nodes text may contain the name of a language that should be used to re-parse the `@injection.content`",
"injection.filename": "indicates that the captured nodes text may contain a filename; the corresponding filetype is then looked-up up via `vim.filetype.match()` and treated as the name of a language that should be used to re-parse the `@injection.content`"
},
"folds": {
"fold": "fold this node"
},
"indents": {
"indent.begin": "Specifies that the next line should be indented. Multiple indents on the same line get collapsed. Indent can also have `indent.immediate` set using a `#set!` directive, which permits the next line to indent even when the block intended to be indented has no content yet, improving interactive typing.",
"indent.end": "Used to specify that the indented region ends and any text subsequent to the capture should be dedented.",
"indent.align": "Specifies aligned indent blocks (like python aligned/hanging indent). Specify the delimiters with `indent.open_delimiter` and `indent.close_delimiter` metadata. For some languages, the last line of an `indent.align` block must not be the same indent as the natural next line, which can be controlled by setting `indent.avoid_last_matching_next`.",
"indent.dedent": "Specifies dedenting starting on the next line.",
"indent.branch": "Used to specify that a dedented region starts at the line including the captured nodes.",
"indent.ignore": "Specifies that indentation should be ignored for this node.",
"indent.auto": "Behaves like 'autoindent' buffer option.",
"indent.zero": "Sets indentation for this node to zero (no indentation)."
},
"locals": {
"local.definition": "various definitions",
"local.definition.constant": "constants",
"local.definition.function": "functions",
"local.definition.method": "methods",
"local.definition.var": "variables",
"local.definition.parameter": "parameters",
"local.definition.macro": "preprocessor macros",
"local.definition.type": "types or classes",
"local.definition.field": "fields or properties",
"local.definition.enum": "enumerations",
"local.definition.namespace": "modules or namespaces",
"local.definition.import": "imported names",
"local.definition.associated": "the associated type of a variable",
"local.scope": "scope block",
"local.reference": "identifier reference"
}
},
"valid_predicates": {
"eq": {
"any": true,
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "any",
"arity": "required"
}
],
"description": "checks for equality between two nodes, or a node and a string"
},
"any-of": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required"
},
{
"type": "string",
"arity": "required"
},
{
"type": "string",
"arity": "variadic"
}
],
"description": "match any of the given strings against the text corresponding to a node"
},
"contains": {
"any": true,
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required"
},
{
"type": "string",
"arity": "variadic"
}
],
"description": "match a string against parts of the text corresponding to a node"
},
"match": {
"any": true,
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required"
}
],
"description": "Match a regexp against the text corresponding to a node"
},
"lua-match": {
"any": true,
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required"
}
],
"description": "match a Lua pattern against the text corresponding to a node"
},
"has-ancestor": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required",
"constraint": "named_node"
},
{
"type": "string",
"arity": "variadic",
"constraint": "named_node"
}
],
"description": "match any of the given node types against all ancestors of a node"
},
"has-parent": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required",
"constraint": "named_node"
},
{
"type": "string",
"arity": "variadic",
"constraint": "named_node"
}
],
"description": "match any of the given node types against the direct ancestor of a node"
},
"kind-eq": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required",
"constraint": "named_node"
},
{
"type": "string",
"arity": "variadic",
"constraint": "named_node"
}
],
"description": "checks whether a capture corresponds to a given set of nodes"
}
},
"valid_directives": {
"set": {
"parameters": [
{
"type": "any",
"arity": "required"
},
{
"type": "any",
"arity": "optional"
},
{
"type": "any",
"arity": "optional"
}
],
"description": "sets key/value metadata for a specific match or capture"
},
"offset": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required",
"constraint": "integer"
},
{
"type": "string",
"arity": "required",
"constraint": "integer"
},
{
"type": "string",
"arity": "required",
"constraint": "integer"
},
{
"type": "string",
"arity": "required",
"constraint": "integer"
}
],
"description": "Takes the range of the captured node and applies an offset. This will set a new range in the form of a list like { {start_row}, {start_col}, {end_row}, {end_col} } for the captured node with `capture_id` as `metadata[capture_id].range`."
},
"gsub": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "required"
},
{
"type": "string",
"arity": "required"
}
],
"description": "Transforms the content of the node using a Lua pattern. This will set a new `metadata[capture_id].text`."
},
"trim": {
"parameters": [
{
"type": "capture",
"arity": "required"
},
{
"type": "string",
"arity": "optional",
"constraint": {
"enum": ["0", "1"]
}
},
{
"type": "string",
"arity": "optional",
"constraint": {
"enum": ["0", "1"]
}
},
{
"type": "string",
"arity": "optional",
"constraint": {
"enum": ["0", "1"]
}
},
{
"type": "string",
"arity": "optional",
"constraint": {
"enum": ["0", "1"]
}
}
],
"description": "Trims whitespace from the node. Sets a new `metadata[capture_id].range`. Takes a capture ID and, optionally, four integers to customize trimming behavior (`1` meaning trim, `0` meaning don't trim). When only given a capture ID, trims blank lines (lines that contain only whitespace, or are empty) from the end of the node (for backwards compatibility). Can trim all whitespace from both sides of the node if parameters are given."
}
}
}

View file

@ -1,77 +1,103 @@
# Contributing to `nvim-treesitter`
First of all, thank you very much for contributing to `nvim-treesitter`.
The main parts of `nvim-treesitter` are
* a curated list of [parsers](#Parsers);
* a collection of [queries](#Queries).
If you haven't already, you should really come and reach out to us on our
[Matrix channel], so we can help you with any question you might have!
Before describing these in detail, some general advice:
* Some basic knowledge of how tree-sitter works is assumed; we recommend reading
- the [upstream documentation](https://tree-sitter.github.io/tree-sitter/);
- [Neovim's documentation](https://neovim.io/doc/user/treesitter.html#treesitter).
* There are dedicated Matrix channels for questions and general help:
- [#nvim-treesitter](https://matrix.to/#/#nvim-treesitter:matrix.org) for questions specific to Neovim's implementation and the queries here;
- [#tree-sitter](https://matrix.to/#/#tree-sitter-chat:matrix.org) for general questions regarding treesitter queries and the `tree-sitter` CLI.
As you know, `nvim-treesitter` is roughly split in two parts:
## Parsers
- Parser configurations : for various things like `locals`, `highlights`
- What we like to call _modules_ : tiny lua modules that provide a given feature, based on parser configurations
>[!IMPORTANT]
> To qualify for inclusion, a parser must meet the following criteria:
> * correspond to a filetype detected by Neovim (nightly)
> * feature complete, tested by users, and actively maintained (according to maintainer discretion)
> * hosted or mirrored on Github (other codeforges are not reliable enough for CI)
> * covered by CI using [upstream workflows](https://github.com/tree-sitter/workflows)
> * provide reference queries covered by a [`ts_query_ls` workflow](https://github.com/tree-sitter-grammars/template/blob/9c46d09d688d27c7aef31c2b32f50260de4e7906/.github/workflows/ci.yml#L69-L86)
> * if the repo contains a `src/parser.c`, it must support the latest ABI
> * if the repo does _not_ contain a `src/parser.c`, it must contain an up-to-date `src/grammar.json`
> * if the repo contains an external scanner, it must be written in C99
>
> Tier 1 parsers (preferred) in addition need to
> * make regular releases following semver (_patch_ for fixes not affecting queries; _minor_ for changes introducing new nodes or patterns; _major_ for changes removing nodes or previously valid patterns)
> * provide WASM release artifacts
Depending on which part of the plugin you want to contribute to, please read the appropriate section.
To add a new parser, edit the following files:
## Style Checks and Tests
1. In `lua/parsers.lua`, add an entry to the returned table of the following form:
We haven't implemented any functional tests yet. Feel free to contribute.
However, we check code style with `luacheck` and `stylua`!
Please install luacheck and activate our `pre-push` hook to automatically check style before
every push:
```bash
luarocks install luacheck
cargo install stylua
ln -s ../../scripts/pre-push .git/hooks/pre-push
```lua
zimbu = {
install_info = {
url = 'https://github.com/zimbulang/tree-sitter-zimbu', -- git repo; use `path` for local path
revision = 'v2.1', -- tag or commit hash
-- optional entries:
branch = 'develop', -- only needed if different from default branch
location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo"
generate = true, -- only needed if repo does not contain pre-generated src/parser.c
},
maintainers = { '@me' }, -- the _query_ maintainers
tier = 1, -- stable: track versioned releases instead of latest commit
-- optional entries:
requires = { 'vim' }, -- if the queries inherit from another language
readme_note = "an example language",
}
```
## Adding new modules
>[!IMPORTANT]
> The "maintainers" here refers to the person maintaining the **queries** in `nvim-treesitter`, not the parser maintainers (who likely don't use Neovim). The maintainers' duty is to review issues and PRs related to the query and to keep them updated with respect to parser changes.
If you want to see a new functionality added to `nvim-treesitter` feel free to first open an issue
to that we can track our solution!
Thus far, there is basically two types of modules:
2. If the parser name is not the same as the Vim filetype, add an entry to the `filetypes` table in `plugin/filetypes.lua`:
- Little modules (like `incremental selection`) that are built in `nvim-treesitter`, we call them
`builtin modules`.
- Bigger modules (like `completion-treesitter`, or `nvim-tree-docs`), or modules that integrate
with other plugins, that we call `remote modules`.
```lua
zimbu = { 'zu' },
```
In any case, you can build your own module! To help you started in the process, we have a template
repository designed to build new modules [here](https://github.com/nvim-treesitter/module-template).
Feel free to use it, and contact us over on our
on the "Neovim tree-sitter" [Matrix channel].
3. Update the list of [supported languages] by running `make docs` (or `./scripts/update-readme.lua` if on Windows).
## Parser configurations
4. Test if both `:TSInstall zimbu` and `:TSInstallFromGrammar zimbu` work without errors (`:checkhealth treesitter` or `./scripts/check-parsers.lua zimbu`).
Contributing to parser configurations is basically modifying one of the `queries/*/*.scm`.
Each of these `scheme` files contains a _tree-sitter query_ for a given purpose.
Before going any further, we highly suggest that you [read more about tree-sitter queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries).
>[!IMPORTANT]
> You also need to add queries in order for the parser to actually be useful!
Each query has an appropriate name, which is then used by modules to extract data from the syntax tree.
For now these are the types of queries used by `nvim-treesitter`:
When you're done, open a Pull Request using the [provided template](.github/PULL_REQUEST_TEMPLATE/new_language.md), e.g. using `gh pr create -B main -T new_language`.
- `highlights.scm`: used for syntax highlighting, using the `highlight` module.
- `locals.scm`: used to extract keyword definitions, scopes, references, etc, using the `locals` module.
- `textobjects.scm`: used to define text objects.
- `folds.scm`: used to define folds.
- `injections.scm`: used to define injections.
## Queries
For these types there is a _norm_ you will have to follow so that features work fine.
Here are some global advices:
To add (or edit existing) queries, create a corresponding `runtime/queries/zimbu/*.scm` file:
- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages),
you can install the [playground plugin](https://github.com/nvim-treesitter/playground).
- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages),
you can debug and experiment with your queries there.
- If not, you should consider installing the [tree-sitter cli](https://github.com/tree-sitter/tree-sitter/tree/master/cli),
you should then be able to open a local playground using `tree-sitter build-wasm && tree-sitter web-ui` within the
parsers repo.
- Examples of queries can be found in [queries/](queries/)
- Matches in the bottom will override queries that are above of them.
- `highlights.scm` used for syntax highlighting,
- `injections.scm` used to specify nodes whose content should be parsed as a different language;
- `folds.scm`; used to define folds;
- `locals.scm`: used to extract keyword definitions, scopes, references, etc. (not used in this plugin).
- `indents.scm`; used to control indentation.
See [tree-sitter queries] for a basic description of the query language. The following tools can be helpful when writing or editing queries:
* [ts_query_ls] is a language server for treesitter queries, which can validate, autocomplete, and format. This tool can also be used as an offline linter and formatter (accessible through `make lintquery`, `make checkquery`, `make formatquery` targets).
* Neovim's `:InspectTree` will show the parsed tree for a buffer and highlight the text corresponding to any given node (and vice versa).
* `:EditQuery` opens a "playground" where you can write query patterns and see which parts of the buffer are captured by each capture.
>[!IMPORTANT]
> The valid captures that can be used in queries is different for each editor, so you cannot just copy them, e.g., from Helix or the parser repositories. For Neovim, all valid captures are listed below. You can verify that your changes adhere to this by running `make lintquery`.
>[!IMPORTANT]
> Since grammars can change constantly, it is important to make sure that the patterns in a query are actually valid for the parser specified in nvim-treesitter's manifest. This can be verified using `make checkquery` (which requires the parser to be installed in the default directory(!) through `nvim-treesitter`). Opening the query in Neovim with the parser installed will also show all invalid patterns, either via [ts_query_ls] or Neovim's builtin query-linter.
>[!TIP]
> Before opening a PR, run `make query` to format, lint, and check all queries.
#### Inheriting languages
If your language is an extension of a language (TypeScript is an extension of JavaScript for
example), you can include the queries from your base language by adding the following _as the first
line of your file_.
line of your file_:
```query
; inherits: lang1,(optionallang)
@ -80,183 +106,405 @@ line of your file_.
If you want to inherit a language, but don't want the languages inheriting from yours to inherit it,
you can mark the language as optional (by putting it between parenthesis).
#### Formatting
All queries are expected to follow a standard format, with every node on a single line and indented by two spaces for each level of nesting. You can automatically format the bundled queries by running `make formatquery`.
Should you need to preserve a specific format for a node, you can exempt it (and all contained nodes) by placing before it
```query
; format-ignore
```
### Highlights
As languages differ quite a lot, here is a set of captures available to you when building a `highlights.scm` query.
One important thing to note is that many of these capture groups are not supported by `neovim` for now, and will not have any
effect on highlighting. We will work on improving highlighting in the near future though.
Syntax highlighting is specified in a `highlights.scm` query, which assigns treesitter nodes to captures that can be assigned a highlight group. This feature is implemented in Neovim and documented at [`:h treesitter-highlight`](https://neovim.io/doc/user/treesitter.html#treesitter-highlight).
Note that your color scheme needs to define (or link) these captures as highlight groups. You can use Neovim's built-in `:Inspect` function to see exactly which highlight groups are applied at a given position.
#### Misc
The valid captures are listed below.
```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. `+` / `*`)
#### Identifiers
```query
@variable ; various variable names
@variable.builtin ; built-in variable names (e.g. `this`)
@variable.parameter ; parameters of a function
@variable.parameter.builtin ; special parameters (e.g. `_`, `it`)
@variable.member ; object and struct fields
@constant ; constant identifiers
@constant.builtin ; built-in constant values
@constant.macro ; constants defined by the preprocessor
@module ; modules or namespaces
@module.builtin ; built-in modules or namespaces
@label ; GOTO and other labels (e.g. `label:` in C), including heredoc labels
```
#### Literals
```query
@string ; string literals
@string.documentation ; string documenting code (e.g. Python docstrings)
@string.regexp ; regular expressions
@string.escape ; escape sequences
@string.special ; other special strings (e.g. dates)
@string.special.symbol ; symbols or atoms
@string.special.url ; URIs (e.g. hyperlinks)
@string.special.path ; filenames
@character ; character literals
@character.special ; special characters (e.g. wildcards)
@boolean ; boolean literals
@number ; numeric literals
@number.float ; floating-point number literals
```
#### Types
```query
@type ; type or class definitions and annotations
@type.builtin ; built-in types
@type.definition ; identifiers in type definitions (e.g. `typedef <type> <identifier>` in C)
@attribute ; attribute annotations (e.g. Python decorators, Rust lifetimes)
@attribute.builtin ; builtin annotations (e.g. `@property` in Python)
@property ; the key in key/value pairs
```
#### Functions
```query
@function ; function definitions
@function.builtin ; built-in functions
@function.call ; function calls
@function.macro ; preprocessor macros
@function.method ; method definitions
@function.method.call ; method calls
@constructor ; constructor calls and definitions
@operator ; symbolic operators (e.g. `+` / `*`)
```
#### Keywords
```query
@keyword ; keywords not fitting into specific categories
@keyword.coroutine ; keywords related to coroutines (e.g. `go` in Go, `async/await` in Python)
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
@keyword.import ; keywords for including or exporting modules (e.g. `import` / `from` in Python)
@keyword.type ; keywords describing namespaces and composite types (e.g. `struct`, `enum`)
@keyword.modifier ; keywords modifying other constructs (e.g. `const`, `static`, `public`)
@keyword.repeat ; keywords related to loops (e.g. `for` / `while`)
@keyword.return ; keywords like `return` and `yield`
@keyword.debug ; keywords related to debugging
@keyword.exception ; keywords related to exceptions (e.g. `throw` / `catch`)
@keyword.conditional ; keywords related to conditionals (e.g. `if` / `else`)
@keyword.conditional.ternary ; ternary operator (e.g. `?` / `:`)
@keyword.directive ; various preprocessor directives & shebangs
@keyword.directive.define ; preprocessor definition directives
```
#### Punctuation
```scheme
```query
@punctuation.delimiter ; delimiters (e.g. `;` / `.` / `,`)
@punctuation.bracket ; brackets (e.g. `()` / `{}` / `[]`)
@punctuation.special ; special symbols (e.g. `{}` in string interpolation)
```
#### Literals
#### Comments
```scheme
@string ; string literals
@string.regex ; regular expressions
@string.escape ; escape sequences
@string.special ; other special strings (e.g. dates)
```query
@comment ; line and block comments
@comment.documentation ; comments documenting code
@character ; character literals
@character.special ; special characters (e.g. wildcards)
@boolean ; boolean literals
@number ; numeric literals
@float ; floating-point number literals
@comment.error ; error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED`)
@comment.warning ; warning-type comments (e.g. `WARNING`, `FIX`, `HACK`)
@comment.todo ; todo-type comments (e.g. `TODO`, `WIP`)
@comment.note ; note-type comments (e.g. `NOTE`, `INFO`, `XXX`)
```
#### Functions
```scheme
@function ; function definitions
@function.builtin ; built-in functions
@function.call ; function calls
@function.macro ; preprocessor macros
@method ; method definitions
@method.call ; method calls
@constructor ; constructor calls and definitions
@parameter ; parameters of a function
```
#### Keywords
```scheme
@keyword ; various keywords
@keyword.function ; keywords that define a function (e.g. `func` in Go, `def` in Python)
@keyword.operator ; operators that are English words (e.g. `and` / `or`)
@keyword.return ; keywords like `return` and `yield`
@conditional ; keywords related to conditionals (e.g. `if` / `else`)
@conditional.ternary ; ternary operator (e.g. `?` / `:`)
@repeat ; keywords related to loops (e.g. `for` / `while`)
@debug ; keywords related to debugging
@label ; GOTO and other labels (e.g. `label:` in C)
@include ; keywords for including modules (e.g. `import` / `from` in Python)
@exception ; keywords related to exceptions (e.g. `throw` / `catch`)
```
#### Types
```scheme
@type ; type or class definitions and annotations
@type.builtin ; built-in types
@type.definition ; type definitions (e.g. `typedef` in C)
@type.qualifier ; type qualifiers (e.g. `const`)
@storageclass ; modifiers that affect storage in memory or life-time
@attribute ; attribute annotations (e.g. Python decorators)
@field ; object and struct fields
@property ; similar to `@field`
```
#### Identifiers
```scheme
@variable ; various variable names
@variable.builtin ; built-in variable names (e.g. `this`)
@constant ; constant identifiers
@constant.builtin ; built-in constant values
@constant.macro ; constants defined by the preprocessor
@namespace ; modules or namespaces
@symbol ; symbols or atoms
```
#### Text
#### Markup
Mainly for markup languages.
```scheme
@text ; non-structured text
@text.strong ; bold text
@text.emphasis ; text with emphasis
@text.underline ; underlined text
@text.strike ; strikethrough text
@text.title ; text that is part of a title
@text.literal ; literal or verbatim text (e.g., inline code)
@text.quote ; text quotations
@text.uri ; URIs (e.g. hyperlinks)
@text.math ; math environments (e.g. `$ ... $` in LaTeX)
@text.environment ; text environments of markup languages
@text.environment.name ; text indicating the type of an environment
@text.reference ; text references, footnotes, citations, etc.
```query
@markup.strong ; bold text
@markup.italic ; italic text
@markup.strikethrough ; struck-through text
@markup.underline ; underlined text (only for literal underline markup!)
@text.todo ; todo notes
@text.note ; info notes
@text.warning ; warning notes
@text.danger ; danger/error notes
@markup.heading ; headings, titles (including markers)
@markup.heading.1 ; top-level heading
@markup.heading.2 ; section heading
@markup.heading.3 ; subsection heading
@markup.heading.4 ; and so on
@markup.heading.5 ; and so forth
@markup.heading.6 ; six levels ought to be enough for anybody
@text.diff.add ; added text (for diff files)
@text.diff.delete ; deleted text (for diff files)
@markup.quote ; block quotes
@markup.math ; math environments (e.g. `$ ... $` in LaTeX)
@markup.link ; text references, footnotes, citations, etc.
@markup.link.label ; link, reference descriptions
@markup.link.url ; URL-style links
@markup.raw ; literal or verbatim text (e.g. inline code)
@markup.raw.block ; literal or verbatim text as a stand-alone block
; (use priority 90 for blocks with injections)
@markup.list ; list markers
@markup.list.checked ; checked todo-style list markers
@markup.list.unchecked ; unchecked todo-style list markers
```
#### Tags
Used for XML-like tags.
```scheme
@tag ; XML tag names
@tag.attribute ; XML tag attributes
@tag.delimiter ; XML tag delimiters
```query
@diff.plus ; added text (for diff files)
@diff.minus ; deleted text (for diff files)
@diff.delta ; changed text (for diff files)
```
#### Conceal
```scheme
@conceal ; for captures that are only used for concealing
```query
@tag ; XML-style tag names (and similar)
@tag.builtin ; builtin tag names (e.g. HTML5 tags)
@tag.attribute ; XML-style tag attributes
@tag.delimiter ; XML-style tag delimiters
```
`@conceal` must be followed by `(#set! conceal "")`.
#### Non-highlighting captures
#### Spell
```query
@conceal ; captures that are only meant to be concealed
```
```scheme
>[!TIP]
> * See [`:h tree-sitter-highlight-conceal`](https://neovim.io/doc/user/treesitter.html#treesitter-highlight-conceal).
> * The capture should be meaningful to allow proper highlighting when `set conceallevel=0`.
> * A conceal can be restricted to part of the capture via the [`#offset!` directive](https://neovim.io/doc/user/treesitter.html#treesitter-directive-offset%21).
```query
@spell ; for defining regions to be spellchecked
@nospell ; for defining regions that should NOT be spellchecked
```
### Locals
>[!TIP]
> The main types of nodes that should be spell checked are
> - comments
> - strings; where it makes sense. Strings that have interpolation or are typically used for non text purposes are not spell checked (e.g. bash).
```scheme
@definition ; various definitions
@definition.constant ; constants
@definition.function ; functions
@definition.method ; methods
@definition.var ; variables
@definition.parameter ; parameters
@definition.macro ; preprocessor macros
@definition.type ; types or classes
@definition.field ; fields or properties
@definition.enum ; enumerations
@definition.namespace ; modules or namespaces
@definition.import ; imported names
@definition.associated ; the associated type of a variable
#### Predicates
@scope ; scope block
@reference ; identifier reference
Captures can be restricted according to node contents using [predicates](https://neovim.io/doc/user/treesitter.html#treesitter-predicates).
>[!IMPORTANT]
> For performance reasons, prefer earlier predicates in this list:
>
> 1. `#eq?` (literal match)
> 2. `#any-of?` (one of several literal matches)
> 3. `#lua-match?` (match against a [Lua pattern](https://neovim.io/doc/user/luaref.html#lua-pattern))
> 4. `#match?`/`#vim-match?` (match against a [Vim regular expression](https://neovim.io/doc/user/pattern.html#regexp)
Besides those provided by Neovim, nvim-treesitter also implements
```query
#kind-eq? ; checks whether a capture corresponds to a given set of nodes
#any-kind-eq? ; checks whether any of a list of captures corresponds to a given set of nodes
```
#### Definition Scope
#### Directives
Nodes contain metadata that can be modified via [directives](https://neovim.io/doc/user/treesitter.html#treesitter-directives).
#### Priority
Captures can be assigned a priority to control precedence of highlights via the
`#set! priority <number>` directive (see [`:h treesitter-highlight-priority`](https://neovim.io/doc/user/treesitter.html#treesitter-highlight-priority)). This is useful for controlling conflicts with injected languages or when inheriting queries from other languages.
>[!NOTE]
> The default priority for treesitter highlights is `100`; queries should only
set priorities between `90` and `120`, to avoid conflict with other sources of highlighting (such as diagnostics or LSP semantic tokens).
>[!TIP]
> Precedence is also influenced by pattern order in a query file. If possible, try to achieve the correct result by reordering patterns before resorting to explicit priorities.
### Injections
Language injections are controlled by `injections.scm` queries, which specify nodes that should be parsed as a different language. This feature is implemented in Neovim and documented at
[`:h treesitter-language-injections](https://neovim.io/doc/user/treesitter.html#treesitter-language-injections).
The valid captures are:
```query
@injection.language ; dynamic detection of the injection language (i.e. the text of the captured node describes the language)
@injection.content ; region for the dynamically detected language
@injection.filename ; indicates that the captured nodes text may contain a filename; the corresponding filetype is then looked-up up via vim.filetype.match() and treated as the name of a language that should be used to re-parse the `@injection.content`
```
>[!TIP]
> When writing injection queries, try to ensure that each captured node is only matched by a single pattern.
### Folds
You can define folds for a given language by adding a `folds.scm` query. This is implemented in Neovim. The only valid capture is `@fold`:
```query
(function_definition) @fold ; fold this node
```
Folds should be given to nodes with defined start and end delimiters/patterns, or to consecutive nodes which are part of the same conceptual "grouping", such as consecutive line comments or import statements. The following items are valid fold candidates:
- Function/method definitions
- Class/interface/trait definitions
- Switch/match statements, and individual match arms
- Execution blocks (such as those found in conditional statements or loops)
- Parameter/argument lists
- Array/object/string expressions
- Consecutive import statements, consecutive line comments
The following items would *not* be valid fold candidates:
- Multiline assignment statements
- Multiline property access expressions
As a rule of thumb, these highlight captures usually reside in or around objects which should be folded:
- `@function`, `@function.method`
- `@keyword.import`, `@keyword.conditional`, `@keyword.repeat`
- `@comment`, `@comment.documentation`
- `@string`, `@string.documentation`
- `@markup.heading.x`, `@markup.list`
### Indents
>[!WARNING]
> Treesitter-based indentation is still experimental and likely to have breaking changes in the future.
Indentation for a language is controlled by `indents.scm` queries. The following captures can be used to set the indentation for nodes, either relative or absolute
* `@indent.begin` specifies that the next line should be indented. Multiple
indents on the same line get collapsed, e.g.,
```query
(
(if_statement)
(ERROR "else") @indent.begin
)
```
You can also `#set! indent.immediate` to permit the next line to indent even when the block intended to be indented has no content yet. (This can improve interactive typing.)
For example for Python,
```query
((if_statement) @indent.begin
(#set! indent.immediate 1))
```
will allow
```python
if True:<CR>
# Auto indent to here
```
* `@indent.end` is used to specify that the indented region ends and any text subsequent to the capture should be dedented.
* `@indent.branch` is used to specify that a dedented region starts at the line _including_ the captured nodes.
* `@indent.dedent` specifies dedenting starting on the _next_ line.
* `@indent.auto` behaves like Vim's [`autoindent`](https://neovim.io/doc/user/options.html#'autoindent') buffer option (copy whatever the indentation of previous line is when opening a new line after it).
* `@indent.ignore` specifies that no indent should be added to this node.
* `@indent.zero` sets the indentation of this node to 0 (i.e., removes _all_ indentation).
* `@indent.align` can be used to specify blocks that should have the same indentation.
This allows
```
foo(a,
b,
c)
```
as well as
```
foo(
a,
b,
c)
```
and
```
foo(
a,
b,
c
)
```
To specify the delimiters to align at, `#set! indent.open_delimiter` and
`indent.close_delimiter`, e.g.,
```query
((argument_list) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
```
For some languages, the last line of an `indent.align` block must not be
the same indent as the natural next line.
For example in Python,
```python
if (a > b and
c < d):
pass
```
is not correct, whereas
```python
if (a > b and
c < d):
pass
```
would be correctly indented. This behavior may be selected by setting
`indent.avoid_last_matching_next`. For example,
```query
(if_statement
condition: (parenthesized_expression) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")")
(#set! indent.avoid_last_matching_next 1)
)
```
specifies that the last line of an `@indent.align` capture
should be additionally indented to avoid clashing with the indent of the first
line of the block inside an `if`.
### Locals
Locals are used to keep track of definitions and references in local or global
scopes, see [upstream
documentation](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables).
Note that nvim-treesitter uses more specific subcaptures for definitions and
**does not use locals** (for highlighting or any other purpose). These queries
are only provided for limited backwards compatibility.
```query
@local.definition ; various definitions
@local.definition.constant ; constants
@local.definition.function ; functions
@local.definition.method ; methods
@local.definition.var ; variables
@local.definition.parameter ; parameters
@local.definition.macro ; preprocessor macros
@local.definition.type ; types or classes
@local.definition.field ; fields or properties
@local.definition.enum ; enumerations
@local.definition.namespace ; modules or namespaces
@local.definition.import ; imported names
@local.definition.associated ; the associated type of a variable
@local.scope ; scope block
@local.reference ; identifier reference
```
#### Definition scope
You can set the scope of a definition by setting the `scope` property on the definition.
@ -272,8 +520,8 @@ doSomething(); // Should point to the declaration as the definition
```query
(function_declaration
((identifier) @definition.var)
(#set! "definition.var.scope" "parent"))
((identifier) @local.definition.var)
(#set! definition.var.scope "parent"))
```
Possible scope values are:
@ -282,44 +530,7 @@ Possible scope values are:
- `global`: The definition is valid in the root scope
- `local`: The definition is valid in the containing scope. This is the default behavior
### Folds
You can define folds for a given language by adding a `folds.scm` query :
```scheme
@fold ; fold this node
```
If the `folds.scm` query is not present, this will fall back to the `@scope` captures in the `locals`
query.
### Injections
Some captures are related to language injection (like markdown code blocks). They are used in `injections.scm`.
You can directly use the name of the language that you want to inject (e.g. `@html` to inject html).
If you want to dynamically detect the language (e.g. for Markdown blocks) use the `@language` to capture
the node describing the language and `@content` to describe the injection region.
```scheme
@{lang} ; e.g. @html to describe a html region
@language ; dynamic detection of the injection language (i.e. the text of the captured node describes the language)
@content ; region for the dynamically detected language
@combined ; combine all matches of a pattern as one single block of content
```
### Indents
```scheme
@indent ; indent children when matching this node
@indent_end ; marks the end of indented block
@aligned_indent ; behaves like python aligned/hanging indent
@dedent ; dedent children when matching this node
@branch ; dedent itself when matching this node
@ignore ; do not indent in this node
@auto ; behaves like 'autoindent' buffer option
@zero_indent ; sets this node at position 0 (no indent)
```
[Matrix channel]: https://matrix.to/#/#nvim-treesitter:matrix.org
[supported languages]: https://github.com/nvim-treesitter/nvim-treesitter/SUPPORTED_LANGUAGES.md
[tree-sitter queries]: https://tree-sitter.github.io/tree-sitter/using-parsers/queries/index.html
[ts_query_ls]: https://github.com/ribru17/ts_query_ls

144
Makefile
View file

@ -1,7 +1,139 @@
# https://github.com/luarocks/luarocks/wiki/Creating-a-Makefile-that-plays-nice-with-LuaRocks
build:
echo "Do nothing"
NVIM_VERSION ?= nightly
install:
mkdir -p $(INST_LUADIR)
cp -r autoload plugin queries lua $(INST_LUADIR)
DEPDIR ?= .test-deps
CURL ?= curl -sL --create-dirs
ifeq ($(shell uname -s),Darwin)
NVIM_ARCH ?= macos-arm64
LUALS_ARCH ?= darwin-arm64
STYLUA_ARCH ?= macos-aarch64
RUST_ARCH ?= aarch64-apple-darwin
else
NVIM_ARCH ?= linux-x86_64
LUALS_ARCH ?= linux-x64
STYLUA_ARCH ?= linux-x86_64
RUST_ARCH ?= x86_64-unknown-linux-gnu
endif
.DEFAULT_GOAL := all
# download test dependencies
NVIM := $(DEPDIR)/nvim-$(NVIM_ARCH)
NVIM_TARBALL := $(NVIM).tar.gz
NVIM_URL := https://github.com/neovim/neovim/releases/download/$(NVIM_VERSION)/$(notdir $(NVIM_TARBALL))
NVIM_BIN := $(NVIM)/nvim-$(NVIM_ARCH)/bin/nvim
NVIM_RUNTIME=$(NVIM)/nvim-$(NVIM_ARCH)/share/nvim/runtime
.PHONY: nvim
nvim: $(NVIM)
$(NVIM):
$(CURL) $(NVIM_URL) -o $(NVIM_TARBALL)
mkdir $@
tar -xf $(NVIM_TARBALL) -C $@
rm -rf $(NVIM_TARBALL)
EMMYLUALS := $(DEPDIR)/emmylua_check-$(LUALS_ARCH)
EMMYLUALS_TARBALL := $(EMMYLUALS).tar.gz
EMMYLUALS_URL := https://github.com/emmyluals/emmylua-analyzer-rust/releases/latest/download/$(notdir $(EMMYLUALS_TARBALL))
.PHONY: emmyluals
emmyluals: $(EMMYLUALS)
$(EMMYLUALS):
$(CURL) $(EMMYLUALS_URL) -o $(EMMYLUALS_TARBALL)
mkdir $@
tar -xf $(EMMYLUALS_TARBALL) -C $@
rm -rf $(EMMYLUALS_TARBALL)
STYLUA := $(DEPDIR)/stylua-$(STYLUA_ARCH)
STYLUA_TARBALL := $(STYLUA).zip
STYLUA_URL := https://github.com/JohnnyMorganz/StyLua/releases/latest/download/$(notdir $(STYLUA_TARBALL))
.PHONY: stylua
stylua: $(STYLUA)
$(STYLUA):
$(CURL) $(STYLUA_URL) -o $(STYLUA_TARBALL)
unzip $(STYLUA_TARBALL) -d $(STYLUA)
rm -rf $(STYLUA_TARBALL)
TSQUERYLS := $(DEPDIR)/ts_query_ls-$(RUST_ARCH)
TSQUERYLS_TARBALL := $(TSQUERYLS).tar.gz
TSQUERYLS_URL := https://github.com/ribru17/ts_query_ls/releases/latest/download/$(notdir $(TSQUERYLS_TARBALL))
.PHONY: tsqueryls
tsqueryls: $(TSQUERYLS)
$(TSQUERYLS):
$(CURL) $(TSQUERYLS_URL) -o $(TSQUERYLS_TARBALL)
mkdir $@
tar -xf $(TSQUERYLS_TARBALL) -C $@
rm -rf $(TSQUERYLS_TARBALL)
HLASSERT := $(DEPDIR)/highlight-assertions-$(RUST_ARCH)
HLASSERT_TARBALL := $(HLASSERT).tar.gz
HLASSERT_URL := https://github.com/nvim-treesitter/highlight-assertions/releases/latest/download/$(notdir $(HLASSERT_TARBALL))
.PHONY: hlassert
hlassert: $(HLASSERT)
$(HLASSERT):
$(CURL) $(HLASSERT_URL) -o $(HLASSERT_TARBALL)
mkdir $@
tar -xf $(HLASSERT_TARBALL) -C $@
rm -rf $(HLASSERT_TARBALL)
PLENTEST := $(DEPDIR)/plentest.nvim
.PHONY: plentest
plentest: $(PLENTEST)
$(PLENTEST):
git clone --filter=blob:none https://github.com/nvim-treesitter/plentest.nvim $(PLENTEST)
# actual test targets
.PHONY: lua
lua: formatlua checklua
.PHONY: formatlua
formatlua: $(STYLUA)
$(STYLUA)/stylua .
.PHONY: checklua
checklua: $(EMMYLUALS) $(NVIM)
VIMRUNTIME=$(NVIM_RUNTIME) $(EMMYLUALS)/emmylua_check --warnings-as-errors .
.PHONY: query
query: formatquery lintquery checkquery
.PHONY: lintquery
lintquery: $(TSQUERYLS)
$(TSQUERYLS)/ts_query_ls lint runtime/queries
.PHONY: formatquery
formatquery: $(TSQUERYLS)
$(TSQUERYLS)/ts_query_ls format runtime/queries
.PHONY: checkquery
checkquery: $(TSQUERYLS)
$(TSQUERYLS)/ts_query_ls check runtime/queries
.PHONY: docs
docs: $(NVIM)
$(NVIM_BIN) -l scripts/update-readme.lua
.PHONY: tests
tests: $(NVIM) $(HLASSERT) $(PLENTEST)
HLASSERT=$(HLASSERT)/highlight-assertions PLENTEST=$(PLENTEST) \
$(NVIM_BIN) --headless --clean -u scripts/minimal_init.lua \
-c "lua require('plentest').test_directory('tests/$(TESTS)', { minimal_init = './scripts/minimal_init.lua' })"
.PHONY: all
all: lua query docs tests
.PHONY: clean
clean:
rm -rf $(DEPDIR)

734
README.md
View file

@ -1,679 +1,187 @@
<div align="center">
<h1>nvim-treesitter</h1>
<p>
<a href="https://matrix.to/#/#nvim-treesitter:matrix.org">
<img alt="Matrix Chat" src="https://img.shields.io/matrix/nvim-treesitter:matrix.org" />
</a>
<a href="https://github.com/nvim-treesitter/nvim-treesitter/actions?query=workflow%3A%22Linting+and+style+checking%22+branch%3Amaster">
<img alt="Linting and Style" src="https://github.com/nvim-treesitter/nvim-treesitter/workflows/Linting%20and%20style%20checking/badge.svg" />
</a>
<a href="https://github.com/nvim-treesitter/nvim-treesitter/actions?query=workflow%3A%22Check+loading+of+syntax+files%22+branch%3Amaster">
<img alt="Syntax files" src="https://github.com/nvim-treesitter/nvim-treesitter/workflows/Check%20loading%20of%20syntax%20files/badge.svg" />
</a>
</p>
</div>
<h1 align="center">
<img src="https://github.com/nvim-treesitter/nvim-treesitter/assets/2361214/0513b223-c902-4f12-92ee-8ac4d8d6f41f" alt="nvim-treesitter">
</h1>
<div align="center">
<p>
<img src="assets/logo.png" align="center" alt="Logo" />
</p>
<p>
<a href="https://github.com/tree-sitter/tree-sitter">Treesitter</a>
configurations and abstraction layer for
<a href="https://github.com/neovim/neovim/">Neovim</a>.
</p>
<p>
<i>
Logo by <a href="https://github.com/steelsojka">@steelsojka</a>
</i>
</p>
</div>
The `nvim-treesitter` plugin provides
1. functions for installing, updating, and removing [**tree-sitter parsers**](SUPPORTED_LANGUAGES.md);
2. a collection of **queries** for enabling tree-sitter features built into Neovim for these languages;
3. a staging ground for [treesitter-based features](#Supported-features) considered for upstreaming to Neovim.
The goal of `nvim-treesitter` is both to provide a simple and easy way to use the interface for [tree-sitter](https://github.com/tree-sitter/tree-sitter) in Neovim and to provide some basic functionality such as highlighting based on it:
For details on these and how to help improving them, see [CONTRIBUTING.md](./CONTRIBUTING.md).
![example-cpp](https://user-images.githubusercontent.com/2361214/202753610-e923bf4e-e88f-494b-bb1e-d22a7688446f.png)
Traditional highlighting (left) vs Treesitter-based highlighting (right).
More examples can be found in [our gallery](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Gallery).
**Warning: Treesitter and nvim-treesitter highlighting are an experimental feature of Neovim.
Please consider the experience with this plug-in as experimental until Tree-Sitter support in Neovim is stable!
We recommend using the nightly builds of Neovim if possible.
You can find the current roadmap [here](https://github.com/nvim-treesitter/nvim-treesitter/projects/1).
The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated!**
Nvim-treesitter is based on three interlocking features: [**language parsers**](#language-parsers), [**queries**](#adding-queries), and [**modules**](#available-modules), where _modules_ provide features e.g., highlighting based on _queries_ for syntax objects extracted from a given buffer by _language parsers_.
Users will generally only need to interact with parsers and modules as explained in the next section.
For more detailed information on setting these up, see ["Advanced setup"](#advanced-setup).
---
### Table of contents
- [Quickstart](#quickstart)
- [Supported languages](#supported-languages)
- [Available modules](#available-modules)
- [Advanced setup](#advanced-setup)
- [Extra features](#extra-features)
- [Troubleshooting](#troubleshooting)
---
>[!CAUTION]
> This is a full, incompatible, rewrite: Treat this as a different plugin you need to set up from scratch following the instructions below. If you can't or don't want to update, specify the [`master` branch](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/README.md) (which is locked but will remain available for backward compatibility with Nvim 0.11).
# Quickstart
## Requirements
- **Neovim 0.8.0 or later** built with **tree-sitter 0.20.3+** (latest [nightly](https://github.com/neovim/neovim#install-from-source) recommended)
- `tar` and `curl` in your path (or alternatively `git`)
- A C compiler in your path and libstdc++ installed ([Windows users please read this!](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support)).
- Neovim 0.12.0 or later (nightly)
- `tar` and `curl` in your path
- [`tree-sitter-cli`](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md) (0.26.1 or later, installed via your package manager, **not npm**)
- a C compiler in your path (see <https://docs.rs/cc/latest/cc/#compile-time-requirements>)
>[!IMPORTANT]
> The current **support policy** for Neovim is
> * the _latest_ [stable release](https://github.com/neovim/neovim/releases/tag/stable),
> * the _latest_ [nightly prerelease](https://github.com/neovim/neovim/releases/tag/nightly).
> Other versions may work but are neither tested nor considered for fixes.
## Installation
You can install `nvim-treesitter` with your favorite package manager (or using the native `package` feature of vim, see `:h packages`).
**NOTE: This plugin is only guaranteed to work with specific versions of language parsers** (as specified in the `lockfile.json`). **When upgrading the plugin, you must make sure that all installed parsers are updated to the latest version** via `:TSUpdate`.
It is strongly recommended to automate this; e.g., if you are using [vim-plug](https://github.com/junegunn/vim-plug), put this in your `init.vim` file:
```vim
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
```
For other plugin managers such as `packer.nvim`, see this [Installation page from the wiki](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Installation) (Note that this page is community maintained).
## Language parsers
Treesitter uses a different _parser_ for every language, which needs to be generated via `tree-sitter-cli` from a `grammar.js` file, then compiled to a `.so` library that needs to be placed in neovim's `runtimepath` (typically under `parser/{language}.so`).
To simplify this, `nvim-treesitter` provides commands to automate this process.
If the language is already [supported by `nvim-treesitter`](#supported-languages), you can install it with
```vim
:TSInstall <language_to_install>
```
This command supports tab expansion.
You can also get a list of all available languages and their installation status with `:TSInstallInfo`.
Parsers not on this list can be added manually by following the steps described under ["Adding parsers"](#adding-parsers) below.
To make sure a parser is at the latest compatible version (as specified in `nvim-treesitter`'s `lockfile.json`), use `:TSUpdate {language}`. To update all parsers unconditionally, use `:TSUpdate all` or just `:TSUpdate`.
## Modules
Each module provides a distinct tree-sitter-based feature such as [highlighting](#highlight), [indentation](#indentation), or [folding](#folding); see [`:h nvim-treesitter-modules`](doc/nvim-treesitter.txt) or ["Available modules"](#available-modules) below for a list of modules and their options.
Following examples assume that you are configuring neovim with lua. If you are using vimscript, see `:help lua-heredoc`.
All modules are disabled by default and need to be activated explicitly in your `init.lua`, e.g., via
This plugin is only guaranteed to work with specific versions of language parsers** (as specified in the `parser.lua` table). **When upgrading the plugin, you must make sure that all installed parsers are updated to the latest version** via `:TSUpdate`.
It is strongly recommended to automate this; e.g., using the following spec with [lazy.nvim](https://github.com/folke/lazy.nvim):
```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" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
{
'nvim-treesitter/nvim-treesitter',
lazy = false,
build = ':TSUpdate'
}
```
Each module can also be enabled or disabled interactively through the following commands:
>[!IMPORTANT]
> This plugin does not support lazy-loading.
```vim
:TSBufEnable {module} " enable module on current buffer
:TSBufDisable {module} " disable module on current buffer
:TSEnable {module} [{ft}] " enable module on every buffer. If filetype is specified, enable only for this filetype.
:TSDisable {module} [{ft}] " disable module on every buffer. If filetype is specified, disable only for this filetype.
:TSModuleInfo [{module}] " list information about modules state for each filetype
## Setup
`nvim-treesitter` can be configured by calling `setup`. **You do not need to call `setup` for `nvim-treesitter` to work using default values.**
```lua
require('nvim-treesitter').setup {
-- Directory to install parsers and queries to (prepended to `runtimepath` to have priority)
install_dir = vim.fn.stdpath('data') .. '/site'
}
```
Parsers and queries can then be installed with
```lua
require('nvim-treesitter').install { 'rust', 'javascript', 'zig' }
```
(This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), you need to `wait()` for it to finish:
```lua
require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' }):wait(300000) -- wait max. 5 minutes
```
Check [`:h nvim-treesitter-commands`](doc/nvim-treesitter.txt) for a list of all available commands.
It may be necessary to reload the buffer (e.g., via `:e`) after enabling a module interactively.
# Supported languages
For `nvim-treesitter` to support a specific feature for a specific language requires both a parser for that language and an appropriate language-specific query file for that feature.
The following is a list of languages for which a parser can be installed through `:TSInstall`; a checked box means that `nvim-treesitter` also contains queries at least for the `highlight` module.
A list of the currently supported languages can be found [on this page](SUPPORTED_LANGUAGES.md). If you wish to add a new language or improve the queries for an existing one, please see our [contributing guide](CONTRIBUTING.md).
Experimental parsers are parsers that have a maintainer but are not stable enough for
daily use yet.
# Supported features
We are looking for maintainers to add more parsers and to write query files for their languages. Check our [tracking issue](https://github.com/nvim-treesitter/nvim-treesitter/issues/2282) for open language requests.
`nvim-treesitter` provides queries for the following features. **These are not automatically enabled.**
<!--This section of the README is automatically updated by a CI job-->
<!--parserinfo-->
- [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot)
- [x] [agda](https://github.com/AusCyberman/tree-sitter-agda) (maintained by @Decodetalkers)
- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime)
- [x] [astro](https://github.com/virchau13/tree-sitter-astro) (maintained by @virchau13)
- [ ] [awk](https://github.com/Beaglefoot/tree-sitter-awk)
- [x] [bash](https://github.com/tree-sitter/tree-sitter-bash) (maintained by @TravonteD)
- [x] [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] [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)
- [x] [capnp](https://github.com/amaanq/tree-sitter-capnp) (maintained by @amaanq)
- [x] [chatito](https://github.com/ObserverOfTime/tree-sitter-chatito) (maintained by @ObserverOfTime)
- [x] [clojure](https://github.com/sogaiu/tree-sitter-clojure) (maintained by @sogaiu)
- [x] [cmake](https://github.com/uyha/tree-sitter-cmake) (maintained by @uyha)
- [x] [comment](https://github.com/stsewd/tree-sitter-comment) (maintained by @stsewd)
- [x] [commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) (maintained by @theHamsta)
- [x] [cooklang](https://github.com/addcninblue/tree-sitter-cooklang) (maintained by @addcninblue)
- [x] [cpon](https://github.com/amaanq/tree-sitter-cpon) (maintained by @amaanq)
- [x] [cpp](https://github.com/tree-sitter/tree-sitter-cpp) (maintained by @theHamsta)
- [x] [css](https://github.com/tree-sitter/tree-sitter-css) (maintained by @TravonteD)
- [x] [cuda](https://github.com/theHamsta/tree-sitter-cuda) (maintained by @theHamsta)
- [x] [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] [diff](https://github.com/the-mikedavis/tree-sitter-diff) (maintained by @gbprod)
- [x] [dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) (maintained by @camdencheek)
- [x] [dot](https://github.com/rydesun/tree-sitter-dot) (maintained by @rydesun)
- [x] [ebnf](https://github.com/RubixDev/ebnf.git) (experimental, maintained by @RubixDev)
- [x] [eex](https://github.com/connorlay/tree-sitter-eex) (maintained by @connorlay)
- [x] [elixir](https://github.com/elixir-lang/tree-sitter-elixir) (maintained by @connorlay)
- [x] [elm](https://github.com/elm-tooling/tree-sitter-elm) (maintained by @zweimach)
- [x] [elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) (maintained by @glapa-grossklag, @amaanq)
- [x] [elvish](https://github.com/ckafi/tree-sitter-elvish) (maintained by @ckafi)
- [ ] [embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template)
- [x] [erlang](https://github.com/WhatsApp/tree-sitter-erlang) (maintained by @filmor)
- [x] [fennel](https://github.com/travonted/tree-sitter-fennel) (maintained by @TravonteD)
- [x] [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] [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] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)
- [x] [gitattributes](https://github.com/ObserverOfTime/tree-sitter-gitattributes) (maintained by @ObserverOfTime)
- [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod)
- [x] [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) (maintained by @theHamsta)
- [x] [gleam](https://github.com/J3RN/tree-sitter-gleam) (maintained by @connorlay)
- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli)
- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta)
- [x] [go](https://github.com/tree-sitter/tree-sitter-go) (maintained by @theHamsta, @WinWisely268)
- [x] [Godot Resources (gdresource)](https://github.com/PrestonKnopp/tree-sitter-godot-resource) (maintained by @pierpo)
- [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek)
- [x] [gosum](https://github.com/amaanq/tree-sitter-go-sum) (maintained by @amaanq)
- [x] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc)
- [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley)
- [ ] [hack](https://github.com/slackhq/tree-sitter-hack)
- [ ] [haskell](https://github.com/tree-sitter/tree-sitter-haskell)
- [x] [hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann)
- [x] [heex](https://github.com/connorlay/tree-sitter-heex) (maintained by @connorlay)
- [x] [help](https://github.com/neovim/tree-sitter-vimdoc) (maintained by @vigoux)
- [x] [hjson](https://github.com/winston0410/tree-sitter-hjson) (maintained by @winston0410)
- [x] [hlsl](https://github.com/theHamsta/tree-sitter-hlsl) (maintained by @theHamsta)
- [x] [hocon](https://github.com/antosha417/tree-sitter-hocon) (maintained by @antosha417)
- [x] [html](https://github.com/tree-sitter/tree-sitter-html) (maintained by @TravonteD)
- [x] [htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) (experimental, maintained by @ObserverOfTime)
- [x] [http](https://github.com/rest-nvim/tree-sitter-http) (maintained by @NTBBloodbath)
- [x] [ini](https://github.com/justinmk/tree-sitter-ini) (experimental, maintained by @theHamsta)
- [x] [java](https://github.com/tree-sitter/tree-sitter-java) (maintained by @p00f)
- [x] [javascript](https://github.com/tree-sitter/tree-sitter-javascript) (maintained by @steelsojka)
- [x] [jq](https://github.com/flurie/tree-sitter-jq) (maintained by @ObserverOfTime)
- [x] [jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) (maintained by @steelsojka)
- [x] [json](https://github.com/tree-sitter/tree-sitter-json) (maintained by @steelsojka)
- [x] [json5](https://github.com/Joakker/tree-sitter-json5) (maintained by @Joakker)
- [x] [JSON with comments](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) (maintained by @WhyNotHugo)
- [x] [jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) (maintained by @nawordar)
- [x] [julia](https://github.com/tree-sitter/tree-sitter-julia) (maintained by @theHamsta)
- [x] [kdl](https://github.com/amaanq/tree-sitter-kdl) (maintained by @amaanq)
- [x] [kotlin](https://github.com/fwcd/tree-sitter-kotlin) (maintained by @SalBakraa)
- [x] [lalrpop](https://github.com/traxys/tree-sitter-lalrpop) (maintained by @traxys)
- [x] [latex](https://github.com/latex-lsp/tree-sitter-latex) (maintained by @theHamsta, @clason)
- [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
- [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
- [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim)
- [x] [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] [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)
- [ ] [nickel](https://github.com/nickel-lang/tree-sitter-nickel)
- [x] [ninja](https://github.com/alemuller/tree-sitter-ninja) (maintained by @alemuller)
- [x] [nix](https://github.com/cstrahan/tree-sitter-nix) (maintained by @leo60228)
- [x] [norg](https://github.com/nvim-neorg/tree-sitter-norg) (maintained by @JoeyGrajciar, @vhyrro)
- [x] [ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu)
- [x] [ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) (maintained by @undu)
- [x] [ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) (maintained by @undu)
- [ ] [org](https://github.com/milisims/tree-sitter-org)
- [x] [pascal](https://github.com/Isopod/tree-sitter-pascal.git) (maintained by @Isopod)
- [x] [perl](https://github.com/ganezdragon/tree-sitter-perl) (maintained by @lcrownover)
- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
- [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228)
- [x] [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] [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] [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)
- [x] [racket](https://github.com/6cdh/tree-sitter-racket) (maintained by @6cdh)
- [x] [rasi](https://github.com/Fymyte/tree-sitter-rasi) (maintained by @Fymyte)
- [x] [regex](https://github.com/tree-sitter/tree-sitter-regex) (maintained by @theHamsta)
- [x] [rego](https://github.com/FallenAngel97/tree-sitter-rego) (maintained by @FallenAngel97)
- [x] [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) (maintained by @bamonroe)
- [x] [ron](https://github.com/amaanq/tree-sitter-ron) (maintained by @amaanq)
- [x] [rst](https://github.com/stsewd/tree-sitter-rst) (maintained by @stsewd)
- [x] [ruby](https://github.com/tree-sitter/tree-sitter-ruby) (maintained by @TravonteD)
- [x] [rust](https://github.com/tree-sitter/tree-sitter-rust) (maintained by @vigoux)
- [x] [scala](https://github.com/tree-sitter/tree-sitter-scala) (maintained by @stevanmilic)
- [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://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)
- [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)
- [x] [swift](https://github.com/alex-pinkus/tree-sitter-swift) (maintained by @alex-pinkus)
- [x] [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) (maintained by @RaafatTurki)
- [x] [t32](https://codeberg.org/xasc/tree-sitter-t32) (maintained by @xasc)
- [x] [teal](https://github.com/euclidianAce/tree-sitter-teal) (maintained by @euclidianAce)
- [x] [terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) (maintained by @MichaHoffmann)
- [x] [thrift](https://github.com/duskmoon314/tree-sitter-thrift) (maintained by @amaanq, @duskmoon314)
- [x] [tiger](https://github.com/ambroisie/tree-sitter-tiger) (maintained by @ambroisie)
- [x] [tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) (maintained by @ahelwer, @susliko)
- [x] [todotxt](https://github.com/arnarg/tree-sitter-todotxt.git) (experimental, maintained by @arnarg)
- [x] [toml](https://github.com/ikatyang/tree-sitter-toml) (maintained by @tk-shirasaka)
- [x] [tsx](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
- [x] [turtle](https://github.com/BonaBeavis/tree-sitter-turtle) (maintained by @BonaBeavis)
- [x] [twig](https://github.com/gbprod/tree-sitter-twig) (maintained by @gbprod)
- [x] [typescript](https://github.com/tree-sitter/tree-sitter-typescript) (maintained by @steelsojka)
- [x] [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)
- [x] [vhs](https://github.com/charmbracelet/tree-sitter-vhs) (maintained by @caarlos0)
- [x] [vim](https://github.com/vigoux/tree-sitter-viml) (maintained by @vigoux)
- [x] [vue](https://github.com/ikatyang/tree-sitter-vue) (maintained by @WhyNotHugo)
- [x] [wgsl](https://github.com/szebniok/tree-sitter-wgsl) (maintained by @szebniok)
- [x] [wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) (maintained by @theHamsta)
- [x] [yaml](https://github.com/ikatyang/tree-sitter-yaml) (maintained by @stsewd)
- [x] [yang](https://github.com/Hubro/tree-sitter-yang) (maintained by @Hubro)
- [x] [zig](https://github.com/maxxnino/tree-sitter-zig) (maintained by @maxxnino)
<!--parserinfo-->
## Highlighting
For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information).
# Available modules
Modules provide the top-level features of `nvim-treesitter`.
The following is a list of modules included in `nvim-treesitter` and their configuration via `init.lua` (where multiple modules can be combined in a single call to `setup`).
Note that not all modules work for all languages (depending on the queries available for them).
Additional modules can be provided as [external plugins](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Extra-modules-and-plugins).
#### Highlight
Consistent syntax highlighting.
Treesitter highlighting is provided by Neovim, see `:h treesitter-highlight`. To enable it for a filetype, put `vim.treesitter.start()` in a `ftplugin/<filetype>.lua` in your config directory, or place the following in your `init.lua`:
```lua
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
vim.api.nvim_create_autocmd('FileType', {
pattern = { '<filetype>' },
callback = function() vim.treesitter.start() end,
})
```
To customize the syntax highlighting of a capture, simply define or link a highlight group of the same name:
## Folds
Treesitter-based folding is provided by Neovim. To enable it, put the following in your `ftplugin` or `FileType` autocommand:
```lua
-- Highlight the @foo.bar capture group with the "Identifier" highlight group
vim.api.nvim_set_hl(0, "@foo.bar", { link = "Identifier" })
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo[0][0].foldmethod = 'expr'
```
For a language-specific highlight, append the name of the language:
## Indentation
Treesitter-based indentation is provided by this plugin but considered **experimental**. To enable it, put the following in your `ftplugin` or `FileType` autocommand:
```lua
-- Highlight @foo.bar as "Identifier" only in Lua files
vim.api.nvim_set_hl(0, "@foo.bar.lua", { link = "Identifier" })
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
```
See `:h treesitter-highlight-groups` for details.
(Note the specific quotes used.)
#### Incremental selection
## Injections
Incremental selection based on the named nodes from the grammar.
Injections are used for multi-language documents, see `:h treesitter-language-injections`. No setup is needed.
```lua
require'nvim-treesitter.configs'.setup {
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn", -- set to `false` to disable one of the mappings
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
```
## Locals
#### Indentation
Indentation based on treesitter for the `=` operator.
**NOTE: This is an experimental feature**.
```lua
require'nvim-treesitter.configs'.setup {
indent = {
enable = true
}
}
```
#### Folding
Tree-sitter based folding. _(Technically not a module because it's per windows and not per buffer.)_
```vim
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set nofoldenable " Disable folding at startup.
```
This will respect your `foldminlines` and `foldnestmax` settings.
These queries can be used to look up definitions and references to identifiers in a given scope. They are not used in this plugin and are provided for (limited) backward compatibility.
# Advanced setup
## Changing the parser install directory
If you want to install the parsers to a custom directory you can specify this
directory with `parser_install_dir` option in that is passed to `setup`.
`nvim-treesitter` will then install the parser files into this directory.
This directory must be writeable and must be explicitly added to the
`runtimepath`. For example:
```lua
vim.opt.runtimepath:append("/some/path/to/store/parsers")
require'nvim-treesitter.configs'.setup {
parser_install_dir = "/some/path/to/store/parsers",
...
}
```
If this option is not included in the setup options, or is explicitly set to
`nil` then the default install directories will be used. If this value is set
the default directories will be ignored.
Bear in mind that any parser installed into a parser folder on the runtime path
will still be considered installed. (For example if
"~/.local/share/nvim/site/parser/c.so" exists then the "c" parser will be
considered installed, even though it is not in `parser_install_dir`)
The default paths are:
1. first the package folder. Where `nvim-treesitter` is installed.
2. second the site directory. This is the "site" subdirectory of `stdpath("data")`.
## Adding parsers
## Adding custom languages
If you have a parser that is not on the list of supported languages (either as a repository on Github or in a local directory), you can add it manually for use by `nvim-treesitter` as follows:
1. Clone the repository or [create a new project](https://tree-sitter.github.io/tree-sitter/creating-parsers#project-setup) in, say, `~/projects/tree-sitter-zimbu`. Make sure that the `tree-sitter-cli` executable is installed and in your path; see <https://tree-sitter.github.io/tree-sitter/creating-parsers#installation> for installation instructions.
2. Run `tree-sitter generate` in this directory (followed by `tree-sitter test` for good measure).
3. Add the following snippet to your `init.lua`:
1. Add the following snippet in a `User TSUpdate` autocommand:
```lua
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.zimbu = {
install_info = {
url = "~/projects/tree-sitter-zimbu", -- local path or git repo
files = {"src/parser.c"},
-- optional entries:
branch = "main", -- default branch in case of git repo if different from master
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
},
filetype = "zu", -- if filetype does not match the parser name
}
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
callback = function()
require('nvim-treesitter.parsers').zimbu = {
install_info = {
url = 'https://github.com/zimbulang/tree-sitter-zimbu',
revision = <sha>, -- commit hash for revision to check out; HEAD if missing
-- optional entries:
branch = 'develop', -- only needed if different from default branch
location = 'parser', -- only needed if the parser is in subdirectory of a "monorepo"
generate = true, -- only needed if repo does not contain pre-generated `src/parser.c`
generate_from_json = false, -- only needed if repo does not contain `src/grammar.json` either
queries = 'queries/neovim', -- also install queries from given directory
},
}
end})
```
If you wish to set a specific parser for a filetype, you should extend the `filetype_to_parsername` table:
Alternatively, if you have a local checkout, you can instead use
```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.
install_info = {
path = '~/parsers/tree-sitter-zimbu',
-- optional entries
location = 'parser',
generate = true,
generate_from_json = false,
queries = 'queries/neovim', -- symlink queries from given directory
},
```
This will always use the state of the directory as-is (i.e., `branch` and `revision` will be ignored).
2. If the parser name differs from the filetype(s) used by Neovim, you need to register the parser via
```lua
vim.treesitter.language.register('zimbu', { 'zu' })
```
4. Start `nvim` and `:TSInstall zimbu`.
You can also skip step 2 and use `:TSInstallFromGrammar zimbu` to install directly from a `grammar.js` in the top-level directory specified by `url`.
Once the parser is installed, you can update it (from the latest revision of the `main` branch if `url` is a Github repository) with `:TSUpdate zimbu`.
Note that neither `:TSInstall` nor `:TSInstallFromGrammar` copy query files from the grammar repository.
If you want your installed grammar to be useful, you must manually [add query files](#adding-queries) to your local nvim-treesitter installation.
Note also that module functionality is only triggered if your language's filetype is correctly identified.
If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`](<https://neovim.io/doc/user/lua.html#vim.filetype.add()>) to add a custom detection rule.
If you use a git repository for your parser and want to use a specific version, you can set the `revision` key
in the `install_info` table for you parser config.
3. Start `nvim` and `:TSInstall zimbu`.
>[!IMPORTANT]
> If the parser requires an external scanner, this must be written in C.
### Modifying parsers
You can use the same approach for overriding parser information. E.g., if you always want to generate the `lua` parser from grammar, add
```lua
vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
callback = function()
require('nvim-treesitter.parsers').lua.install_info.generate = true
end})
```
## Adding queries
Queries are what `nvim-treesitter` uses to extract information from the syntax tree;
they are located in the `queries/{language}/*` runtime directories (see `:h rtp`),
like the `queries` folder of this plugin, e.g. `queries/{language}/{locals,highlights,textobjects}.scm`.
Other modules may require additional queries such as `folding.scm`. You can find a
list of all supported capture names in [CONTRIBUTING.md](https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations).
All queries found in the runtime directories will be combined.
By convention, if you want to write a query, use the `queries/` directory,
but if you want to extend a query use the `after/queries/` directory.
If you want to completely override a query, you can use `:h set_query()`.
For example, to override the `injections` queries from `c` with your own:
```lua
require("vim.treesitter.query").set_query("c", "injections", "(comment) @comment")
```
Note: when using `set_query`, all queries in the runtime directories will be ignored.
## Adding modules
If you wish you write your own module, you need to support
- tree-sitter language detection support;
- attaching and detaching to buffers;
- all nvim-treesitter commands.
At the top level, you can use the `define_modules` function to define one or more modules or module groups:
```lua
require'nvim-treesitter'.define_modules {
my_cool_plugin = {
attach = function(bufnr, lang)
-- Do cool stuff here
end,
detach = function(bufnr)
-- Undo cool stuff here
end,
is_supported = function(lang)
-- Check if the language is supported
end
}
}
```
with the following properties:
- `module_path` specifies a require path (string) that exports a module with an `attach` and `detach` function. This is not required if the functions are on this definition.
- `enable` determines if the module is enabled by default. This is usually overridden by the user.
- `disable` takes a list of languages that this module is disabled for. This is usually overridden by the user.
- `is_supported` takes a function that takes a language and determines if this module supports that language.
- `attach` takes a function that attaches to a buffer. This is required if `module_path` is not provided.
- `detach` takes a function that detaches from a buffer. This is required if `module_path` is not provided.
# Extra features
### Statusline indicator
```vim
echo nvim_treesitter#statusline(90) " 90 can be any length
module->expression_statement->call->identifier
```
### Utilities
You can get some utility functions with
```lua
local ts_utils = require 'nvim-treesitter.ts_utils'
```
Check [`:h nvim-treesitter-utils`](doc/nvim-treesitter.txt) for more information.
# Troubleshooting
Before doing anything, make sure you have the latest version of this plugin and run `:checkhealth nvim-treesitter`.
It can also help to update the parsers via `:TSUpdate`.
#### Feature `X` does not work for `{language}`...
First, check the `health#nvim_treesitter#check` and the `health#treesitter#check` sections of `:checkhealth` for any warning.
If there is one, it's highly likely that this is the cause of the problem.
Next check the `## Parser/Features` subsection of the `health#nvim_treesitter#check` section of `:checkhealth` to ensure the desired module is enabled for your language.
If not, you might be missing query files; see [Adding queries](#adding-queries).
Finally, ensure Neovim is correctly identifying your language's filetype using the `:echo &filetype` command while one of your language's files is open in Neovim.
If not, add a short Vimscript file to nvim-treesitter's `ftdetect` runtime directory following [Neovim's documentation](https://neovim.io/doc/user/filetype.html#new-filetype) on filetype detection.
You can also quickly & temporarily set the filetype for a single buffer with the `:set filetype=langname` command to test whether it fixes the problem.
If everything is okay, then it might be an actual error.
In that case, feel free to [open an issue here](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose).
#### I get `module 'vim.treesitter.query' not found`
Make sure you have the latest version of Neovim.
#### I get `Error detected while processing .../plugin/nvim-treesitter.vim` every time I open Neovim
This is probably due to a change in a parser's grammar or its queries.
Try updating the parser that you suspect has changed (`:TSUpdate {language}`) or all of them (`:TSUpdate`).
If the error persists after updating all parsers,
please [open an issue](https://github.com/nvim-treesitter/nvim-treesitter/issues/new/choose).
#### I get `query error: invalid node type at position`
This could be due a query file outside this plugin using outdated nodes,
or due to an outdated parser.
- Make sure you have the parsers up to date with `:TSUpdate`
- Make sure you don't have more than one `parser` runtime directory.
You can execute this command `:echo nvim_get_runtime_file('parser', v:true)` to find all runtime directories.
If you get more than one path, remove the ones that are outside this plugin (`nvim-treesitter` directory),
so the correct version of the parser is used.
#### I experience weird highlighting issues similar to [#78](https://github.com/nvim-treesitter/nvim-treesitter/issues/78)
This is a well known issue, which arises when the tree and the buffer have gotten out of sync.
As this is an upstream issue, we don't have any definite fix.
To get around this, you can force reparsing the buffer with
```vim
:write | edit | TSBufEnable highlight
```
This will save, restore and enable highlighting for the current buffer.
#### I experience bugs when using `nvim-treesitter`'s `foldexpr` similar to [#194](https://github.com/nvim-treesitter/nvim-treesitter/issues/194)
This might happen, and is known to happen, with `vim-clap`.
To avoid these kind of errors, please use `setlocal` instead of `set` for the respective filetypes.
#### I run into errors like `module 'nvim-treesitter.configs' not found` at startup
This is because of `rtp` management in `nvim`, adding `packadd
nvim-treesitter` should fix the issue.
#### I want to use Git instead of curl for downloading the parsers
In your Lua config:
```lua
require("nvim-treesitter.install").prefer_git = true
```
#### I want to use a HTTP proxy for downloading the parsers
You can either configure curl to use additional CLI arguments in your Lua config:
```lua
require("nvim-treesitter.install").command_extra_args = {
curl = { "--proxy", "<proxy url>" },
}
```
or you can configure git via `.gitconfig` and use git instead of curl
```lua
require("nvim-treesitter.install").prefer_git = true
```
#### I want to use a mirror instead of "https://github.com/"
In your Lua config:
```lua
for _, config in pairs(require("nvim-treesitter.parsers").get_parser_configs()) do
config.install_info.url = config.install_info.url:gsub("https://github.com/", "something else")
end
require'nvim-treesitter.configs'.setup {
--
--
}
```
Queries can be placed anywhere in your `runtimepath` under `queries/<language>`, with earlier directories taking precedence unless the queries are marked with `; extends`; see [`:h treesitter-query-modelines`](https://neovim.io/doc/user/treesitter.html#treesitter-query-modeline).

365
SUPPORTED_LANGUAGES.md generated Normal file
View file

@ -0,0 +1,365 @@
# Supported languages
The following is a list of languages for which a parser can be installed through `:TSInstall`.
Legend:
- **Tier:** _stable_ (updates follow semver releases), _unstable_ (updates follow HEAD), _unmaintained_ (no automatic updates), or _unsupported_ (known to be broken, cannot be installed)
- **Queries** available for **H**ighlights, **F**olds, **I**ndents, In**J**ections, **L**ocals
- **Maintainer** of queries in nvim-treesitter (may be different from parser maintainer!)
<!--This section of the README is automatically updated by a CI job-->
<!--parserinfo-->
Language | Tier | Queries | Maintainer
-------- |:----:|:-------:| ----------
[ada](https://github.com/briot/tree-sitter-ada) | unstable | `HF JL` | @briot
[agda](https://github.com/tree-sitter/tree-sitter-agda) | unstable | `HF J ` | @Decodetalkers
[angular](https://github.com/dlvandenberg/tree-sitter-angular) | unstable | `HFIJL` | @dlvandenberg
[apex](https://github.com/aheber/tree-sitter-sfapex) | unstable | `HF JL` | @aheber, @xixiafinland
[arduino](https://github.com/tree-sitter-grammars/tree-sitter-arduino) | unstable | `HFIJL` | @ObserverOfTime
[asm](https://github.com/RubixDev/tree-sitter-asm) | unstable | `H  J ` | @RubixDev
[astro](https://github.com/virchau13/tree-sitter-astro) | unstable | `HFIJL` | @virchau13
[authzed](https://github.com/mleonidas/tree-sitter-authzed) | unstable | `H  J ` | @mattpolzin
[awk](https://github.com/Beaglefoot/tree-sitter-awk) | unstable | `H  J ` |
[bash](https://github.com/tree-sitter/tree-sitter-bash) | unstable | `HFIJL` | @TravonteD
[bass](https://github.com/vito/tree-sitter-bass) | unstable | `HFIJL` | @amaanq
[beancount](https://github.com/polarmutex/tree-sitter-beancount) | unstable | `HF J ` | @polarmutex
[bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) | unstable | `HFIJ ` | @theHamsta, @clason
[bicep](https://github.com/tree-sitter-grammars/tree-sitter-bicep) | unstable | `HFIJL` | @amaanq
[bitbake](https://github.com/tree-sitter-grammars/tree-sitter-bitbake) | unstable | `HFIJL` | @amaanq
[blade](https://github.com/EmranMR/tree-sitter-blade) | unstable | `HFIJ ` | @calebdw
[bp](https://github.com/ambroisie/tree-sitter-bp)[^bp] | unstable | `HFIJL` | @ambroisie
[bpftrace](https://github.com/sgruszka/tree-sitter-bpftrace) | unstable | `H  J ` | @sgruszka
[brightscript](https://github.com/ajdelcimmuto/tree-sitter-brightscript) | unstable | `HFIJ ` | @ajdelcimmuto
[c](https://github.com/tree-sitter/tree-sitter-c) | unstable | `HFIJL` | @amaanq
[c3](https://github.com/c3lang/tree-sitter-c3) | unstable | `HFIJ ` | @cbuttner
[c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) | unstable | `HF JL` | @amaanq
[caddy](https://github.com/opa-oz/tree-sitter-caddy) | unmaintained | `HFIJ ` |
[cairo](https://github.com/tree-sitter-grammars/tree-sitter-cairo) | unstable | `HFIJL` | @amaanq
[capnp](https://github.com/tree-sitter-grammars/tree-sitter-capnp) | unstable | `HFIJL` | @amaanq
[chatito](https://github.com/tree-sitter-grammars/tree-sitter-chatito) | unstable | `HFIJL` | @ObserverOfTime
[circom](https://github.com/Decurity/tree-sitter-circom) | unstable | `HF JL` | @alexandr-martirosyan
[clojure](https://github.com/sogaiu/tree-sitter-clojure) | unstable | `HF JL` | @NoahTheDuke
[cmake](https://github.com/uyha/tree-sitter-cmake) | unstable | `HFIJ ` | @uyha
[comment](https://github.com/stsewd/tree-sitter-comment) | unstable | `H    ` | @stsewd
[commonlisp](https://github.com/tree-sitter-grammars/tree-sitter-commonlisp) | unstable | `HF JL` | @theHamsta
[cooklang](https://github.com/addcninblue/tree-sitter-cooklang) | unstable | `H  J ` | @addcninblue
[corn](https://github.com/jakestanger/tree-sitter-corn) | unstable | `HFIJL` | @jakestanger
[cpon](https://github.com/tree-sitter-grammars/tree-sitter-cpon) | unstable | `HFIJL` | @amaanq
[cpp](https://github.com/tree-sitter/tree-sitter-cpp) | unstable | `HFIJL` | @theHamsta
[css](https://github.com/tree-sitter/tree-sitter-css) | unstable | `HFIJ ` | @TravonteD
[csv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq
[cuda](https://github.com/tree-sitter-grammars/tree-sitter-cuda) | unstable | `HFIJL` | @theHamsta
[cue](https://github.com/eonpatapon/tree-sitter-cue) | unstable | `HFIJL` | @amaanq
[cylc](https://github.com/elliotfontaine/tree-sitter-cylc) | unstable | `HFIJ ` | @elliotfontaine
[d](https://github.com/gdamore/tree-sitter-d) | unstable | `HFIJL` | @amaanq
[dart](https://github.com/UserNobody14/tree-sitter-dart) | unstable | `HFIJL` | @akinsho
[desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) | stable | `HF J ` | @ValdezFOmar
[devicetree](https://github.com/joelspadin/tree-sitter-devicetree) | unstable | `HFIJL` | @jedrzejboczar
[dhall](https://github.com/jbellerb/tree-sitter-dhall) | unstable | `HF J ` | @amaanq
[diff](https://github.com/tree-sitter-grammars/tree-sitter-diff) | unstable | `HF J ` | @gbprod
[disassembly](https://github.com/ColinKennedy/tree-sitter-disassembly) | unstable | `H  J ` | @ColinKennedy
[djot](https://github.com/treeman/tree-sitter-djot) | unstable | `HFIJL` | @NoahTheDuke
[dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | unstable | `H  J ` | @camdencheek
[dot](https://github.com/rydesun/tree-sitter-dot) | unstable | `HFIJ ` | @rydesun
[doxygen](https://github.com/tree-sitter-grammars/tree-sitter-doxygen) | unstable | `H IJ ` | @amaanq
[dtd](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HF JL` | @ObserverOfTime
[earthfile](https://github.com/glehmann/tree-sitter-earthfile) | unstable | `H  J ` | @glehmann
[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H  J ` | @RubixDev
ecma (queries only)[^ecma] | unstable | `HFIJL` | @steelsojka
[editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) | stable | `HF J ` | @ValdezFOmar
[eds](https://github.com/uyha/tree-sitter-eds) | unstable | `HF   ` | @uyha
[eex](https://github.com/connorlay/tree-sitter-eex) | unstable | `H  J ` | @connorlay
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | unstable | `HFIJL` | @connorlay
[elm](https://github.com/elm-tooling/tree-sitter-elm) | unstable | `HF J ` | @zweimach
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | unstable | `HFIJL` | @glapa-grossklag, @amaanq
[elvish](https://github.com/elves/tree-sitter-elvish) | unstable | `H  J ` | @elves
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unstable | `H  J ` |
[enforce](https://github.com/simonvic/tree-sitter-enforce) | unstable | `HFIJL` | @simonvic
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | unstable | `HF J ` | @filmor
[facility](https://github.com/FacilityApi/tree-sitter-facility) | unstable | `HFIJ ` | @bryankenote
[faust](https://github.com/khiner/tree-sitter-faust) | unstable | `H  J ` | @khiner
[fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | unstable | `HF JL` | @alexmozaidze
[fidl](https://github.com/google/tree-sitter-fidl) | unstable | `HF J ` | @chaopeng
[firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | unstable | `HFIJL` | @amaanq
[fish](https://github.com/ram02z/tree-sitter-fish) | unstable | `HFIJL` | @ram02z
[foam](https://github.com/FoamScience/tree-sitter-foam) | unstable | `HFIJL` | @FoamScience
[forth](https://github.com/AlexanderBrevig/tree-sitter-forth) | unstable | `HFIJL` | @amaanq
[fortran](https://github.com/stadelmanma/tree-sitter-fortran) | unstable | `HFIJ ` | @amaanq
[fsh](https://github.com/mgramigna/tree-sitter-fsh) | unstable | `H  J ` | @mgramigna
[fsharp](https://github.com/ionide/tree-sitter-fsharp) | unstable | `H  J ` | @nsidorenco
[func](https://github.com/tree-sitter-grammars/tree-sitter-func) | unstable | `H  J ` | @amaanq
[gap](https://github.com/gap-system/tree-sitter-gap)[^gap] | unstable | `HF JL` | @reiniscirpons
[gaptst](https://github.com/gap-system/tree-sitter-gaptst)[^gaptst] | unstable | `HF J ` | @reiniscirpons
[gdscript](https://github.com/PrestonKnopp/tree-sitter-gdscript)[^gdscript] | unmaintained | `HFIJL` |
[gdshader](https://github.com/airblast-dev/tree-sitter-gdshader) | unstable | `H  J ` | @airblast-dev
[git_config](https://github.com/the-mikedavis/tree-sitter-git-config) | unstable | `HF J ` | @amaanq
[git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) | unstable | `H  J ` | @gbprod
[gitattributes](https://github.com/tree-sitter-grammars/tree-sitter-gitattributes) | unstable | `H  JL` | @ObserverOfTime
[gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) | unstable | `H  J ` | @gbprod
[gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) | unstable | `H  J ` | @theHamsta
[gleam](https://github.com/gleam-lang/tree-sitter-gleam) | unstable | `HFIJL` | @amaanq
[glimmer](https://github.com/ember-tooling/tree-sitter-glimmer)[^glimmer] | unstable | `HFIJL` | @NullVoxPopuli
[glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) | unstable | `HFIJL` | @NullVoxPopuli
[glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) | unstable | `HFIJ ` | @NullVoxPopuli
[glsl](https://github.com/tree-sitter-grammars/tree-sitter-glsl) | unstable | `HFIJL` | @theHamsta
[gn](https://github.com/tree-sitter-grammars/tree-sitter-gn) | unstable | `HFIJL` | @amaanq
[gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) | unstable | `H  J ` | @dpezto
[go](https://github.com/tree-sitter/tree-sitter-go) | unstable | `HFIJL` | @theHamsta, @WinWisely268
[goctl](https://github.com/chaozwn/tree-sitter-goctl) | unstable | `HFIJ ` | @chaozwn
[godot_resource](https://github.com/PrestonKnopp/tree-sitter-godot-resource)[^godot_resource] | unstable | `HF JL` | @pierpo
[gomod](https://github.com/camdencheek/tree-sitter-go-mod) | unstable | `H  J ` | @camdencheek
[gosum](https://github.com/tree-sitter-grammars/tree-sitter-go-sum) | unstable | `H    ` | @amaanq
[gotmpl](https://github.com/ngalaiko/tree-sitter-go-template) | unstable | `HF JL` | @qvalentin
[gowork](https://github.com/omertuc/tree-sitter-go-work) | unstable | `H  J ` | @omertuc
[gpg](https://github.com/tree-sitter-grammars/tree-sitter-gpg-config) | unstable | `H  J ` | @ObserverOfTime
[graphql](https://github.com/bkegley/tree-sitter-graphql) | unstable | `H IJ ` | @bkegley
[gren](https://github.com/MaeBrooks/tree-sitter-gren) | unstable | `H  J ` | @MaeBrooks
[groovy](https://github.com/murtaza64/tree-sitter-groovy) | unstable | `HFIJL` | @murtaza64
[groq](https://github.com/ajrussellaudio/tree-sitter-groq) | unstable | `HFIJ ` | @ajrussellaudio
[gstlaunch](https://github.com/tree-sitter-grammars/tree-sitter-gstlaunch) | unstable | `H    ` | @theHamsta
[hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H  J ` |
[hare](https://github.com/tree-sitter-grammars/tree-sitter-hare) | unstable | `HFIJL` | @amaanq
[haskell](https://github.com/tree-sitter-grammars/tree-sitter-haskell) | unstable | `HF JL` | @mrcjkb
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | unstable | `HF   ` | @lykahb
[hcl](https://github.com/tree-sitter-grammars/tree-sitter-hcl) | unstable | `HFIJ ` | @MichaHoffmann
[heex](https://github.com/connorlay/tree-sitter-heex) | unstable | `HFIJL` | @connorlay
[helm](https://github.com/ngalaiko/tree-sitter-go-template) | unstable | `HF JL` | @qvalentin
[hjson](https://github.com/winston0410/tree-sitter-hjson) | unstable | `HFIJL` | @winston0410
[hlsl](https://github.com/tree-sitter-grammars/tree-sitter-hlsl) | unstable | `HFIJL` | @theHamsta
[hlsplaylist](https://github.com/Freed-Wu/tree-sitter-hlsplaylist) | unstable | `H  J ` | @Freed-Wu
[hocon](https://github.com/antosha417/tree-sitter-hocon) | unstable | `HF J ` | @antosha417
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF JL` | @urbit-pilled
[html](https://github.com/tree-sitter/tree-sitter-html) | unstable | `HFIJL` | @TravonteD
html_tags (queries only)[^html_tags] | unstable | `H IJ ` | @TravonteD
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | @ObserverOfTime
[http](https://github.com/rest-nvim/tree-sitter-http) | unstable | `HF J ` | @amaanq, @NTBBloodbath
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | unstable | `HFIJ ` | @pfeiferj
[hyprlang](https://github.com/tree-sitter-grammars/tree-sitter-hyprlang) | unstable | `HFIJ ` | @luckasRanarison
[idl](https://github.com/cathaysia/tree-sitter-idl) | unstable | `H IJ ` | @cathaysia
[idris](https://github.com/kayhide/tree-sitter-idris) | unstable | `HF JL` |
[ini](https://github.com/justinmk/tree-sitter-ini) | unstable | `HF J ` | @theHamsta
[inko](https://github.com/inko-lang/tree-sitter-inko) | stable | `HFIJL` | @yorickpeterse
[ispc](https://github.com/tree-sitter-grammars/tree-sitter-ispc) | unstable | `HFIJL` | @fab4100
[janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) | unstable | `HF JL` | @sogaiu
[java](https://github.com/tree-sitter/tree-sitter-java) | unstable | `HFIJL` | @p00f
[javadoc](https://github.com/rmuir/tree-sitter-javadoc) | unstable | `H IJ ` | @rmuir
[javascript](https://github.com/tree-sitter/tree-sitter-javascript) | unstable | `HFIJL` | @steelsojka
[jinja](https://github.com/cathaysia/tree-sitter-jinja)[^jinja] | unstable | `H  J ` | @cathaysia
[jinja_inline](https://github.com/cathaysia/tree-sitter-jinja)[^jinja_inline] | unstable | `H  J ` | @cathaysia
[jjdescription](https://github.com/ribru17/tree-sitter-jjdescription) | stable | `H  J ` | @ribru17
[jq](https://github.com/flurie/tree-sitter-jq) | unstable | `H  JL` | @ObserverOfTime
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | unstable | `H    ` | @steelsojka
[json](https://github.com/tree-sitter/tree-sitter-json) | unstable | `HFIJL` | @steelsojka
[json5](https://github.com/Joakker/tree-sitter-json5) | unstable | `H  J ` | @Joakker
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | unstable | `HF JL` | @nawordar
jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka
[julia](https://github.com/tree-sitter-grammars/tree-sitter-julia) | unstable | `HFIJL` | @clason
[just](https://github.com/IndianBoy42/tree-sitter-just) | unstable | `HFIJL` | @Hubro
[kcl](https://github.com/kcl-lang/tree-sitter-kcl) | unstable | `HF J ` | @bertbaron
[kconfig](https://github.com/tree-sitter-grammars/tree-sitter-kconfig) | unstable | `HFIJL` | @amaanq
[kdl](https://github.com/tree-sitter-grammars/tree-sitter-kdl) | unstable | `HFIJL` | @amaanq
[kitty](https://github.com/OXY2DEV/tree-sitter-kitty) | unstable | `H  J ` | @OXY2DEV
[kos](https://github.com/kos-lang/tree-sitter-kos) | unstable | `HF JL` | @cdragan
[kotlin](https://github.com/fwcd/tree-sitter-kotlin) | unstable | `HF JL` |
[koto](https://github.com/koto-lang/tree-sitter-koto) | unstable | `HF JL` | @irh
[kusto](https://github.com/Willem-J-an/tree-sitter-kusto) | unstable | `H  J ` | @Willem-J-an
[lalrpop](https://github.com/traxys/tree-sitter-lalrpop) | unstable | `HF JL` | @traxys
[latex](https://github.com/latex-lsp/tree-sitter-latex) | unstable | `HF J ` | @theHamsta, @clason
[ledger](https://github.com/cbarrete/tree-sitter-ledger) | unstable | `HFIJ ` | @cbarrete
[leo](https://github.com/r001/tree-sitter-leo) | unstable | `H IJ ` | @r001
[linkerscript](https://github.com/tree-sitter-grammars/tree-sitter-linkerscript) | unstable | `HFIJL` | @amaanq
[liquid](https://github.com/hankthetank27/tree-sitter-liquid) | unstable | `H  J ` | @hankthetank27
[liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) | unstable | `HFIJL` | @toots
[llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) | unstable | `H  J ` | @benwilliamgraham
[lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) | unstable | `HFIJL` | @muniftanjim
[luadoc](https://github.com/tree-sitter-grammars/tree-sitter-luadoc) | unstable | `H    ` | @amaanq
[luap](https://github.com/tree-sitter-grammars/tree-sitter-luap)[^luap] | unstable | `H    ` | @amaanq
[luau](https://github.com/tree-sitter-grammars/tree-sitter-luau) | unstable | `HFIJL` | @amaanq
[m68k](https://github.com/grahambates/tree-sitter-m68k) | unstable | `HF JL` | @grahambates
[make](https://github.com/tree-sitter-grammars/tree-sitter-make) | unstable | `HF J ` | @lewis6991
[markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown] | unstable | `HFIJ ` | @MDeiml
[markdown_inline](https://github.com/tree-sitter-grammars/tree-sitter-markdown)[^markdown_inline] | unstable | `H  J ` | @MDeiml
[matlab](https://github.com/acristoffers/tree-sitter-matlab) | unstable | `HFIJL` | @acristoffers
[menhir](https://github.com/Kerl13/tree-sitter-menhir) | unstable | `H  J ` | @Kerl13
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `HFIJ ` |
[meson](https://github.com/tree-sitter-grammars/tree-sitter-meson) | unstable | `HFIJ ` | @Decodetalkers
[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H  JL` | @artagnon
[muttrc](https://github.com/neomutt/tree-sitter-muttrc) | unstable | `H  J ` | @Freed-Wu
[nasm](https://github.com/naclsn/tree-sitter-nasm) | unstable | `H  J ` | @ObserverOfTime
[nginx](https://github.com/opa-oz/tree-sitter-nginx) | unstable | `HF J ` | @opa-oz
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unstable | `H IJ ` |
[nim](https://github.com/alaviss/tree-sitter-nim) | unstable | `HF JL` | @aMOPel
[nim_format_string](https://github.com/aMOPel/tree-sitter-nim-format-string) | unstable | `H  J ` | @aMOPel
[ninja](https://github.com/alemuller/tree-sitter-ninja) | unstable | `HFIJ ` | @alemuller
[nix](https://github.com/nix-community/tree-sitter-nix) | unstable | `HFIJL` | @leo60228, @mrcjkb, @zimbatm
[nqc](https://github.com/tree-sitter-grammars/tree-sitter-nqc) | unstable | `HFIJL` | @amaanq
[nu](https://github.com/nushell/tree-sitter-nu) | unstable | `HFIJ ` | @abhisheksingh0x558
[objc](https://github.com/tree-sitter-grammars/tree-sitter-objc) | unstable | `HFIJL` | @amaanq
[objdump](https://github.com/ColinKennedy/tree-sitter-objdump) | unstable | `H  J ` | @ColinKennedy
[ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | unstable | `HFIJL` | @undu
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | unstable | `H  J ` | @undu
[odin](https://github.com/tree-sitter-grammars/tree-sitter-odin) | unstable | `HFIJL` | @amaanq
[pascal](https://github.com/Isopod/tree-sitter-pascal) | unstable | `HFIJL` | @Isopod
[passwd](https://github.com/ath3/tree-sitter-passwd) | unstable | `H    ` | @amaanq
[pem](https://github.com/tree-sitter-grammars/tree-sitter-pem) | unstable | `HF J ` | @ObserverOfTime
[perl](https://github.com/tree-sitter-perl/tree-sitter-perl) | unstable | `HF J ` | @RabbiVeesh, @LeoNerd
[php](https://github.com/tree-sitter/tree-sitter-php)[^php] | unstable | `HFIJL` | @tk-shirasaka, @calebdw
[php_only](https://github.com/tree-sitter/tree-sitter-php)[^php_only] | unstable | `HFIJL` | @tk-shirasaka, @calebdw
[phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) | unstable | `H    ` | @mikehaertl
[pioasm](https://github.com/leo60228/tree-sitter-pioasm) | unstable | `H  J ` | @leo60228
[pkl](https://github.com/apple/tree-sitter-pkl) | unstable | `HF J ` | @ribru17
[po](https://github.com/tree-sitter-grammars/tree-sitter-po) | unstable | `HF J ` | @amaanq
[pod](https://github.com/tree-sitter-perl/tree-sitter-pod) | unstable | `H    ` | @RabbiVeesh, @LeoNerd
[poe_filter](https://github.com/tree-sitter-grammars/tree-sitter-poe-filter)[^poe_filter] | unstable | `HFIJ ` | @ObserverOfTime
[pony](https://github.com/tree-sitter-grammars/tree-sitter-pony) | unstable | `HFIJL` | @amaanq, @mfelsche
[powershell](https://github.com/airbus-cert/tree-sitter-powershell) | unstable | `HFIJL` | @L2jLiga
[printf](https://github.com/tree-sitter-grammars/tree-sitter-printf) | unstable | `H    ` | @ObserverOfTime
[prisma](https://github.com/victorhqc/tree-sitter-prisma) | unstable | `HF J ` | @elianiva
[problog](https://github.com/foxyseta/tree-sitter-prolog) | unstable | `HFIJ ` | @foxyseta
[prolog](https://github.com/foxyseta/tree-sitter-prolog) | unstable | `HFIJ ` | @foxyseta
[promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H  J ` | @MichaHoffmann
[properties](https://github.com/tree-sitter-grammars/tree-sitter-properties)[^properties] | unstable | `H  JL` | @ObserverOfTime
[proto](https://github.com/coder3101/tree-sitter-proto) | unstable | `HFIJ ` | @stefanvanburen
[prql](https://github.com/PRQL/tree-sitter-prql) | unstable | `H  J ` | @matthias-Q
[psv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq
[pug](https://github.com/zealot128/tree-sitter-pug) | unstable | `H  J ` | @zealot128
[puppet](https://github.com/tree-sitter-grammars/tree-sitter-puppet) | unstable | `HFIJL` | @amaanq
[purescript](https://github.com/postsolar/tree-sitter-purescript) | unstable | `H  JL` | @postsolar
[pymanifest](https://github.com/tree-sitter-grammars/tree-sitter-pymanifest) | unstable | `H  J ` | @ObserverOfTime
[python](https://github.com/tree-sitter/tree-sitter-python) | stable | `HFIJL` | @stsewd, @theHamsta
[ql](https://github.com/tree-sitter/tree-sitter-ql) | unstable | `HFIJL` | @pwntester
[qmldir](https://github.com/tree-sitter-grammars/tree-sitter-qmldir) | unstable | `H  J ` | @amaanq
[qmljs](https://github.com/yuja/tree-sitter-qmljs) | unstable | `HF J ` | @Decodetalkers
[query](https://github.com/tree-sitter-grammars/tree-sitter-query)[^query] | unstable | `HFIJL` | @steelsojka
[r](https://github.com/r-lib/tree-sitter-r) | unstable | `H IJL` | @ribru17
[racket](https://github.com/6cdh/tree-sitter-racket) | unstable | `HF J ` |
[ralph](https://github.com/alephium/tree-sitter-ralph) | unstable | `H  J ` | @tdroxler
[rasi](https://github.com/Fymyte/tree-sitter-rasi) | unstable | `HFIJL` | @Fymyte
[razor](https://github.com/tris203/tree-sitter-razor) | unstable | `HF J ` | @tris203
[rbs](https://github.com/joker1007/tree-sitter-rbs) | unstable | `HFIJ ` | @joker1007
[re2c](https://github.com/tree-sitter-grammars/tree-sitter-re2c) | unstable | `HFIJL` | @amaanq
[readline](https://github.com/tree-sitter-grammars/tree-sitter-readline) | unstable | `HFIJ ` | @ribru17
[regex](https://github.com/tree-sitter/tree-sitter-regex) | unstable | `H    ` | @theHamsta
[rego](https://github.com/FallenAngel97/tree-sitter-rego) | unstable | `H  J ` | @FallenAngel97
[requirements](https://github.com/tree-sitter-grammars/tree-sitter-requirements) | unstable | `H  J ` | @ObserverOfTime
[rescript](https://github.com/rescript-lang/tree-sitter-rescript) | unstable | `HFIJL` | @ribru17
[rifleconf](https://github.com/purarue/tree-sitter-rifleconf) | unstable | `H  J ` | @purarue
[rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | unstable | `HF J ` | @bamonroe
[robot](https://github.com/Hubro/tree-sitter-robot) | unmaintained | `HFIJ ` |
[robots_txt](https://github.com/opa-oz/tree-sitter-robots-txt) | unstable | `H  J ` | @opa-oz
[roc](https://github.com/faldor20/tree-sitter-roc) | unmaintained | `H IJL` |
[ron](https://github.com/tree-sitter-grammars/tree-sitter-ron) | unstable | `HFIJL` | @amaanq
[rst](https://github.com/stsewd/tree-sitter-rst) | unstable | `H  JL` | @stsewd
[ruby](https://github.com/tree-sitter/tree-sitter-ruby) | unstable | `HFIJL` | @TravonteD
[runescript](https://github.com/2004Scape/tree-sitter-runescript) | unstable | `H  J ` | @2004Scape
[rust](https://github.com/tree-sitter/tree-sitter-rust) | unstable | `HFIJL` | @amaanq
[scala](https://github.com/tree-sitter/tree-sitter-scala) | unstable | `HF JL` | @stevanmilic
[scfg](https://github.com/rockorager/tree-sitter-scfg) | unstable | `H  J ` | @WhyNotHugo
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J ` |
[scss](https://github.com/serenadeai/tree-sitter-scss) | unstable | `HFIJ ` | @elianiva
[sflog](https://github.com/aheber/tree-sitter-sfapex)[^sflog] | unstable | `H    ` | @aheber, @xixiaofinland
[slang](https://github.com/tree-sitter-grammars/tree-sitter-slang)[^slang] | unstable | `HFIJL` | @theHamsta
[slim](https://github.com/theoo/tree-sitter-slim) | unstable | `HFIJL` | @theoo
[slint](https://github.com/slint-ui/tree-sitter-slint) | unstable | `HFIJL` | @hunger
[smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) | unstable | `HFIJL` | @amaanq
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | unstable | `H  J ` | @amaanq, @keynmol
[snakemake](https://github.com/osthomas/tree-sitter-snakemake) | unstable | `HFIJL` | @osthomas
[snl](https://github.com/minijackson/tree-sitter-snl)[^snl] | unstable | `HFIJL` | @minijackson
[solidity](https://github.com/JoranHonig/tree-sitter-solidity) | unstable | `HF J ` | @amaanq
[soql](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | @aheber, @xixiafinland
[sosl](https://github.com/aheber/tree-sitter-sfapex) | unstable | `H    ` | @aheber, @xixiafinland
[sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) | unstable | `H  JL` | @Sarrus1
[sparql](https://github.com/GordianDziwis/tree-sitter-sparql) | unstable | `HFIJL` | @GordianDziwis
[sproto](https://github.com/hanxi/tree-sitter-sproto) | unstable | `HFIJ ` | @hanxi
[sql](https://github.com/derekstride/tree-sitter-sql) | unstable | `HFIJ ` | @derekstride
[squirrel](https://github.com/tree-sitter-grammars/tree-sitter-squirrel) | unstable | `HFIJL` | @amaanq
[ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | @ObserverOfTime
[starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | unstable | `HFIJL` | @amaanq
[strace](https://github.com/sigmaSd/tree-sitter-strace) | unstable | `H  J ` | @amaanq
[styled](https://github.com/mskelton/tree-sitter-styled) | unstable | `HFIJ ` | @mskelton
[supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | unstable | `HFIJL` | @madskjeldgaard, @elgiano
[superhtml](https://github.com/kristoff-it/superhtml) | unstable | `H  J ` | @rockorager
[surface](https://github.com/connorlay/tree-sitter-surface) | unstable | `HFIJ ` | @connorlay
[svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) | unstable | `HFIJL` | @amaanq
[sway](https://github.com/FuelLabs/tree-sitter-sway.git) | unstable | `HFIJL` | @ribru17
[swift](https://github.com/alex-pinkus/tree-sitter-swift) | unstable | `HFIJL` | @alex-pinkus
[sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) | unstable | `HF J ` | @RaafatTurki
[systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) | unstable | `HF JL` | @ok-ryoko
[systemverilog](https://github.com/gmlarumbe/tree-sitter-systemverilog) | unstable | `HF J ` | @zhangwwpeng
[t32](https://github.com/xasc/tree-sitter-t32) | unstable | `HFIJL` | @xasc
[tablegen](https://github.com/tree-sitter-grammars/tree-sitter-tablegen) | unstable | `HFIJL` | @amaanq
[tact](https://github.com/tact-lang/tree-sitter-tact) | unstable | `HFIJL` | @novusnota
[tcl](https://github.com/tree-sitter-grammars/tree-sitter-tcl) | unstable | `HFIJ ` | @lewis6991
[teal](https://github.com/euclidianAce/tree-sitter-teal) | unstable | `HFIJL` | @euclidianAce
[templ](https://github.com/vrischmann/tree-sitter-templ) | unstable | `HF J ` | @vrischmann
[tera](https://github.com/uncenter/tree-sitter-tera) | unstable | `H  J ` | @uncenter
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | unstable | `HFIJ ` | @MichaHoffmann
[textproto](https://github.com/PorterAtGoogle/tree-sitter-textproto) | unstable | `HFIJ ` | @Porter
[thrift](https://github.com/tree-sitter-grammars/tree-sitter-thrift) | unstable | `HFIJL` | @amaanq, @duskmoon314
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | unstable | `HFIJL` | @ambroisie
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | unstable | `HF JL` | @ahelwer, @susliko
[tmux](https://github.com/Freed-Wu/tree-sitter-tmux) | unstable | `H  J ` | @Freed-Wu, @stevenxxiu
[todotxt](https://github.com/arnarg/tree-sitter-todotxt) | unstable | `H    ` | @arnarg
[toml](https://github.com/tree-sitter-grammars/tree-sitter-toml) | unstable | `HFIJL` | @tk-shirasaka
[tsv](https://github.com/tree-sitter-grammars/tree-sitter-csv) | unstable | `H    ` | @amaanq
[tsx](https://github.com/tree-sitter/tree-sitter-typescript) | unstable | `HFIJL` | @steelsojka
[turtle](https://github.com/GordianDziwis/tree-sitter-turtle) | unstable | `HFIJL` | @GordianDziwis
[twig](https://github.com/gbprod/tree-sitter-twig) | unstable | `H  J ` | @gbprod
[typescript](https://github.com/tree-sitter/tree-sitter-typescript) | unstable | `HFIJL` | @steelsojka
[typespec](https://github.com/happenslol/tree-sitter-typespec) | unstable | `H IJ ` | @happenslol
[typoscript](https://github.com/Teddytrombone/tree-sitter-typoscript) | unstable | `HFIJ ` | @Teddytrombone
[typst](https://github.com/uben0/tree-sitter-typst) | unstable | `HFIJ ` | @uben0, @RaafatTurki
[udev](https://github.com/tree-sitter-grammars/tree-sitter-udev) | unstable | `H  JL` | @ObserverOfTime
[ungrammar](https://github.com/tree-sitter-grammars/tree-sitter-ungrammar) | unstable | `HFIJL` | @Philipp-M, @amaanq
[unison](https://github.com/kylegoetz/tree-sitter-unison) | unstable | `HF J ` | @tapegram
[usd](https://github.com/ColinKennedy/tree-sitter-usd) | unstable | `HFIJL` | @ColinKennedy
[uxntal](https://github.com/tree-sitter-grammars/tree-sitter-uxntal) | unstable | `HFIJL` | @amaanq
[v](https://github.com/vlang/v-analyzer) | unstable | `HFIJL` | @kkharji, @amaanq
[vala](https://github.com/vala-lang/tree-sitter-vala) | unstable | `HF J ` | @Prince781
[vento](https://github.com/ventojs/tree-sitter-vento) | unmaintained | `H  J ` |
[vhdl](https://github.com/jpt13653903/tree-sitter-vhdl) | unstable | `HF J ` | @jpt13653903
[vhs](https://github.com/charmbracelet/tree-sitter-vhs) | unstable | `H  J ` | @caarlos0
[vim](https://github.com/tree-sitter-grammars/tree-sitter-vim) | unstable | `HF JL` | @clason
[vimdoc](https://github.com/neovim/tree-sitter-vimdoc) | unstable | `H  J ` | @clason
[vrl](https://github.com/belltoy/tree-sitter-vrl) | unstable | `HFIJL` | @belltoy
[vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) | unstable | `HFIJ ` | @WhyNotHugo, @lucario387
[wgsl](https://github.com/szebniok/tree-sitter-wgsl) | unstable | `HFIJ ` | @szebniok
[wgsl_bevy](https://github.com/tree-sitter-grammars/tree-sitter-wgsl-bevy) | unstable | `HFI  ` | @theHamsta
[wing](https://github.com/winglang/tree-sitter-wing) | unstable | `HF JL` | @gshpychka, @MarkMcCulloh
[wit](https://github.com/bytecodealliance/tree-sitter-wit) | stable | `HF J ` | @mkatychev
[wxml](https://github.com/BlockLune/tree-sitter-wxml) | unstable | `HFIJ ` | @BlockLune
[xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H  JL` | @ObserverOfTime
[xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | @ObserverOfTime
[xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | stable | `HF JL` | @ValdezFOmar
[yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) | unstable | `HFIJL` | @amaanq
[yang](https://github.com/Hubro/tree-sitter-yang) | unstable | `HFIJ ` | @Hubro
[yuck](https://github.com/tree-sitter-grammars/tree-sitter-yuck) | unstable | `HFIJL` | @Philipp-M, @amaanq
[zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) | unstable | `H  J ` | @Freed-Wu
[zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) | unstable | `HFIJL` | @amaanq
[ziggy](https://github.com/kristoff-it/ziggy) | unmaintained | `H I  ` |
[ziggy_schema](https://github.com/kristoff-it/ziggy) | unmaintained | `H I  ` |
[zsh](https://github.com/georgeharker/tree-sitter-zsh) | unstable | `HF JL` | @georgeharker
[^bp]: Android Blueprint
[^ecma]: queries required by javascript, typescript, tsx, qmljs
[^gap]: GAP system
[^gaptst]: GAP system test files
[^gdscript]: Godot
[^glimmer]: Glimmer and Ember
[^godot_resource]: Godot Resources
[^html_tags]: queries required by html, astro, vue, svelte
[^jinja]: basic highlighting
[^jinja_inline]: needed for full highlighting
[^jsx]: queries required by javascript, tsx
[^luap]: Lua patterns
[^markdown]: basic highlighting
[^markdown_inline]: needed for full highlighting
[^php]: PHP with embedded HTML
[^php_only]: PHP without embedded HTML
[^poe_filter]: Path of Exile item filter
[^properties]: Java properties files
[^query]: Tree-sitter query language
[^sflog]: Salesforce debug log
[^slang]: Shader Slang
[^snl]: EPICS Sequencer's SNL files
<!--parserinfo-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,27 +0,0 @@
function! nvim_treesitter#statusline(...) abort
return luaeval("require'nvim-treesitter.statusline'.statusline(_A)", get(a:, 1, {}))
endfunction
function! nvim_treesitter#foldexpr() abort
return luaeval(printf('require"nvim-treesitter.fold".get_fold_indic(%d)', v:lnum))
endfunction
function! nvim_treesitter#installable_parsers(arglead, cmdline, cursorpos) abort
return join(luaeval("require'nvim-treesitter.parsers'.available_parsers()") + ['all'], "\n")
endfunction
function! nvim_treesitter#installed_parsers(arglead, cmdline, cursorpos) abort
return join(luaeval("require'nvim-treesitter.info'.installed_parsers()") + ['all'], "\n")
endfunction
function! nvim_treesitter#available_modules(arglead, cmdline, cursorpos) abort
return join(luaeval("require'nvim-treesitter.configs'.available_modules()"), "\n")
endfunction
function! nvim_treesitter#available_query_groups(arglead, cmdline, cursorpos) abort
return join(luaeval("require'nvim-treesitter.query'.available_query_groups()"), "\n")
endfunction
function! nvim_treesitter#indent() abort
return luaeval(printf('require"nvim-treesitter.indent".get_indent(%d)', v:lnum))
endfunction

View file

@ -1,6 +1,4 @@
*nvim-treesitter* Treesitter configurations and abstraction layer for Neovim.
Minimum version of neovim: nightly
*nvim-treesitter.txt* Treesitter parser and query installer for Neovim
Authors:
Kiyan Yazdani <yazdani.kiyan@protonmail.com>
@ -13,470 +11,179 @@ Authors:
Type |gO| to see the table of contents.
==============================================================================
INTRODUCTION *nvim-treesitter-intro*
INTRODUCTION *nvim-treesitter-intro*
nvim-treesitter wraps the Neovim treesitter API to provide functionalities
such as highlighting and incremental selection, and a command to easily
install parsers.
Nvim-treesitter provides functionalities for managing treesitter parsers and
compatible queries for core features (highlighting, injections, folds,
indents).
==============================================================================
QUICK START *nvim-treesitter-quickstart*
QUICK START *nvim-treesitter-quickstart*
Install the parser for your language
>
:TSInstall {language}
<
To get a list of supported languages
>
:TSInstallInfo
<
By default, everything is disabled.
To enable supported features, put this in your `init.lua` file:
>
require'nvim-treesitter.configs'.setup {
-- A directory to install the parsers into.
-- If this is excluded or nil parsers are installed
-- to either the package dir, or the "site" dir.
-- If a custom path is used (not nil) it must be added to the runtimepath.
parser_install_dir = "/some/path/to/store/parsers",
-- A list of parser names, or "all"
ensure_installed = { "c", "lua", "rust" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
auto_install = false,
-- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" },
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
disable = { "c", "rust" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
To configure `nvim-treesitter`, put this in your `init.lua` file:
>lua
require'nvim-treesitter'.setup {
-- A directory to install the parsers and queries to.
-- Defaults to the `stdpath('data')/site` dir.
install_dir = "/some/path/to/store/parsers",
}
vim.opt.runtimepath:append("/some/path/to/store/parsers")
NOTE: You do not need to call `setup` to use this plugin with the default
settings!
Parsers and queries can then be installed with >lua
require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' }
<
To check installed parsers and queries, use `:checkhealth nvim-treesitter`.
See |nvim-treesitter-modules| for a list of all available modules and its options.
==============================================================================
MODULES *nvim-treesitter-modules*
|nvim-treesitter| provides several functionalities via modules (and submodules),
each module makes use of the query files defined for each language,
All modules are disabled by default, and some provide default keymaps.
Each module corresponds to an entry in the dictionary passed to the
`nvim-treesitter.configs.setup` function, this should be in your `init.lua` file.
>
require'nvim-treesitter.configs'.setup {
-- Modules and its options go here
highlight = { enable = true },
incremental_selection = { enable = true },
textobjects = { enable = true },
}
<
All modules share some common options, like `enable` and `disable`.
When `enable` is `true` this will enable the module for all supported languages,
if you want to disable the module for some languages you can pass a list to the `disable` option.
>
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
disable = { "cpp", "lua" },
},
}
<
For more fine-grained control, `disable` can also take a function and
whenever it returns `true`, the module is disabled for that buffer.
The function is called once when a module starts in a buffer and receives the
language and buffer number as arguments:
>
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
disable = function(lang, bufnr) -- Disable in large C++ buffers
return lang == "cpp" and vim.api.nvim_buf_line_count(bufnr) > 50000
end,
},
}
<
Options that define or accept a keymap use the same format you use to define
keymaps in Neovim, so you can write keymaps as `gd`, `<space>a`, `<leader>a`
`<C-a>` (control + a), `<A-n>` (alt + n), `<CR>` (enter), etc.
External plugins can provide their own modules with their own options,
those can also be configured using the `nvim-treesitter.configs.setup`
function.
------------------------------------------------------------------------------
HIGHLIGHT *nvim-treesitter-highlight-mod*
Consistent syntax highlighting.
Query files: `highlights.scm`.
Supported options:
- enable: `true` or `false`.
- disable: list of languages.
- additional_vim_regex_highlighting: `true` or `false`, or a list of languages.
Set this to `true` if you depend on 'syntax' being enabled
(like for indentation). Using this option may slow down your editor,
and you may see some duplicate highlights.
Defaults to `false`.
>
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
custom_captures = {
-- Highlight the @foo.bar capture group with the "Identifier" highlight group.
["foo.bar"] = "Identifier",
},
-- Setting this to true or a list of languages will run `:h syntax` and tree-sitter at the same time.
additional_vim_regex_highlighting = false,
},
}
<
You can also set custom highlight captures
>
lua <<EOF
require"nvim-treesitter.highlight".set_custom_captures {
-- Highlight the @foo.bar capture group with the "Identifier" highlight group.
["foo.bar"] = "Identifier",
}
EOF
<
Note: The api is not stable yet.
------------------------------------------------------------------------------
INCREMENTAL SELECTION *nvim-treesitter-incremental-selection-mod*
Incremental selection based on the named nodes from the grammar.
Query files: `locals.scm`.
Supported options:
- enable: `true` or `false`.
- disable: list of languages.
- keymaps:
- init_selection: in normal mode, start incremental selection.
Defaults to `gnn`.
- node_incremental: in visual mode, increment to the upper named parent.
Defaults to `grn`.
- scope_incremental: in visual mode, increment to the upper scope
(as defined in `locals.scm`). Defaults to `grc`.
- node_decremental: in visual mode, decrement to the previous named node.
Defaults to `grm`.
>
require'nvim-treesitter.configs'.setup {
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
<
------------------------------------------------------------------------------
INDENTATION *nvim-treesitter-indentation-mod*
Indentation based on treesitter for the |=| operator.
NOTE: this is an experimental feature.
Query files: `indents.scm`.
Supported options:
- enable: `true` or `false`.
- disable: list of languages.
>
require'nvim-treesitter.configs'.setup {
indent = {
enable = true
},
}
Treesitter features for installed languages need to be enabled manually in a
|FileType| autocommand or |ftplugin|, e.g. >lua
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'rust', 'javascript', 'zig' },
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = 'expr'
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
<
==============================================================================
COMMANDS *nvim-treesitter-commands*
COMMANDS *nvim-treesitter-commands*
*:TSInstall*
:TSInstall {language} ...~
:TSInstall {language} *:TSInstall*
Install one or more treesitter parsers.
You can use |:TSInstall| `all` to install all parsers. Use |:TSInstall!| to
force the reinstallation of already installed parsers.
*:TSInstallSync*
:TSInstallSync {language} ...~
Install one or more treesitter parsers. {language} can be one or multiple
parsers or tiers (`stable`, `unstable`, or `all` (not recommended)). This is a
no-op if the parser(s) are already installed. Installation is performed
asynchronously. Use *:TSInstall!* to force installation even if a parser is
already installed.
Perform the |:TSInstall| operation synchronously.
:TSInstallFromGrammar {language} *:TSInstallFromGrammar*
*:TSInstallInfo*
:TSInstallInfo~
Like |:TSInstall| but also regenerates the `parser.c` from the original
grammar. Useful for languages where the provided `parser.c` is outdated (e.g.,
uses a no longer supported ABI).
List information about currently installed parsers
:TSUpdate [{language}] *:TSUpdate*
*:TSUpdate*
:TSUpdate {language} ...~
Update parsers to the `revision` specified in the manifest if this is newer
than the installed version. If {language} is specified, update the
corresponding parser or tier; otherwise update all installed parsers. This is
a no-op if all (specified) parsers are up to date.
Update the installed parser for one more {language} or all installed parsers
if {language} is omitted. The specified parser is installed if it is not already
installed.
Note: It is recommended to add this command as a build step in your plugin
manager.
*:TSUpdateSync*
:TSUpdateSync {language} ...~
:TSUninstall {language} *:TSUninstall*
Perform the |:TSUpdate| operation synchronously.
Deletes the parser for one or more {language}, or all parsers with `all`.
*:TSUninstall*
:TSUninstall {language} ...~
:TSLog *:TSLog*
Deletes the parser for one or more {language}. You can use 'all' for language
to uninstall all parsers.
*:TSBufEnable*
:TSBufEnable {module}~
Enable {module} on the current buffer.
A list of modules can be found at |:TSModuleInfo|
*:TSBufDisable*
:TSBufDisable {module}~
Disable {module} on the current buffer.
A list of modules can be found at |:TSModuleInfo|
*:TSBufToggle*
:TSBufToggle {module}~
Toggle (enable if disabled, disable if enabled) {module} on the current
buffer.
A list of modules can be found at |:TSModuleInfo|
*:TSEnable*
:TSEnable {module} [{language}]~
Enable {module} for the session.
If {language} is specified, enable module for the session only for this
particular language.
A list of modules can be found at |:TSModuleInfo|
A list of languages can be found at |:TSInstallInfo|
*:TSDisable*
:TSDisable {module} [{language}]~
Disable {module} for the session.
If {language} is specified, disable module for the session only for this
particular language.
A list of modules can be found at |:TSModuleInfo|
A list of languages can be found at |:TSInstallInfo|
*:TSToggle*
:TSToggle {module} [{language}]~
Toggle (enable if disabled, disable if enabled) {module} for the session.
If {language} is specified, toggle module for the session only for this
particular language.
A list of modules can be found at |:TSModuleInfo|
A list of languages can be found at |:TSInstallInfo|
*:TSModuleInfo*
:TSModuleInfo [{module}]~
List the state for the given module or all modules for the current session in
a new buffer.
These highlight groups are used by default:
>
highlight default TSModuleInfoGood guifg=LightGreen gui=bold
highlight default TSModuleInfoBad guifg=Crimson
highlight default link TSModuleInfoHeader Type
highlight default link TSModuleInfoNamespace Statement
highlight default link TSModuleInfoParser Identifier
<
*:TSEditQuery*
:TSEditQuery {query-group} [{lang}]~
Edit the query file for a {query-group} (e.g. highlights, locals) for given
{lang}. If there are multiple the user is prompted to select one of them.
If no such file exists, a buffer for a new file in the user's config directory
is created. If {lang} is not specified, the language of the current buffer
is used.
*:TSEditQueryUserAfter*
:TSEditQueryUserAfter {query-group} [{lang}]~
Same as |:TSEditQuery| but edits a file in the `after` directory of the
user's config directory. Useful to add custom extensions for the queries
provided by a plugin.
Shows all messages from previous install, update, or uninstall operations.
==============================================================================
UTILS *nvim-treesitter-utils*
API *nvim-treesitter-api*
Nvim treesitter has some wrapper functions that you can retrieve with:
>
local ts_utils = require 'nvim-treesitter.ts_utils'
setup({opts}) *nvim-treesitter.setup()*
Configure installation options. Needs to be specified before any
installation operation.
Note: You only need to call `setup` if you want to set non-default
options!
Parameters: ~
• {opts} `(table?)` Optional parameters:
• {install_dir} (`string?`, default `stdpath('data')/site/`)
directory to install parsers and queries to. Note: will be
prepended to |runtimepath|.
install({languages} [, {opts}]) *nvim-treesitter.install()*
Download, compile, and install the specified treesitter parsers and copy
the corresponding queries to a directory on |runtimepath|, enabling their
use in Neovim.
Note: This operation is performed asynchronously by default. For
synchronous operation (e.g., in a bootstrapping script), you need to
`wait()` for it: >lua
require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' })
:wait(300000) -- max. 5 minutes
<
Methods
*ts_utils.get_node_at_cursor*
get_node_at_cursor(winnr)~
Parameters: ~
• {languages} `(string[]|string)` (List of) languages or tiers (`stable`,
`unstable`) to install.
• {opts} `(table?)` Optional parameters:
• {force} (`boolean?`, default `false`) force installation
of already installed parsers
• {generate} (`boolean?`, default `false`) generate
`parser.c` from `grammar.json` or `grammar.js` before
compiling.
• {max_jobs} (`integer?`) limit parallel tasks (useful in
combination with {generate} on memory-limited systems).
• {summary} (`boolean?`, default `false`) print summary of
successful and total operations for multiple languages.
`winnr` will be 0 if nil.
Returns the node under the cursor.
uninstall({languages} [, {opts}]) *nvim-treesitter.uninstall()*
*ts_utils.is_parent*
is_parent(dest, source)~
Remove the parser and queries for the specified language(s).
Determines whether `dest` is a parent of `source`.
Returns a boolean.
Parameters: ~
• {languages} `(string[]|string)` (List of) languages or tiers (`stable`,
`unstable`) to update.
• {opts} `(table?)` Optional parameters:
• {summary} (`boolean?`, default `false`) print summary of
successful and total operations for multiple languages.
*ts_utils.get_named_children*
get_named_children(node)~
update([{languages}, {opts}]) *nvim-treesitter.update()*
Returns a table of named children of `node`.
Update the parsers and queries if older than the revision specified in the
manifest.
*ts_utils.get_next_node*
get_next_node(node, allow_switch_parent, allow_next_parent)~
Returns the next node within the same parent.
If no node is found, returns `nil`.
If `allow_switch_parent` is true, it will allow switching parent
when the node is the last node.
If `allow_next_parent` is true, it will allow next parent if
the node is the last node and the next parent doesn't have children.
*ts_utils.get_previous_node*
get_previous_node(node, allow_switch_parents, allow_prev_parent)~
Returns the previous node within the same parent.
`allow_switch_parent` and `allow_prev_parent` follow the same rule
as |ts_utils.get_next_node| but if the node is the first node.
*ts_utils.goto_node*
goto_node(node, goto_end, avoid_set_jump)~
Sets cursor to the position of `node` in the current windows.
If `goto_end` is truthy, the cursor is set to the end the node range.
Setting `avoid_set_jump` to `true`, avoids setting the current cursor position
to the jump list.
*ts_utils.swap_nodes*
swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second)~
Swaps the nodes or ranges.
set `cursor_to_second` to true to move the cursor to the second node
*ts_utils.memoize_by_buf_tick*
memoize_by_buf_tick(fn, options)~
Caches the return value for a function and returns the cache value if the tick
of the buffer has not changed from the previous.
`fn`: a function that takes any arguments
and returns a value to store.
`options?`: <table>
- `bufnr`: a function/value that extracts the bufnr from the given arguments.
- `key`: a function/value that extracts the cache key from the given arguments.
`returns`: a function to call with bufnr as argument to
retrieve the value from the cache
*ts_utils.node_to_lsp_range*
node_to_lsp_range(node)~
Get an lsp formatted range from a node range
*ts_utils.node_length*
node_length(node)~
Get the byte length of node range
*ts_utils.update_selection*
update_selection(buf, node)~
Set the selection to the node range
*ts_utils.highlight_range*
highlight_range(range, buf, hl_namespace, hl_group)~
Set a highlight that spans the given range
*ts_utils.highlight_node*
highlight_node(node, buf, hl_namespace, hl_group)~
Set a highlight that spans the given node's range
==============================================================================
FUNCTIONS *nvim-treesitter-functions*
*nvim_treesitter#statusline()*
nvim_treesitter#statusline(opts)~
Returns a string describing the current position in the file. This
could be used as a statusline indicator.
Default options (lua syntax):
>
{
indicator_size = 100,
type_patterns = {'class', 'function', 'method'},
transform_fn = function(line) return line:gsub('%s*[%[%(%{]*%s*$', '') end,
separator = ' -> '
}
Note: This operation is performed asynchronously by default. For
synchronous operation (e.g., in a bootstrapping script), you need to
`wait()` for it: >lua
require('nvim-treesitter').update():wait(300000) -- max. 5 minutes
<
- `indicator_size` - How long should the string be. If longer, it is cut from
the beginning.
- `type_patterns` - Which node type patterns to match.
- `transform_fn` - Function used to transform the single item in line. By
default removes opening brackets and spaces from end.
- `separator` - Separator between nodes.
Parameters: ~
• {languages} `(string[]|string)?` (List of) languages or tiers to update
(default: all installed).
• {opts} `(table?)` Optional parameters:
• {max_jobs} (`integer?`) limit parallel tasks (useful in
combination with {generate} on memory-limited systems).
• {summary} (`boolean?`, default `false`) print summary of
successful and total operations for multiple languages.
*nvim_treesitter#foldexpr()*
nvim_treesitter#foldexpr()~
indentexpr() *nvim-treesitter.indentexpr()*
Functions to be used to determine the fold level at a given line number.
To use it: >
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
Used to enable treesitter indentation for a language via >lua
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
<
get_available([{tier}]) *nvim-treesitter.get_available()*
This will respect your 'foldminlines' and 'foldnestmax' settings.
Return list of languages available for installation.
Note: This is highly experimental, and folding can break on some types of
edits. If you encounter such breakage, hiting `zx` should fix folding.
In any case, feel free to open an issue with the reproducing steps.
Parameters: ~
• {tier} `(integer?)` Only return languages of specified {tier} (`1`:
stable, `2`: unstable, `3`: unmaintained, `4`: unsupported)
==============================================================================
PERFORMANCE *nvim-treesitter-performance*
get_installed([{type}]) *nvim-treesitter.get_installed()*
`nvim-treesitter` checks the 'runtimepath' on startup in order to discover
available parsers and queries and index them. As a consequence, a very long
'runtimepath' might result in delayed startup times.
Return list of languages installed via `nvim-treesitter`.
Note: This only searches `nvim-treesitter`'s (configured or default)
installation directory; parsers and queries from other sources can be
placed anywhere on 'runtimepath' and are not included. To list all, e.g.,
parsers that are installed from any source, use >lua
vim.api.nvim_get_runtime_file('parser/*', true)
<
Parameters: ~
• {type} `('queries'|parsers'?)` If specified, only show languages with
installed queries or parsers, respectively.
vim:tw=78:ts=8:expandtab:noet:ft=help:norl:

View file

@ -1,488 +0,0 @@
{
"ada": {
"revision": "42cc2eb141529b03a91c18ec8646a0a58fb111ba"
},
"agda": {
"revision": "80ea622cf952a0059e168e5c92a798b2f1925652"
},
"arduino": {
"revision": "257efffa387da3283a37816b71dedfecf4af5222"
},
"astro": {
"revision": "a1f66bf72ed68b87f779bce9a52e5c6521fc867e"
},
"awk": {
"revision": "e559793754c60c2cdf00cbb0409842d75f0a41dc"
},
"bash": {
"revision": "7f9506c34ab6a0f4e3e052b7a49cbeef91f71236"
},
"beancount": {
"revision": "f3741a3a68ade59ec894ed84a64673494d2ba8f3"
},
"bibtex": {
"revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34"
},
"blueprint": {
"revision": "6ef91ca8270f0112b9c6d27ecb9966c741a5d103"
},
"c": {
"revision": "f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2"
},
"c_sharp": {
"revision": "5b6c4d0d19d79b05c69ad752e11829910e3b4610"
},
"capnp": {
"revision": "fc6e2addf103861b9b3dffb82c543eb6b71061aa"
},
"chatito": {
"revision": "3baf22e7e507cedf15d1dbc03df8afa50a625586"
},
"clojure": {
"revision": "262d6d60f39f0f77b3dd08da8ec895bd5a044416"
},
"cmake": {
"revision": "399605a02bcd5daa309ce63a6459c600dce3473f"
},
"comment": {
"revision": "a37ca370310ac6f89b6e0ebf2b86b2219780494e"
},
"commonlisp": {
"revision": "c7e814975ab0d0d04333d1f32391c41180c58919"
},
"cooklang": {
"revision": "5e113412aadb78955c27010daa4dbe1d202013cf"
},
"cpon": {
"revision": "b894a70f883d2cb7505b87a9d84a189fe8cd1982"
},
"cpp": {
"revision": "66262d3e76eb2046c76e6d661a6b72664bfb5819"
},
"css": {
"revision": "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51"
},
"cuda": {
"revision": "9b1f7481a151686fce8af66da147f40388f8ee4d"
},
"d": {
"revision": "c2fbf21bd3aa45495fe13247e040ad5815250032"
},
"dart": {
"revision": "53485a8f301254e19c518aa20c80f1bcf7cf5c62"
},
"devicetree": {
"revision": "ea30a05d0f0446a96d8b096ad11828ad4f8ad849"
},
"dhall": {
"revision": "affb6ee38d629c9296749767ab832d69bb0d9ea8"
},
"diff": {
"revision": "f69bde8e56f431863eba2fe4bab23e7d9692855f"
},
"dockerfile": {
"revision": "8ee3a0f7587b2bd8c45c8cb7d28bd414604aec62"
},
"dot": {
"revision": "9ab85550c896d8b294d9b9ca1e30698736f08cea"
},
"ebnf": {
"revision": "8e635b0b723c620774dfb8abf382a7f531894b40"
},
"eex": {
"revision": "f742f2fe327463335e8671a87c0b9b396905d1d1"
},
"elixir": {
"revision": "b20eaa75565243c50be5e35e253d8beb58f45d56"
},
"elm": {
"revision": "28bb193640d916dfaf947912c1413cebb0484841"
},
"elsa": {
"revision": "0a66b2b3f3c1915e67ad2ef9f7dbd2a84820d9d7"
},
"elvish": {
"revision": "f32711e31e987fd5c2c002f3daba02f25c68672f"
},
"embedded_template": {
"revision": "203f7bd3c1bbfbd98fc19add4b8fcb213c059205"
},
"erlang": {
"revision": "2422bc9373094bfa97653ac540e08759f812523c"
},
"fennel": {
"revision": "517195970428aacca60891b050aa53eabf4ba78d"
},
"fish": {
"revision": "f9176908c9eb2e11eb684d79e1d00f3b29bd65c9"
},
"foam": {
"revision": "c238f4af9a5723a212cf1a4c9b31dd5c1d5270a2"
},
"fortran": {
"revision": "67cf1c96fd0dd92edd7812a95626c86c9be0781a"
},
"fsh": {
"revision": "fa3347712f7a59ed02ccf508284554689c6cde28"
},
"func": {
"revision": "f161cfe22452b386eeeab29ba0d2c14893f1a31f"
},
"fusion": {
"revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
},
"gdscript": {
"revision": "31ebb7cd0b880ea53a152eaf9d4df73f737181cc"
},
"git_rebase": {
"revision": "d8a4207ebbc47bd78bacdf48f883db58283f9fd8"
},
"gitattributes": {
"revision": "577a075d46ea109905c5cb6179809df88da61ce9"
},
"gitcommit": {
"revision": "f71b93f399c9c2b315825827c95466e7405ec622"
},
"gitignore": {
"revision": "f4685bf11ac466dd278449bcfe5fd014e94aa504"
},
"gleam": {
"revision": "cfcbca3f8f734773878e00d7bfcedea98eb10be2"
},
"glimmer": {
"revision": "40cfb72a53654cbd666451ca04ffd500257c7b73"
},
"glsl": {
"revision": "e2c2214045de2628b81089b1a739962f59654558"
},
"go": {
"revision": "64457ea6b73ef5422ed1687178d4545c3e91334a"
},
"godot_resource": {
"revision": "b6ef0768711086a86b3297056f9ffb5cc1d77b4a"
},
"gomod": {
"revision": "4a65743dbc2bb3094114dd2b43da03c820aa5234"
},
"gosum": {
"revision": "14da5c2a34861eb2d97ed89f39324156031e8878"
},
"gowork": {
"revision": "949a8a470559543857a62102c84700d291fc984c"
},
"graphql": {
"revision": "5e66e961eee421786bdda8495ed1db045e06b5fe"
},
"hack": {
"revision": "b7bd6928532ada34dddb1dece4a158ab62c6e783"
},
"haskell": {
"revision": "3bdba07c7a8eec23f87fa59ce9eb2ea4823348b3"
},
"hcl": {
"revision": "0ff887f2a60a147452d52db060de6b42f42f1441"
},
"heex": {
"revision": "2e1348c3cf2c9323e87c2744796cf3f3868aa82a"
},
"help": {
"revision": "8f75ef3ec86bc315d5fdb939899b397289389181"
},
"hjson": {
"revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0"
},
"hlsl": {
"revision": "18f2dcb5f65075457638658c4763672e826dcddf"
},
"hocon": {
"revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc"
},
"html": {
"revision": "29f53d8f4f2335e61bf6418ab8958dac3282077a"
},
"htmldjango": {
"revision": "b2dba02eddab66be669022320273d0dfe1ff923d"
},
"http": {
"revision": "2c6c44574031263326cb1e51658bbc0c084326e7"
},
"ini": {
"revision": "1a0ce072ebf3afac7d5603d9a95bb7c9a6709b44"
},
"java": {
"revision": "3c24aa9365985830421a3a7b6791b415961ea770"
},
"javascript": {
"revision": "266455e22fc54f0add4dd2404ebe307d4d65deae"
},
"jq": {
"revision": "13990f530e8e6709b7978503da9bc8701d366791"
},
"jsdoc": {
"revision": "189a6a4829beb9cdbe837260653b4a3dfb0cc3db"
},
"json": {
"revision": "73076754005a460947cafe8e03a8cf5fa4fa2938"
},
"json5": {
"revision": "5dd5cdc418d9659682556b6adca2dd9ace0ac6d2"
},
"jsonc": {
"revision": "02b01653c8a1c198ae7287d566efa86a135b30d5"
},
"jsonnet": {
"revision": "fdc775714afa27fdef823adbaba6ab98f5ae66f2"
},
"julia": {
"revision": "e2f449e2bcc95f1d07ceb62d67f986005f73a6be"
},
"kdl": {
"revision": "c3c4856464842e05366b1f3ebc4434c9194cad43"
},
"kotlin": {
"revision": "e4637037a5fe6f25fe66c305669faa0855f35692"
},
"lalrpop": {
"revision": "7744b56f03ac1e5643fad23c9dd90837fe97291e"
},
"latex": {
"revision": "6b7ea839307670e6bda011f888717d3a882ecc09"
},
"ledger": {
"revision": "f787ae635ca79589faa25477b94291a87e2d3e23"
},
"llvm": {
"revision": "e9948edc41e9e5869af99dddb2b5ff5cc5581af6"
},
"lua": {
"revision": "0fc89962b7ff5c7d676b8592c1cbce1ceaa806fd"
},
"m68k": {
"revision": "d097b123f19c6eaba2bf181c05420d88b9fc489d"
},
"make": {
"revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
},
"markdown": {
"revision": "7e7aa9a25ca9729db9fe22912f8f47bdb403a979"
},
"markdown_inline": {
"revision": "7e7aa9a25ca9729db9fe22912f8f47bdb403a979"
},
"menhir": {
"revision": "db7953acb0d5551f207373c81fa07a57d7b085cb"
},
"mermaid": {
"revision": "d787c66276e7e95899230539f556e8b83ee16f6d"
},
"meson": {
"revision": "5f3138d555aceef976ec9a1d4a3f78e13b31e45f"
},
"nickel": {
"revision": "d6c7eeb751038f934b5b1aa7ff236376d0235c56"
},
"ninja": {
"revision": "0a95cfdc0745b6ae82f60d3a339b37f19b7b9267"
},
"nix": {
"revision": "6b71a810c0acd49b980c50fc79092561f7cee307"
},
"norg": {
"revision": "1a305093569632de50f9a316ff843dcda25b4ef5"
},
"ocaml": {
"revision": "f1106bf834703f1f2f795da1a3b5f8f40174ffcc"
},
"ocaml_interface": {
"revision": "f1106bf834703f1f2f795da1a3b5f8f40174ffcc"
},
"ocamllex": {
"revision": "ac1d5957e719d49bd6acd27439b79843e4daf8ed"
},
"org": {
"revision": "081179c52b3e8175af62b9b91dc099d010c38770"
},
"pascal": {
"revision": "9e995404ddff8319631d72d4b46552e737206912"
},
"perl": {
"revision": "749d26fe13fb131b92e6515416096e572575b981"
},
"php": {
"revision": "f860e598194f4a71747f91789bf536b393ad4a56"
},
"phpdoc": {
"revision": "2f4d16c861b5a454b577d057f247f9902d7b47f5"
},
"pioasm": {
"revision": "924aadaf5dea2a6074d72027b064f939acf32e20"
},
"poe_filter": {
"revision": "80dc10195e26c72598ed1ab02cdf2d8e4c792e7b"
},
"prisma": {
"revision": "eca2596a355b1a9952b4f80f8f9caed300a272b5"
},
"proto": {
"revision": "42d82fa18f8afe59b5fc0b16c207ee4f84cb185f"
},
"pug": {
"revision": "884e225b5ecca5d885ae627275f16ef648acd42e"
},
"python": {
"revision": "528855eee2665210e1bf5556de48b8d8dacb8932"
},
"ql": {
"revision": "bd087020f0d8c183080ca615d38de0ec827aeeaf"
},
"qmljs": {
"revision": "ab75be9750e6f2f804638824d1790034286a830c"
},
"query": {
"revision": "0717de07078a20a8608c98ad5f26c208949d0e15"
},
"r": {
"revision": "80efda55672d1293aa738f956c7ae384ecdc31b4"
},
"racket": {
"revision": "1a5df0206b25a05cb1b35a68d2105fc7493df39b"
},
"rasi": {
"revision": "5f04634dd4e12de4574c4a3dc9d6d5d4da4a2a1b"
},
"regex": {
"revision": "e1cfca3c79896ff79842f057ea13e529b66af636"
},
"rego": {
"revision": "b2667c975f07b33be3ceb83bea5cfbad88095866"
},
"rnoweb": {
"revision": "502c1126dc6777f09af5bef16e72a42f75bd081e"
},
"ron": {
"revision": "ce6086b2c9e8e71065b8129d6c2289c5f66d1879"
},
"rst": {
"revision": "25e6328872ac3a764ba8b926aea12719741103f1"
},
"ruby": {
"revision": "206c7077164372c596ffa8eaadb9435c28941364"
},
"rust": {
"revision": "fbf9e507d09d8b3c0bb9dfc4d46c31039a47dc4a"
},
"scala": {
"revision": "2275b754360de8539e02e84106fa38f7cb6de275"
},
"scheme": {
"revision": "67b90a365bebf4406af4e5a546d6336de787e135"
},
"scss": {
"revision": "c478c6868648eff49eb04a4df90d703dc45b312a"
},
"slint": {
"revision": "07547525cdf4627343dca5891f1743ae45e879bb"
},
"smali": {
"revision": "a67a429784dafa0ca4342d71e6530137ca803883"
},
"smithy": {
"revision": "cf8c7eb9faf7c7049839585eac19c94af231e6a0"
},
"solidity": {
"revision": "52ed0880c0126df2f2c7693f215fe6f38e4a2e0a"
},
"sparql": {
"revision": "05f949d3c1c15e3261473a244d3ce87777374dec"
},
"sql": {
"revision": "3a3f92b29c880488a08bc2baaf1aca6432ec3380"
},
"starlark": {
"revision": "2e94347f71147c268a4c5c0ce188be8baf2fce5a"
},
"supercollider": {
"revision": "90c6d9f777d2b8c4ce497c48b5f270a44bcf3ea0"
},
"surface": {
"revision": "f4586b35ac8548667a9aaa4eae44456c1f43d032"
},
"svelte": {
"revision": "52e122ae68b316d3aa960a0a422d3645ba717f42"
},
"swift": {
"revision": "0c32d2948b79939b6464d9ced40fca43912cd486"
},
"sxhkdrc": {
"revision": "440d5f913d9465c9c776a1bd92334d32febcf065"
},
"t32": {
"revision": "f8106fcf5a27f905b3d9d55d9cd3e910bea70c60"
},
"teal": {
"revision": "2158ecce11ea542f9b791baf2c7fb33798174ed2"
},
"terraform": {
"revision": "0ff887f2a60a147452d52db060de6b42f42f1441"
},
"thrift": {
"revision": "e0c3e50e17846230e88becdce28fbb1b41dcabba"
},
"tiger": {
"revision": "a233ebe360a73a92c50978e5c4e9e471bc59ff42"
},
"tlaplus": {
"revision": "6d2ec894aef843fc89312c904e20c5f555aec4e3"
},
"todotxt": {
"revision": "0207f6a4ab6aeafc4b091914d31d8235049a2578"
},
"toml": {
"revision": "8bd2056818b21860e3d756b5a58c4f6e05fb744e"
},
"tsx": {
"revision": "5d20856f34315b068c41edaee2ac8a100081d259"
},
"turtle": {
"revision": "085437f5cb117703b7f520dd92161140a684f092"
},
"twig": {
"revision": "2457993b13a06dec2706e6a6c3d5b65bb23024b8"
},
"typescript": {
"revision": "5d20856f34315b068c41edaee2ac8a100081d259"
},
"v": {
"revision": "136f3a0ad91ab8a781c2d4eb419df0a981839f69"
},
"vala": {
"revision": "8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b"
},
"verilog": {
"revision": "4457145e795b363f072463e697dfe2f6973c9a52"
},
"vhs": {
"revision": "54fe7c05dfa2b9e100572496531e15c9bec86343"
},
"vim": {
"revision": "e39a7bbcfdcfc7900629962b785c7e14503ae590"
},
"vue": {
"revision": "91fe2754796cd8fba5f229505a23fa08f3546c06"
},
"wgsl": {
"revision": "40259f3c77ea856841a4e0c4c807705f3e4a2b65"
},
"wgsl_bevy": {
"revision": "7cd38d6895060b023353e04f7af099ec64add5d1"
},
"yaml": {
"revision": "0e36bed171768908f331ff7dff9d956bae016efb"
},
"yang": {
"revision": "2c0e6be8dd4dcb961c345fa35c309ad4f5bd3502"
},
"zig": {
"revision": "6b3f5788f38be900b45f5af5a753bf6a37d614b8"
}
}

View file

@ -1,22 +0,0 @@
local install = require "nvim-treesitter.install"
local utils = require "nvim-treesitter.utils"
local info = require "nvim-treesitter.info"
local configs = require "nvim-treesitter.configs"
local statusline = require "nvim-treesitter.statusline"
-- Registers all query predicates
require "nvim-treesitter.query_predicates"
local M = {}
function M.setup()
utils.setup_commands("install", install.commands)
utils.setup_commands("info", info.commands)
utils.setup_commands("configs", configs.commands)
configs.init()
end
M.define_modules = configs.define_modules
M.statusline = statusline.statusline
return M

View file

@ -0,0 +1,47 @@
---@meta
error('Cannot require a meta file')
---@class InstallInfo
---
---URL of parser repo (Github)
---@field url string
---
---Commit hash of parser to download (compatible with queries)
---@field revision string
---
---Branch of parser repo to download (if not default branch)
---@field branch? string
---
---Location of `grammar.js` in repo (if not at root, e.g., in a monorepo)
---@field location? string
---
---Repo does not contain a `parser.c`; must be generated from grammar first
---@field generate? boolean
---
---Generate parser from `grammar.json` instead of `grammar.js` (default true)
---@field generate_from_json? boolean
---
---Parser repo is a local directory; overrides `url`, `revision`, and `branch`
---@field path? string
---
---Directory with queries to be installed
---@field queries? string
---@class ParserInfo
---
---Information necessary to build and install the parser (empty for query-only language)
---@field install_info? InstallInfo
---
---List of Github users maintaining the queries for Neovim
---@field maintainers? string[]
---
---List of other languages to install (e.g., if queries inherit from them)
---@field requires? string[]
---
---Language support tier, maps to "stable", "unstable", "unmaintained", "unsupported"
---@field tier integer
---
---Explanatory footnote text to add in SUPPORTED_LANGUAGES.md
---@field readme_note? string
---@alias nvim-ts.parsers table<string,ParserInfo>

736
lua/nvim-treesitter/async.lua vendored Normal file
View file

@ -0,0 +1,736 @@
---@meta nvim-treesitter.async vendored file, don't diagnose
local pcall = copcall or pcall
--- @param ... any
--- @return {[integer]: any, n: integer}
local function pack_len(...)
return { n = select('#', ...), ... }
end
--- like unpack() but use the length set by F.pack_len if present
--- @param t? { [integer]: any, n?: integer }
--- @param first? integer
--- @return ...any
local function unpack_len(t, first)
if t then
return unpack(t, first or 1, t.n or table.maxn(t))
end
end
--- @class async
local M = {}
--- Weak table to keep track of running tasks
--- @type table<thread,async.Task?>
local threads = setmetatable({}, { __mode = 'k' })
--- @return async.Task?
local function running()
local task = threads[coroutine.running()]
if task and not (task:_completed() or task._closing) then
return task
end
end
--- Base class for async tasks. Async functions should return a subclass of
--- this. This is designed specifically to be a base class of uv_handle_t
--- @class async.Handle
--- @field close fun(self: async.Handle, callback?: fun())
--- @field is_closing? fun(self: async.Handle): boolean
--- @alias async.CallbackFn fun(...: any): async.Handle?
--- @class async.Task : async.Handle
--- @field package _callbacks table<integer,fun(err?: any, ...: any)>
--- @field package _callback_pos integer
--- @field private _thread thread
---
--- Tasks can call other async functions (task of callback functions)
--- when we are waiting on a child, we store the handle to it here so we can
--- cancel it.
--- @field private _current_child? async.Handle
---
--- Error result of the task is an error occurs.
--- Must use `await` to get the result.
--- @field private _err? any
---
--- Result of the task.
--- Must use `await` to get the result.
--- @field private _result? any[]
local Task = {}
Task.__index = Task
--- @private
--- @param func function
--- @return async.Task
function Task._new(func)
local thread = coroutine.create(func)
local self = setmetatable({
_closing = false,
_thread = thread,
_callbacks = {},
_callback_pos = 1,
}, Task)
threads[thread] = self
return self
end
--- @param callback fun(err?: any, ...: any)
function Task:await(callback)
if self._closing then
callback('closing')
elseif self:_completed() then -- TODO(lewis6991): test
-- Already finished or closed
callback(self._err, unpack_len(self._result))
else
self._callbacks[self._callback_pos] = callback
self._callback_pos = self._callback_pos + 1
end
end
--- @package
function Task:_completed()
return (self._err or self._result) ~= nil
end
-- Use max 32-bit signed int value to avoid overflow on 32-bit systems.
-- Do not use `math.huge` as it is not interpreted as a positive integer on all
-- platforms.
local MAX_TIMEOUT = 2 ^ 31 - 1
--- Synchronously wait (protected) for a task to finish (blocking)
---
--- If an error is returned, `Task:traceback()` can be used to get the
--- stack trace of the error.
---
--- Example:
--- ```lua
---
--- local ok, err_or_result = task:pwait(10)
---
--- if not ok then
--- error(task:traceback(err_or_result))
--- end
---
--- local _, result = assert(task:pwait(10))
--- ```
---
--- Can be called if a task is closing.
--- @param timeout? integer
--- @return boolean status
--- @return any ... result or error
function Task:pwait(timeout)
local done = vim.wait(timeout or MAX_TIMEOUT, function()
-- Note we use self:_completed() instead of self:await() to avoid creating a
-- callback. This avoids having to cleanup/unregister any callback in the
-- case of a timeout.
return self:_completed()
end)
if not done then
return false, 'timeout'
elseif self._err then
return false, self._err
else
return true, unpack_len(self._result)
end
end
--- Synchronously wait for a task to finish (blocking)
---
--- Example:
--- ```lua
--- local result = task:wait(10) -- wait for 10ms or else error
---
--- local result = task:wait() -- wait indefinitely
--- ```
--- @param timeout? integer Timeout in milliseconds
--- @return any ... result
function Task:wait(timeout)
local res = pack_len(self:pwait(timeout))
local stat = res[1]
if not stat then
error(self:traceback(res[2]))
end
return unpack_len(res, 2)
end
--- @private
--- @param msg? string
--- @param _lvl? integer
--- @return string
function Task:_traceback(msg, _lvl)
_lvl = _lvl or 0
local thread = ('[%s] '):format(self._thread)
local child = self._current_child
if getmetatable(child) == Task then
--- @cast child async.Task
msg = child:_traceback(msg, _lvl + 1)
end
local tblvl = getmetatable(child) == Task and 2 or nil
msg = (msg or '') .. debug.traceback(self._thread, '', tblvl):gsub('\n\t', '\n\t' .. thread)
if _lvl == 0 then
--- @type string
msg = msg
:gsub('\nstack traceback:\n', '\nSTACK TRACEBACK:\n', 1)
:gsub('\nstack traceback:\n', '\n')
:gsub('\nSTACK TRACEBACK:\n', '\nstack traceback:\n', 1)
end
return msg
end
--- Get the traceback of a task when it is not active.
--- Will also get the traceback of nested tasks.
---
--- @param msg? string
--- @return string
function Task:traceback(msg)
return self:_traceback(msg)
end
--- If a task completes with an error, raise the error
function Task:raise_on_error()
self:await(function(err)
if err then
error(self:_traceback(err), 0)
end
end)
return self
end
--- @private
--- @param err? any
--- @param result? {[integer]: any, n: integer}
function Task:_finish(err, result)
self._current_child = nil
self._err = err
self._result = result
threads[self._thread] = nil
local errs = {} --- @type string[]
for _, cb in pairs(self._callbacks) do
--- @type boolean, string
local ok, cb_err = pcall(cb, err, unpack_len(result))
if not ok then
errs[#errs + 1] = cb_err
end
end
if #errs > 0 then
error(table.concat(errs, '\n'), 0)
end
end
--- @return boolean
function Task:is_closing()
return self._closing
end
--- Close the task and all its children.
--- If callback is provided it will run asynchronously,
--- else it will run synchronously.
---
--- @param callback? fun()
function Task:close(callback)
if self:_completed() then
if callback then
callback()
end
return
end
if self._closing then
return
end
self._closing = true
if callback then -- async
if self._current_child then
self._current_child:close(function()
self:_finish('closed')
callback()
end)
else
self:_finish('closed')
callback()
end
else -- sync
if self._current_child then
self._current_child:close(function()
self:_finish('closed')
end)
else
self:_finish('closed')
end
vim.wait(0, function()
return self:_completed()
end)
end
end
--- @param obj any
--- @return boolean
local function is_async_handle(obj)
local ty = type(obj)
return (ty == 'table' or ty == 'userdata') and vim.is_callable(obj.close)
end
--- @param ... any
function Task:_resume(...)
--- @type [boolean, string|async.CallbackFn]
local ret = pack_len(coroutine.resume(self._thread, ...))
local stat = ret[1]
if not stat then
-- Coroutine had error
self:_finish(ret[2])
elseif coroutine.status(self._thread) == 'dead' then
-- Coroutine finished
local result = pack_len(unpack_len(ret, 2))
self:_finish(nil, result)
else
local fn = ret[2]
--- @cast fn -string
-- TODO(lewis6991): refine error handler to be more specific
local ok, r
ok, r = pcall(fn, function(...)
if is_async_handle(r) then
--- @cast r async.Handle
-- We must close children before we resume to ensure
-- all resources are collected.
local args = pack_len(...)
r:close(function()
self:_resume(unpack_len(args))
end)
else
self:_resume(...)
end
end)
if not ok then
self:_finish(r)
elseif is_async_handle(r) then
self._current_child = r
end
end
end
--- @return 'running'|'suspended'|'normal'|'dead'?
function Task:status()
return coroutine.status(self._thread)
end
--- Run a function in an async context, asynchronously.
---
--- Examples:
--- ```lua
--- -- The two below blocks are equivalent:
---
--- -- Run a uv function and wait for it
--- local stat = async.arun(function()
--- return async.await(2, vim.uv.fs_stat, 'foo.txt')
--- end):wait()
---
--- -- Since uv functions have sync versions. You can just do:
--- local stat = vim.fs_stat('foo.txt')
--- ```
--- @generic T, R
--- @param func async fun(...: T...): R...
--- @param ... T...
--- @return async.Task
function M.arun(func, ...)
local task = Task._new(func)
task:_resume(...)
return task
end
--- @alias async.TaskFun<T, R> fun(...: T...): async.Task
--- @generic T, R
--- @class async._TaskFun<T, R>
--- @field package _fun async fun(...: T...): R...
--- @operator call(...: T...): async.Task
local TaskFun = {}
TaskFun.__index = TaskFun
--- @generic T, R
--- @param self async._TaskFun<T, R>
--- @param ... T...
--- @return async.Task
function TaskFun:__call(...)
return M.arun(self._fun, ...)
end
--- Create an async function
--- @generic T, R
--- @param fun async fun(...: T...): R...
--- @return async.TaskFun<T, R>
function M.async(fun)
return setmetatable({ _fun = fun }, TaskFun)
end
--- Returns the status of a tasks thread.
---
--- @param task? async.Task
--- @return 'running'|'suspended'|'normal'|'dead'?
function M.status(task)
task = task or running()
if task then
assert(getmetatable(task) == Task, 'Expected Task')
return task:status()
end
end
--- @async
--- @generic R1, R2, R3, R4
--- @param fun fun(callback: fun(r1: R1, r2: R2, r3: R3, r4: R4)): any?
--- @return R1, R2, R3, R4
local function yield(fun)
assert(type(fun) == 'function', 'Expected function')
return coroutine.yield(fun)
end
--- @async
--- @param task async.Task
--- @return any ...
local function await_task(task)
--- @param callback fun(err?: string, ...: any)
--- @return function
local res = pack_len(yield(function(callback)
task:await(callback)
return task
end))
local err = res[1]
if err then
-- TODO(lewis6991): what is the correct level to pass?
error(err, 0)
end
return unpack_len(res, 2)
end
--- Asynchronous blocking wait
--- @param argc integer
--- @param fun async.CallbackFn
--- @param ... any func arguments
--- @return any ...
local function await_cbfun(argc, fun, ...)
local args = pack_len(...)
--- @param callback fun(...:any)
--- @return any?
return yield(function(callback)
args[argc] = callback
args.n = math.max(args.n, argc)
return fun(unpack_len(args))
end)
end
--- @generic T, R
--- @param taskfun async.TaskFun<T, R>
--- @param ... T...
--- @return R...
local function await_taskfun(taskfun, ...)
return taskfun._fun(...)
end
--- Asynchronous blocking wait
---
--- Example:
--- ```lua
--- local task = async.arun(function()
--- return 1, 'a'
--- end)
---
--- local task_fun = async.async(function(arg)
--- return 2, 'b', arg
--- end)
---
--- async.arun(function()
--- do -- await a callback function
--- async.await(1, vim.schedule)
--- end
---
--- do -- await a task (new async context)
--- local n, s = async.await(task)
--- assert(n == 1 and s == 'a')
--- end
---
--- do -- await a started task function (new async context)
--- local n, s, arg = async.await(task_fun('A'))
--- assert(n == 2)
--- assert(s == 'b')
--- assert(args == 'A')
--- end
---
--- do -- await a task function (re-using the current async context)
--- local n, s, arg = async.await(task_fun, 'B')
--- assert(n == 2)
--- assert(s == 'b')
--- assert(args == 'B')
--- end
--- end)
--- ```
--- @async
--- @overload fun(argc: integer, func: async.CallbackFn, ...:any): any ...
--- @overload fun(task: async.Task): any ...
--- @overload fun(taskfun: async.TaskFun): any ...
function M.await(...)
assert(running(), 'Not in async context')
local arg1 = select(1, ...)
if type(arg1) == 'number' then
return await_cbfun(...)
elseif getmetatable(arg1) == Task then
return await_task(...)
elseif getmetatable(arg1) == TaskFun then
return await_taskfun(...)
end
error('Invalid arguments, expected Task or (argc, func) got: ' .. type(arg1), 2)
end
--- Creates an async function with a callback style function.
---
--- Example:
---
--- ```lua
--- --- Note the callback argument is not present in the return function
--- --- @type fun(timeout: integer)
--- local sleep = async.awrap(2, function(timeout, callback)
--- local timer = vim.uv.new_timer()
--- timer:start(timeout * 1000, 0, callback)
--- -- uv_timer_t provides a close method so timer will be
--- -- cleaned up when this function finishes
--- return timer
--- end)
---
--- async.arun(function()
--- print('hello')
--- sleep(2)
--- print('world')
--- end)
--- ```
---
--- local atimer = async.awrap(
--- @param argc integer
--- @param func async.CallbackFn
--- @return async function
function M.awrap(argc, func)
assert(type(argc) == 'number')
assert(type(func) == 'function')
--- @async
return function(...)
return M.await(argc, func, ...)
end
end
if vim.schedule then
--- An async function that when called will yield to the Neovim scheduler to be
--- able to call the API.
M.schedule = M.awrap(1, vim.schedule)
end
--- Create a function that runs a function when it is garbage collected.
--- @generic F
--- @param f F
--- @param gc fun()
--- @return F
local function gc_fun(f, gc)
local proxy = newproxy(true)
local proxy_mt = getmetatable(proxy)
proxy_mt.__gc = gc
proxy_mt.__call = function(_, ...)
return f(...)
end
return proxy
end
--- @param task_cbs table<async.Task,function>
local function gc_cbs(task_cbs)
for task, tcb in pairs(task_cbs) do
for j, cb in pairs(task._callbacks) do
if cb == tcb then
task._callbacks[j] = nil
break
end
end
end
end
--- @async
--- Example:
--- ```lua
--- local task1 = async.arun(function()
--- return 1, 'a'
--- end)
---
--- local task2 = async.arun(function()
--- return 1, 'a'
--- end)
---
--- local task3 = async.arun(function()
--- error('task3 error')
--- end)
---
--- async.arun(function()
--- for i, err, r1, r2 in async.iter({task1, task2, task3})
--- print(i, err, r1, r2)
--- end
--- end)
--- ```
---
--- Prints:
--- ```
--- 1 nil 1 'a'
--- 2 nil 2 'b'
--- 3 'task3 error' nil nil
--- ```
---
--- @param tasks async.Task[]
--- @return fun(): (integer?, any?, ...)
function M.iter(tasks)
assert(running(), 'Not in async context')
local results = {} --- @type [integer, any, ...][]
-- Iter blocks in an async context so only one waiter is needed
local waiter = nil
local task_cbs = {} --- @type table<async.Task,function>
local remaining = #tasks
--- If can_gc_cbs is true, then the iterator function has been garbage
--- collected and means any awaiters can also be garbage collected. The
--- only time we can't do this is if with the special case when iter() is
--- called anonymously (`local i = async.iter(tasks)()`), so we should not
--- garbage collect the callbacks until at least one awaiter is called.
local can_gc_cbs = false
for i, task in ipairs(tasks) do
local function cb(err, ...)
if can_gc_cbs == true then
gc_cbs(task_cbs)
end
local callback = waiter
-- Clear waiter before calling it
waiter = nil
remaining = remaining - 1
if callback then
-- Iterator is waiting, yield to it
callback(i, err, ...)
else
-- Task finished before Iterator was called. Store results.
table.insert(results, pack_len(i, err, ...))
end
end
task_cbs[task] = cb
task:await(cb)
end
return gc_fun(
M.awrap(1, function(callback)
if next(results) then
local res = table.remove(results, 1)
callback(unpack_len(res))
elseif remaining == 0 then
callback() -- finish
else
assert(not waiter, 'internal error: waiter already set')
waiter = callback
end
end),
function()
-- Don't gc callbacks just yet. Wait until at least one of them is called.
can_gc_cbs = true
end
)
end
do -- join()
--- @param results table<integer,table>
--- @param i integer
--- @param ... any
--- @return boolean
local function collect(results, i, ...)
if i then
results[i] = pack_len(...)
end
return i ~= nil
end
--- @param iter fun(): ...
--- @return table<integer,table>
local function drain_iter(iter)
local results = {} --- @type table<integer,table>
while collect(results, iter()) do
end
return results
end
--- @async
--- Wait for all tasks to finish and return their results.
---
--- Example:
--- ```lua
--- local task1 = async.arun(function()
--- return 1, 'a'
--- end)
---
--- local task2 = async.arun(function()
--- return 1, 'a'
--- end)
---
--- local task3 = async.arun(function()
--- error('task3 error')
--- end)
---
--- async.arun(function()
--- local results = async.join({task1, task2, task3})
--- print(vim.inspect(results))
--- end)
--- ```
---
--- Prints:
--- ```
--- {
--- [1] = { nil, 1, 'a' },
--- [2] = { nil, 2, 'b' },
--- [3] = { 'task2 error' },
--- }
--- ```
--- @param tasks async.Task[]
--- @return table<integer,[any?,...?]>
function M.join(tasks)
assert(running(), 'Not in async context')
return drain_iter(M.iter(tasks))
end
--- @async
--- @param tasks async.Task[]
--- @return integer?, any?, ...?
function M.joinany(tasks)
return M.iter(tasks)()
end
end
return M

View file

@ -1,71 +0,0 @@
local api = vim.api
local M = {}
-- Creates a cache table for buffers keyed by a type name.
-- Cache entries attach to the buffer and cleanup entries
-- as buffers are detached.
function M.create_buffer_cache()
local cache = {}
---@type table<string, table<string, any>>
local items = setmetatable({}, {
__index = function(tbl, key)
rawset(tbl, key, {})
return rawget(tbl, key)
end,
})
---@type table<integer|string, boolean>
local loaded_buffers = {}
---@param type_name string
---@param bufnr integer
---@param value any
function cache.set(type_name, bufnr, value)
if not loaded_buffers[bufnr] then
loaded_buffers[bufnr] = true
-- Clean up the cache if the buffer is detached
-- to avoid memory leaks
api.nvim_buf_attach(bufnr, false, {
on_detach = function()
cache.clear_buffer(bufnr)
loaded_buffers[tostring(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
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
return cache
end
return M

View file

@ -0,0 +1,174 @@
local M = {}
M.tiers = { 'stable', 'unstable', 'unmaintained', 'unsupported' }
---@class TSConfig
---@field install_dir string
---@type TSConfig
local config = {
install_dir = vim.fs.joinpath(vim.fn.stdpath('data') --[[@as string]], 'site'),
}
---Setup call for users to override configuration configurations.
---@param user_data TSConfig? user configuration table
function M.setup(user_data)
if user_data then
if user_data.install_dir then
user_data.install_dir = vim.fs.normalize(user_data.install_dir)
vim.o.rtp = user_data.install_dir .. ',' .. vim.o.rtp
end
config = vim.tbl_deep_extend('force', config, user_data)
end
end
-- Returns the install path for parsers, parser info, and queries.
-- If the specified directory does not exist, it is created.
---@param dir_name string
---@return string
function M.get_install_dir(dir_name)
local dir = vim.fs.joinpath(config.install_dir, dir_name)
if not vim.uv.fs_stat(dir) then
local ok, err = pcall(vim.fn.mkdir, dir, 'p', '0755')
if not ok then
local log = require('nvim-treesitter.log')
log.error(err --[[@as string]])
end
end
return dir
end
---@param type 'queries'|'parsers'?
---@return string[]
function M.get_installed(type)
local installed = {} --- @type table<string, boolean>
if not (type and type == 'parsers') then
for f in vim.fs.dir(M.get_install_dir('queries')) do
installed[f] = true
end
end
if not (type and type == 'queries') then
for f in vim.fs.dir(M.get_install_dir('parser')) do
installed[vim.fn.fnamemodify(f, ':r')] = true
end
end
return vim.tbl_keys(installed)
end
-- Get a list of all available parsers
---@param tier integer? only get parsers of specified tier
---@return string[]
function M.get_available(tier)
vim.api.nvim_exec_autocmds('User', { pattern = 'TSUpdate' })
local parsers = require('nvim-treesitter.parsers')
--- @type string[]
local languages = vim.tbl_keys(parsers)
table.sort(languages)
if tier then
languages = vim.tbl_filter(
--- @param p string
function(p)
return parsers[p] ~= nil and parsers[p].tier == tier
end,
languages
)
end
return languages
end
local function expand_tiers(list)
for i, tier in ipairs(M.tiers) do
if vim.list_contains(list, tier) then
list = vim.tbl_filter(
--- @param l string
function(l)
return l ~= tier
end,
list
)
vim.list_extend(list, M.get_available(i))
end
end
return list
end
---Normalize languages
---@param languages? string[]|string
---@param skip? { missing: boolean?, unsupported: boolean?, installed: boolean?, dependencies: boolean? }
---@return string[]
function M.norm_languages(languages, skip)
if not languages then
return {}
elseif type(languages) == 'string' then
languages = { languages }
end
if vim.list_contains(languages, 'all') then
if skip and skip.missing then
return M.get_installed()
end
languages = M.get_available()
end
languages = expand_tiers(languages)
if skip and skip.installed then
local installed = M.get_installed()
languages = vim.tbl_filter(
--- @param v string
function(v)
return not vim.list_contains(installed, v)
end,
languages
)
end
if skip and skip.missing then
local installed = M.get_installed()
languages = vim.tbl_filter(
--- @param v string
function(v)
return vim.list_contains(installed, v)
end,
languages
)
end
local parsers = require('nvim-treesitter.parsers')
languages = vim.tbl_filter(
--- @param v string
function(v)
if parsers[v] ~= nil then
return true
else
require('nvim-treesitter.log').warn('skipping unsupported language: ' .. v)
return false
end
end,
languages
)
if skip and skip.unsupported then
languages = vim.tbl_filter(
--- @param v string
function(v)
return not (parsers[v] and parsers[v].tier and parsers[v].tier == 4)
end,
languages
)
end
if not (skip and skip.dependencies) then
for _, lang in pairs(languages) do
if parsers[lang] and parsers[lang].requires then
vim.list_extend(languages, parsers[lang].requires)
end
end
end
return vim.list.unique(languages)
end
return M

View file

@ -1,619 +0,0 @@
local api = vim.api
local queries = require "nvim-treesitter.query"
local ts_query = require "vim.treesitter.query"
local parsers = require "nvim-treesitter.parsers"
local utils = require "nvim-treesitter.utils"
local caching = require "nvim-treesitter.caching"
local M = {}
---@class TSConfig
---@field modules {[string]:TSModule}
---@field sync_install boolean
---@field ensure_installed string[]|string
---@field ignore_install string[]
---@field auto_install boolean
---@field update_strategy string
---@field parser_install_dir string|nil
---@type TSConfig
local config = {
modules = {},
sync_install = false,
ensure_installed = {},
auto_install = false,
ignore_install = {},
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
---@class TSModule
---@field module_path string
---@field enable boolean|string[]|function(string): boolean
---@field disable boolean|string[]|function(string): boolean
---@field keymaps table<string, string>
---@field is_supported function(string): boolean
---@field attach function(string)
---@field detach function(string)
---@field enabled_buffers table<integer, boolean>
---@field additional_vim_regex_highlighting boolean|string[]
---@type {[string]: TSModule}
local builtin_modules = {
highlight = {
module_path = "nvim-treesitter.highlight",
-- @deprecated: use `highlight.set_custom_captures` instead
custom_captures = {},
enable = false,
is_supported = function(lang)
return queries.has_highlights(lang)
end,
additional_vim_regex_highlighting = false,
},
incremental_selection = {
module_path = "nvim-treesitter.incremental_selection",
enable = false,
keymaps = {
init_selection = "gnn", -- set to `false` to disable one of the mappings
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
is_supported = function()
return true
end,
},
indent = {
module_path = "nvim-treesitter.indent",
enable = false,
is_supported = queries.has_indents,
},
}
local attached_buffers_by_module = caching.create_buffer_cache()
---Resolves a module by requiring the `module_path` or using the module definition.
---@param mod_name string
---@return TSModule|nil
local function resolve_module(mod_name)
local config_mod = M.get_module(mod_name)
if not config_mod then
return
end
if type(config_mod.attach) == "function" and type(config_mod.detach) == "function" then
return config_mod
elseif type(config_mod.module_path) == "string" then
return require(config_mod.module_path)
end
end
---Enables and attaches the module to a buffer for lang.
---@param mod string path to module
---@param bufnr integer|nil buffer number, defaults to current buffer
---@param lang string|nil language, defaults to current language
local function enable_module(mod, bufnr, lang)
local module = M.get_module(mod)
if not module then
return
end
bufnr = bufnr or api.nvim_get_current_buf()
lang = lang or parsers.get_buf_lang(bufnr)
if not module.enable then
if module.enabled_buffers then
module.enabled_buffers[bufnr] = true
else
module.enabled_buffers = { [bufnr] = true }
end
end
M.attach_module(mod, bufnr, lang)
end
---Enables autocomands for the module.
---After the module is loaded `loaded` will be set to true for the module.
---@param mod string path to module
local function enable_mod_conf_autocmd(mod)
local config_mod = M.get_module(mod)
if not config_mod or config_mod.loaded then
return
end
api.nvim_create_autocmd("FileType", {
group = api.nvim_create_augroup("NvimTreesitter-" .. mod, {}),
callback = function(args)
require("nvim-treesitter.configs").reattach_module(mod, args.buf)
end,
desc = "Reattach module",
})
config_mod.loaded = true
end
---Enables the module globally and for all current buffers.
---After enabled, `enable` will be set to true for the module.
---@param mod string path to module
local function enable_all(mod)
local config_mod = M.get_module(mod)
if not config_mod then
return
end
enable_mod_conf_autocmd(mod)
config_mod.enable = true
config_mod.enabled_buffers = nil
for _, bufnr in pairs(api.nvim_list_bufs()) do
enable_module(mod, bufnr)
end
end
---Disables and detaches the module for a buffer.
---@param mod string path to module
---@param bufnr integer buffer number, defaults to current buffer
local function disable_module(mod, bufnr)
local module = M.get_module(mod)
if not module then
return
end
bufnr = bufnr or api.nvim_get_current_buf()
if module.enabled_buffers then
module.enabled_buffers[bufnr] = false
end
M.detach_module(mod, bufnr)
end
---Disables autocomands for the module.
---After the module is unloaded `loaded` will be set to false for the module.
---@param mod string path to module
local function disable_mod_conf_autocmd(mod)
local config_mod = M.get_module(mod)
if not config_mod or not config_mod.loaded then
return
end
api.nvim_clear_autocmds { event = "FileType", group = "NvimTreesitter-" .. mod }
config_mod.loaded = false
end
---Disables the module globally and for all current buffers.
---After disabled, `enable` will be set to false for the module.
---@param mod string path to module
local function disable_all(mod)
local config_mod = M.get_module(mod)
if not config_mod then
return
end
config_mod.enabled_buffers = nil
disable_mod_conf_autocmd(mod)
config_mod.enable = false
for _, bufnr in pairs(api.nvim_list_bufs()) do
disable_module(mod, bufnr)
end
end
---Toggles a module for a buffer
---@param mod string path to module
---@param bufnr integer buffer number, defaults to current buffer
---@param lang string language, defaults to current language
local function toggle_module(mod, bufnr, lang)
bufnr = bufnr or api.nvim_get_current_buf()
lang = lang or parsers.get_buf_lang(bufnr)
if attached_buffers_by_module.has(mod, bufnr) then
disable_module(mod, bufnr)
else
enable_module(mod, bufnr, lang)
end
end
-- Toggles the module globally and for all current buffers.
-- @param mod path to module
local function toggle_all(mod)
local config_mod = M.get_module(mod)
if not config_mod then
return
end
if config_mod.enable then
disable_all(mod)
else
enable_all(mod)
end
end
---Recurses through all modules including submodules
---@param accumulator function called for each module
---@param root {[string]: TSModule}|nil root configuration table to start at
---@param path string|nil prefix path
local function recurse_modules(accumulator, root, path)
root = root or config.modules
for name, module in pairs(root) do
local new_path = path and (path .. "." .. name) or name
if M.is_module(module) then
accumulator(name, module, new_path, root)
elseif type(module) == "table" then
recurse_modules(accumulator, module, new_path)
end
end
end
-- Shows current configuration of all nvim-treesitter modules
---@param process_function function used as the `process` parameter
--- for vim.inspect (https://github.com/kikito/inspect.lua#optionsprocess)
local function config_info(process_function)
process_function = process_function
or function(item, path)
if path[#path] == vim.inspect.METATABLE then
return
end
if path[#path] == "is_supported" then
return
end
return item
end
print(vim.inspect(config, { process = process_function }))
end
---@param query_group string
---@param lang string
function M.edit_query_file(query_group, lang)
lang = lang or parsers.get_buf_lang()
local files = ts_query.get_query_files(lang, query_group, true)
if #files == 0 then
utils.notify "No query file found! Creating a new one!"
M.edit_query_file_user_after(query_group, lang)
elseif #files == 1 then
vim.cmd(":edit " .. files[1])
else
vim.ui.select(files, { prompt = "Select a file:" }, function(file)
if file then
vim.cmd(":edit " .. file)
end
end)
end
end
---@param query_group string
---@param lang string
function M.edit_query_file_user_after(query_group, lang)
lang = lang or parsers.get_buf_lang()
local folder = utils.join_path(vim.fn.stdpath "config", "after", "queries", lang)
local file = utils.join_path(folder, query_group .. ".scm")
if vim.fn.isdirectory(folder) ~= 1 then
vim.ui.select({ "Yes", "No" }, { prompt = '"' .. folder .. '" does not exist. Create it?' }, function(choice)
if choice == "Yes" then
vim.fn.mkdir(folder, "p", "0755")
vim.cmd(":edit " .. file)
end
end)
else
vim.cmd(":edit " .. file)
end
end
M.commands = {
TSBufEnable = {
run = enable_module,
args = {
"-nargs=1",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSBufDisable = {
run = disable_module,
args = {
"-nargs=1",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSBufToggle = {
run = toggle_module,
args = {
"-nargs=1",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSEnable = {
run = enable_all,
args = {
"-nargs=+",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSDisable = {
run = disable_all,
args = {
"-nargs=+",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSToggle = {
run = toggle_all,
args = {
"-nargs=+",
"-complete=custom,nvim_treesitter#available_modules",
},
},
TSConfigInfo = {
run = config_info,
args = {
"-nargs=0",
},
},
TSEditQuery = {
run = M.edit_query_file,
args = {
"-nargs=+",
"-complete=custom,nvim_treesitter#available_query_groups",
},
},
TSEditQueryUserAfter = {
run = M.edit_query_file_user_after,
args = {
"-nargs=+",
"-complete=custom,nvim_treesitter#available_query_groups",
},
},
}
---@param mod string module
---@param lang string the language of the buffer
---@param bufnr integer the buffer
function M.is_enabled(mod, lang, bufnr)
if not parsers.has_parser(lang) then
return false
end
local module_config = M.get_module(mod)
if not module_config then
return false
end
local buffer_enabled = module_config.enabled_buffers and module_config.enabled_buffers[bufnr]
local config_enabled = module_config.enable or buffer_enabled
if not config_enabled or not module_config.is_supported(lang) then
return false
end
local disable = module_config.disable
if type(disable) == "function" then
if disable(lang, bufnr) then
return false
end
elseif type(disable) == "table" then
-- Otherwise it's a list of languages
for _, parser in pairs(disable) do
if lang == parser then
return false
end
end
end
return true
end
---Setup call for users to override module configurations.
---@param user_data TSConfig module overrides
function M.setup(user_data)
config.modules = vim.tbl_deep_extend("force", config.modules, user_data)
config.ignore_install = user_data.ignore_install or {}
config.parser_install_dir = user_data.parser_install_dir or nil
if config.parser_install_dir then
config.parser_install_dir = vim.fn.expand(config.parser_install_dir, ":p")
end
config.auto_install = user_data.auto_install or false
if config.auto_install then
require("nvim-treesitter.install").setup_auto_install()
end
local ensure_installed = user_data.ensure_installed or {}
if #ensure_installed > 0 then
if user_data.sync_install then
require("nvim-treesitter.install").ensure_installed_sync(ensure_installed)
else
require("nvim-treesitter.install").ensure_installed(ensure_installed)
end
end
config.modules.ensure_installed = nil
config.ensure_installed = ensure_installed
recurse_modules(function(_, _, new_path)
local data = utils.get_at_path(config.modules, new_path)
if data.enable then
enable_all(new_path)
end
end, config.modules)
end
-- Defines a table of modules that can be attached/detached to buffers
-- based on language support. A module consist of the following properties:
---* @enable Whether the modules is enabled. Can be true or false.
---* @disable A list of languages to disable the module for. Only relevant if enable is true.
---* @keymaps A list of user mappings for a given module if relevant.
---* @is_supported A function which, given a ft, will return true if the ft works on the module.
---* @module_path A string path to a module file using `require`. The exported module must contain
--- an `attach` and `detach` function. This path is not required if `attach` and `detach`
--- functions are provided directly on the module definition.
---* @attach An attach function that is called for each buffer that the module is enabled for. This is required
--- if a `module_path` is not specified.
---* @detach A detach function that is called for each buffer that the module is enabled for. This is required
--- if a `module_path` is not specified.
--
-- Modules are not setup until `init` is invoked by the plugin. This allows modules to be defined in any order
-- and can be loaded lazily.
--
---* @example
---require"nvim-treesitter".define_modules {
--- my_cool_module = {
--- attach = function()
--- do_some_cool_setup()
--- end,
--- detach = function()
--- do_some_cool_teardown()
--- end
--- }
---}
---@param mod_defs TSModule[]
function M.define_modules(mod_defs)
if not is_initialized then
table.insert(queued_modules_defs, mod_defs)
return
end
recurse_modules(function(key, mod, _, group)
group[key] = vim.tbl_extend("keep", mod, {
enable = false,
disable = {},
is_supported = function()
return true
end,
})
end, mod_defs)
config.modules = vim.tbl_deep_extend("keep", config.modules, mod_defs)
for _, mod in ipairs(M.available_modules(mod_defs)) do
local module_config = M.get_module(mod)
if module_config and module_config.enable then
enable_mod_conf_autocmd(mod)
end
end
end
---Attaches a module to a buffer
---@param mod_name string the module name
---@param bufnr integer the buffer
---@param lang string the language of the buffer
function M.attach_module(mod_name, bufnr, lang)
bufnr = bufnr or api.nvim_get_current_buf()
lang = lang or parsers.get_buf_lang(bufnr)
local resolved_mod = resolve_module(mod_name)
if resolved_mod and not attached_buffers_by_module.has(mod_name, bufnr) and M.is_enabled(mod_name, lang, bufnr) then
attached_buffers_by_module.set(mod_name, bufnr, true)
resolved_mod.attach(bufnr, lang)
end
end
-- Detaches a module to a buffer
---@param mod_name string the module name
---@param bufnr integer the buffer
function M.detach_module(mod_name, bufnr)
local resolved_mod = resolve_module(mod_name)
bufnr = bufnr or api.nvim_get_current_buf()
if resolved_mod and attached_buffers_by_module.has(mod_name, bufnr) then
attached_buffers_by_module.remove(mod_name, bufnr)
resolved_mod.detach(bufnr)
end
end
-- Same as attach_module, but if the module is already attached, detach it first.
---@param mod_name string the module name
---@param bufnr integer the buffer
---@param lang string the language of the buffer
function M.reattach_module(mod_name, bufnr, lang)
M.detach_module(mod_name, bufnr)
M.attach_module(mod_name, bufnr, lang)
end
-- Gets available modules
---@param root {[string]:TSModule}|nil table to find modules
---@return string[] modules list of module paths
function M.available_modules(root)
local modules = {}
recurse_modules(function(_, _, path)
table.insert(modules, path)
end, root)
return modules
end
---Gets a module config by path
---@param mod_path string path to the module
---@return TSModule|nil: the module or nil
function M.get_module(mod_path)
local mod = utils.get_at_path(config.modules, mod_path)
return M.is_module(mod) and mod or nil
end
-- Determines whether the provided table is a module.
-- A module should contain an attach and detach function.
---@param mod table|nil the module table
---@return boolean
function M.is_module(mod)
return type(mod) == "table"
and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(mod.module_path) == "string")
end
-- Initializes built-in modules and any queued modules
-- registered by plugins or the user.
function M.init()
is_initialized = true
M.define_modules(builtin_modules)
for _, mod_def in ipairs(queued_modules_defs) do
M.define_modules(mod_def)
end
end
-- If parser_install_dir is not nil is used or created.
-- If parser_install_dir is nil try the package dir of the nvim-treesitter
-- plugin first, followed by the "site" dir from "runtimepath". "site" dir will
-- be created if it doesn't exist. Using only the package dir won't work when
-- the plugin is installed with Nix, since the "/nix/store" is read-only.
---@param folder_name string|nil
---@return string|nil, string|nil
function M.get_parser_install_dir(folder_name)
folder_name = folder_name or "parser"
local install_dir = config.parser_install_dir or utils.get_package_path()
local parser_dir = utils.join_path(install_dir, folder_name)
return utils.create_or_reuse_writable_dir(
parser_dir,
utils.join_space("Could not create parser dir '", parser_dir, "': "),
utils.join_space(
"Parser dir '",
parser_dir,
"' should be read/write (see README on how to configure an alternative install location)"
)
)
end
function M.get_parser_info_dir()
return M.get_parser_install_dir "parser-info"
end
function M.get_update_strategy()
return config.update_strategy
end
function M.get_ignored_parser_installs()
return config.ignore_install or {}
end
function M.get_ensure_installed_parsers()
return config.ensure_installed or {}
end
return M

View file

@ -1,123 +0,0 @@
local api = vim.api
local tsutils = require "nvim-treesitter.ts_utils"
local query = require "nvim-treesitter.query"
local parsers = require "nvim-treesitter.parsers"
local M = {}
-- This is cached on buf tick to avoid computing that multiple times
-- Especially not for every line in the file when `zx` is hit
local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr)
local max_fold_level = api.nvim_win_get_option(0, "foldnestmax")
local trim_level = function(level)
if level > max_fold_level then
return max_fold_level
end
return level
end
local parser = parsers.get_parser(bufnr)
if not parser then
return {}
end
local matches = query.get_capture_matches_recursively(bufnr, function(lang)
if query.has_folds(lang) then
return "@fold", "folds"
elseif query.has_locals(lang) then
return "@scope", "locals"
end
end)
-- start..stop is an inclusive range
---@type table<number, number>
local start_counts = {}
---@type table<number, number>
local stop_counts = {}
local prev_start = -1
local prev_stop = -1
local min_fold_lines = api.nvim_win_get_option(0, "foldminlines")
for _, match in ipairs(matches) do
local start, stop, stop_col ---@type integer, integer, integer
if match.metadata and match.metadata.range then
start, _, stop, stop_col = unpack(match.metadata.range) ---@type integer, integer, integer, integer
else
start, _, stop, stop_col = match.node:range() ---@type integer, integer, integer, integer
end
if stop_col == 0 then
stop = stop - 1
end
local fold_length = stop - start + 1
local should_fold = fold_length > min_fold_lines
-- Fold only multiline nodes that are not exactly the same as previously met folds
-- Checking against just the previously found fold is sufficient if nodes
-- are returned in preorder or postorder when traversing tree
if should_fold and not (start == prev_start and stop == prev_stop) then
start_counts[start] = (start_counts[start] or 0) + 1
stop_counts[stop] = (stop_counts[stop] or 0) + 1
prev_start = start
prev_stop = stop
end
end
---@type string[]
local levels = {}
local current_level = 0
-- We now have the list of fold opening and closing, fill the gaps and mark where fold start
for lnum = 0, api.nvim_buf_line_count(bufnr) do
local prefix = ""
local last_trimmed_level = trim_level(current_level)
current_level = current_level + (start_counts[lnum] or 0)
local trimmed_level = trim_level(current_level)
current_level = current_level - (stop_counts[lnum] or 0)
local next_trimmed_level = trim_level(current_level)
-- Determine if it's the start/end of a fold
-- NB: vim's fold-expr interface does not have a mechanism to indicate that
-- two (or more) folds start at this line, so it cannot distinguish between
-- ( \n ( \n )) \n (( \n ) \n )
-- versus
-- ( \n ( \n ) \n ( \n ) \n )
-- If it did have such a mechanism, (trimmed_level - last_trimmed_level)
-- would be the correct number of starts to pass on.
if trimmed_level - last_trimmed_level > 0 then
prefix = ">"
elseif trimmed_level - next_trimmed_level > 0 then
-- Ending marks tend to confuse vim more than it helps, particularly when
-- the fold level changes by at least 2; we can uncomment this if
-- vim's behavior gets fixed.
-- prefix = "<"
prefix = ""
end
levels[lnum + 1] = prefix .. tostring(trimmed_level)
end
return levels
end)
---@param lnum integer
---@return string
function M.get_fold_indic(lnum)
if not parsers.has_parser() or not lnum then
return "0"
end
local buf = api.nvim_get_current_buf()
local levels = folds_levels(buf) or {}
return levels[lnum] or "0"
end
return M

View file

@ -1,171 +1,174 @@
local api = vim.api
local fn = vim.fn
local queries = require "nvim-treesitter.query"
local info = require "nvim-treesitter.info"
local shell = require "nvim-treesitter.shell_command_selectors"
local install = require "nvim-treesitter.install"
local utils = require "nvim-treesitter.utils"
local health = vim.health or require "health"
local parsers = require('nvim-treesitter.parsers')
local config = require('nvim-treesitter.config')
local util = require('nvim-treesitter.util')
local tsq = vim.treesitter.query
local health = vim.health
local M = {}
local NVIM_TREESITTER_MINIMUM_ABI = 13
local TREE_SITTER_MIN_VER = { 0, 26, 1 }
---@param name string
---@return table?
local function check_exe(name)
if vim.fn.executable(name) == 1 then
local path = vim.fn.exepath(name)
local out = vim.trim(vim.fn.system({ name, '--version' }))
local version = vim.version.parse(out)
return { path = path, version = version, out = out }
end
end
local function install_health()
health.report_start "Installation"
health.start('Requirements')
if fn.has "nvim-0.7" == 0 then
health.report_error "Nvim-treesitter requires Neovim 0.7.0+"
end
do -- nvim check
if vim.fn.has('nvim-0.12') ~= 1 then
health.error('Nvim-treesitter requires Neovim 0.12.0 or later.')
end
if fn.executable "tree-sitter" == 0 then
health.report_warn(
"`tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar,"
.. " not required for :TSInstall)"
)
else
health.report_ok(
"`tree-sitter` found "
.. (utils.ts_cli_version() or "(unknown version)")
.. " (parser generator, only needed for :TSInstallFromGrammar)"
)
end
if fn.executable "node" == 0 then
health.report_warn(
"`node` executable not found (only needed for :TSInstallFromGrammar," .. " not required for :TSInstall)"
)
else
local handle = io.popen "node --version"
local result = handle:read "*a"
handle:close()
local version = vim.split(result, "\n")[1]
health.report_ok("`node` found " .. version .. " (only needed for :TSInstallFromGrammar)")
end
if fn.executable "git" == 0 then
health.report_error("`git` executable not found.", {
"Install it with your package manager.",
"Check that your `$PATH` is set correctly.",
})
else
health.report_ok "`git` executable found."
end
local cc = shell.select_executable(install.compilers)
if not cc then
health.report_error("`cc` executable not found.", {
"Check that any of "
.. vim.inspect(install.compilers)
.. " is in your $PATH"
.. ' or set the environment variable CC or `require"nvim-treesitter.install".compilers` explicitly!',
})
else
local version = vim.fn.systemlist(cc .. (cc == "cl" and "" or " --version"))[1]
health.report_ok(
"`"
.. cc
.. "` executable found. Selected from "
.. vim.inspect(install.compilers)
.. (version and ("\nVersion: " .. version) or "")
)
end
if vim.treesitter.language_version then
if vim.treesitter.language_version >= NVIM_TREESITTER_MINIMUM_ABI then
health.report_ok(
"Neovim was compiled with tree-sitter runtime ABI version "
health.ok(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. " (required >="
.. ' (required >='
.. NVIM_TREESITTER_MINIMUM_ABI
.. "). Parsers must be compatible with runtime ABI."
.. ').'
)
else
health.report_error(
"Neovim was compiled with tree-sitter runtime ABI version "
health.error(
'Neovim was compiled with tree-sitter runtime ABI version '
.. vim.treesitter.language_version
.. ".\n"
.. "nvim-treesitter expects at least ABI version "
.. '.\n'
.. 'nvim-treesitter expects at least ABI version '
.. NVIM_TREESITTER_MINIMUM_ABI
.. "\n"
.. "Please make sure that Neovim is linked against are recent tree-sitter runtime when building"
.. " or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI."
.. '\n'
.. 'Please make sure that Neovim is linked against a recent tree-sitter library when building'
.. ' or raise an issue at your Neovim packager. Parsers must be compatible with runtime ABI.'
)
end
end
health.report_start("OS Info:\n" .. vim.inspect(vim.loop.os_uname()))
do -- treesitter check
local ts = check_exe('tree-sitter')
if ts then
if vim.version.ge(ts.version, TREE_SITTER_MIN_VER) then
health.ok(string.format('tree-sitter-cli %s (%s)', ts.version, ts.path))
else
health.error(
string.format('tree-sitter-cli v%d.%d.%d is required', unpack(TREE_SITTER_MIN_VER))
)
end
else
health.error('tree-sitter-cli not found')
end
end
do -- curl+tar check
local tar = check_exe('tar')
if tar then
health.ok(string.format('tar %s (%s)', tar.version, tar.path))
else
health.error('tar not found')
end
local curl = check_exe('curl')
if curl then
health.ok(string.format('curl %s (%s)\n%s', curl.version, curl.path, curl.out))
else
health.error('curl not found')
end
end
health.start('OS Info')
local osinfo = vim.uv.os_uname() ---@type table<string,string>
for k, v in pairs(osinfo) do
health.info(k .. ': ' .. v)
end
local installdir = config.get_install_dir('')
health.start('Install directory for parsers and queries')
health.info(installdir)
if vim.uv.fs_access(installdir, 'w') then
health.ok('is writable.')
else
health.error('is not writable.')
end
if
vim.list_contains(vim.tbl_map(vim.fs.normalize, vim.api.nvim_list_runtime_paths()), installdir)
then
health.ok('is in runtimepath.')
else
health.error('is not in runtimepath.')
end
end
local function query_status(lang, query_group)
local ok, err = pcall(queries.get_query, lang, query_group)
local ok, err = pcall(tsq.get, lang, query_group)
if not ok then
return "x", err
return 'x', err
elseif not err then
return "."
return '.'
else
return ""
return ''
end
end
function M.check()
--- @type {[1]: string, [2]: string, [3]: string}[]
local error_collection = {}
-- Installation dependency checks
install_health()
queries.invalidate_query_cache()
-- Parser installation checks
local parser_installation = { "Parser/Features" .. string.rep(" ", 9) .. "H L F I J" }
for _, parser_name in pairs(info.installed_parsers()) do
local installed = #api.nvim_get_runtime_file("parser/" .. parser_name .. ".so", false)
-- Only append information about installed parsers
if installed >= 1 then
local multiple_parsers = installed > 1 and "+" or ""
local out = " - " .. parser_name .. multiple_parsers .. string.rep(" ", 20 - (#parser_name + #multiple_parsers))
for _, query_group in pairs(queries.built_in_query_groups) do
local status, err = query_status(parser_name, query_group)
out = out .. status .. " "
-- Parser installation checks
health.start('Installed languages' .. string.rep(' ', 5) .. 'H L F I J')
local languages = config.get_installed()
table.sort(languages)
for _, lang in ipairs(languages) do
local parser = parsers[lang]
local out = lang .. string.rep(' ', 22 - #lang)
if parser and parser.install_info then
for _, query_group in pairs(M.bundled_queries) do
local status, err = query_status(lang, query_group)
out = out .. status .. ' '
if err then
table.insert(error_collection, { parser_name, query_group, err })
table.insert(error_collection, { lang, query_group, err })
end
end
table.insert(parser_installation, vim.fn.trim(out, " ", 2))
end
if parser and parser.requires then
for _, p in pairs(parser.requires) do
if not vim.list_contains(languages, p) then
table.insert(error_collection, { lang, 'queries', 'dependency ' .. p .. ' missing' })
end
end
end
health.info(vim.fn.trim(out, ' ', 2))
end
local legend = [[
health.start(' Legend: [H]ighlights, [L]ocals, [F]olds, [I]ndents, In[J]ections')
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang}]]
table.insert(parser_installation, legend)
-- Finally call the report function
health.report_start(table.concat(parser_installation, "\n"))
if #error_collection > 0 then
health.report_start "The following errors have been detected:"
health.start('The following errors have been detected in query files:')
for _, p in ipairs(error_collection) do
local lang, type, err = unpack(p)
local lang, type = p[1], p[2]
local lines = {}
table.insert(lines, lang .. "(" .. type .. "): " .. err)
local files = vim.treesitter.query.get_query_files(lang, type)
table.insert(lines, lang .. '(' .. type .. '): ')
local files = tsq.get_files(lang, type)
if #files > 0 then
table.insert(lines, lang .. "(" .. type .. ") is concatenated from the following files:")
for _, file in ipairs(files) do
local fd = io.open(file, "r")
if fd then
local ok, file_err = pcall(vim.treesitter.query.parse_query, lang, fd:read "*a")
if ok then
table.insert(lines, '| [OK]:"' .. file .. '"')
else
table.insert(lines, '| [ERROR]:"' .. file .. '", failed to load: ' .. file_err)
end
fd:close()
local query = util.read_file(file)
local _, file_err = pcall(tsq.parse, lang, query)
if file_err then
table.insert(lines, file)
end
end
end
health.report_error(table.concat(lines, "\n"))
health.error(table.concat(lines, ''))
end
end
end
M.bundled_queries = { 'highlights', 'locals', 'folds', 'indents', 'injections' }
return M

View file

@ -1,49 +0,0 @@
local configs = require "nvim-treesitter.configs"
local M = {}
---@param config TSModule
---@param lang string
---@return boolean
local function should_enable_vim_regex(config, lang)
local additional_hl = config.additional_vim_regex_highlighting
local is_table = type(additional_hl) == "table"
---@diagnostic disable-next-line: param-type-mismatch
return additional_hl and (not is_table or vim.tbl_contains(additional_hl, lang))
end
---@param bufnr integer
---@param lang string
function M.attach(bufnr, lang)
local config = configs.get_module "highlight"
vim.treesitter.start(bufnr, lang)
if config and should_enable_vim_regex(config, lang) then
vim.bo[bufnr].syntax = "ON"
end
end
---@param bufnr integer
function M.detach(bufnr)
vim.treesitter.stop(bufnr)
end
---@deprecated
function M.start(...)
vim.notify(
"`nvim-treesitter.highlight.start` is deprecated: use `nvim-treesitter.highlight.attach` or `vim.treesitter.start`",
vim.log.levels.WARN
)
M.attach(...)
end
---@deprecated
function M.stop(...)
vim.notify(
"`nvim-treesitter.highlight.stop` is deprecated: use `nvim-treesitter.highlight.detach` or `vim.treesitter.stop`",
vim.log.levels.WARN
)
M.detach(...)
end
return M

View file

@ -1,176 +0,0 @@
local api = vim.api
local configs = require "nvim-treesitter.configs"
local ts_utils = require "nvim-treesitter.ts_utils"
local locals = require "nvim-treesitter.locals"
local parsers = require "nvim-treesitter.parsers"
local queries = require "nvim-treesitter.query"
local M = {}
---@type table<integer, table<TSNode|nil>>
local selections = {}
function M.init_selection()
local buf = api.nvim_get_current_buf()
local node = ts_utils.get_node_at_cursor()
selections[buf] = { [1] = node }
ts_utils.update_selection(buf, node)
end
-- Get the range of the current visual selection.
--
-- The range starts with 1 and the ending is inclusive.
---@return integer, integer, integer, integer
local function visual_selection_range()
local _, csrow, cscol, _ = unpack(vim.fn.getpos "'<") ---@type integer, integer, integer, integer
local _, cerow, cecol, _ = unpack(vim.fn.getpos "'>") ---@type integer, integer, integer, integer
local start_row, start_col, end_row, end_col ---@type integer, integer, integer, integer
if csrow < cerow or (csrow == cerow and cscol <= cecol) then
start_row = csrow
start_col = cscol
end_row = cerow
end_col = cecol
else
start_row = cerow
start_col = cecol
end_row = csrow
end_col = cscol
end
return start_row, start_col, end_row, end_col
end
---@param node TSNode
---@return boolean
local function range_matches(node)
local csrow, cscol, cerow, cecol = visual_selection_range()
local srow, scol, erow, ecol = ts_utils.get_vim_range { node:range() }
return srow == csrow and scol == cscol and erow == cerow and ecol == cecol
end
---@param get_parent fun(node: TSNode): TSNode|nil
---@return fun():nil
local function select_incremental(get_parent)
return function()
local buf = api.nvim_get_current_buf()
local nodes = selections[buf]
local csrow, cscol, cerow, cecol = visual_selection_range()
-- Initialize incremental selection with current selection
if not nodes or #nodes == 0 or not range_matches(nodes[#nodes]) then
local root = parsers.get_parser():parse()[1]:root()
local node = root:named_descendant_for_range(csrow - 1, cscol - 1, cerow - 1, cecol)
ts_utils.update_selection(buf, node)
if nodes and #nodes > 0 then
table.insert(selections[buf], node)
else
selections[buf] = { [1] = node }
end
return
end
-- Find a node that changes the current selection.
local node = nodes[#nodes] ---@type TSNode
while true do
local parent = get_parent(node)
if not parent or parent == node then
-- Keep searching in the main tree
-- TODO: we should search on the parent tree of the current node.
local root = parsers.get_parser():parse()[1]:root()
parent = root:named_descendant_for_range(csrow - 1, cscol - 1, cerow - 1, cecol)
if not parent or root == node or parent == node then
ts_utils.update_selection(buf, node)
return
end
end
node = parent
local srow, scol, erow, ecol = ts_utils.get_vim_range { node:range() }
local same_range = (srow == csrow and scol == cscol and erow == cerow and ecol == cecol)
if not same_range then
table.insert(selections[buf], node)
if node ~= nodes[#nodes] then
table.insert(nodes, node)
end
ts_utils.update_selection(buf, node)
return
end
end
end
end
M.node_incremental = select_incremental(function(node)
return node:parent() or node
end)
M.scope_incremental = select_incremental(function(node)
local lang = parsers.get_buf_lang()
if queries.has_locals(lang) then
return locals.containing_scope(node:parent() or node)
else
return node
end
end)
function M.node_decremental()
local buf = api.nvim_get_current_buf()
local nodes = selections[buf]
if not nodes or #nodes < 2 then
return
end
table.remove(selections[buf])
local node = nodes[#nodes] ---@type TSNode
ts_utils.update_selection(buf, node)
end
local FUNCTION_DESCRIPTIONS = {
init_selection = "Start selecting nodes with nvim-treesitter",
node_incremental = "Increment selection to named node",
scope_incremental = "Increment selection to surrounding scope",
node_decremental = "Shrink selection to previous named node",
}
---@param bufnr integer
function M.attach(bufnr)
local config = configs.get_module "incremental_selection"
for funcname, mapping in pairs(config.keymaps) do
if mapping then
---@type string, string|function
local mode, rhs
if funcname == "init_selection" then
mode = "n"
---@type function
rhs = M[funcname]
else
mode = "x"
-- We need to move to command mode to access marks '< (visual area start) and '> (visual area end) which are not
-- properly accessible in visual mode.
rhs = string.format(":lua require'nvim-treesitter.incremental_selection'.%s()<CR>", funcname)
end
vim.keymap.set(
mode,
mapping,
rhs,
{ buffer = bufnr, silent = true, noremap = true, desc = FUNCTION_DESCRIPTIONS[funcname] }
)
end
end
end
function M.detach(bufnr)
local config = configs.get_module "incremental_selection"
for f, mapping in pairs(config.keymaps) do
if mapping then
if f == "init_selection" then
vim.keymap.del("n", mapping, { buffer = bufnr })
else
vim.keymap.del("x", mapping, { buffer = bufnr })
end
end
end
end
return M

View file

@ -1,101 +1,132 @@
local parsers = require "nvim-treesitter.parsers"
local queries = require "nvim-treesitter.query"
local tsutils = require "nvim-treesitter.ts_utils"
local ts = vim.treesitter
local M = {}
M.avoid_force_reparsing = {
yaml = true,
}
M.comment_parsers = {
comment = true,
luadoc = true,
javadoc = true,
jsdoc = true,
phpdoc = true,
}
---@param root TSNode
local function getline(lnum)
return vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1] or ''
end
---@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)
---@return integer
local function get_indentcols_at_line(lnum)
local _, indentcols = getline(lnum):find('^%s*')
return indentcols or 0
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)
---@param col? integer
---@return TSNode?
local function get_first_node_at_line(root, lnum, col)
col = col or get_indentcols_at_line(lnum)
return root:descendant_for_range(lnum - 1, col, lnum - 1, col + 1)
end
---@param root TSNode
---@param lnum integer
---@param col? integer
---@return TSNode?
local function get_last_node_at_line(root, lnum, col)
col = col or (#getline(lnum) - 1)
return root:descendant_for_range(lnum - 1, col, lnum - 1, col + 1)
end
---@param bufnr integer
---@param node TSNode
---@param delimiter string
---@return TSNode|nil child
---@return boolean|nil is_end
---@return TSNode? child
---@return boolean? is_end
local function find_delimiter(bufnr, node, delimiter)
for child, _ in node:iter_children() do
if child:type() == delimiter then
local linenr = child:start()
local line = vim.api.nvim_buf_get_lines(bufnr, linenr, linenr + 1, false)[1]
local end_char = { child:end_() }
return child, #line == end_char[2]
local trimmed_after_delim
local escaped_delimiter = delimiter:gsub('[%-%.%+%[%]%(%)%$%^%%%?%*]', '%%%1')
trimmed_after_delim =
assert(line):sub(end_char[2] + 1):gsub('[%s' .. escaped_delimiter .. ']*', '')
return child, #trimmed_after_delim == 0
end
end
end
local get_indents = tsutils.memoize_by_buf_tick(function(bufnr, root, lang)
---Memoize a function using hash_fn to hash the arguments.
---@generic F: function
---@param fn F
---@param hash_fn fun(...): any
---@return F
local function memoize(fn, hash_fn)
local cache = setmetatable({}, { __mode = 'kv' }) ---@type table<any,any>
return function(...)
local key = hash_fn(...)
if cache[key] == nil then
local v = fn(...) ---@type any
cache[key] = v ~= nil and v or vim.NIL
end
local v = cache[key]
return v ~= vim.NIL and v or nil
end
end
local get_indents = memoize(function(bufnr, root, lang)
---@type table<string,table<string,table>>
local map = {
auto = {},
indent = {},
indent_end = {},
dedent = {},
branch = {},
ignore = {},
aligned_indent = {},
zero_indent = {},
['indent.auto'] = {},
['indent.begin'] = {},
['indent.end'] = {},
['indent.dedent'] = {},
['indent.branch'] = {},
['indent.ignore'] = {},
['indent.align'] = {},
['indent.zero'] = {},
}
for name, node, metadata in queries.iter_captures(bufnr, "indents", root, lang) do
map[name][node:id()] = metadata or {}
local query = ts.query.get(lang, 'indents')
if not query then
return map
end
for id, node, metadata in query:iter_captures(root, bufnr) do
if assert(query.captures[id]):sub(1, 1) ~= '_' then
map[query.captures[id]][node:id()] = metadata or {}
end
end
return map
end, {
-- Memoize by bufnr and lang together.
key = function(bufnr, root, lang)
return tostring(bufnr) .. root:id() .. "_" .. lang
end,
})
end, function(bufnr, root, lang)
return tostring(bufnr) .. root:id() .. '_' .. lang
end)
---@param lnum number (1-indexed)
---@param lnum integer (1-indexed)
---@return integer
function M.get_indent(lnum)
local bufnr = vim.api.nvim_get_current_buf()
local parser = parsers.get_parser(bufnr)
local parser = ts.get_parser(bufnr)
if not parser or not lnum then
return -1
end
local root_lang = parsers.get_buf_lang(bufnr)
-- some languages like Python will actually have worse results when re-parsing at opened new line
if not M.avoid_force_reparsing[root_lang] then
-- Reparse in case we got triggered by ":h indentkeys"
parser:parse()
end
parser:parse({ vim.fn.line('w0') - 1, vim.fn.line('w$') })
-- Get language tree with smallest range around node that's not a comment parser
local root, lang_tree ---@type TSNode, LanguageTree
local root, lang_tree ---@type TSNode, vim.treesitter.LanguageTree
parser:for_each_tree(function(tstree, tree)
if not tstree or M.comment_parsers[tree:lang()] then
return
end
local local_root = tstree:root()
if ts.is_in_node_range(local_root, lnum - 1, 0) then
if not root or tsutils.node_length(root) >= tsutils.node_length(local_root) then
if not root or root:byte_length() >= local_root:byte_length() then
root = local_root
lang_tree = tree
end
@ -108,12 +139,27 @@ function M.get_indent(lnum)
end
local q = get_indents(vim.api.nvim_get_current_buf(), root, lang_tree:lang())
local is_empty_line = string.match(vim.fn.getline(lnum), "^%s*$") ~= nil
local node ---@type TSNode
if is_empty_line then
local node ---@type TSNode?
if getline(lnum):find('^%s*$') then
local prevlnum = vim.fn.prevnonblank(lnum)
node = get_last_node_at_line(root, prevlnum)
if q.indent_end[node:id()] then
local indentcols = get_indentcols_at_line(prevlnum)
local prevline = vim.trim(getline(prevlnum))
-- The final position can be trailing spaces, which should not affect indentation
node = get_last_node_at_line(root, prevlnum, indentcols + #prevline - 1)
if node and node:type():match('comment') then
-- The final node we capture of the previous line can be a comment node, which should also be ignored
-- Unless the last line is an entire line of comment, ignore the comment range and find the last node again
local first_node = get_first_node_at_line(root, prevlnum, indentcols)
local _, scol, _, _ = node:range()
if first_node and first_node:id() ~= node:id() then
-- In case the last captured node is a trailing comment node, re-trim the string
prevline = vim.trim(prevline:sub(1, scol - indentcols))
-- Add back indent as indent of prevline was trimmed away
local col = indentcols + #prevline - 1
node = get_last_node_at_line(root, prevlnum, col)
end
end
if node and q['indent.end'][node:id()] then
node = get_first_node_at_line(root, lnum)
end
else
@ -129,22 +175,33 @@ function M.get_indent(lnum)
end
-- tracks to ensure multiple indent levels are not applied for same line
local is_processed_by_row = {}
local is_processed_by_row = {} --- @type table<integer,boolean>
if q.zero_indent[node:id()] then
if node and q['indent.zero'][node:id()] then
return 0
end
while node do
-- do 'autoindent' if not marked as @indent
if not q.indent[node:id()] and q.auto[node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then
if
not q['indent.begin'][node:id()]
and not q['indent.align'][node:id()]
and q['indent.auto'][node:id()]
and node:start() < lnum - 1
and lnum - 1 <= node:end_()
then
return -1
end
-- Do not indent if we are inside an @ignore block.
-- If a node spans from L1,C1 to L2,C2, we know that lines where L1 < line <= L2 would
-- have their indentations contained by the node.
if not q.indent[node:id()] and q.ignore[node:id()] and node:start() < lnum - 1 and lnum - 1 <= node:end_() then
if
not q['indent.begin'][node:id()]
and q['indent.ignore'][node:id()]
and node:start() < lnum - 1
and lnum - 1 <= node:end_()
then
return 0
end
@ -154,7 +211,10 @@ function M.get_indent(lnum)
if
not is_processed_by_row[srow]
and ((q.branch[node:id()] and srow == lnum - 1) or (q.dedent[node:id()] and srow ~= lnum - 1))
and (
(q['indent.branch'][node:id()] and srow == lnum - 1)
or (q['indent.dedent'][node:id()] and srow ~= lnum - 1)
)
then
indent = indent - indent_size
is_processed = true
@ -165,39 +225,112 @@ function M.get_indent(lnum)
local is_in_err = false
if should_process then
local parent = node:parent()
is_in_err = parent and parent:has_error()
is_in_err = parent and parent:has_error() or false
end
if
should_process
and (
q.indent[node:id()]
and (srow ~= erow or is_in_err)
and (srow ~= lnum - 1 or q.indent[node:id()].start_at_same_line)
q['indent.begin'][node:id()]
and (srow ~= erow or is_in_err or q['indent.begin'][node:id()]['indent.immediate'])
and (srow ~= lnum - 1 or q['indent.begin'][node:id()]['indent.start_at_same_line'])
)
then
indent = indent + indent_size
is_processed = true
end
if is_in_err and not q['indent.align'][node:id()] then
-- only when the node is in error, promote the
-- first child's aligned indent to the error node
-- to work around ((ERROR "X" . (_)) @aligned_indent (#set! "delimiter" "AB"))
-- matching for all X, instead set do
-- (ERROR "X" @aligned_indent (#set! "delimiter" "AB") . (_))
-- and we will fish it out here.
for c in node:iter_children() do
if q['indent.align'][c:id()] then
q['indent.align'][node:id()] = q['indent.align'][c:id()]
break
end
end
end
-- 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 ---@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)
if
should_process
and q['indent.align'][node:id()]
and (srow ~= erow or is_in_err)
and (srow ~= lnum - 1)
then
local metadata = q['indent.align'][node:id()]
local o_delim_node, o_is_last_in_line ---@type TSNode?, boolean?
local c_delim_node, c_is_last_in_line ---@type TSNode?, boolean?, boolean?
local indent_is_absolute = false
if metadata['indent.open_delimiter'] then
o_delim_node, o_is_last_in_line =
find_delimiter(bufnr, node, metadata['indent.open_delimiter'])
else
o_delim_node = node
end
if metadata['indent.close_delimiter'] then
c_delim_node, c_is_last_in_line =
find_delimiter(bufnr, node, metadata['indent.close_delimiter'])
else
c_delim_node = node
end
if o_delim_node then
if is_last_in_line then
local o_srow, o_scol = o_delim_node:start()
local c_srow = nil --- @type integer?
if c_delim_node then
c_srow = c_delim_node:start()
end
if o_is_last_in_line then
-- hanging indent (previous line ended with starting delimiter)
indent = indent + indent_size * 1
-- should be processed like indent
if should_process then
indent = indent + indent_size * 1
if c_is_last_in_line then
-- If current line is outside the range of a node marked with `@aligned_indent`
-- Then its indent level shouldn't be affected by `@aligned_indent` node
if c_srow and c_srow < lnum - 1 then
indent = math.max(indent - indent_size, 0)
end
end
end
else
local _, o_scol = o_delim_node:start()
return math.max(indent, 0) + o_scol + (metadata.increment or 1)
-- aligned indent
if c_is_last_in_line and c_srow and o_srow ~= c_srow and c_srow < lnum - 1 then
-- If current line is outside the range of a node marked with `@aligned_indent`
-- Then its indent level shouldn't be affected by `@aligned_indent` node
indent = math.max(indent - indent_size, 0)
else
indent = o_scol + (metadata['indent.increment'] or 1)
indent_is_absolute = true
end
end
-- deal with the final line
local avoid_last_matching_next = false
if c_srow and c_srow ~= o_srow and c_srow == lnum - 1 then
-- delims end on current line, and are not open and closed same line.
-- then this last line may need additional indent to avoid clashes
-- with the next. `indent.avoid_last_matching_next` controls this behavior,
-- for example this is needed for function parameters.
avoid_last_matching_next = metadata['indent.avoid_last_matching_next'] or false
end
if avoid_last_matching_next then
-- last line must be indented more in cases where
-- it would be same indent as next line (we determine this as one
-- width more than the open indent to avoid confusing with any
-- hanging indents)
if indent <= vim.fn.indent(o_srow + 1) + indent_size then
indent = indent + indent_size * 1
else
indent = indent
end
end
is_processed = true
if indent_is_absolute then
-- don't allow further indenting by parent nodes, this is an absolute position
return indent
end
end
end
@ -210,17 +343,4 @@ function M.get_indent(lnum)
return indent
end
---@type table<integer, string>
local indent_funcs = {}
---@param bufnr integer
function M.attach(bufnr)
indent_funcs[bufnr] = vim.bo.indentexpr
vim.bo.indentexpr = "nvim_treesitter#indent()"
end
function M.detach(bufnr)
vim.bo.indentexpr = indent_funcs[bufnr]
end
return M

View file

@ -1,190 +0,0 @@
local api = vim.api
local configs = require "nvim-treesitter.configs"
local parsers = require "nvim-treesitter.parsers"
local M = {}
local function install_info()
local max_len = 0
for _, ft in pairs(parsers.available_parsers()) do
if #ft > max_len then
max_len = #ft
end
end
local parser_list = parsers.available_parsers()
table.sort(parser_list)
for _, lang in pairs(parser_list) do
local is_installed = #api.nvim_get_runtime_file("parser/" .. lang .. ".so", false) > 0
api.nvim_out_write(lang .. string.rep(" ", max_len - #lang + 1))
if is_installed then
api.nvim_out_write "[✓] installed\n"
elseif pcall(vim.treesitter.inspect_lang, lang) then
api.nvim_out_write "[✗] not installed (but still loaded. Restart Neovim!)\n"
else
api.nvim_out_write "[✗] not installed\n"
end
end
end
-- Sort a list of modules into namespaces.
-- {'mod1', 'mod2.sub1', 'mod2.sub2', 'mod3'}
-- ->
-- { default = {'mod1', 'mod3'}, mod2 = {'sub1', 'sub2'}}
---@param modulelist string[]
---@return table
local function namespace_modules(modulelist)
local modules = {}
for _, module in ipairs(modulelist) do
if module:find "%." then
local namespace, submodule = module:match "^(.*)%.(.*)$"
if not modules[namespace] then
modules[namespace] = {}
end
table.insert(modules[namespace], submodule)
else
if not modules.default then
modules.default = {}
end
table.insert(modules.default, module)
end
end
return modules
end
---@param list string[]
---@return integer length
local function longest_string_length(list)
local length = 0
for _, value in ipairs(list) do
if #value > length then
length = #value
end
end
return length
end
---@param curbuf integer
---@param origbuf integer
---@param parserlist string[]
---@param namespace string
---@param modulelist string[]
local function append_module_table(curbuf, origbuf, parserlist, namespace, modulelist)
local maxlen_parser = longest_string_length(parserlist)
table.sort(modulelist)
-- header
local header = ">> " .. namespace .. string.rep(" ", maxlen_parser - #namespace - 1)
for _, module in pairs(modulelist) do
header = header .. module .. " "
end
api.nvim_buf_set_lines(curbuf, -1, -1, true, { header })
-- actual table
for _, parser in ipairs(parserlist) do
local padding = string.rep(" ", maxlen_parser - #parser + 2)
local line = parser .. padding
local namespace_prefix = (namespace == "default") and "" or namespace .. "."
for _, module in pairs(modulelist) do
local modlen = #module
module = namespace_prefix .. module
if configs.is_enabled(module, parser, origbuf) then
line = line .. ""
else
line = line .. ""
end
line = line .. string.rep(" ", modlen + 1)
end
api.nvim_buf_set_lines(curbuf, -1, -1, true, { line })
end
api.nvim_buf_set_lines(curbuf, -1, -1, true, { "" })
end
local function print_info_modules(parserlist, module)
local origbuf = api.nvim_get_current_buf()
api.nvim_command "enew"
local curbuf = api.nvim_get_current_buf()
local modules
if module then
modules = namespace_modules { module }
else
modules = namespace_modules(configs.available_modules())
end
---@type string[]
local namespaces = {}
for k, _ in pairs(modules) do
table.insert(namespaces, k)
end
table.sort(namespaces)
table.sort(parserlist)
for _, namespace in ipairs(namespaces) do
append_module_table(curbuf, origbuf, parserlist, namespace, modules[namespace])
end
api.nvim_buf_set_option(curbuf, "modified", false)
api.nvim_buf_set_option(curbuf, "buftype", "nofile")
vim.cmd [[
syntax match TSModuleInfoGood //
syntax match TSModuleInfoBad //
syntax match TSModuleInfoHeader /^>>.*$/ contains=TSModuleInfoNamespace
syntax match TSModuleInfoNamespace /^>> \w*/ contained
syntax match TSModuleInfoParser /^[^> ]*\ze /
]]
local highlights = {
TSModuleInfoGood = { fg = "LightGreen", bold = true, default = true },
TSModuleInfoBad = { fg = "Crimson", default = true },
TSModuleInfoHeader = { link = "Type", default = true },
TSModuleInfoNamespace = { link = "Statement", default = true },
TSModuleInfoParser = { link = "Identifier", default = true },
}
for k, v in pairs(highlights) do
api.nvim_set_hl(0, k, v)
end
end
local function module_info(module)
if module and not configs.get_module(module) then
return
end
local parserlist = parsers.available_parsers()
if module then
print_info_modules(parserlist, module)
else
print_info_modules(parserlist)
end
end
---@return string[]
function M.installed_parsers()
local installed = {}
for _, p in pairs(parsers.available_parsers()) do
if parsers.has_parser(p) then
table.insert(installed, p)
end
end
return installed
end
M.commands = {
TSInstallInfo = {
run = install_info,
args = {
"-nargs=0",
},
},
TSModuleInfo = {
run = module_info,
args = {
"-nargs=?",
"-complete=custom,nvim_treesitter#available_modules",
},
},
}
return M

View file

@ -0,0 +1,31 @@
local M = {}
function M.setup(...)
require('nvim-treesitter.config').setup(...)
end
function M.get_available(...)
return require('nvim-treesitter.config').get_available(...)
end
function M.get_installed(...)
return require('nvim-treesitter.config').get_installed(...)
end
function M.install(...)
return require('nvim-treesitter.install').install(...)
end
function M.uninstall(...)
return require('nvim-treesitter.install').uninstall(...)
end
function M.update(...)
return require('nvim-treesitter.install').update(...)
end
function M.indentexpr()
return require('nvim-treesitter.indent').get_indent(vim.v.lnum)
end
return M

File diff suppressed because it is too large Load diff

View file

@ -1,368 +0,0 @@
-- Functions to handle locals
-- Locals are a generalization of definition and scopes
-- its the way nvim-treesitter uses to "understand" the code
local queries = require "nvim-treesitter.query"
local ts_utils = require "nvim-treesitter.ts_utils"
local ts_query = vim.treesitter.query
local api = vim.api
local M = {}
function M.collect_locals(bufnr)
return queries.collect_group_results(bufnr, "locals")
end
-- Iterates matches from a locals query file.
-- @param bufnr the buffer
-- @param root the root node
function M.iter_locals(bufnr, root)
return queries.iter_group_results(bufnr, "locals", root)
end
---@param bufnr integer
---@return any
function M.get_locals(bufnr)
return queries.get_matches(bufnr, "locals")
end
-- Creates unique id for a node based on text and range
---@param scope TSNode: the scope node of the definition
---@param node_text string: the node text to use
---@return string: a string id
function M.get_definition_id(scope, node_text)
-- Add a valid starting character in case node text doesn't start with a valid one.
return table.concat({ "k", node_text or "", scope:range() }, "_")
end
function M.get_definitions(bufnr)
local locals = M.get_locals(bufnr)
local defs = {}
for _, loc in ipairs(locals) do
if loc.definition then
table.insert(defs, loc.definition)
end
end
return defs
end
function M.get_scopes(bufnr)
local locals = M.get_locals(bufnr)
local scopes = {}
for _, loc in ipairs(locals) do
if loc.scope and loc.scope.node then
table.insert(scopes, loc.scope.node)
end
end
return scopes
end
function M.get_references(bufnr)
local locals = M.get_locals(bufnr)
local refs = {}
for _, loc in ipairs(locals) do
if loc.reference and loc.reference.node then
table.insert(refs, loc.reference.node)
end
end
return refs
end
-- Gets a table with all the scopes containing a node
-- The order is from most specific to least (bottom up)
---@param node TSNode
---@param bufnr integer
---@return TSNode[]
function M.get_scope_tree(node, bufnr)
local scopes = {} ---@type TSNode[]
for scope in M.iter_scope_tree(node, bufnr) do
table.insert(scopes, scope)
end
return scopes
end
-- Iterates over a nodes scopes moving from the bottom up
---@param node TSNode
---@param bufnr integer
---@return fun(): TSNode|nil
function M.iter_scope_tree(node, bufnr)
local last_node = node
return function()
if not last_node then
return
end
local scope = M.containing_scope(last_node, bufnr, false) or ts_utils.get_root_for_node(node)
last_node = scope:parent()
return scope
end
end
-- Gets a table of all nodes and their 'kinds' from a locals list
---@param local_def any: the local list result
---@return table: a list of node entries
function M.get_local_nodes(local_def)
local result = {}
M.recurse_local_nodes(local_def, function(def, _node, kind)
table.insert(result, vim.tbl_extend("keep", { kind = kind }, def))
end)
return result
end
-- Recurse locals results until a node is found.
-- The accumulator function is given
-- * The table of the node
-- * The node
-- * The full definition match `@definition.var.something` -> 'var.something'
-- * The last definition match `@definition.var.something` -> 'something'
---@param local_def any The locals result
---@param accumulator function The accumulator function
---@param full_match? string The full match path to append to
---@param last_match? string The last match
function M.recurse_local_nodes(local_def, accumulator, full_match, last_match)
if type(local_def) ~= "table" then
return
end
if local_def.node then
accumulator(local_def, local_def.node, full_match, last_match)
else
for match_key, def in pairs(local_def) do
M.recurse_local_nodes(def, accumulator, full_match and (full_match .. "." .. match_key) or match_key, match_key)
end
end
end
-- Get a single dimension table to look definition nodes.
-- Keys are generated by using the range of the containing scope and the text of the definition node.
-- This makes looking up a definition for a given scope a simple key lookup.
--
-- This is memoized by buffer tick. If the function is called in succession
-- without the buffer tick changing, then the previous result will be used
-- since the syntax tree hasn't changed.
--
-- Usage lookups require finding the definition of the node, so `find_definition`
-- is called very frequently, which is why this lookup must be fast as possible.
--
---@param bufnr integer: the buffer
---@return table result: a table for looking up definitions
M.get_definitions_lookup_table = ts_utils.memoize_by_buf_tick(function(bufnr)
local definitions = M.get_definitions(bufnr)
local result = {}
for _, definition in ipairs(definitions) do
for _, node_entry in ipairs(M.get_local_nodes(definition)) do
local scopes = M.get_definition_scopes(node_entry.node, bufnr, node_entry.scope)
-- Always use the highest valid scope
local scope = scopes[#scopes]
local node_text = ts_query.get_node_text(node_entry.node, bufnr)
local id = M.get_definition_id(scope, node_text)
result[id] = node_entry
end
end
return result
end)
-- Gets all the scopes of a definition based on the scope type
-- Scope types can be
--
-- "parent": Uses the parent of the containing scope, basically, skipping a scope
-- "global": Uses the top most scope
-- "local": Uses the containing scope of the definition. This is the default
--
---@param node TSNode: the definition node
---@param bufnr integer: the buffer
---@param scope_type string: the scope type
function M.get_definition_scopes(node, bufnr, scope_type)
local scopes = {}
local scope_count = 1 ---@type integer|nil
-- Definition is valid for the containing scope
-- and the containing scope of that scope
if scope_type == "parent" then
scope_count = 2
-- Definition is valid in all parent scopes
elseif scope_type == "global" then
scope_count = nil
end
local i = 0
for scope in M.iter_scope_tree(node, bufnr) do
table.insert(scopes, scope)
i = i + 1
if scope_count and i >= scope_count then
break
end
end
return scopes
end
---@param node TSNode
---@param bufnr integer
---@return TSNode node
---@return TSNode scope
---@return string|nil kind
function M.find_definition(node, bufnr)
local def_lookup = M.get_definitions_lookup_table(bufnr)
local node_text = ts_query.get_node_text(node, bufnr)
for scope in M.iter_scope_tree(node, bufnr) do
local id = M.get_definition_id(scope, node_text)
if def_lookup[id] then
local entry = def_lookup[id]
return entry.node, scope, entry.kind
end
end
return node, ts_utils.get_root_for_node(node), nil
end
-- Finds usages of a node in a given scope.
---@param node TSNode the node to find usages for
---@param scope_node TSNode the node to look within
---@return TSNode[]: a list of nodes
function M.find_usages(node, scope_node, bufnr)
bufnr = bufnr or api.nvim_get_current_buf()
local node_text = ts_query.get_node_text(node, bufnr)
if not node_text or #node_text < 1 then
return {}
end
local scope_node = scope_node or ts_utils.get_root_for_node(node)
local usages = {}
for match in M.iter_locals(bufnr, scope_node) do
if
match.reference
and match.reference.node
and ts_query.get_node_text(match.reference.node, bufnr) == node_text
then
local def_node, _, kind = M.find_definition(match.reference.node, bufnr)
if kind == nil or def_node == node then
table.insert(usages, match.reference.node)
end
end
end
return usages
end
---@param node TSNode
---@param bufnr? integer
---@param allow_scope? boolean
---@return TSNode|nil
function M.containing_scope(node, bufnr, allow_scope)
local bufnr = bufnr or api.nvim_get_current_buf()
local allow_scope = allow_scope == nil or allow_scope == true
local scopes = M.get_scopes(bufnr)
if not node or not scopes then
return
end
local iter_node = node
while iter_node ~= nil and not vim.tbl_contains(scopes, iter_node) do
iter_node = iter_node:parent()
end
return iter_node or (allow_scope and node or nil)
end
function M.nested_scope(node, cursor_pos)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
if not node or not scopes then
return
end
local row = cursor_pos.row ---@type integer
local col = cursor_pos.col ---@type integer
local scope = M.containing_scope(node)
for _, child in ipairs(ts_utils.get_named_children(scope)) do
local row_, col_ = child:start()
if vim.tbl_contains(scopes, child) and ((row_ + 1 == row and col_ > col) or row_ + 1 > row) then
return child
end
end
end
function M.next_scope(node)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
if not node or not scopes then
return
end
local scope = M.containing_scope(node)
local parent = scope:parent()
if not parent then
return
end
local is_prev = true
for _, child in ipairs(ts_utils.get_named_children(parent)) do
if child == scope then
is_prev = false
elseif not is_prev and vim.tbl_contains(scopes, child) then
return child
end
end
end
---@param node TSNode
---@return TSNode|nil
function M.previous_scope(node)
local bufnr = api.nvim_get_current_buf()
local scopes = M.get_scopes(bufnr)
if not node or not scopes then
return
end
local scope = M.containing_scope(node)
local parent = scope:parent()
if not parent then
return
end
local is_prev = true
local children = ts_utils.get_named_children(parent)
for i = #children, 1, -1 do
if children[i] == scope then
is_prev = false
elseif not is_prev and vim.tbl_contains(scopes, children[i]) then
return children[i]
end
end
end
return M

100
lua/nvim-treesitter/log.lua Normal file
View file

@ -0,0 +1,100 @@
local echo = vim.api.nvim_echo
-- TODO(lewis6991): write these out to a file
local messages = {} --- @type {[1]: string, [2]: string?, [3]: string}[]
local sev_to_hl = {
trace = 'DiagnosticHint',
debug = 'Normal',
info = 'MoreMsg',
warn = 'WarningMsg',
error = 'ErrorMsg',
}
---@param ctx string?
---@return string
local function mkpfx(ctx)
return ctx and string.format('[nvim-treesitter/%s]', ctx) or '[nvim-treesitter]'
end
---@class TSLogModule
---@field trace fun(fmt: string, ...: any)
---@field debug fun(fmt: string, ...: any)
---@field info fun(fmt: string, ...: any)
---@field warn fun(fmt: string, ...: any)
---@field error fun(fmt: string, ...: any)
local M = {}
---@class Logger
---@field ctx? string
local Logger = {}
M.Logger = Logger
---@param ctx? string
---@return Logger
function M.new(ctx)
return setmetatable({ ctx = ctx }, { __index = Logger })
end
---@param m string
---@param ... any
function Logger:trace(m, ...)
messages[#messages + 1] = { 'trace', self.ctx, m:format(...) }
end
---@param m string
---@param ... any
function Logger:debug(m, ...)
messages[#messages + 1] = { 'debug', self.ctx, m:format(...) }
end
---@param m string
---@param ... any
function Logger:info(m, ...)
local m1 = m:format(...)
messages[#messages + 1] = { 'info', self.ctx, m1 }
echo({ { mkpfx(self.ctx) .. ': ' .. m1, sev_to_hl.info } }, true, {})
end
---@param m string
---@param ... any
function Logger:warn(m, ...)
local m1 = m:format(...)
messages[#messages + 1] = { 'warn', self.ctx, m1 }
echo({ { mkpfx(self.ctx) .. ' warning: ' .. m1, sev_to_hl.warn } }, true, {})
end
---@param m string
---@param ... any
---@return string
function Logger:error(m, ...)
local m1 = m:format(...)
messages[#messages + 1] = { 'error', self.ctx, m1 }
echo({ { mkpfx(self.ctx) .. ' error: ' .. m1, sev_to_hl.error } }, true, {})
return m1
end
local noctx_logger = M.new()
setmetatable(M, {
__index = function(t, k)
--- @diagnostic disable-next-line:no-unknown
t[k] = function(...)
return noctx_logger[k](noctx_logger, ...)
end
return t[k]
end,
})
function M.show()
for _, l in ipairs(messages) do
local sev, ctx, msg = l[1], l[2], l[3]
local hl = sev_to_hl[sev]
local text = ctx and string.format('%s(%s): %s', sev, ctx, msg)
or string.format('%s: %s', sev, msg)
echo({ { text, hl } }, false, {})
end
end
return M

File diff suppressed because it is too large Load diff

View file

@ -1,453 +0,0 @@
local api = vim.api
local tsq = require "vim.treesitter.query"
local tsrange = require "nvim-treesitter.tsrange"
local utils = require "nvim-treesitter.utils"
local parsers = require "nvim-treesitter.parsers"
local caching = require "nvim-treesitter.caching"
local M = {}
local EMPTY_ITER = function() end
M.built_in_query_groups = { "highlights", "locals", "folds", "indents", "injections" }
-- Creates a function that checks whether a given query exists
-- for a specific language.
---@param query string
---@return fun(string): boolean
local function get_query_guard(query)
return function(lang)
return M.has_query_files(lang, query)
end
end
for _, query in ipairs(M.built_in_query_groups) do
M["has_" .. query] = get_query_guard(query)
end
---@return string[]
function M.available_query_groups()
local query_files = api.nvim_get_runtime_file("queries/*/*.scm", true)
local groups = {}
for _, f in ipairs(query_files) do
groups[vim.fn.fnamemodify(f, ":t:r")] = true
end
local list = {}
for k, _ in pairs(groups) do
table.insert(list, k)
end
return list
end
do
local query_cache = caching.create_buffer_cache()
local function update_cached_matches(bufnr, changed_tick, query_group)
query_cache.set(query_group, bufnr, {
tick = changed_tick,
cache = M.collect_group_results(bufnr, query_group) or {},
})
end
---@param bufnr integer
---@param query_group string
---@return any
function M.get_matches(bufnr, query_group)
bufnr = bufnr or api.nvim_get_current_buf()
local cached_local = query_cache.get(query_group, bufnr)
if not cached_local or api.nvim_buf_get_changedtick(bufnr) > cached_local.tick then
update_cached_matches(bufnr, api.nvim_buf_get_changedtick(bufnr), query_group)
end
return query_cache.get(query_group, bufnr).cache
end
end
---@param lang string
---@param query_name string
---@return string[]
local function runtime_queries(lang, query_name)
return api.nvim_get_runtime_file(string.format("queries/%s/%s.scm", lang, query_name), true) or {}
end
---@type table<string, table<string, boolean>>
local query_files_cache = {}
---@param lang string
---@param query_name string
---@return boolean
function M.has_query_files(lang, query_name)
if not query_files_cache[lang] then
query_files_cache[lang] = {}
end
if query_files_cache[lang][query_name] == nil then
local files = runtime_queries(lang, query_name)
query_files_cache[lang][query_name] = files and #files > 0
end
return query_files_cache[lang][query_name]
end
do
local mt = {}
mt.__index = function(tbl, key)
if rawget(tbl, key) == nil then
rawset(tbl, key, {})
end
return rawget(tbl, key)
end
-- cache will auto set the table for each lang if it is nil
---@type table<string, table<string, Query>>
local cache = setmetatable({}, mt)
-- Same as `vim.treesitter.query` except will return cached values
---@param lang string
---@param query_name string
function M.get_query(lang, query_name)
if cache[lang][query_name] == nil then
cache[lang][query_name] = tsq.get_query(lang, query_name)
end
return cache[lang][query_name]
end
-- Invalidates the query file cache.
--
-- If lang and query_name is both present, will reload for only the lang and query_name.
-- If only lang is present, will reload all query_names for that lang
-- If none are present, will reload everything
---@param lang? string
---@param query_name? string
function M.invalidate_query_cache(lang, query_name)
if lang and query_name then
cache[lang][query_name] = nil
if query_files_cache[lang] then
query_files_cache[lang][query_name] = nil
end
elseif lang and not query_name then
query_files_cache[lang] = nil
for query_name0, _ in pairs(cache[lang]) do
M.invalidate_query_cache(lang, query_name0)
end
elseif not lang and not query_name then
query_files_cache = {}
for lang0, _ in pairs(cache) do
for query_name0, _ in pairs(cache[lang0]) do
M.invalidate_query_cache(lang0, query_name0)
end
end
else
error "Cannot have query_name by itself!"
end
end
end
-- This function is meant for an autocommand and not to be used. Only use if file is a query file.
---@param fname string
function M.invalidate_query_file(fname)
local fnamemodify = vim.fn.fnamemodify
M.invalidate_query_cache(fnamemodify(fname, ":p:h:t"), fnamemodify(fname, ":t:r"))
end
---@class QueryInfo
---@field root TSNode
---@field source integer
---@field start integer
---@field stop integer
---@param bufnr integer
---@param query_name string
---@param root TSNode
---@param root_lang string|nil
---@return Query|nil, QueryInfo|nil
local function prepare_query(bufnr, query_name, root, root_lang)
local buf_lang = parsers.get_buf_lang(bufnr)
if not buf_lang then
return
end
local parser = parsers.get_parser(bufnr, buf_lang)
if not parser then
return
end
if not root then
local first_tree = parser:trees()[1]
if first_tree then
root = first_tree:root()
end
end
if not root then
return
end
local range = { root:range() }
if not root_lang then
local lang_tree = parser:language_for_range(range)
if lang_tree then
root_lang = lang_tree:lang()
end
end
if not root_lang then
return
end
local query = M.get_query(root_lang, query_name)
if not query then
return
end
return query,
{
root = root,
source = bufnr,
start = range[1],
-- The end row is exclusive so we need to add 1 to it.
stop = range[3] + 1,
}
end
---@param query Query
---@param bufnr integer
---@param start_row integer
---@param end_row integer
function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
-- A function that splits a string on '.'
---@param to_split string
---@return string[]
local function split(to_split)
local t = {}
for str in string.gmatch(to_split, "([^.]+)") do
table.insert(t, str)
end
return t
end
-- 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
for index = 1, (#path - 1) do
if curr_obj[path[index]] == nil then
curr_obj[path[index]] = {}
end
curr_obj = curr_obj[path[index]]
end
curr_obj[path[#path]] = value
end
local matches = query:iter_matches(qnode, bufnr, start_row, end_row)
local function iterator()
local pattern, match, metadata = matches()
if pattern ~= nil then
local prepared_match = {}
-- Extract capture names from each match
for id, node in pairs(match) do
local name = query.captures[id] -- name of the capture in the query
if name ~= nil then
local path = split(name .. ".node")
insert_to_path(prepared_match, path, node)
local metadata_path = split(name .. ".metadata")
insert_to_path(prepared_match, metadata_path, metadata[id])
end
end
-- Add some predicates for testing
---@type string[][] ( TODO: make pred type so this can be pred[])
local preds = query.info.patterns[pattern]
if preds then
for _, pred in pairs(preds) do
-- functions
if pred[1] == "set!" and type(pred[2]) == "string" then
insert_to_path(prepared_match, split(pred[2]), pred[3])
end
if pred[1] == "make-range!" and type(pred[2]) == "string" and #pred == 4 then
insert_to_path(
prepared_match,
split(pred[2] .. ".node"),
tsrange.TSRange.from_nodes(bufnr, match[pred[3]], match[pred[4]])
)
end
end
end
return prepared_match
end
end
return iterator
end
-- Return all nodes corresponding to a specific capture path (like @definition.var, @reference.type)
-- Works like M.get_references or M.get_scopes except you can choose the capture
-- Can also be a nested capture like @definition.function to get all nodes defining a function.
--
---@param bufnr integer the buffer
---@param captures string|string[]
---@param query_group string the name of query group (highlights or injections for example)
---@param root TSNode|nil node from where to start the search
---@param lang string|nil the language from where to get the captures.
--- Root nodes can have several languages.
---@return table|nil
function M.get_capture_matches(bufnr, captures, query_group, root, lang)
if type(captures) == "string" then
captures = { captures }
end
local strip_captures = {} ---@type string[]
for i, capture in ipairs(captures) do
if capture:sub(1, 1) ~= "@" then
error 'Captures must start with "@"'
return
end
-- Remove leading "@".
strip_captures[i] = capture:sub(2)
end
local matches = {}
for match in M.iter_group_results(bufnr, query_group, root, lang) do
for _, capture in ipairs(strip_captures) do
local insert = utils.get_at_path(match, capture)
if insert then
table.insert(matches, insert)
end
end
end
return matches
end
function M.iter_captures(bufnr, query_name, root, lang)
local query, params = prepare_query(bufnr, query_name, root, lang)
if not query then
return EMPTY_ITER
end
assert(params)
local iter = query:iter_captures(params.root, params.source, params.start, params.stop)
local function wrapped_iter()
local id, node, metadata = iter()
if not id then
return
end
local name = query.captures[id]
if string.sub(name, 1, 1) == "_" then
return wrapped_iter()
end
return name, node, metadata
end
return wrapped_iter
end
---@param bufnr integer
---@param capture_string string
---@param query_group string
---@param filter_predicate fun(match: table): boolean
---@param scoring_function fun(match: table): number
---@param root TSNode
---@return table|unknown
function M.find_best_match(bufnr, capture_string, query_group, filter_predicate, scoring_function, root)
if string.sub(capture_string, 1, 1) == "@" then
--remove leading "@"
capture_string = string.sub(capture_string, 2)
end
local best ---@type table|nil
local best_score ---@type number
for maybe_match in M.iter_group_results(bufnr, query_group, root) do
local match = utils.get_at_path(maybe_match, capture_string)
if match and filter_predicate(match) then
local current_score = scoring_function(match)
if not best then
best = match
best_score = current_score
end
if current_score > best_score then
best = match
best_score = current_score
end
end
end
return best
end
---Iterates matches from a query file.
---@param bufnr integer the buffer
---@param query_group string the query file to use
---@param root TSNode the root node
---@param root_lang? string the root node lang, if known
function M.iter_group_results(bufnr, query_group, root, root_lang)
local query, params = prepare_query(bufnr, query_group, root, root_lang)
if not query then
return EMPTY_ITER
end
assert(params)
return M.iter_prepared_matches(query, params.root, params.source, params.start, params.stop)
end
function M.collect_group_results(bufnr, query_group, root, lang)
local matches = {}
for prepared_match in M.iter_group_results(bufnr, query_group, root, lang) do
table.insert(matches, prepared_match)
end
return matches
end
---@alias CaptureResFn function(string, LanguageTree, LanguageTree): string, string
-- Same as get_capture_matches except this will recursively get matches for every language in the tree.
---@param bufnr integer The buffer
---@param capture_or_fn string|CaptureResFn The capture to get. If a function is provided then that
--- function will be used to resolve both the capture and query argument.
--- The function can return `nil` to ignore that tree.
---@param query_type string? The query to get the capture from. This is ignored if a function is provided
--- for the capture argument.
---@return table[]
function M.get_capture_matches_recursively(bufnr, capture_or_fn, query_type)
---@type CaptureResFn
local type_fn
if type(capture_or_fn) == "function" then
type_fn = capture_or_fn
else
type_fn = function(_, _, _)
return capture_or_fn, query_type
end
end
local parser = parsers.get_parser(bufnr)
local matches = {}
if parser then
parser:for_each_tree(function(tree, lang_tree)
local lang = lang_tree:lang()
local capture, type_ = type_fn(lang, tree, lang_tree)
if capture then
vim.list_extend(matches, M.get_capture_matches(bufnr, capture, type_, tree:root(), lang) or {})
end
end)
end
return matches
end
return M

View file

@ -1,225 +0,0 @@
local query = require "vim.treesitter.query"
local function error(str)
vim.api.nvim_err_writeln(str)
end
local function valid_args(name, pred, count, strict_count)
local arg_count = #pred - 1
if strict_count then
if arg_count ~= count then
error(string.format("%s must have exactly %d arguments", name, count))
return false
end
elseif arg_count < count then
error(string.format("%s must have at least %d arguments", name, count))
return false
end
return true
end
---@param match (TSNode|nil)[]
---@param _pattern string
---@param _bufnr integer
---@param pred string[]
---@return boolean|nil
query.add_predicate("nth?", function(match, _pattern, _bufnr, pred)
if not valid_args("nth?", pred, 2, true) then
return
end
local node = match[pred[2]] ---@type TSNode
local n = tonumber(pred[3])
if node and node:parent() and node:parent():named_child_count() > n then
return node:parent():named_child(n) == node
end
return false
end)
---@param match (TSNode|nil)[]
---@param _pattern string
---@param _bufnr integer
---@param pred string[]
---@return boolean|nil
local function has_ancestor(match, _pattern, _bufnr, pred)
if not valid_args(pred[1], pred, 2) then
return
end
local node = match[pred[2]]
local ancestor_types = { unpack(pred, 3) }
if not node then
return true
end
local just_direct_parent = pred[1]:find("has-parent", 1, true)
node = node:parent()
while node do
if vim.tbl_contains(ancestor_types, node:type()) then
return true
end
if just_direct_parent then
node = nil
else
node = node:parent()
end
end
return false
end
query.add_predicate("has-ancestor?", has_ancestor)
query.add_predicate("has-parent?", has_ancestor)
---@param match (TSNode|nil)[]
---@param _pattern string
---@param bufnr integer
---@param pred string[]
---@return boolean|nil
query.add_predicate("is?", function(match, _pattern, bufnr, pred)
if not valid_args("is?", pred, 2) then
return
end
-- Avoid circular dependencies
local locals = require "nvim-treesitter.locals"
local node = match[pred[2]]
local types = { unpack(pred, 3) }
if not node then
return true
end
local _, _, kind = locals.find_definition(node, bufnr)
return vim.tbl_contains(types, kind)
end)
---@param match (TSNode|nil)[]
---@param _pattern string
---@param _bufnr integer
---@param pred string[]
---@return boolean|nil
query.add_predicate("has-type?", function(match, _pattern, _bufnr, pred)
if not valid_args(pred[1], pred, 2) then
return
end
local node = match[pred[2]]
local types = { unpack(pred, 3) }
if not node then
return true
end
return vim.tbl_contains(types, node:type())
end)
-- 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 ---@type string|string[], string, string|integer
if #pred == 3 then
-- (#downcase! @capture "key")
key = pred[3]
value = metadata[pred[2]][key]
else
-- (#downcase! "key")
key = pred[2]
value = metadata[key]
end
if type(value) == "string" then
text = value
else
local node = match[value]
text = query.get_node_text(node, bufnr) or ""
end
if #pred == 3 then
metadata[pred[2]][key] = string.lower(text)
else
metadata[key] = string.lower(text)
end
end)
---@param match (TSNode|nil)[]
---@param _pattern string
---@param _bufnr integer
---@param pred string[]
---@param metadata table
---@return boolean|nil
query.add_directive("exclude_children!", function(match, _pattern, _bufnr, pred, metadata)
local capture_id = pred[2]
local node = match[capture_id]
local start_row, start_col, end_row, end_col = node:range()
local ranges = {}
for i = 0, node:named_child_count() - 1 do
local child = node:named_child(i) ---@type TSNode
local child_start_row, child_start_col, child_end_row, child_end_col = child:range()
if child_start_row > start_row or child_start_col > start_col then
table.insert(ranges, {
start_row,
start_col,
child_start_row,
child_start_col,
})
end
start_row = child_end_row
start_col = child_end_col
end
if end_row > start_row or end_col > start_col then
table.insert(ranges, { start_row, start_col, end_row, end_col })
end
metadata.content = ranges
end)
-- Trim blank lines from end of the region
-- Arguments are the captures to trim.
---@param match (TSNode|nil)[]
---@param _ string
---@param bufnr integer
---@param pred string[]
---@param metadata table
query.add_directive("trim!", function(match, _, bufnr, pred, metadata)
for _, id in ipairs { select(2, unpack(pred)) } do
local node = match[id]
local start_row, start_col, end_row, end_col = node:range()
-- Don't trim if region ends in middle of a line
if end_col ~= 0 then
return
end
while true do
-- As we only care when end_col == 0, always inspect one line above end_row.
local end_line = vim.api.nvim_buf_get_lines(bufnr, end_row - 1, end_row, true)[1]
if end_line ~= "" then
break
end
end_row = end_row - 1
end
-- If this produces an invalid range, we just skip it.
if start_row < end_row or (start_row == end_row and start_col <= end_col) then
if not metadata[id] then
metadata[id] = {}
end
metadata[id].range = { start_row, start_col, end_row, end_col }
end
end
end)

View file

@ -1,310 +0,0 @@
local fn = vim.fn
local utils = require "nvim-treesitter.utils"
-- Convert path for cmd.exe on Windows.
-- This is needed when vim.opt.shellslash is in use.
---@param p string
---@return string
local function cmdpath(p)
if vim.opt.shellslash:get() then
local r = p:gsub("/", "\\")
return r
else
return p
end
end
local M = {}
---@param directory string
---@param cwd string
---@param info_msg string
---@return table
function M.select_mkdir_cmd(directory, cwd, info_msg)
if fn.has "win32" == 1 then
return {
cmd = "cmd",
opts = {
args = { "/C", "mkdir", cmdpath(directory) },
cwd = cwd,
},
info = info_msg,
err = "Could not create " .. directory,
}
else
return {
cmd = "mkdir",
opts = {
args = { directory },
cwd = cwd,
},
info = info_msg,
err = "Could not create " .. directory,
}
end
end
---@param file string
---@param info_msg string
---@return table
function M.select_rm_file_cmd(file, info_msg)
if fn.has "win32" == 1 then
return {
cmd = "cmd",
opts = {
args = { "/C", "if", "exist", cmdpath(file), "del", cmdpath(file) },
},
info = info_msg,
err = "Could not delete " .. file,
}
else
return {
cmd = "rm",
opts = {
args = { file },
},
info = info_msg,
err = "Could not delete " .. file,
}
end
end
---@param executables string[]
---@return string|nil
function M.select_executable(executables)
return vim.tbl_filter(function(c) ---@param c string
return c ~= vim.NIL and fn.executable(c) == 1
end, executables)[1]
end
---@param repo InstallInfo
---@param compiler string
---@return string[]
function M.select_compiler_args(repo, compiler)
if string.match(compiler, "cl$") or string.match(compiler, "cl.exe$") then
return {
"/Fe:",
"parser.so",
"/Isrc",
repo.files,
"-Os",
"/LD",
}
elseif string.match(compiler, "zig$") or string.match(compiler, "zig.exe$") then
return {
"c++",
"-o",
"parser.so",
repo.files,
"-lc",
"-Isrc",
"-shared",
"-Os",
}
else
local args = {
"-o",
"parser.so",
"-I./src",
repo.files,
"-shared",
"-Os",
}
if
#vim.tbl_filter(function(file) ---@param file string
local ext = vim.fn.fnamemodify(file, ":e")
return ext == "cc" or ext == "cpp" or ext == "cxx"
end, repo.files) > 0
then
table.insert(args, "-lstdc++")
end
if fn.has "win32" == 0 then
table.insert(args, "-fPIC")
end
return args
end
end
function M.select_compile_command(repo, cc, compile_location)
local make = M.select_executable { "gmake", "make" }
if
string.match(cc, "cl$")
or string.match(cc, "cl.exe$")
or not repo.use_makefile
or fn.has "win32" == 1
or not make
then
return {
cmd = cc,
info = "Compiling...",
err = "Error during compilation",
opts = {
args = vim.tbl_flatten(M.select_compiler_args(repo, cc)),
cwd = compile_location,
},
}
else
return {
cmd = make,
info = "Compiling...",
err = "Error during compilation",
opts = {
args = {
"--makefile=" .. utils.join_path(utils.get_package_path(), "scripts", "compile_parsers.makefile"),
"CC=" .. cc,
"CXX_STANDARD=" .. (repo.cxx_standard or "c++14"),
},
cwd = compile_location,
},
}
end
end
function M.select_install_rm_cmd(cache_folder, project_name)
if fn.has "win32" == 1 then
local dir = cache_folder .. "\\" .. project_name
return {
cmd = "cmd",
opts = {
args = { "/C", "if", "exist", cmdpath(dir), "rmdir", "/s", "/q", cmdpath(dir) },
},
}
else
return {
cmd = "rm",
opts = {
args = { "-rf", cache_folder .. "/" .. project_name },
},
}
end
end
function M.select_mv_cmd(from, to, cwd)
if fn.has "win32" == 1 then
return {
cmd = "cmd",
opts = {
args = { "/C", "move", "/Y", cmdpath(from), cmdpath(to) },
cwd = cwd,
},
}
else
return {
cmd = "mv",
opts = {
args = { from, to },
cwd = cwd,
},
}
end
end
---@param repo InstallInfo
---@param project_name string
---@param cache_folder string
---@param revision string|nil
---@param prefer_git boolean
---@return table
function M.select_download_commands(repo, project_name, cache_folder, revision, prefer_git)
local can_use_tar = vim.fn.executable "tar" == 1 and vim.fn.executable "curl" == 1
local is_github = repo.url:find("github.com", 1, true)
local is_gitlab = repo.url:find("gitlab.com", 1, true)
revision = revision or repo.branch or "master"
if can_use_tar and (is_github or is_gitlab) and not prefer_git then
local path_sep = utils.get_path_sep()
local url = repo.url:gsub(".git$", "")
local folder_rev = revision
if is_github and revision:match "^v%d" then
folder_rev = revision:sub(2)
end
return {
M.select_install_rm_cmd(cache_folder, project_name .. "-tmp"),
{
cmd = "curl",
info = "Downloading " .. project_name .. "...",
err = "Error during download, please verify your internet connection",
opts = {
args = {
"--silent",
"-L", -- follow redirects
is_github and url .. "/archive/" .. revision .. ".tar.gz"
or url .. "/-/archive/" .. revision .. "/" .. project_name .. "-" .. revision .. ".tar.gz",
"--output",
project_name .. ".tar.gz",
},
cwd = cache_folder,
},
},
M.select_mkdir_cmd(project_name .. "-tmp", cache_folder, "Creating temporary directory"),
{
cmd = "tar",
info = "Extracting " .. project_name .. "...",
err = "Error during tarball extraction.",
opts = {
args = {
"-xvzf",
project_name .. ".tar.gz",
"-C",
project_name .. "-tmp",
},
cwd = cache_folder,
},
},
M.select_rm_file_cmd(cache_folder .. path_sep .. project_name .. ".tar.gz"),
M.select_mv_cmd(
utils.join_path(project_name .. "-tmp", url:match "[^/]-$" .. "-" .. folder_rev),
project_name,
cache_folder
),
M.select_install_rm_cmd(cache_folder, project_name .. "-tmp"),
}
else
local git_folder = utils.join_path(cache_folder, project_name)
local clone_error = "Error during download, please verify your internet connection"
return {
{
cmd = "git",
info = "Downloading " .. project_name .. "...",
err = clone_error,
opts = {
args = {
"clone",
repo.url,
project_name,
},
cwd = cache_folder,
},
},
{
cmd = "git",
info = "Checking out locked revision",
err = "Error while checking out revision",
opts = {
args = {
"checkout",
revision,
},
cwd = git_folder,
},
},
}
end
end
---@param dir string
---@param command string
---@return string command
function M.make_directory_change_for_command(dir, command)
if fn.has "win32" == 1 then
return string.format("pushd %s & %s & popd", cmdpath(dir), command)
else
return string.format("cd %s;\n %s", dir, command)
end
end
return M

View file

@ -1,50 +0,0 @@
local parsers = require "nvim-treesitter.parsers"
local ts_utils = require "nvim-treesitter.ts_utils"
local M = {}
-- Trim spaces and opening brackets from end
local transform_line = function(line)
return line:gsub("%s*[%[%(%{]*%s*$", "")
end
function M.statusline(opts)
if not parsers.has_parser() then
return
end
local options = opts or {}
if type(opts) == "number" then
options = { indicator_size = opts }
end
local bufnr = options.bufnr or 0
local indicator_size = options.indicator_size or 100
local type_patterns = options.type_patterns or { "class", "function", "method" }
local transform_fn = options.transform_fn or transform_line
local separator = options.separator or " -> "
local current_node = ts_utils.get_node_at_cursor()
if not current_node then
return ""
end
local lines = {}
local expr = current_node
while expr do
local line = ts_utils._get_line_for_node(expr, type_patterns, transform_fn, bufnr)
if line ~= "" and not vim.tbl_contains(lines, line) then
table.insert(lines, 1, line)
end
expr = expr:parent()
end
local text = table.concat(lines, separator)
local text_len = #text
if text_len > indicator_size then
return "..." .. text:sub(text_len - indicator_size, text_len)
end
return text
end
return M

View file

@ -1,459 +0,0 @@
local api = vim.api
local parsers = require "nvim-treesitter.parsers"
local utils = require "nvim-treesitter.utils"
local ts = vim.treesitter
local M = {}
local function get_node_text(node, bufnr)
bufnr = bufnr or api.nvim_get_current_buf()
if not node then
return {}
end
-- We have to remember that end_col is end-exclusive
local start_row, start_col, end_row, end_col = ts.get_node_range(node)
if start_row ~= end_row then
local lines = api.nvim_buf_get_lines(bufnr, start_row, end_row + 1, false)
if next(lines) == nil then
return {}
end
lines[1] = string.sub(lines[1], start_col + 1)
-- end_row might be just after the last line. In this case the last line is not truncated.
if #lines == end_row - start_row + 1 then
lines[#lines] = string.sub(lines[#lines], 1, end_col)
end
return lines
else
local line = api.nvim_buf_get_lines(bufnr, start_row, start_row + 1, false)[1]
-- If line is nil then the line is empty
return line and { string.sub(line, start_col + 1, end_col) } or {}
end
end
---@private
---@param node TSNode
---@param type_patterns string[]
---@param transform_fn fun(line: string): string
---@param bufnr integer
---@return string
function M._get_line_for_node(node, type_patterns, transform_fn, bufnr)
local node_type = node:type()
local is_valid = false
for _, rgx in ipairs(type_patterns) do
if node_type:find(rgx) then
is_valid = true
break
end
end
if not is_valid then
return ""
end
local line = transform_fn(vim.trim(get_node_text(node, bufnr)[1] or ""))
-- Escape % to avoid statusline to evaluate content as expression
return line:gsub("%%", "%%%%")
end
-- Gets the actual text content of a node
-- @deprecated Use vim.treesitter.query.get_node_text
-- @param node the node to get the text from
-- @param bufnr the buffer containing the node
-- @return list of lines of text of the node
function M.get_node_text(node, bufnr)
vim.notify_once(
"nvim-treesitter.ts_utils.get_node_text is deprecated: use vim.treesitter.query.get_node_text",
vim.log.levels.WARN
)
return get_node_text(node, bufnr)
end
-- Determines whether a node is the parent of another
-- @param dest the possible parent
-- @param source the possible child node
function M.is_parent(dest, source)
if not (dest and source) then
return false
end
local current = source
while current ~= nil do
if current == dest then
return true
end
current = current:parent()
end
return false
end
-- Get next node with same parent
---@param node TSNode
---@param allow_switch_parents? boolean allow switching parents if last node
---@param allow_next_parent? boolean allow next parent if last node and next parent without children
function M.get_next_node(node, allow_switch_parents, allow_next_parent)
local destination_node ---@type TSNode
local parent = node:parent()
if not parent then
return
end
local found_pos = 0
for i = 0, parent:named_child_count() - 1, 1 do
if parent:named_child(i) == node then
found_pos = i
break
end
end
if parent:named_child_count() > found_pos + 1 then
destination_node = parent:named_child(found_pos + 1)
elseif allow_switch_parents then
local next_node = M.get_next_node(node:parent())
if next_node and next_node:named_child_count() > 0 then
destination_node = next_node:named_child(0)
elseif next_node and allow_next_parent then
destination_node = next_node
end
end
return destination_node
end
-- Get previous node with same parent
---@param node TSNode
---@param allow_switch_parents? boolean allow switching parents if first node
---@param allow_previous_parent? boolean allow previous parent if first node and previous parent without children
function M.get_previous_node(node, allow_switch_parents, allow_previous_parent)
local destination_node ---@type TSNode
local parent = node:parent()
if not parent then
return
end
local found_pos = 0
for i = 0, parent:named_child_count() - 1, 1 do
if parent:named_child(i) == node then
found_pos = i
break
end
end
if 0 < found_pos then
destination_node = parent:named_child(found_pos - 1)
elseif allow_switch_parents then
local previous_node = M.get_previous_node(node:parent())
if previous_node and previous_node:named_child_count() > 0 then
destination_node = previous_node:named_child(previous_node:named_child_count() - 1)
elseif previous_node and allow_previous_parent then
destination_node = previous_node
end
end
return destination_node
end
function M.get_named_children(node)
local nodes = {} ---@type TSNode[]
for i = 0, node:named_child_count() - 1, 1 do
nodes[i + 1] = node:named_child(i)
end
return nodes
end
function M.get_node_at_cursor(winnr, ignore_injected_langs)
winnr = winnr or 0
local cursor = api.nvim_win_get_cursor(winnr)
local cursor_range = { cursor[1] - 1, cursor[2] }
local buf = vim.api.nvim_win_get_buf(winnr)
local root_lang_tree = parsers.get_parser(buf)
if not root_lang_tree then
return
end
local root ---@type TSNode|nil
if ignore_injected_langs then
for _, tree in ipairs(root_lang_tree:trees()) do
local tree_root = tree:root()
if tree_root and ts.is_in_node_range(tree_root, cursor_range[1], cursor_range[2]) then
root = tree_root
break
end
end
else
root = M.get_root_for_position(cursor_range[1], cursor_range[2], root_lang_tree)
end
if not root then
return
end
return root:named_descendant_for_range(cursor_range[1], cursor_range[2], cursor_range[1], cursor_range[2])
end
function M.get_root_for_position(line, col, root_lang_tree)
if not root_lang_tree then
if not parsers.has_parser() then
return
end
root_lang_tree = parsers.get_parser()
end
local lang_tree = root_lang_tree:language_for_range { line, col, line, col }
for _, tree in ipairs(lang_tree:trees()) do
local root = tree:root()
if root and ts.is_in_node_range(root, line, col) then
return root, tree, lang_tree
end
end
-- This isn't a likely scenario, since the position must belong to a tree somewhere.
return nil, nil, lang_tree
end
---comment
---@param node TSNode
---@return TSNode result
function M.get_root_for_node(node)
local parent = node
local result = node
while parent ~= nil do
result = parent
parent = result:parent()
end
return result
end
function M.highlight_node(node, buf, hl_namespace, hl_group)
if not node then
return
end
M.highlight_range({ node:range() }, buf, hl_namespace, hl_group)
end
-- Get a compatible vim range (1 index based) from a TS node range.
--
-- TS nodes start with 0 and the end col is ending exclusive.
-- They also treat a EOF/EOL char as a char ending in the first
-- col of the next row.
---comment
---@param range integer[]
---@param buf integer|nil
---@return integer, integer, integer, integer
function M.get_vim_range(range, buf)
---@type integer, integer, integer, integer
local srow, scol, erow, ecol = unpack(range)
srow = srow + 1
scol = scol + 1
erow = erow + 1
if ecol == 0 then
-- Use the value of the last col of the previous row instead.
erow = erow - 1
if not buf or buf == 0 then
ecol = vim.fn.col { erow, "$" } - 1
else
ecol = #api.nvim_buf_get_lines(buf, erow - 1, erow, false)[1]
end
ecol = math.max(ecol, 1)
end
return srow, scol, erow, ecol
end
function M.highlight_range(range, buf, hl_namespace, hl_group)
---@type integer, integer, integer, integer
local start_row, start_col, end_row, end_col = unpack(range)
---@diagnostic disable-next-line: missing-parameter
vim.highlight.range(buf, hl_namespace, hl_group, { start_row, start_col }, { end_row, end_col })
end
-- Set visual selection to node
-- @param selection_mode One of "charwise" (default) or "v", "linewise" or "V",
-- "blockwise" or "<C-v>" (as a string with 5 characters or a single character)
function M.update_selection(buf, node, selection_mode)
local start_row, start_col, end_row, end_col = M.get_vim_range({ ts.get_node_range(node) }, buf)
local v_table = { charwise = "v", linewise = "V", blockwise = "<C-v>" }
selection_mode = selection_mode or "charwise"
-- Normalise selection_mode
if vim.tbl_contains(vim.tbl_keys(v_table), selection_mode) then
selection_mode = v_table[selection_mode]
end
-- enter visual mode if normal or operator-pending (no) mode
-- Why? According to https://learnvimscriptthehardway.stevelosh.com/chapters/15.html
-- If your operator-pending mapping ends with some text visually selected, Vim will operate on that text.
-- Otherwise, Vim will operate on the text between the original cursor position and the new position.
local mode = api.nvim_get_mode()
if mode.mode ~= selection_mode then
-- Call to `nvim_replace_termcodes()` is needed for sending appropriate command to enter blockwise mode
selection_mode = vim.api.nvim_replace_termcodes(selection_mode, true, true, true)
api.nvim_cmd({ cmd = "normal", bang = true, args = { selection_mode } }, {})
end
api.nvim_win_set_cursor(0, { start_row, start_col - 1 })
vim.cmd "normal! o"
api.nvim_win_set_cursor(0, { end_row, end_col - 1 })
end
-- Byte length of node range
---@param node TSNode
---@return number
function M.node_length(node)
local _, _, start_byte = node:start()
local _, _, end_byte = node:end_()
return end_byte - start_byte
end
---@deprecated Use `vim.treesitter.is_in_node_range()` instead
function M.is_in_node_range(node, line, col)
vim.notify_once(
"nvim-treesitter.ts_utils.is_in_node_range is deprecated: use vim.treesitter.is_in_node_range",
vim.log.levels.WARN
)
return ts.is_in_node_range(node, line, col)
end
---@deprecated Use `vim.treesitter.get_node_range()` instead
function M.get_node_range(node_or_range)
vim.notify_once(
"nvim-treesitter.ts_utils.get_node_range is deprecated: use vim.treesitter.get_node_range",
vim.log.levels.WARN
)
return ts.get_node_range(node_or_range)
end
---@param node TSNode
---@return table
function M.node_to_lsp_range(node)
local start_line, start_col, end_line, end_col = ts.get_node_range(node)
local rtn = {}
rtn.start = { line = start_line, character = start_col }
rtn["end"] = { line = end_line, character = end_col }
return rtn
end
-- Memoizes a function based on the buffer tick of the provided bufnr.
-- The cache entry is cleared when the buffer is detached to avoid memory leaks.
-- The options argument is a table with two optional values:
-- - bufnr: extracts a bufnr from the given arguments.
-- - key: extracts the cache key from the given arguments.
---@param fn function the fn to memoize, taking the buffer as first argument
---@param options? {bufnr: integer?, key: string|fun(...): string?} the memoization options
---@return function: a memoized function
function M.memoize_by_buf_tick(fn, options)
options = options or {}
---@type table<string, {result: any, last_tick: integer}>
local cache = {}
local bufnr_fn = utils.to_func(options.bufnr or utils.identity)
local key_fn = utils.to_func(options.key or utils.identity)
return function(...)
local bufnr = bufnr_fn(...)
local key = key_fn(...)
local tick = api.nvim_buf_get_changedtick(bufnr)
if cache[key] then
if cache[key].last_tick == tick then
return cache[key].result
end
else
local function detach_handler()
cache[key] = nil
end
-- Clean up logic only!
api.nvim_buf_attach(bufnr, false, {
on_detach = detach_handler,
on_reload = detach_handler,
})
end
cache[key] = {
result = fn(...),
last_tick = tick,
}
return cache[key].result
end
end
function M.swap_nodes(node_or_range1, node_or_range2, bufnr, cursor_to_second)
if not node_or_range1 or not node_or_range2 then
return
end
local range1 = M.node_to_lsp_range(node_or_range1)
local range2 = M.node_to_lsp_range(node_or_range2)
local text1 = get_node_text(node_or_range1, bufnr)
local text2 = get_node_text(node_or_range2, bufnr)
local edit1 = { range = range1, newText = table.concat(text2, "\n") }
local edit2 = { range = range2, newText = table.concat(text1, "\n") }
vim.lsp.util.apply_text_edits({ edit1, edit2 }, bufnr, "utf-8")
if cursor_to_second then
utils.set_jump()
local char_delta = 0
local line_delta = 0
if
range1["end"].line < range2.start.line
or (range1["end"].line == range2.start.line and range1["end"].character <= range2.start.character)
then
line_delta = #text2 - #text1
end
if range1["end"].line == range2.start.line and range1["end"].character <= range2.start.character then
if line_delta ~= 0 then
--- why?
--correction_after_line_change = -range2.start.character
--text_now_before_range2 = #(text2[#text2])
--space_between_ranges = range2.start.character - range1["end"].character
--char_delta = correction_after_line_change + text_now_before_range2 + space_between_ranges
--- Equivalent to:
char_delta = #text2[#text2] - range1["end"].character
-- add range1.start.character if last line of range1 (now text2) does not start at 0
if range1.start.line == range2.start.line + line_delta then
char_delta = char_delta + range1.start.character
end
else
char_delta = #text2[#text2] - #text1[#text1]
end
end
api.nvim_win_set_cursor(
api.nvim_get_current_win(),
{ range2.start.line + 1 + line_delta, range2.start.character + char_delta }
)
end
end
function M.goto_node(node, goto_end, avoid_set_jump)
if not node then
return
end
if not avoid_set_jump then
utils.set_jump()
end
local range = { M.get_vim_range { node:range() } }
---@type table<number>
local position
if not goto_end then
position = { range[1], range[2] }
else
position = { range[3], range[4] }
end
-- Position is 1, 0 indexed.
api.nvim_win_set_cursor(0, { position[1], position[2] - 1 })
end
return M

View file

@ -1,154 +0,0 @@
local M = {}
local TSRange = {}
TSRange.__index = TSRange
local api = vim.api
local ts_utils = require "nvim-treesitter.ts_utils"
local parsers = require "nvim-treesitter.parsers"
local function get_byte_offset(buf, row, col)
return api.nvim_buf_get_offset(buf, row) + vim.fn.byteidx(api.nvim_buf_get_lines(buf, row, row + 1, false)[1], col)
end
function TSRange.new(buf, start_row, start_col, end_row, end_col)
return setmetatable({
start_pos = { start_row, start_col, get_byte_offset(buf, start_row, start_col) },
end_pos = { end_row, end_col, get_byte_offset(buf, end_row, end_col) },
buf = buf,
[1] = start_row,
[2] = start_col,
[3] = end_row,
[4] = end_col,
}, TSRange)
end
function TSRange.from_nodes(buf, start_node, end_node)
TSRange.__index = TSRange
local start_pos = start_node and { start_node:start() } or { end_node:start() }
local end_pos = end_node and { end_node:end_() } or { start_node:end_() }
return setmetatable({
start_pos = { start_pos[1], start_pos[2], start_pos[3] },
end_pos = { end_pos[1], end_pos[2], end_pos[3] },
buf = buf,
[1] = start_pos[1],
[2] = start_pos[2],
[3] = end_pos[1],
[4] = end_pos[2],
}, TSRange)
end
function TSRange.from_table(buf, range)
return setmetatable({
start_pos = { range[1], range[2], get_byte_offset(buf, range[1], range[2]) },
end_pos = { range[3], range[4], get_byte_offset(buf, range[3], range[4]) },
buf = buf,
[1] = range[1],
[2] = range[2],
[3] = range[3],
[4] = range[4],
}, TSRange)
end
function TSRange:parent()
local root_lang_tree = parsers.get_parser(self.buf)
local root = ts_utils.get_root_for_position(self[1], self[2], root_lang_tree)
return root
and root:named_descendant_for_range(self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2])
or nil
end
function TSRange:field() end
function TSRange:child_count()
return #self:collect_children()
end
function TSRange:named_child_count()
return #self:collect_children(function(c)
return c:named()
end)
end
function TSRange:iter_children()
local raw_iterator = self:parent().iter_children()
return function()
while true do
local node = raw_iterator()
if not node then
return
end
local _, _, start_byte = node:start()
local _, _, end_byte = node:end_()
if start_byte >= self.start_pos[3] and end_byte <= self.end_pos[3] then
return node
end
end
end
end
function TSRange:collect_children(filter_fun)
local children = {}
for _, c in self:iter_children() do
if not filter_fun or filter_fun(c) then
table.insert(children, c)
end
end
return children
end
function TSRange:child(index)
return self:collect_children()[index + 1]
end
function TSRange:named_child(index)
return self:collect_children(function(c)
return c.named()
end)[index + 1]
end
function TSRange:start()
return unpack(self.start_pos)
end
function TSRange:end_()
return unpack(self.end_pos)
end
function TSRange:range()
return self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2]
end
function TSRange:type()
return "nvim-treesitter-range"
end
function TSRange:symbol()
return -1
end
function TSRange:named()
return false
end
function TSRange:missing()
return false
end
function TSRange:has_error()
return #self:collect_children(function(c)
return c:has_error()
end) > 0 and true or false
end
function TSRange:sexpr()
return table.concat(
vim.tbl_map(function(c)
return c:sexpr()
end, self:collect_children()),
" "
)
end
M.TSRange = TSRange
return M

View file

@ -0,0 +1,20 @@
local M = {}
--- @param filename string
--- @return string
function M.read_file(filename)
local file = assert(io.open(filename, 'r'))
local r = file:read('*a')
file:close()
return r
end
--- @param filename string
--- @param content string
function M.write_file(filename, content)
local file = assert(io.open(filename, 'w'))
file:write(content)
file:close()
end
return M

View file

@ -1,237 +0,0 @@
local api = vim.api
local fn = vim.fn
local luv = vim.loop
local M = {}
-- Wrapper around vim.notify with common options set.
---@param msg string
---@param log_level number|nil
---@param opts table|nil
function M.notify(msg, log_level, opts)
local default_opts = { title = "nvim-treesitter" }
vim.notify(msg, log_level, vim.tbl_extend("force", default_opts, opts or {}))
end
-- Returns the system-specific path separator.
---@return string
function M.get_path_sep()
return (fn.has "win32" == 1 and not vim.opt.shellslash:get()) and "\\" or "/"
end
-- Returns a function that joins the given arguments with separator. Arguments
-- can't be nil. Example:
--
--[[
print(M.generate_join(" ")("foo", "bar"))
--]]
--prints "foo bar"
---@param separator string
---@return fun(...: string): string
function M.generate_join(separator)
return function(...)
return table.concat({ ... }, separator)
end
end
M.join_path = M.generate_join(M.get_path_sep())
M.join_space = M.generate_join " "
---@class Command
---@field run function
---@field f_args string
---@field args string
-- Define user defined vim command which calls nvim-treesitter module function
-- - If module name is 'mod', it should be defined in hierarchy 'nvim-treesitter.mod'
-- - A table with name 'commands' should be defined in 'mod' which needs to be passed as
-- the commands param of this function
--
---@param mod string Name of the module that resides in the hierarchy - nvim-treesitter.module
---@param commands table<string, Command> 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 <f-args>)
--- - type of arguments that needs to be passed to the vim command
--- - {args}: (string, optional)
--- - vim command attributes
---
---* @example
--- If module is nvim-treesitter.custom_mod
--- <pre>
--- M.commands = {
--- custom_command = {
--- run = M.module_function,
--- f_args = "<f-args>",
--- args = {
--- "-range"
--- }
--- }
--- }
---
--- utils.setup_commands("custom_mod", require("nvim-treesitter.custom_mod").commands)
--- </pre>
---
--- Will generate command :
--- <pre>
--- command! -range custom_command \
--- lua require'nvim-treesitter.custom_mod'.commands.custom_command['run<bang>'](<f-args>)
--- </pre>
function M.setup_commands(mod, commands)
for command_name, def in pairs(commands) do
local f_args = def.f_args or "<f-args>"
local call_fn =
string.format("lua require'nvim-treesitter.%s'.commands.%s['run<bang>'](%s)", mod, command_name, f_args)
local parts = vim.tbl_flatten {
"command!",
"-bar",
def.args,
command_name,
call_fn,
}
api.nvim_command(table.concat(parts, " "))
end
end
---@param dir string
---@param create_err string
---@param writeable_err string
---@return string|nil, string|nil
function M.create_or_reuse_writable_dir(dir, create_err, writeable_err)
create_err = create_err or M.join_space("Could not create dir '", dir, "': ")
writeable_err = writeable_err or M.join_space("Invalid rights, '", dir, "' should be read/write")
-- Try creating and using parser_dir if it doesn't exist
if not luv.fs_stat(dir) then
local ok, error = pcall(vim.fn.mkdir, dir, "p", "0755")
if not ok then
return nil, M.join_space(create_err, error)
end
return dir
end
-- parser_dir exists, use it if it's read/write
if luv.fs_access(dir, "RW") then
return dir
end
-- parser_dir exists but isn't read/write, give up
return nil, M.join_space(writeable_err, dir, "'")
end
function M.get_package_path()
-- Path to this source file, removing the leading '@'
local source = string.sub(debug.getinfo(1, "S").source, 2)
-- Path to the package root
return fn.fnamemodify(source, ":p:h:h:h")
end
function M.get_cache_dir()
local cache_dir = fn.stdpath "data"
if luv.fs_access(cache_dir, "RW") then
return cache_dir
elseif luv.fs_access("/tmp", "RW") then
return "/tmp"
end
return nil, M.join_space("Invalid cache rights,", fn.stdpath "data", "or /tmp should be read/write")
end
-- Returns $XDG_DATA_HOME/nvim/site, but could use any directory that is in
-- runtimepath
function M.get_site_dir()
return M.join_path(fn.stdpath "data", "site")
end
-- Gets a property at path
---@param tbl table the table to access
---@param path string the '.' separated path
---@return table|nil result the value at path or nil
function M.get_at_path(tbl, path)
if path == "" then
return tbl
end
local segments = vim.split(path, ".", true)
---@type table[]|table
local result = tbl
for _, segment in ipairs(segments) do
if type(result) == "table" then
---@type table
-- TODO: figure out the actual type of tbl
result = result[segment]
end
end
return result
end
function M.set_jump()
vim.cmd "normal! m'"
end
-- Filters a list based on the given predicate
---@param tbl any[] The list to filter
---@param predicate fun(v:any, i:number):boolean The predicate to filter with
function M.filter(tbl, predicate)
local result = {}
for i, v in ipairs(tbl) do
if predicate(v, i) then
table.insert(result, v)
end
end
return result
end
-- Returns a list of all values from the first list
-- that are not present in the second list.
---@param tbl1 any[] The first table
---@param tbl2 any[] The second table
---@return table
function M.difference(tbl1, tbl2)
return M.filter(tbl1, function(v)
return not vim.tbl_contains(tbl2, v)
end)
end
function M.identity(a)
return a
end
-- Returns a function returning the given value
---@param a any
---@return fun():any
function M.constant(a)
return function()
return a
end
end
-- Returns a function that returns the given value if it is a function,
-- otherwise returns a function that returns the given value.
---@param a any
---@return fun(...):any
function M.to_func(a)
return type(a) == "function" and a or M.constant(a)
end
---@return string|nil
function M.ts_cli_version()
if fn.executable "tree-sitter" == 1 then
local handle = io.popen "tree-sitter -V"
if not handle then
return
end
local result = handle:read "*a"
handle:close()
return vim.split(result, "\n")[1]:match "[^tree%psitter ].*"
end
end
return M

View file

@ -1,35 +0,0 @@
local MODREV, SPECREV = 'scm', '-1'
rockspec_format = '3.0'
package = 'nvim-treesitter'
version = MODREV .. SPECREV
description = {
summary = 'Nvim Treesitter configurations and abstraction layer',
labels = { 'neovim' },
homepage = 'https://github.com/nvim-treesitter/nvim-treesitter',
license = 'Apache-2.0',
}
dependencies = {
'lua >= 5.1',
}
source = {
url = 'git://github.com/nvim-treesitter/nvim-treesitter',
}
build = {
type = 'make',
install_variables = {
INST_PREFIX='$(PREFIX)',
INST_BINDIR='$(BINDIR)',
INST_LIBDIR='$(LIBDIR)',
INST_LUADIR='$(LUADIR)',
INST_CONFDIR='$(CONFDIR)',
},
copy_directories = {
'autoload',
'plugin',
'queries'
}
}

View file

@ -1,2 +0,0 @@
*
!.gitignore

2
parser/.gitignore vendored
View file

@ -1,2 +0,0 @@
*
!.gitignore

69
plugin/filetypes.lua Normal file
View file

@ -0,0 +1,69 @@
local filetypes = {
angular = { 'htmlangular' },
bash = { 'sh' },
bibtex = { 'bib' },
c_sharp = { 'cs', 'csharp' },
commonlisp = { 'lisp' },
cooklang = { 'cook' },
devicetree = { 'dts' },
diff = { 'gitdiff' },
eex = { 'eelixir' },
elixir = { 'ex' },
embedded_template = { 'eruby' },
erlang = { 'erl' },
facility = { 'fsd' },
faust = { 'dsp' },
gdshader = { 'gdshaderinc' },
git_config = { 'gitconfig' },
git_rebase = { 'gitrebase' },
glimmer = { 'handlebars', 'html.handlebars' },
godot_resource = { 'gdresource' },
haskell = { 'hs' },
haskell_persistent = { 'haskellpersistent' },
idris = { 'idris2' },
ini = { 'confini', 'dosini' },
janet_simple = { 'janet' },
javascript = { 'javascriptreact', 'ecma', 'ecmascript', 'jsx', 'js' },
json = { 'jsonc' },
glimmer_javascript = { 'javascript.glimmer' },
latex = { 'tex' },
linkerscript = { 'ld' },
m68k = { 'asm68k' },
make = { 'automake' },
markdown = { 'pandoc' },
muttrc = { 'neomuttrc' },
ocaml_interface = { 'ocamlinterface' },
perl = { 'pl' },
poe_filter = { 'poefilter' },
powershell = { 'ps1' },
properties = { 'jproperties' },
python = { 'py', 'gyp' },
qmljs = { 'qml' },
runescript = { 'clientscript' },
scala = { 'sbt' },
slang = { 'shaderslang' },
sqp = { 'mysqp' },
ssh_config = { 'sshconfig' },
starlark = { 'bzl' },
surface = { 'sface' },
systemverilog = { 'verilog' },
t32 = { 'trace32' },
tcl = { 'expect' },
terraform = { 'terraform-vars' },
textproto = { 'pbtxt' },
tlaplus = { 'tla' },
tsx = { 'typescriptreact', 'typescript.tsx' },
typescript = { 'ts' },
glimmer_typescript = { 'typescript.glimmer' },
typst = { 'typ' },
udev = { 'udevrules' },
uxntal = { 'tal', 'uxn' },
v = { 'vlang' },
vhs = { 'tape' },
xml = { 'xsd', 'xslt', 'svg' },
xresources = { 'xdefaults' },
}
for lang, ft in pairs(filetypes) do
vim.treesitter.language.register(lang, ft)
end

View file

@ -1,34 +1,75 @@
-- Last Change: 2022 Apr 16
if vim.g.loaded_nvim_treesitter then
return
end
vim.g.loaded_nvim_treesitter = true
-- setup modules
require("nvim-treesitter").setup()
local api = vim.api
-- define autocommands
local augroup = api.nvim_create_augroup("NvimTreesitter", {})
local function complete_available_parsers(arglead)
return vim.tbl_filter(
--- @param v string
function(v)
return v:find(arglead) ~= nil
end,
require('nvim-treesitter.config').get_available()
)
end
api.nvim_create_autocmd("Filetype", {
pattern = "query",
group = augroup,
callback = function()
api.nvim_clear_autocmds {
group = augroup,
event = "BufWritePost",
}
api.nvim_create_autocmd("BufWritePost", {
group = augroup,
buffer = 0,
callback = function(opts)
require("nvim-treesitter.query").invalidate_query_file(opts.file)
end,
desc = "Invalidate query file",
})
end,
desc = "Reload query",
local function complete_installed_parsers(arglead)
return vim.tbl_filter(
--- @param v string
function(v)
return v:find(arglead) ~= nil
end,
require('nvim-treesitter.config').get_installed()
)
end
-- create user commands
api.nvim_create_user_command('TSInstall', function(args)
require('nvim-treesitter.install').install(args.fargs, { force = args.bang, summary = true })
end, {
nargs = '+',
bang = true,
bar = true,
complete = complete_available_parsers,
desc = 'Install treesitter parsers',
})
api.nvim_create_user_command('TSInstallFromGrammar', function(args)
require('nvim-treesitter.install').install(args.fargs, {
generate = true,
summary = true,
force = args.bang,
})
end, {
nargs = '+',
bang = true,
bar = true,
complete = complete_available_parsers,
desc = 'Install treesitter parsers from grammar',
})
api.nvim_create_user_command('TSUpdate', function(args)
require('nvim-treesitter.install').update(args.fargs, { summary = true })
end, {
nargs = '*',
bar = true,
complete = complete_installed_parsers,
desc = 'Update installed treesitter parsers',
})
api.nvim_create_user_command('TSUninstall', function(args)
require('nvim-treesitter.install').uninstall(args.fargs, { summary = true })
end, {
nargs = '+',
bar = true,
complete = complete_installed_parsers,
desc = 'Uninstall treesitter parsers',
})
api.nvim_create_user_command('TSLog', function()
require('nvim-treesitter.log').show()
end, {
desc = 'View log messages',
})

View file

@ -0,0 +1,41 @@
local query = vim.treesitter.query
local predicates = {
---@param match table<integer,TSNode[]>
---@param pred any[]
---@param any boolean
---@return boolean
['kind-eq'] = function(match, pred, any)
local nodes = match[pred[2]]
if not nodes or #nodes == 0 then
return true
end
local types = { unpack(pred, 3) }
for _, node in ipairs(nodes) do
local res = vim.list_contains(types, node:type())
if any and res then
return true
elseif not any and not res then
return false
end
end
return not any
end,
}
-- register custom predicates (overwrite existing; needed for CI)
---@param match table<integer,TSNode[]>
---@param pred any[]
---@return boolean
query.add_predicate('kind-eq?', function(match, _, _, pred)
return predicates['kind-eq'](match, pred, false)
end, { force = true })
---@param match table<integer,TSNode[]>
---@param pred any[]
---@return boolean
query.add_predicate('any-kind-eq?', function(match, _, _, pred)
return predicates['kind-eq'](match, pred, true)
end, { force = true })

View file

@ -1,14 +0,0 @@
;; Support for folding in Ada
;; za toggles folding a package, subprogram, if statement or loop
[
(package_declaration)
(generic_package_declaration)
(package_body)
(subprogram_body)
(block_statement)
(if_statement)
(loop_statement)
(gnatprep_declarative_if_statement)
(gnatprep_if_statement)
] @fold

View file

@ -1,180 +0,0 @@
;; highlight queries.
;; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
;; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations
;; for a list of recommended @ tags, though not all of them have matching
;; highlights in neovim.
[
"abort"
"abs"
"abstract"
"accept"
"access"
"all"
"array"
"at"
"begin"
"declare"
"delay"
"delta"
"digits"
"do"
"end"
"entry"
"exit"
"generic"
"interface"
"is"
"limited"
"null"
"of"
"others"
"out"
"pragma"
"private"
"range"
"synchronized"
"tagged"
"task"
"terminate"
"until"
"when"
] @keyword
[
"aliased"
"constant"
"renames"
] @storageclass
[
"mod"
"new"
"protected"
"record"
"subtype"
"type"
] @keyword.type
[
"with"
"use"
] @include
[
"body"
"function"
"overriding"
"procedure"
"package"
"separate"
] @keyword.function
[
"and"
"in"
"not"
"or"
"xor"
] @keyword.operator
[
"while"
"loop"
"for"
"parallel"
"reverse"
"some"
] @repeat
[
"return"
] @keyword.return
[
"case"
"if"
"else"
"then"
"elsif"
"select"
] @conditional
[
"exception"
"raise"
] @exception
(comment) @comment
(comment) @spell ;; spell-check comments
(string_literal) @string
(string_literal) @spell ;; spell-check strings
(character_literal) @string
(numeric_literal) @number
;; Highlight the name of subprograms
(procedure_specification name: (_) @function)
(function_specification name: (_) @function)
(package_declaration name: (_) @function)
(package_body name: (_) @function)
(generic_instantiation name: (_) @function)
(entry_declaration . (identifier) @function)
;; Some keywords should take different categories depending on the context
(use_clause "use" @include "type" @include)
(with_clause "private" @include)
(with_clause "limited" @include)
(use_clause (_) @namespace)
(with_clause (_) @namespace)
(loop_statement "end" @keyword.repeat)
(if_statement "end" @conditional)
(loop_parameter_specification "in" @keyword.repeat)
(loop_parameter_specification "in" @keyword.repeat)
(iterator_specification ["in" "of"] @keyword.repeat)
(range_attribute_designator "range" @keyword.repeat)
(raise_statement "with" @exception)
(gnatprep_declarative_if_statement) @preproc
(gnatprep_if_statement) @preproc
(gnatprep_identifier) @preproc
(subprogram_declaration "is" @keyword.function "abstract" @keyword.function)
(aspect_specification "with" @keyword.function)
(full_type_declaration "is" @keyword.type)
(subtype_declaration "is" @keyword.type)
(record_definition "end" @keyword.type)
(full_type_declaration (_ "access" @keyword.type))
(array_type_definition "array" @keyword.type "of" @keyword.type)
(access_to_object_definition "access" @keyword.type)
(access_to_object_definition "access" @keyword.type
[
(general_access_modifier "constant" @keyword.type)
(general_access_modifier "all" @keyword.type)
]
)
(range_constraint "range" @keyword.type)
(signed_integer_type_definition "range" @keyword.type)
(index_subtype_definition "range" @keyword.type)
(record_type_definition "abstract" @keyword.type)
(record_type_definition "tagged" @keyword.type)
(record_type_definition "limited" @keyword.type)
(record_type_definition (record_definition "null" @keyword.type))
(private_type_declaration "is" @keyword.type "private" @keyword.type)
(private_type_declaration "tagged" @keyword.type)
(private_type_declaration "limited" @keyword.type)
(task_type_declaration "task" @keyword.type "is" @keyword.type)
;; Gray the body of expression functions
(expression_function_declaration
(function_specification)
"is"
(_) @attribute
)
(subprogram_declaration (aspect_specification) @attribute)
;; Highlight full subprogram specifications
;(subprogram_body
; [
; (procedure_specification)
; (function_specification)
; ] @function.spec
;)
;; Highlight errors in red. This is not very useful in practice, as text will
;; be highlighted as user types, and the error could be elsewhere in the code.
;; This also requires defining :hi @error guifg=Red for instance.
(ERROR) @error

View file

@ -1,33 +0,0 @@
;; Better highlighting by referencing to the definition, for variable
;; references. However, this is not yet supported by neovim
;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables
(compilation) @scope
(package_declaration) @scope
(package_body) @scope
(subprogram_declaration) @scope
(subprogram_body) @scope
(block_statement) @scope
(with_clause (identifier) @definition.import)
(procedure_specification name: (_) @definition.function)
(function_specification name: (_) @definition.function)
(package_declaration name: (_) @definition.var)
(package_body name: (_) @definition.var)
(generic_instantiation . name: (_) @definition.var)
(component_declaration . (identifier) @definition.var)
(exception_declaration . (identifier) @definition.var)
(formal_object_declaration . (identifier) @definition.var)
(object_declaration . (identifier) @definition.var)
(parameter_specification . (identifier) @definition.var)
(full_type_declaration . (identifier) @definition.type)
(private_type_declaration . (identifier) @definition.type)
(private_extension_declaration . (identifier) @definition.type)
(incomplete_type_declaration . (identifier) @definition.type)
(protected_type_declaration . (identifier) @definition.type)
(formal_complete_type_declaration . (identifier) @definition.type)
(formal_incomplete_type_declaration . (identifier) @definition.type)
(task_type_declaration . (identifier) @definition.type)
(subtype_declaration . (identifier) @definition.type)
(identifier) @reference

View file

@ -1,4 +0,0 @@
[
(record)
(module)
] @fold

View file

@ -1,82 +0,0 @@
;; Constants
(integer) @number
;; Variables and Symbols
(typed_binding (atom (qid) @variable))
(untyped_binding) @variable
(typed_binding (expr) @type)
(id) @function
(bid) @function
(function_name (atom (qid) @function))
(field_name) @function
[(data_name) (record_name)] @constructor
; Set
(SetN) @type.builtin
(expr . (atom) @function)
((atom) @boolean
(#any-of? @boolean "true" "false" "True" "False"))
;; Imports and Module Declarations
"import" @include
(module_name) @namespace
;; Pragmas and comments
(pragma) @preproc
(comment) @comment
;; Keywords
[
"where"
"data"
"rewrite"
"postulate"
"public"
"private"
"tactic"
"Prop"
"quote"
"renaming"
"open"
"in"
"hiding"
"constructor"
"abstract"
"let"
"field"
"mutual"
"module"
"infix"
"infixl"
"infixr"
"record"
(ARROW)
]
@keyword
;;;(expr
;;; f_name: (atom) @function)
;; Brackets
[
"("
")"
"{"
"}"]
@punctuation.bracket
[
"="
] @operator

View file

@ -1,111 +0,0 @@
; inherits: cpp
((identifier) @function.builtin
(#any-of? @function.builtin
; Digital I/O
"digitalRead"
"digitalWrite"
"pinMode"
; Analog I/O
"analogRead"
"analogReference"
"analogWrite"
; Zero, Due & MKR Family
"analogReadResolution"
"analogWriteResolution"
; Advanced I/O
"noTone"
"pulseIn"
"pulseInLong"
"shiftIn"
"shiftOut"
"tone"
; Time
"delay"
"delayMicroseconds"
"micros"
"millis"
; Math
"abs"
"constrain"
"map"
"max"
"min"
"pow"
"sq"
"sqrt"
; Trigonometry
"cos"
"sin"
"tan"
; Characters
"isAlpha"
"isAlphaNumeric"
"isAscii"
"isControl"
"isDigit"
"isGraph"
"isHexadecimalDigit"
"isLowerCase"
"isPrintable"
"isPunct"
"isSpace"
"isUpperCase"
"isWhitespace"
; Random Numbers
"random"
"randomSeed"
; Bits and Bytes
"bit"
"bitClear"
"bitRead"
"bitSet"
"bitWrite"
"highByte"
"lowByte"
; External Interrupts
"attachInterrupt"
"detachInterrupt"
; Interrupts
"interrupts"
"noInterrupts"
))
((identifier) @type.builtin
(#any-of? @type.builtin
"Serial"
"SPI"
"Stream"
"Wire"
"Keyboard"
"Mouse"
"String"
))
((identifier) @constant.builtin
(#any-of? @constant.builtin
"HIGH"
"LOW"
"INPUT"
"OUTPUT"
"INPUT_PULLUP"
"LED_BUILTIN"
))
(function_definition
(function_declarator
declarator: (identifier) @function.builtin)
(#any-of? @function.builtin "loop" "setup"))
(call_expression
function: (primitive_type) @function.builtin)
(call_expression
function: (identifier) @constructor
(#any-of? @constructor "SPISettings" "String"))
(declaration
(type_identifier) @type.builtin
(function_declarator
declarator: (identifier) @constructor)
(#eq? @type.builtin "SPISettings"))

View file

@ -1,3 +0,0 @@
(preproc_arg) @arduino
(comment) @comment

View file

@ -1,5 +0,0 @@
; inherits: html
[ "---" ] @punctuation.delimiter
[ "{" "}" ] @punctuation.special

View file

@ -1,19 +0,0 @@
; inherits: html
((frontmatter
(raw_text) @typescript))
((interpolation
(raw_text) @tsx))
((script_element
(raw_text) @typescript))
((style_element
(start_tag
(attribute
(attribute_name) @_lang_attr
(quoted_attribute_value (attribute_value) @_lang_value)))
(raw_text) @scss)
(#eq? @_lang_attr "lang")
(#eq? @_lang_value "scss"))

View file

@ -1,154 +0,0 @@
; adapted from https://github.com/Beaglefoot/tree-sitter-awk
[
(identifier)
(field_ref)
] @variable
(field_ref (_) @variable)
(number) @number
(string) @string
(regex) @string.regex
(escape_sequence) @string.escape
(comment) @comment @spell
(ns_qualified_name (namespace) @namespace)
(ns_qualified_name "::" @punctuation.delimiter)
(func_def name: (_ (identifier) @function) @function)
(func_call name: (_ (identifier) @function) @function)
(func_def (param_list (identifier) @parameter))
[
"print"
"printf"
"getline"
] @function.builtin
[
(delete_statement)
(break_statement)
(continue_statement)
(next_statement)
(nextfile_statement)
] @keyword
[
"func"
"function"
] @keyword.function
[
"return"
"exit"
] @keyword.return
[
"do"
"while"
"for"
"in"
] @repeat
[
"if"
"else"
"switch"
"case"
"default"
] @conditional
[
"@include"
"@load"
] @include
"@namespace" @preproc
[
"BEGIN"
"END"
"BEGINFILE"
"ENDFILE"
] @label
(binary_exp [
"^"
"**"
"*"
"/"
"%"
"+"
"-"
"<"
">"
"<="
">="
"=="
"!="
"~"
"!~"
"in"
"&&"
"||"
] @operator)
(unary_exp [
"!"
"+"
"-"
] @operator)
(assignment_exp [
"="
"+="
"-="
"*="
"/="
"%="
"^="
] @operator)
(ternary_exp [
"?"
":"
] @conditional.ternary)
(update_exp [
"++"
"--"
] @operator)
(redirected_io_statement [
">"
">>"
] @operator)
(piped_io_statement [
"|"
"|&"
] @operator)
(piped_io_exp [
"|"
"|&"
] @operator)
(field_ref "$" @punctuation.delimiter)
(regex "/" @punctuation.delimiter)
(regex_constant "@" @punctuation.delimiter)
[ ";" "," ] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket

View file

@ -1,2 +0,0 @@
(comment) @comment
(regex) @regex

View file

@ -1,136 +0,0 @@
(simple_expansion) @none
(expansion
"${" @punctuation.special
"}" @punctuation.special) @none
[
"("
")"
"(("
"))"
"{"
"}"
"["
"]"
"[["
"]]"
] @punctuation.bracket
[
";"
";;"
(heredoc_start)
] @punctuation.delimiter
[
"$"
] @punctuation.special
[
">"
">>"
"<"
"<<"
"&"
"&&"
"|"
"||"
"="
"=~"
"=="
"!="
] @operator
[
(string)
(raw_string)
(ansi_c_string)
(heredoc_body)
] @string @spell
(variable_assignment (word) @string)
[
"if"
"then"
"else"
"elif"
"fi"
"case"
"in"
"esac"
] @conditional
[
"for"
"do"
"done"
"while"
] @repeat
[
"declare"
"export"
"local"
"readonly"
"unset"
] @keyword
"function" @keyword.function
(special_variable_name) @constant
; trap -l
((word) @constant.builtin
(#match? @constant.builtin "^SIG(HUP|INT|QUIT|ILL|TRAP|ABRT|BUS|FPE|KILL|USR[12]|SEGV|PIPE|ALRM|TERM|STKFLT|CHLD|CONT|STOP|TSTP|TT(IN|OU)|URG|XCPU|XFSZ|VTALRM|PROF|WINCH|IO|PWR|SYS|RTMIN([+]([1-9]|1[0-5]))?|RTMAX(-([1-9]|1[0-4]))?)$"))
((word) @boolean
(#match? @boolean "^(true|false)$"))
(comment) @comment @spell
(test_operator) @string
(command_substitution
[ "$(" ")" ] @punctuation.bracket)
(process_substitution
[ "<(" ")" ] @punctuation.bracket)
(function_definition
name: (word) @function)
(command_name (word) @function.call)
((command_name (word) @function.builtin)
(#any-of? @function.builtin
"alias" "cd" "clear" "echo" "eval" "exit" "getopts" "popd"
"pushd" "return" "set" "shift" "shopt" "source" "test"))
(command
argument: [
(word) @parameter
(concatenation (word) @parameter)
])
((word) @number
(#lua-match? @number "^[0-9]+$"))
(file_redirect
descriptor: (file_descriptor) @operator
destination: (word) @parameter)
(expansion
[ "${" "}" ] @punctuation.bracket)
(variable_name) @variable
((variable_name) @constant
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
(case_item
value: (word) @parameter)
(regex) @string.regex
((program . (comment) @preproc)
(#match? @preproc "^#!/"))

View file

@ -1,3 +0,0 @@
(comment) @comment
(regex) @regex

View file

@ -1,13 +0,0 @@
; Scopes
(function_definition) @scope
; Definitions
(variable_assignment
name: (variable_name) @definition.var)
(function_definition
name: (word) @definition.function)
; References
(variable_name) @reference
(word) @reference

View file

@ -1,4 +0,0 @@
[
(transaction)
(section)
] @fold

View file

@ -1,3 +0,0 @@
[
(entry)
] @fold

View file

@ -1,10 +0,0 @@
[
(entry)
] @indent
[
"{"
"}"
] @branch
(comment) @ignore

View file

@ -1,57 +0,0 @@
(object_id) @variable
(string) @string
(escape_sequence) @string.escape
(comment) @comment
(constant) @constant.builtin
(boolean) @boolean
(using) @include
(template) @keyword
(decorator) @attribute
(property_definition (property_name) @property)
(object) @type
(signal_binding (signal_name) @function.builtin)
(signal_binding (function (identifier)) @function)
(signal_binding "swapped" @keyword)
(styles_list "styles" @function.macro)
(layout_definition "layout" @function.macro)
(gettext_string "_" @function.builtin)
(menu_definition "menu" @keyword)
(menu_section "section" @keyword)
(menu_item "item" @function.macro)
(template_definition (template_name_qualifier) @type.qualifier)
(import_statement (gobject_library) @namespace)
(import_statement (version_number) @float)
(float) @float
(number) @number
[
";"
"."
","
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket

View file

@ -1,19 +0,0 @@
[
(for_statement)
(if_statement)
(while_statement)
(switch_statement)
(case_statement)
(function_definition)
(struct_specifier)
(enum_specifier)
(comment)
(preproc_if)
(preproc_elif)
(preproc_else)
(preproc_ifdef)
(initializer_list)
] @fold
(compound_statement
(compound_statement) @fold)

View file

@ -1,202 +0,0 @@
; Lower priority to prefer @parameter when identifier appears in parameter_declaration.
((identifier) @variable (#set! "priority" 95))
[
"default"
"enum"
"struct"
"typedef"
"union"
"goto"
] @keyword
"sizeof" @keyword.operator
"return" @keyword.return
[
"while"
"for"
"do"
"continue"
"break"
] @repeat
[
"if"
"else"
"case"
"switch"
] @conditional
[
"#if"
"#ifdef"
"#ifndef"
"#else"
"#elif"
"#endif"
(preproc_directive)
] @preproc
"#define" @define
"#include" @include
[ ";" ":" "," ] @punctuation.delimiter
"..." @punctuation.special
[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket
[
"="
"-"
"*"
"/"
"+"
"%"
"~"
"|"
"&"
"^"
"<<"
">>"
"->"
"."
"<"
"<="
">="
">"
"=="
"!="
"!"
"&&"
"||"
"-="
"+="
"*="
"/="
"%="
"|="
"&="
"^="
">>="
"<<="
"--"
"++"
] @operator
;; Make sure the comma operator is given a highlight group after the comma
;; punctuator so the operator is highlighted properly.
(comma_expression [ "," ] @operator)
[
(true)
(false)
] @boolean
(conditional_expression [ "?" ":" ] @conditional.ternary)
(string_literal) @string
(system_lib_string) @string
(escape_sequence) @string.escape
(null) @constant.builtin
(number_literal) @number
(char_literal) @character
[
(preproc_arg)
(preproc_defined)
] @function.macro
(((field_expression
(field_identifier) @property)) @_parent
(#not-has-parent? @_parent template_method function_declarator call_expression))
(field_designator) @property
(((field_identifier) @property)
(#has-ancestor? @property field_declaration)
(#not-has-ancestor? @property function_declarator))
(statement_identifier) @label
[
(type_identifier)
(sized_type_specifier)
(type_descriptor)
] @type
(storage_class_specifier) @storageclass
(type_qualifier) @type.qualifier
(linkage_specification
"extern" @storageclass)
(type_definition
declarator: (type_identifier) @type.definition)
(primitive_type) @type.builtin
((identifier) @constant
(#lua-match? @constant "^[A-Z][A-Z0-9_]+$"))
(enumerator
name: (identifier) @constant)
(case_statement
value: (identifier) @constant)
((identifier) @constant.builtin
(#any-of? @constant.builtin "stderr" "stdin" "stdout"))
;; Preproc def / undef
(preproc_def
name: (_) @constant)
(preproc_call
directive: (preproc_directive) @_u
argument: (_) @constant
(#eq? @_u "#undef"))
(call_expression
function: (identifier) @function.call)
(call_expression
function: (field_expression
field: (field_identifier) @function.call))
(function_declarator
declarator: (identifier) @function)
(preproc_function_def
name: (identifier) @function.macro)
(comment) @comment @spell
;; Parameters
(parameter_declaration
declarator: (identifier) @parameter)
(parameter_declaration
declarator: (pointer_declarator) @parameter)
(preproc_params (identifier) @parameter)
[
"__attribute__"
"__cdecl"
"__clrcall"
"__stdcall"
"__fastcall"
"__thiscall"
"__vectorcall"
"_unaligned"
"__unaligned"
"__declspec"
(attribute_declaration)
] @attribute
(ERROR) @error

View file

@ -1,120 +0,0 @@
[
(compound_statement)
(field_declaration_list)
(case_statement)
(enumerator_list)
(compound_literal_expression)
(initializer_list)
(init_declarator)
(expression_statement)
] @indent
(
ERROR
"for" "(" @indent ";" ";" ")" @indent_end)
(
(for_statement
body: (_) @_body
) @indent
(#not-has-type? @_body compound_statement)
)
(
while_statement
condition: (_) @indent
)
(
(while_statement
body: (_) @_body
) @indent
(#not-has-type? @_body compound_statement)
)
(
(if_statement)
(ERROR "else") @indent
)
(
if_statement
condition: (_) @indent
)
;; Make sure all cases of if-else are tagged with @indent
;; So we will offset the indents for the else case
(
(if_statement
consequence: (compound_statement)
"else" @branch
alternative:
[
[ "{" "}" ] @branch
(compound_statement ["{" "}"] @branch)
(_)
]
) @indent
)
(
(if_statement
consequence: (_ ";" @indent_end) @_consequence
) @indent
(#not-has-type? @_consequence compound_statement)
)
(
(if_statement
consequence: (_) @_consequence
"else" @branch
alternative:
[
[ "{" "}" ] @branch
(compound_statement ["{" "}"] @branch)
(_)
]
)
(#not-has-type? @_consequence compound_statement)
)
;; Dedent for chaining if-else statements
;; this will go recursively through each if-elseif
;; if-elseif -> second `if` is dedented once, indented twice
;; if-elseif-elseif -> third `if` is dedented twice, indented 3 times
;; -> all are indented once
(
(if_statement
consequence: (_)
alternative:
[
(if_statement consequence: (compound_statement) @dedent)
(_)
] @dedent
)
)
(compound_statement "}" @indent_end)
[
")"
"}"
(statement_identifier)
] @branch
[
"#define"
"#ifdef"
"#ifndef"
"#elif"
"#if"
"#else"
"#endif"
] @zero_indent
[
(preproc_arg)
(string_literal)
] @ignore
((ERROR (parameter_declaration)) @aligned_indent
(#set! "delimiter" "()"))
([(argument_list) (parameter_list)] @aligned_indent
(#set! "delimiter" "()"))
(comment) @auto

View file

@ -1,3 +0,0 @@
(preproc_arg) @c
(comment) @comment

View file

@ -1,53 +0,0 @@
;; Functions definitions
(function_declarator
declarator: (identifier) @definition.function)
(preproc_function_def
name: (identifier) @definition.macro) @scope
(preproc_def
name: (identifier) @definition.macro)
(pointer_declarator
declarator: (identifier) @definition.var)
(parameter_declaration
declarator: (identifier) @definition.parameter)
(init_declarator
declarator: (identifier) @definition.var)
(array_declarator
declarator: (identifier) @definition.var)
(declaration
declarator: (identifier) @definition.var)
(enum_specifier
name: (_) @definition.type
(enumerator_list
(enumerator name: (identifier) @definition.var)))
;; Type / Struct / Enum
(field_declaration
declarator: (field_identifier) @definition.field)
(type_definition
declarator: (type_identifier) @definition.type)
(struct_specifier
name: (type_identifier) @definition.type)
;; goto
(labeled_statement (statement_identifier) @definition)
;; References
(identifier) @reference
((field_identifier) @reference
(set! reference.kind "field"))
((type_identifier) @reference
(set! reference.kind "type"))
(goto_statement (statement_identifier) @reference)
;; Scope
[
(for_statement)
(if_statement)
(while_statement)
(translation_unit)
(function_definition)
(compound_statement) ; a block in curly braces
(struct_specifier)
] @scope

View file

@ -1,15 +0,0 @@
body: [
(declaration_list)
(switch_body)
(enum_member_declaration_list)
] @fold
accessors: [
(accessor_list)
] @fold
initializer: [
(initializer_expression)
] @fold
(block) @fold

View file

@ -1,399 +0,0 @@
(identifier) @variable
((identifier) @keyword
(#eq? @keyword "value")
(#has-ancestor? @keyword accessor_declaration))
(method_declaration
name: (identifier) @method)
(local_function_statement
name: (identifier) @method)
(method_declaration
type: (identifier) @type)
(local_function_statement
type: (identifier) @type)
(interpolation) @none
(invocation_expression
(member_access_expression
name: (identifier) @method.call))
(invocation_expression
function: (conditional_access_expression
(member_binding_expression
name: (identifier) @method.call)))
(namespace_declaration
name: [(qualified_name) (identifier)] @namespace)
(qualified_name
(identifier) @type)
(invocation_expression
(identifier) @method.call)
(field_declaration
(variable_declaration
(variable_declarator
(identifier) @field)))
(initializer_expression
(assignment_expression
left: (identifier) @field))
(parameter_list
(parameter
name: (identifier) @parameter))
(parameter_list
(parameter
type: (identifier) @type))
(integer_literal) @number
(real_literal) @float
(null_literal) @constant.builtin
(character_literal) @character
[
(string_literal)
(verbatim_string_literal)
(interpolated_string_expression)
] @string
(boolean_literal) @boolean
[
(predefined_type)
] @type.builtin
(implicit_type) @keyword
(comment) @comment @spell
(using_directive
(identifier) @type)
(using_directive
(name_equals (identifier) @type.definition))
(property_declaration
name: (identifier) @property)
(property_declaration
type: (identifier) @type)
(nullable_type
(identifier) @type)
(catch_declaration
type: (identifier) @type)
(interface_declaration
name: (identifier) @type)
(class_declaration
name: (identifier) @type)
(record_declaration
name: (identifier) @type)
(enum_declaration
name: (identifier) @type)
(constructor_declaration
name: (identifier) @constructor)
(constructor_initializer [
"base" @constructor
])
(variable_declaration
(identifier) @type)
(object_creation_expression
(identifier) @type)
; Generic Types.
(type_of_expression
(generic_name
(identifier) @type))
(type_argument_list
(generic_name
(identifier) @type))
(base_list
(generic_name
(identifier) @type))
(type_constraint
(generic_name
(identifier) @type))
(object_creation_expression
(generic_name
(identifier) @type))
(property_declaration
(generic_name
(identifier) @type))
(_
type: (generic_name
(identifier) @type))
; Generic Method invocation with generic type
(invocation_expression
function: (generic_name
. (identifier) @method.call))
(invocation_expression
(member_access_expression
(generic_name
(identifier) @method)))
(base_list
(identifier) @type)
(type_argument_list
(identifier) @type)
(type_parameter_list
(type_parameter) @type)
(type_parameter_constraints_clause
target: (identifier) @type)
(attribute
name: (identifier) @attribute)
(for_each_statement
type: (identifier) @type)
(tuple_element
type: (identifier) @type)
(tuple_expression
(argument
(declaration_expression
type: (identifier) @type)))
(as_expression
right: (identifier) @type)
(type_of_expression
(identifier) @type)
(name_colon
(identifier) @parameter)
(warning_directive) @text.warning
(error_directive) @exception
(define_directive
(identifier) @constant) @constant.macro
(undef_directive
(identifier) @constant) @constant.macro
(line_directive) @constant.macro
(line_directive
(preproc_integer_literal) @constant
(preproc_string_literal)? @string)
(pragma_directive
(identifier) @constant) @constant.macro
(pragma_directive
(preproc_string_literal) @string) @constant.macro
[
(nullable_directive)
(region_directive)
(endregion_directive)
] @constant.macro
[
"if"
"else"
"switch"
"break"
"case"
(if_directive)
(elif_directive)
(else_directive)
(endif_directive)
] @conditional
(if_directive
(identifier) @constant)
(elif_directive
(identifier) @constant)
[
"while"
"for"
"do"
"continue"
"goto"
"foreach"
] @repeat
[
"try"
"catch"
"throw"
"finally"
] @exception
[
"+"
"?"
":"
"++"
"-"
"--"
"&"
"&&"
"|"
"||"
"!"
"!="
"=="
"*"
"/"
"%"
"<"
"<="
">"
">="
"="
"-="
"+="
"*="
"/="
"%="
"^"
"^="
"&="
"|="
"~"
">>"
">>>"
"<<"
"<<="
">>="
">>>="
"=>"
] @operator
[
";"
"."
","
":"
] @punctuation.delimiter
[
"["
"]"
"{"
"}"
"("
")"
"<"
">"
] @punctuation.bracket
[
(this_expression)
(base_expression)
] @variable.builtin
[
"using"
"as"
] @include
(alias_qualified_name
(identifier "global") @include)
[
"with"
"new"
"typeof"
"sizeof"
"is"
"and"
"or"
"not"
"stackalloc"
"in"
"out"
"ref"
] @keyword.operator
[
"lock"
"params"
"operator"
"default"
"implicit"
"explicit"
"override"
"async"
"await"
"class"
"delegate"
"enum"
"interface"
"namespace"
"struct"
"get"
"set"
"init"
"where"
"record"
"event"
"add"
"remove"
"checked"
"unchecked"
"fixed"
] @keyword
[
"const"
"extern"
"readonly"
"static"
"volatile"
"required"
] @storageclass
[
"abstract"
"private"
"protected"
"internal"
"public"
"partial"
"sealed"
"virtual"
] @type.qualifier
(parameter_modifier) @operator
(query_expression
(_ [
"from"
"orderby"
"select"
"group"
"by"
"ascending"
"descending"
"equals"
"let"
] @keyword))
[
"return"
"yield"
] @keyword.return

View file

@ -1 +0,0 @@
(comment) @comment

View file

@ -1,41 +0,0 @@
;; Definitions
(variable_declarator
. (identifier) @definition.var)
(variable_declarator
(tuple_pattern
(identifier) @definition.var))
(declaration_expression
name: (identifier) @definition.var)
(for_each_statement
left: (identifier) @definition.var)
(for_each_statement
left: (tuple_pattern
(identifier) @definition.var))
(parameter
(identifier) @definition.parameter)
(method_declaration
name: (identifier) @definition.method)
(local_function_statement
name: (identifier) @definition.method)
(property_declaration
name: (identifier) @definition)
(type_parameter
(identifier) @definition.type)
(class_declaration
name: (identifier) @definition)
;; References
(identifier) @reference
;; Scope
(block) @scope

View file

@ -1,141 +0,0 @@
; Preproc
(unique_id) @preproc
(top_level_annotation_body) @preproc
; Includes
[
"import"
"$import"
"embed"
] @include
(import_path) @string
; Builtins
[
(primitive_type)
"List"
] @type.builtin
; Typedefs
(type_definition) @type.definition
; Labels (@number, @number!)
(field_version) @label
; Methods
(annotation_definition_identifier) @method
(method_identifier) @method
; Fields
(field_identifier) @field
; Properties
(property) @property
; Parameters
(param_identifier) @parameter
(return_identifier) @parameter
; Constants
(const_identifier) @constant
(local_const) @constant
(enum_member) @constant
(void) @constant.builtin
; Types
(enum_identifier) @type
(extend_type) @type
(type_identifier) @type
; Attributes
(annotation_identifier) @attribute
(attribute) @attribute
; Operators
[
; @ ! -
"="
] @operator
; Keywords
[
"annotation"
"enum"
"group"
"interface"
"struct"
"union"
] @keyword
[
"extends"
"namespace"
"using"
(annotation_target)
] @keyword
; Literals
[
(string)
(concatenated_string)
(block_text)
(namespace)
] @string
(escape_sequence) @string.escape
(data_string) @string.special
(number) @number
(float) @float
(boolean) @boolean
; Misc
[
"const"
] @type.qualifier
[
"*"
"$"
":"
] @punctuation.special
["{" "}"] @punctuation.bracket
["(" ")"] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
","
";"
"->"
] @punctuation.delimiter
(data_hex) @symbol
; Comments
(comment) @comment @spell

View file

@ -1,34 +0,0 @@
[
(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

View file

@ -1 +0,0 @@
(comment) @comment

View file

@ -1,90 +0,0 @@
[
(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)))

View file

@ -1,5 +0,0 @@
[
(intent_def)
(slot_def)
(alias_def)
] @fold

View file

@ -1,54 +0,0 @@
;; Punctuation
[
"%["
"@["
"~["
"*["
"]"
"("
")"
] @punctuation.bracket
[":" ","] @punctuation.delimiter
(["\"" "'"] @punctuation.special @conceal
(#set! conceal ""))
["%" "?" "#"] @character.special
;; Entities
(intent) @namespace
(slot) @type
(variation) @type.qualifier
(alias) @property
(number) @number
(argument
key: (string) @label
value: (string) @string)
(escape) @string.escape
;; Import
"import" @include
(file) @string.special
;; Text
(word) @text @spell
;; Comment
(comment) @comment @spell
;; Error
(ERROR) @error

View file

@ -1,7 +0,0 @@
[
(intent_def)
(slot_def)
(alias_def)
] @indent
(ERROR "]") @indent

View file

@ -1 +0,0 @@
(comment) @comment

Some files were not shown because too many files have changed in this diff Show more