diff options
63 files changed, 932 insertions, 335 deletions
diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index e9f69fb72..46e699613 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -8,6 +8,10 @@ on: - "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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 41830b225..6ed8e7ba2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ on: jobs: lua: name: Lint Lua files - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v6 @@ -26,7 +26,7 @@ jobs: queries: name: Lint query files - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v6 @@ -40,7 +40,7 @@ jobs: readme: name: Lint docs - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/update-parsers.yml b/.github/workflows/update-parsers.yml index 23741d761..694a8bbbd 100644 --- a/.github/workflows/update-parsers.yml +++ b/.github/workflows/update-parsers.yml @@ -15,13 +15,13 @@ jobs: matrix: tier: [1, 2] name: Update parsers tier ${{ matrix.tier }} - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@v6 with: ref: main - - uses: actions/create-github-app-token@v2 + - uses: actions/create-github-app-token@v3 id: app-token with: app-id: ${{ vars.TOKEN_ID }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0dc03947b..52ec52633 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,21 @@ Before describing these in detail, some general advice: ## Parsers +>[!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 + To add a new parser, edit the following files: 1. In `lua/parsers.lua`, add an entry to the returned table of the following form: @@ -37,29 +52,14 @@ zimbu = { ``` >[!IMPORTANT] -> If the repo does not contain a pre-generated `src/parser.c`, it **must** at least contain `src/grammar.json` so that the parser can be generated without having `node` installed. - ->[!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. ->[!IMPORTANT] -> Due to reliability issues with smaller codeforges, only Github-hosted parsers are currently eligible for inclusion. (The development may happen elsewhere, but there must at least exist a Github mirror to pull the source from.) We are monitoring the situation and hope to support more codeforges again in the future. - ->[!NOTE] -> To qualify for Tier 1 ("stable"), a parser needs to -> * make 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; -> * include and maintain reference queries. - 2. If the parser name is not the same as the Vim filetype, add an entry to the `filetypes` table in `plugin/filetypes.lua`: ```lua zimbu = { 'zu' }, ``` ->[!IMPORTANT] -> Only external scanners written in C are supported for portability reasons. - 3. Update the list of [supported languages] by running `make docs` (or `./scripts/update-readme.lua` if on Windows). 4. Test if both `:TSInstall zimbu` and `:TSInstallFromGrammar zimbu` work without errors (`:checkhealth treesitter` or `./scripts/check-parsers.lua zimbu`). @@ -1,5 +1,5 @@ NVIM_VERSION ?= nightly -LUALS_VERSION := 3.15.0 +LUALS_VERSION := 3.17.1 DEPDIR ?= .test-deps CURL ?= curl -sL --create-dirs @@ -86,13 +86,13 @@ $(HLASSERT): tar -xf $(HLASSERT_TARBALL) -C $@ rm -rf $(HLASSERT_TARBALL) -PLENARY := $(DEPDIR)/plenary.nvim +PLENTEST := $(DEPDIR)/plentest.nvim -.PHONY: plenary -plenary: $(PLENARY) +.PHONY: plentest +plentest: $(PLENTEST) -$(PLENARY): - git clone --filter=blob:none https://github.com/nvim-lua/plenary.nvim $(PLENARY) +$(PLENTEST): + git clone --filter=blob:none https://github.com/nvim-treesitter/plentest.nvim $(PLENTEST) # actual test targets @@ -129,10 +129,10 @@ docs: $(NVIM) $(NVIM_BIN) -l scripts/update-readme.lua .PHONY: tests -tests: $(NVIM) $(HLASSERT) $(PLENARY) - HLASSERT=$(HLASSERT)/highlight-assertions PLENARY=$(PLENARY) \ +tests: $(NVIM) $(HLASSERT) $(PLENTEST) + HLASSERT=$(HLASSERT)/highlight-assertions PLENTEST=$(PLENTEST) \ $(NVIM_BIN) --headless --clean -u scripts/minimal_init.lua \ - -c "PlenaryBustedDirectory tests/$(TESTS) { minimal_init = './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 @@ -16,16 +16,15 @@ For details on these and how to help improving them, see [CONTRIBUTING.md](./CON ## Requirements -- Neovim 0.11.0 or later (nightly) +- 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) +- [`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 **support policy** for Neovim is -> 1. the _latest_ [stable release](https://github.com/neovim/neovim/releases/tag/stable); -> 2. the _latest_ [nightly prerelease](https://github.com/neovim/neovim/releases/tag/nightly). -> Other versions may work but are neither tested nor considered for fixes. In general, compatibility with Nvim 0.X is removed after the release of Nvim 0.(X+1).1. +> The current **support policy** for Neovim is +> * the _latest_ [nightly prerelease](https://github.com/neovim/neovim/releases/tag/nightly). +> Other versions may work but are neither tested nor considered for fixes. Once this plugin is [considered stable](https://github.com/nvim-treesitter/nvim-treesitter/issues/4767), support will be added for the latest release. ## Installation @@ -50,7 +49,7 @@ It is strongly recommended to automate this; e.g., using the following spec with `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 { +require('nvim-treesitter').setup { -- Directory to install parsers and queries to (prepended to `runtimepath` to have priority) install_dir = vim.fn.stdpath('data') .. '/site' } @@ -59,7 +58,7 @@ require'nvim-treesitter'.setup { Parsers and queries can then be installed with ```lua -require'nvim-treesitter'.install { 'rust', 'javascript', 'zig' } +require('nvim-treesitter').install { 'rust', 'javascript', 'zig' } ``` (This is a no-op if the parsers are already installed.) Note that this function runs asynchronously; for synchronous installation in a script context ("bootstrapping"), you need to `wait()` for it to finish: diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index 153483006..978a4b8ed 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -4,7 +4,7 @@ The following is a list of languages for which a parser can be installed through 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, **I**ndents, **F**olds, In**J**ections, **L**ocals +- **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--> @@ -28,11 +28,12 @@ Language | Tier | Queries | Maintainer [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 ` | @opa-oz +[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 @@ -52,7 +53,7 @@ Language | Tier | Queries | Maintainer [cylc](https://github.com/elliotfontaine/tree-sitter-cylc) | unstable | `HFIJ ` | @elliotfontaine [d](https://github.com/gdamore/tree-sitter-d) | unstable | `HFIJL` | @amaanq [dart](https://github.com/UserNobody14/tree-sitter-dart) | unstable | `HFIJL` | @akinsho -[desktop](https://github.com/ValdezFOmar/tree-sitter-desktop) | unstable | `HF J ` | @ValdezFOmar +[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 @@ -65,7 +66,7 @@ Language | Tier | Queries | Maintainer [earthfile](https://github.com/glehmann/tree-sitter-earthfile) | unstable | `H J ` | @glehmann [ebnf](https://github.com/RubixDev/ebnf) | unstable | `H J ` | @RubixDev ecma (queries only)[^ecma] | unstable | `HFIJL` | @steelsojka -[editorconfig](https://github.com/ValdezFOmar/tree-sitter-editorconfig) | unstable | `HF J ` | @ValdezFOmar +[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 @@ -158,7 +159,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [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` | @SalBakraa +[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 @@ -174,7 +175,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [luap](https://github.com/tree-sitter-grammars/tree-sitter-luap)[^luap] | unstable | `H ` | @amaanq [luau](https://github.com/tree-sitter-grammars/tree-sitter-luau) | unstable | `HFIJL` | @amaanq [m68k](https://github.com/grahambates/tree-sitter-m68k) | unstable | `HF JL` | @grahambates -[make](https://github.com/alemuller/tree-sitter-make) | unstable | `HF J ` | @lewis6991 +[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 @@ -218,7 +219,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [prolog](https://github.com/foxyseta/tree-sitter-prolog) | unstable | `HFIJ ` | @foxyseta [promql](https://github.com/MichaHoffmann/tree-sitter-promql) | unstable | `H J ` | @MichaHoffmann [properties](https://github.com/tree-sitter-grammars/tree-sitter-properties)[^properties] | unstable | `H JL` | @ObserverOfTime -[proto](https://github.com/treywood/tree-sitter-proto) | unstable | `HFIJ ` | @treywood +[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 @@ -244,9 +245,9 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [rescript](https://github.com/rescript-lang/tree-sitter-rescript) | unstable | `HFIJL` | @ribru17 [rifleconf](https://github.com/purarue/tree-sitter-rifleconf) | unstable | `H J ` | @purarue [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) | unstable | `HF J ` | @bamonroe -[robot](https://github.com/Hubro/tree-sitter-robot) | unstable | `HFIJ ` | @Hubro +[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) | unstable | `H IJL` | @nat-418 +[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 @@ -276,7 +277,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [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 +[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 @@ -315,7 +316,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [uxntal](https://github.com/tree-sitter-grammars/tree-sitter-uxntal) | unstable | `HFIJL` | @amaanq [v](https://github.com/vlang/v-analyzer) | unstable | `HFIJL` | @kkharji, @amaanq [vala](https://github.com/vala-lang/tree-sitter-vala) | unstable | `HF J ` | @Prince781 -[vento](https://github.com/ventojs/tree-sitter-vento) | unstable | `H J ` | @wrapperup, @oscarotero +[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 @@ -329,7 +330,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [wxml](https://github.com/BlockLune/tree-sitter-wxml) | unstable | `HFIJ ` | @BlockLune [xcompose](https://github.com/tree-sitter-grammars/tree-sitter-xcompose) | unstable | `H JL` | @ObserverOfTime [xml](https://github.com/tree-sitter-grammars/tree-sitter-xml) | unstable | `HFIJL` | @ObserverOfTime -[xresources](https://github.com/ValdezFOmar/tree-sitter-xresources) | unstable | `HF JL` | @ValdezFOmar +[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 @@ -337,7 +338,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [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) | stable | `HF JL` | @georgeharker +[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 diff --git a/lua/nvim-treesitter/config.lua b/lua/nvim-treesitter/config.lua index b3a294563..97fca649f 100644 --- a/lua/nvim-treesitter/config.lua +++ b/lua/nvim-treesitter/config.lua @@ -16,7 +16,7 @@ function M.setup(user_data) if user_data then if user_data.install_dir then user_data.install_dir = vim.fs.normalize(user_data.install_dir) - vim.opt.runtimepath:prepend(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 diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 08ec42bb7..2fcaea5a0 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -7,7 +7,7 @@ local health = vim.health local M = {} local NVIM_TREESITTER_MINIMUM_ABI = 13 -local TREE_SITTER_MIN_VER = { 0, 25, 0 } +local TREE_SITTER_MIN_VER = { 0, 26, 1 } ---@param name string ---@return table? @@ -95,11 +95,7 @@ local function install_health() else health.error('is not writable.') end - if - vim.iter(vim.api.nvim_list_runtime_paths()):any(function(p) - return installdir == vim.fs.normalize(p) .. '/' - end) - then + if vim.list_contains(vim.api.nvim_list_runtime_paths(), installdir) then health.ok('is in runtimepath.') else health.error('is not in runtimepath.') @@ -148,7 +144,7 @@ function M.check() end health.info(vim.fn.trim(out, ' ', 2)) end - health.start(' Legend: H[ighlights], L[ocals], F[olds], I[ndents], In[J]ections') + health.start(' Legend: [H]ighlights, [L]ocals, [F]olds, [I]ndents, In[J]ections') if #error_collection > 0 then health.start('The following errors have been detected in query files:') diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 1020e7da9..893f95361 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -97,7 +97,31 @@ end local function system(cmd, opts) local cwd = opts and opts.cwd or uv.cwd() log.trace('running job: (cwd=%s) %s', cwd, table.concat(cmd, ' ')) - local r = a.await(3, vim.system, cmd, opts) --[[@as vim.SystemCompleted]] + + ---vim.system throws an error when uv.spawn fails, in particular if cmd or cwd + ---does not exist. This kills the coroutine, so the async'ed call simply hangs. + ---Instead, we pass a wrapper that catches errors and propagates them as a proper + ---`SystemObj`. + ---TODO(clason): remove when https://github.com/neovim/neovim/issues/38257 is resolved. + ---@param _cmd string[] + ---@param _opts vim.SystemOpts + ---@param on_exit fun(result: vim.SystemCompleted) + ---@return vim.SystemObj? + local function system_wrap(_cmd, _opts, on_exit) + local ok, ret = pcall(vim.system, _cmd, _opts, on_exit) + if not ok then + on_exit({ + code = 125, + signal = 0, + stdout = '', + stderr = ret --[[@as string]], + }) + return nil + end + return ret --[[@as vim.SystemObj]] + end + + local r = a.await(3, system_wrap, cmd, opts) --[[@as vim.SystemCompleted]] a.schedule() if r.stdout and r.stdout ~= '' then log.trace('stdout -> %s', r.stdout) @@ -197,17 +221,13 @@ end ---@param output_dir string ---@return string? err local function do_download(logger, url, project_name, cache_dir, revision, output_dir) - local is_gitlab = url:find('gitlab.com', 1, true) - local tmp = output_dir .. '-tmp' rmpath(tmp) a.schedule() url = url:gsub('.git$', '') - local target = is_gitlab - and string.format('%s/-/archive/%s/%s-%s.tar.gz', url, revision, project_name, revision) - or string.format('%s/archive/%s.tar.gz', url, revision) + local target = string.format('%s/archive/%s.tar.gz', url, revision) local tarball_path = fs.joinpath(cache_dir, project_name .. '.tar.gz') @@ -218,6 +238,8 @@ local function do_download(logger, url, project_name, cache_dir, revision, outpu '--silent', '--fail', '--show-error', + '--retry', + '7', '-L', -- follow redirects target, '--output', @@ -300,11 +322,9 @@ end local function do_install(logger, compile_location, target_location) logger:info(string.format('Installing parser')) - if uv.os_uname().sysname == 'Windows_NT' then -- why can't you just be normal?! - local tempfile = target_location .. tostring(uv.hrtime()) - uv_rename(target_location, tempfile) -- parser may be in use: rename... - uv_unlink(tempfile) -- ...and mark for garbage collection - end + local tempfile = target_location .. tostring(uv.hrtime()) + uv_rename(target_location, tempfile) -- parser may be in use: rename... + uv_unlink(tempfile) -- ...and mark for garbage collection local err = uv_copyfile(compile_location, target_location) a.schedule() diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b7037d245..815e474e2 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -18,7 +18,7 @@ return { }, angular = { install_info = { - revision = '3bd2036e710f609ea08fcfca5a1eb1169ecc114f', + revision = 'f0d0685701b70883fa2dfe94ee7dc27965cab841', url = 'https://github.com/dlvandenberg/tree-sitter-angular', }, maintainers = { '@dlvandenberg' }, @@ -36,7 +36,7 @@ return { }, arduino = { install_info = { - revision = '53eb391da4c6c5857f8defa2c583c46c2594f565', + revision = '11dd46c9ae25135c473c0003a133bb06a484af0c', url = 'https://github.com/tree-sitter-grammars/tree-sitter-arduino', }, maintainers = { '@ObserverOfTime' }, @@ -93,7 +93,7 @@ return { }, beancount = { install_info = { - revision = '653cce316fbff8d212a2488ae13df648efb542a4', + revision = 'd7a03a7506fbbbc4b16a9a2054ff7c2b337744b8', url = 'https://github.com/polarmutex/tree-sitter-beancount', }, maintainers = { '@polarmutex' }, @@ -125,7 +125,7 @@ return { }, blade = { install_info = { - revision = 'cc764dadcbbceb3f259396fef66f970c72e94f96', + revision = 'b9436b7b936907aff730de0dac1b99d7c632cc86', url = 'https://github.com/EmranMR/tree-sitter-blade', }, maintainers = { '@calebdw' }, @@ -140,6 +140,14 @@ return { readme_note = 'Android Blueprint', tier = 2, }, + bpftrace = { + install_info = { + revision = '774f4458ad39691336ead1ee361b22434c4cdec7', + url = 'https://github.com/sgruszka/tree-sitter-bpftrace', + }, + maintainers = { '@sgruszka' }, + tier = 2, + }, brightscript = { install_info = { revision = '253fdfaa23814cb46c2d5fc19049fa0f2f62c6da', @@ -158,7 +166,7 @@ return { }, c3 = { install_info = { - revision = '805f776dcfbfef5c9baf4270ec942b3e8dc7ff16', + revision = '78e2ae9cff29ef8ca6666006abe80f1236d42996', url = 'https://github.com/c3lang/tree-sitter-c3', }, maintainers = { '@cbuttner' }, @@ -166,7 +174,7 @@ return { }, c_sharp = { install_info = { - revision = '485f0bae0274ac9114797fc10db6f7034e4086e3', + revision = '88366631d598ce6595ec655ce1591b315cffb14c', url = 'https://github.com/tree-sitter/tree-sitter-c-sharp', }, maintainers = { '@amaanq' }, @@ -177,7 +185,6 @@ return { revision = '2686186edb61be47960431c93a204fb249681360', url = 'https://github.com/opa-oz/tree-sitter-caddy', }, - maintainers = { '@opa-oz' }, tier = 3, }, cairo = { @@ -270,7 +277,7 @@ return { }, cpp = { install_info = { - revision = '12bd6f7e96080d2e70ec51d4068f2f66120dde35', + revision = '8b5b49eb196bec7040441bee33b2c9a4838d6967', url = 'https://github.com/tree-sitter/tree-sitter-cpp', }, maintainers = { '@theHamsta' }, @@ -306,7 +313,7 @@ return { }, cue = { install_info = { - revision = '770737bcff2c4aa3f624d439e32b07dbb07102d3', + revision = '20bb9195dac00b64c00ee494812abf3bf76f4181', url = 'https://github.com/eonpatapon/tree-sitter-cue', }, maintainers = { '@amaanq' }, @@ -330,7 +337,7 @@ return { }, dart = { install_info = { - revision = 'd4d8f3e337d8be23be27ffc35a0aef972343cd54', + revision = '0fc19c3a57b1109802af41d2b8f60d8835c5da3a', url = 'https://github.com/UserNobody14/tree-sitter-dart', }, maintainers = { '@akinsho' }, @@ -338,11 +345,11 @@ return { }, desktop = { install_info = { - revision = 'c0279c1fb1e2e1f06f374437815d4abda02e30b2', + revision = 'v1.1.1', url = 'https://github.com/ValdezFOmar/tree-sitter-desktop', }, maintainers = { '@ValdezFOmar' }, - tier = 2, + tier = 1, }, devicetree = { install_info = { @@ -411,7 +418,7 @@ return { dtd = { install_info = { location = 'dtd', - revision = '863dbc381f44f6c136a399e684383b977bb2beaa', + revision = '5000ae8f22d11fbe93939b05c1e37cf21117162d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -441,11 +448,11 @@ return { }, editorconfig = { install_info = { - revision = 'f8e8a4cefe4de5d7e87bd129f3a69bdcdf73eebe', + revision = 'v2.0.0', url = 'https://github.com/ValdezFOmar/tree-sitter-editorconfig', }, maintainers = { '@ValdezFOmar' }, - tier = 2, + tier = 1, }, eds = { install_info = { @@ -465,7 +472,7 @@ return { }, elixir = { install_info = { - revision = 'd24cecee673c4c770f797bac6f87ae4b6d7ddec5', + revision = '7937d3b4d65fa574163cfa59394515d3c1cf16f4', url = 'https://github.com/elixir-lang/tree-sitter-elixir', }, maintainers = { '@connorlay' }, @@ -512,7 +519,7 @@ return { }, erlang = { install_info = { - revision = 'f21023bbd6cd30cadbc793d80ae4d990d9be86fc', + revision = '1d78195c4fbb1fc027eb3e4220427f1eb8bfc89e', url = 'https://github.com/WhatsApp/tree-sitter-erlang', }, maintainers = { '@filmor' }, @@ -536,7 +543,7 @@ return { }, fennel = { install_info = { - revision = 'fd4a24e349bcbac8a03a5a00d0dfa207baf53ca5', + revision = '3f0f6b24d599e92460b969aabc4f4c5a914d15a0', url = 'https://github.com/alexmozaidze/tree-sitter-fennel', }, maintainers = { '@alexmozaidze' }, @@ -560,7 +567,7 @@ return { }, fish = { install_info = { - revision = 'aa074a0bacde8b5823c592574d7138f156a95776', + revision = 'fa2143f5d66a9eb6c007ba9173525ea7aaafe788', url = 'https://github.com/ram02z/tree-sitter-fish', }, maintainers = { '@ram02z' }, @@ -584,7 +591,7 @@ return { }, fortran = { install_info = { - revision = 'e0132896b8959c09dc20b56e4a1c5d25bc341697', + revision = 'be30d90dc7dfa4080b9c4abed3f400c9163a88df', url = 'https://github.com/stadelmanma/tree-sitter-fortran', }, maintainers = { '@amaanq' }, @@ -601,7 +608,7 @@ return { fsharp = { install_info = { location = 'fsharp', - revision = '5141851c278a99958469eb1736c7afc4ec738e47', + revision = '1c2d9351d1f731c08cfdc4ed41e63126ae56e462', url = 'https://github.com/ionide/tree-sitter-fsharp', }, maintainers = { '@nsidorenco' }, @@ -617,7 +624,7 @@ return { }, gap = { install_info = { - revision = '2bac14863b76ad0ff6fd7204c50574732acd66df', + revision = 'ed2480d42281586932920527823b307bc45052b8', url = 'https://github.com/gap-system/tree-sitter-gap', }, maintainers = { '@reiniscirpons' }, @@ -660,7 +667,7 @@ return { }, git_rebase = { install_info = { - revision = 'bff4b66b44b020d918d67e2828eada1974a966aa', + revision = '760ba8e34e7a68294ffb9c495e1388e030366188', url = 'https://github.com/the-mikedavis/tree-sitter-git-rebase', }, maintainers = { '@gbprod' }, @@ -676,7 +683,7 @@ return { }, gitcommit = { install_info = { - revision = 'a716678c0f00645fed1e6f1d0eb221481dbd6f6d', + revision = '33fe8548abcc6e374feaac5724b5a2364bf23090', url = 'https://github.com/gbprod/tree-sitter-gitcommit', }, maintainers = { '@gbprod' }, @@ -692,7 +699,7 @@ return { }, gleam = { install_info = { - revision = '0c0c63a07998767b22f0d2655f903611eca6acd0', + revision = '0bb1b0ae1a3555180ae7b0004851da747fc230d1', url = 'https://github.com/gleam-lang/tree-sitter-gleam', }, maintainers = { '@amaanq' }, @@ -700,7 +707,7 @@ return { }, glimmer = { install_info = { - revision = 'da605af8c5999b43e6839b575eae5e6cafabb06f', + revision = '88af85568bde3b91acb5d4c352ed094d0c1f9d84', url = 'https://github.com/ember-tooling/tree-sitter-glimmer', }, maintainers = { '@NullVoxPopuli' }, @@ -834,7 +841,7 @@ return { }, groovy = { install_info = { - revision = '86911590a8e46d71301c66468e5620d9faa5b6af', + revision = '781d9cd1b482a70a6b27091e5c9e14bbcab3b768', url = 'https://github.com/murtaza64/tree-sitter-groovy', }, maintainers = { '@murtaza64' }, @@ -889,7 +896,7 @@ return { }, hcl = { install_info = { - revision = 'fad991865fee927dd1de5e172fb3f08ac674d914', + revision = '64ad62785d442eb4d45df3a1764962dafd5bc98b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -897,7 +904,7 @@ return { }, heex = { install_info = { - revision = 'b5a7cb5f74dc695a9ff5f04919f872ebc7a895e9', + revision = '3968d6e20b3c4cc234f339eddd6b7d118516e281', url = 'https://github.com/connorlay/tree-sitter-heex', }, maintainers = { '@connorlay' }, @@ -994,7 +1001,7 @@ return { }, hyprlang = { install_info = { - revision = '22723f25f3faf329863d952c9601b492afd971c9', + revision = 'cecd6b748107d9da1f7b4ca03ef95f1f71d93b8f', url = 'https://github.com/tree-sitter-grammars/tree-sitter-hyprlang', }, maintainers = { '@luckasRanarison' }, @@ -1002,7 +1009,7 @@ return { }, idl = { install_info = { - revision = 'e6b8b4d2ba285caacf6f9e931f1f637f5bc02b03', + revision = '57c4ba057415ebe8e184fb11716c985dc3545e5e', url = 'https://github.com/cathaysia/tree-sitter-idl', }, maintainers = { '@cathaysia' }, @@ -1025,7 +1032,7 @@ return { }, inko = { install_info = { - revision = 'v0.4.0', + revision = 'v0.5.1', url = 'https://github.com/inko-lang/tree-sitter-inko', }, maintainers = { '@yorickpeterse' }, @@ -1042,7 +1049,7 @@ return { }, janet_simple = { install_info = { - revision = '7e28cbf1ca061887ea43591a2898001f4245fddf', + revision = 'd183186995204314700be3e9e0a48053ea16b350', url = 'https://github.com/sogaiu/tree-sitter-janet-simple', }, maintainers = { '@sogaiu' }, @@ -1058,7 +1065,7 @@ return { }, javadoc = { install_info = { - revision = '373fbd84f35aff70031426ed6edf3cdf52b93532', + revision = '42c9bc340c90ec15ed96eb4314269e8249376be9', url = 'https://github.com/rmuir/tree-sitter-javadoc', }, maintainers = { '@rmuir' }, @@ -1076,7 +1083,7 @@ return { jinja = { install_info = { location = 'tree-sitter-jinja', - revision = 'e589222a1ad44361bc376d5abdccd08e1fecfee5', + revision = '7bd0422c6a57aaabfee8603502d7708d0a536f5f', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1087,7 +1094,7 @@ return { jinja_inline = { install_info = { location = 'tree-sitter-jinja_inline', - revision = 'e589222a1ad44361bc376d5abdccd08e1fecfee5', + revision = '7bd0422c6a57aaabfee8603502d7708d0a536f5f', url = 'https://github.com/cathaysia/tree-sitter-jinja', }, maintainers = { '@cathaysia' }, @@ -1141,7 +1148,7 @@ return { }, julia = { install_info = { - revision = 'dd7f707577585ade7a488d32dbfb366246ea3837', + revision = '8454f266717232525ed03c7b09164b0404a03150', url = 'https://github.com/tree-sitter-grammars/tree-sitter-julia', }, maintainers = { '@clason' }, @@ -1149,7 +1156,7 @@ return { }, just = { install_info = { - revision = 'bb0c898a80644de438e6efe5d88d30bf092935cd', + revision = 'd9da862c156020c1a83d3c6ccdda32be6d8a5d4a', url = 'https://github.com/IndianBoy42/tree-sitter-just', }, maintainers = { '@Hubro' }, @@ -1181,7 +1188,7 @@ return { }, kitty = { install_info = { - revision = 'f821c16397ffab5b776d8781245215811438a624', + revision = 'fa6ab3fd32d890a0217495c96b35761e6d2dcb5b', url = 'https://github.com/OXY2DEV/tree-sitter-kitty', }, maintainers = { '@OXY2DEV' }, @@ -1189,7 +1196,7 @@ return { }, kos = { install_info = { - revision = '5f11d41b3150b0837e8b3964151ebb7fc4f367e9', + revision = '03b261c1a78b71c38cf4616497f253c4a4ce118b', url = 'https://github.com/kos-lang/tree-sitter-kos', }, maintainers = { '@cdragan' }, @@ -1197,10 +1204,9 @@ return { }, kotlin = { install_info = { - revision = '57fb4560ba8641865bc0baa6b3f413b236112c4c', + revision = '802fd920c153b02b9d266369a3ef061622f2bbf0', url = 'https://github.com/fwcd/tree-sitter-kotlin', }, - maintainers = { '@SalBakraa' }, tier = 2, }, koto = { @@ -1221,7 +1227,7 @@ return { }, lalrpop = { install_info = { - revision = '8d38e9755c05d37df8a24dadb0fc64f6588ac188', + revision = '27b0f7bb55b4cabd8f01a933d9ee6a49dbfc2192', url = 'https://github.com/traxys/tree-sitter-lalrpop', }, maintainers = { '@traxys' }, @@ -1238,7 +1244,7 @@ return { }, ledger = { install_info = { - revision = '96c92d4908a836bf8f661166721c98439f8afb80', + revision = '22a1ab8195c1f6e808679f803007756fe7638c6f', url = 'https://github.com/cbarrete/tree-sitter-ledger', }, maintainers = { '@cbarrete' }, @@ -1262,7 +1268,7 @@ return { }, liquid = { install_info = { - revision = 'd6ebde3974742cd1b61b55d1d94aab1dacb41056', + revision = 'fa11c7ba45038b61e03a8a00ad667fb5f3d72088', url = 'https://github.com/hankthetank27/tree-sitter-liquid', }, maintainers = { '@hankthetank27' }, @@ -1270,7 +1276,7 @@ return { }, liquidsoap = { install_info = { - revision = '4de01f44de2c051c33832ce523cf44690561320d', + revision = '0169d92b0a93e9f32289533ef23abdafca579e56', url = 'https://github.com/savonet/tree-sitter-liquidsoap', }, maintainers = { '@toots' }, @@ -1286,7 +1292,7 @@ return { }, lua = { install_info = { - revision = 'e284fcec45ead0d477e326fccd2cd4a68a89dae4', + revision = '10fe0054734eec83049514ea2e718b2a56acd0c9', url = 'https://github.com/tree-sitter-grammars/tree-sitter-lua', }, maintainers = { '@muniftanjim' }, @@ -1328,8 +1334,8 @@ return { }, make = { install_info = { - revision = 'a4b9187417d6be349ee5fd4b6e77b4172c6827dd', - url = 'https://github.com/alemuller/tree-sitter-make', + revision = '70613f3d812cbabbd7f38d104d60a409c4008b43', + url = 'https://github.com/tree-sitter-grammars/tree-sitter-make', }, maintainers = { '@lewis6991' }, tier = 2, @@ -1337,7 +1343,7 @@ return { markdown = { install_info = { location = 'tree-sitter-markdown', - revision = '2dfd57f547f06ca5631a80f601e129d73fc8e9f0', + revision = 'f969cd3ae3f9fbd4e43205431d0ae286014c05b5', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1348,7 +1354,7 @@ return { markdown_inline = { install_info = { location = 'tree-sitter-markdown-inline', - revision = '2dfd57f547f06ca5631a80f601e129d73fc8e9f0', + revision = 'f969cd3ae3f9fbd4e43205431d0ae286014c05b5', url = 'https://github.com/tree-sitter-grammars/tree-sitter-markdown', }, maintainers = { '@MDeiml' }, @@ -1357,7 +1363,7 @@ return { }, matlab = { install_info = { - revision = '1bccabdbd420a9c3c3f96f36d7f9e65b3d9c88ef', + revision = 'c2390a59016f74e7d5f75ef09510768b4f30217e', url = 'https://github.com/acristoffers/tree-sitter-matlab', }, maintainers = { '@acristoffers' }, @@ -1380,7 +1386,7 @@ return { }, meson = { install_info = { - revision = 'd4fa3c7260d1537ac5183740b9338373a673d5c0', + revision = 'c84f3540624b81fc44067030afce2ff78d6ede05', url = 'https://github.com/tree-sitter-grammars/tree-sitter-meson', }, maintainers = { '@Decodetalkers' }, @@ -1389,7 +1395,7 @@ return { mlir = { install_info = { generate = true, - revision = 'c7eec06be8a9ddae688e1b03fca2eed79e9801c4', + revision = '90d41fd327a8a6ded2fb366909ea86d8e31392ea', url = 'https://github.com/artagnon/tree-sitter-mlir', }, maintainers = { '@artagnon' }, @@ -1421,14 +1427,14 @@ return { }, nickel = { install_info = { - revision = 'a0a5d98a6f0edb5d00a18e62e7d1d02a5607c391', + revision = 'b5b6cc3bc7b9ea19f78fed264190685419cd17a8', url = 'https://github.com/nickel-lang/tree-sitter-nickel', }, tier = 2, }, nim = { install_info = { - revision = '4ad352773688deb84a95eeaa9872acda5b466439', + revision = '3878440d9398515ae053c6f6024986e69868bb74', url = 'https://github.com/alaviss/tree-sitter-nim', }, maintainers = { '@aMOPel' }, @@ -1469,7 +1475,7 @@ return { }, nu = { install_info = { - revision = '4c149627cc592560f77ead1c384e27ec85926407', + revision = '696d257f6b652edb50878a783b30ad7833dec49e', url = 'https://github.com/nushell/tree-sitter-nu', }, maintainers = { '@abhisheksingh0x558' }, @@ -1554,8 +1560,8 @@ return { }, perl = { install_info = { - branch = 'release', - revision = '0c24d001dd1921e418fb933d208a7bd7dd3f923a', + generate = true, + revision = 'ea9667dc65a816acace002a2b1b099978785ca33', url = 'https://github.com/tree-sitter-perl/tree-sitter-perl', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1564,7 +1570,7 @@ return { php = { install_info = { location = 'php', - revision = '7d07b41ce2d442ca9a90ed85d0075eccc17ae315', + revision = '3f2465c217d0a966d41e584b42d75522f2a3149e', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1575,7 +1581,7 @@ return { php_only = { install_info = { location = 'php_only', - revision = '7d07b41ce2d442ca9a90ed85d0075eccc17ae315', + revision = '3f2465c217d0a966d41e584b42d75522f2a3149e', url = 'https://github.com/tree-sitter/tree-sitter-php', }, maintainers = { '@tk-shirasaka', '@calebdw' }, @@ -1600,7 +1606,7 @@ return { }, pkl = { install_info = { - revision = 'ac58931956c000d3aeefbb55a81fc3c5bd6aecf0', + revision = '7c8a0d15d83c1a436e91277d5023340f1ae5726b', url = 'https://github.com/apple/tree-sitter-pkl', }, maintainers = { '@ribru17' }, @@ -1616,8 +1622,8 @@ return { }, pod = { install_info = { - branch = 'release', - revision = '0bf8387987c21bf2f8ed41d2575a8f22b139687f', + generate = true, + revision = '4559a9767eb15d757dce24107b840b137f673d33', url = 'https://github.com/tree-sitter-perl/tree-sitter-pod', }, maintainers = { '@RabbiVeesh', '@LeoNerd' }, @@ -1643,7 +1649,7 @@ return { powershell = { filetype = 'ps1', install_info = { - revision = '7212f47716ced384ac012b2cc428fd9f52f7c5d4', + revision = '73800ecc8bddeee8f1079a5a2e0c13c3d00269bb', url = 'https://github.com/airbus-cert/tree-sitter-powershell', }, maintainers = { '@L2jLiga' }, @@ -1703,10 +1709,10 @@ return { }, proto = { install_info = { - revision = 'e9f6b43f6844bd2189b50a422d4e2094313f6aa3', - url = 'https://github.com/treywood/tree-sitter-proto', + revision = 'd65a18ce7c2242801f702770114ad08056c7f8c9', + url = 'https://github.com/coder3101/tree-sitter-proto', }, - maintainers = { '@treywood' }, + maintainers = { '@stefanvanburen' }, tier = 2, }, prql = { @@ -1795,7 +1801,7 @@ return { }, query = { install_info = { - revision = '6350ad724e7b17a7eea712d4860b4d2ae892e0b6', + revision = 'fc5409c6820dd5e02b0b0a309d3da2bfcde2db17', url = 'https://github.com/tree-sitter-grammars/tree-sitter-query', }, maintainers = { '@steelsojka' }, @@ -1812,7 +1818,7 @@ return { }, racket = { install_info = { - revision = '56b57807f86aa4ddb14892572b318edd4bc90ebe', + revision = '54649be8b939341d2d5410b594ab954fe8814bd0', url = 'https://github.com/6cdh/tree-sitter-racket', }, tier = 2, @@ -1875,7 +1881,7 @@ return { }, rego = { install_info = { - revision = '20b5a5958c837bc9f74b231022a68a594a313f6d', + revision = 'ddd39af81fe8b0288102a7cb97959dfce723e0f3', url = 'https://github.com/FallenAngel97/tree-sitter-rego', }, maintainers = { '@FallenAngel97' }, @@ -1892,7 +1898,7 @@ return { }, rescript = { install_info = { - revision = 'd2df8a285fff95de56a91d2f8152aeceb66f40ef', + revision = '43c2f1f35024918d415dc933d4cc534d6419fedf', url = 'https://github.com/rescript-lang/tree-sitter-rescript', }, maintainers = { '@ribru17' }, @@ -1900,7 +1906,7 @@ return { }, rifleconf = { install_info = { - revision = 'fe10eab6cacff239ec61f4456e793bed15703aaf', + revision = '6389ef0fc0d48f0397ec233109c074a0cb685e36', url = 'https://github.com/purarue/tree-sitter-rifleconf', }, maintainers = { '@purarue' }, @@ -1916,11 +1922,10 @@ return { }, robot = { install_info = { - revision = 'e34def7cb0d8a66a59ec5057fe17bb4e6b17b56a', + revision = 'v1.3.0', url = 'https://github.com/Hubro/tree-sitter-robot', }, - maintainers = { '@Hubro' }, - tier = 2, + tier = 3, }, robots_txt = { install_info = { @@ -1935,8 +1940,7 @@ return { revision = '40e52f343f1b1f270d6ecb2ca898ca9b8cba6936', url = 'https://github.com/faldor20/tree-sitter-roc', }, - maintainers = { '@nat-418' }, - tier = 2, + tier = 3, }, ron = { install_info = { @@ -1956,7 +1960,7 @@ return { }, ruby = { install_info = { - revision = '89bd7a8e5450cb6a942418a619d30469f259e5d6', + revision = 'ad907a69da0c8a4f7a943a7fe012712208da6dee', url = 'https://github.com/tree-sitter/tree-sitter-ruby', }, maintainers = { '@TravonteD' }, @@ -1972,7 +1976,7 @@ return { }, rust = { install_info = { - revision = '261b20226c04ef601adbdf185a800512a5f66291', + revision = '8a1ccae7aaccdc11b04dbd803453e3e9cfd9159b', url = 'https://github.com/tree-sitter/tree-sitter-rust', }, maintainers = { '@amaanq' }, @@ -1980,7 +1984,7 @@ return { }, scala = { install_info = { - revision = '97aead18d97708190a51d4f551ea9b05b60641c9', + revision = '14c5cfd2b8e0f057ba0f4f72ee4812b0ae6cdce3', url = 'https://github.com/tree-sitter/tree-sitter-scala', }, maintainers = { '@stevanmilic' }, @@ -1996,7 +2000,7 @@ return { }, scheme = { install_info = { - revision = 'b5c701148501fa056302827442b5b4956f1edc03', + revision = 'c6cb7c7d7a04b3f5d999c28e2e9c0c31b2d50ece', url = 'https://github.com/6cdh/tree-sitter-scheme', }, tier = 2, @@ -2039,7 +2043,7 @@ return { }, slint = { install_info = { - revision = '10fb0f188d7950400773c06ba6c31075866e14bf', + revision = '4d7ad0617c30f865f051bbac04a9826bea29f987', url = 'https://github.com/slint-ui/tree-sitter-slint', }, maintainers = { '@hunger' }, @@ -2080,7 +2084,7 @@ return { }, solidity = { install_info = { - revision = '4e938a46c7030dd001bc99e1ac0f0c750ac98254', + revision = '048fe686cb1fde267243739b8bdbec8fc3a55272', url = 'https://github.com/JoranHonig/tree-sitter-solidity', }, maintainers = { '@amaanq' }, @@ -2131,7 +2135,7 @@ return { sql = { install_info = { branch = 'gh-pages', - revision = '2d5dcd16f9ee49cb5a6d99eabb00fd4ea298587f', + revision = '851e9cb257ba7c66cc8c14214a31c44d2f1e954e', url = 'https://github.com/derekstride/tree-sitter-sql', }, maintainers = { '@derekstride' }, @@ -2179,10 +2183,10 @@ return { }, supercollider = { install_info = { - revision = '76b3cab1773f08bb7d3a185420b0a44c6da8c294', + revision = 'e2d1480de0a62cd53f81645cb39bc1f3fa2dce5a', url = 'https://github.com/madskjeldgaard/tree-sitter-supercollider', }, - maintainers = { '@madskjeldgaard' }, + maintainers = { '@madskjeldgaard', '@elgiano' }, tier = 2, }, superhtml = { @@ -2222,7 +2226,7 @@ return { swift = { install_info = { generate = true, - revision = '82a239e4c164b0567fb99b80b53f99ba661f2168', + revision = '8abb3e8b33256d89127a35e87480736f74755ff9', url = 'https://github.com/alex-pinkus/tree-sitter-swift', }, maintainers = { '@alex-pinkus' }, @@ -2246,7 +2250,7 @@ return { }, systemverilog = { install_info = { - revision = '7c4b01b7df2f6e7fa1f698c9d30ac8f93af18ed2', + revision = '293928578cb27fbd0005fcc5f09c09a1e8628c89', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', }, maintainers = { '@zhangwwpeng' }, @@ -2254,7 +2258,7 @@ return { }, t32 = { install_info = { - revision = '5b5e4336731bda5ea2e6b78b6a2d9e7a89032b75', + revision = '3bce3977303c3f88bfa9fcdfcfd1a4f8f6ffa0b0', url = 'https://github.com/xasc/tree-sitter-t32', }, maintainers = { '@xasc' }, @@ -2312,7 +2316,7 @@ return { terraform = { install_info = { location = 'dialects/terraform', - revision = 'fad991865fee927dd1de5e172fb3f08ac674d914', + revision = '64ad62785d442eb4d45df3a1764962dafd5bc98b', url = 'https://github.com/MichaHoffmann/tree-sitter-hcl', }, maintainers = { '@MichaHoffmann' }, @@ -2345,7 +2349,7 @@ return { }, tlaplus = { install_info = { - revision = '2d831940c782850f64dabf5b7b17e9e51f7f0ebb', + revision = 'add40814fda369f6efd989977b2c498aaddde984', url = 'https://github.com/tlaplus-community/tree-sitter-tlaplus', }, maintainers = { '@ahelwer', '@susliko' }, @@ -2463,7 +2467,7 @@ return { unison = { install_info = { generate = true, - revision = '169e7f748a540ec360c0cb086b448faad012caa4', + revision = '10365cc70ab2b2de85ea7ab35cf6b7636c36ce8b', url = 'https://github.com/kylegoetz/tree-sitter-unison', }, maintainers = { '@tapegram' }, @@ -2488,7 +2492,7 @@ return { v = { install_info = { location = 'tree_sitter_v', - revision = '9cf6a37689f06b17d170dec644ace81eb8eab280', + revision = '095865df4b9ddd21e376d635586c663d5a736f71', url = 'https://github.com/vlang/v-analyzer', }, maintainers = { '@kkharji', '@amaanq' }, @@ -2504,15 +2508,14 @@ return { }, vento = { install_info = { - revision = '3b32474bc29584ea214e4e84b47102408263fe0e', + revision = 'edd6596d4b0f392b87fc345dc26d84a6c32f7059', url = 'https://github.com/ventojs/tree-sitter-vento', }, - maintainers = { '@wrapperup', '@oscarotero' }, - tier = 2, + tier = 3, }, vhdl = { install_info = { - revision = '7ae08deb5d1641aa57111342218ca1e1b3a5d539', + revision = 'c2d9be3d5ab7fb2cae8ad5ae604cd3606a4af0f2', url = 'https://github.com/jpt13653903/tree-sitter-vhdl', }, maintainers = { '@jpt13653903' }, @@ -2528,7 +2531,7 @@ return { }, vim = { install_info = { - revision = '78866caaacf123f4d9d227fe1ab521cc62167a88', + revision = '3092fcd99eb87bbd0fc434aa03650ba58bd5b43b', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vim', }, maintainers = { '@clason' }, @@ -2552,8 +2555,7 @@ return { }, vue = { install_info = { - branch = 'main', - revision = '22bdfa6c9fc0f5ffa44c6e938ec46869ac8a99ff', + revision = 'ce8011a414fdf8091f4e4071752efc376f4afb08', url = 'https://github.com/tree-sitter-grammars/tree-sitter-vue', }, maintainers = { '@WhyNotHugo', '@lucario387' }, @@ -2586,7 +2588,7 @@ return { }, wit = { install_info = { - revision = 'v1.2.0', + revision = 'v1.3.0', url = 'https://github.com/bytecodealliance/tree-sitter-wit', }, maintainers = { '@mkatychev' }, @@ -2611,7 +2613,7 @@ return { xml = { install_info = { location = 'xml', - revision = '863dbc381f44f6c136a399e684383b977bb2beaa', + revision = '5000ae8f22d11fbe93939b05c1e37cf21117162d', url = 'https://github.com/tree-sitter-grammars/tree-sitter-xml', }, maintainers = { '@ObserverOfTime' }, @@ -2620,15 +2622,15 @@ return { }, xresources = { install_info = { - revision = 'f60fb1e661d85f35fb8e7b988a41d2a74f65bfd4', + revision = 'v1.0.0', url = 'https://github.com/ValdezFOmar/tree-sitter-xresources', }, maintainers = { '@ValdezFOmar' }, - tier = 2, + tier = 1, }, yaml = { install_info = { - revision = '7708026449bed86239b1cd5bce6e3c34dbca6415', + revision = '4463985dfccc640f3d6991e3396a2047610cf5f8', url = 'https://github.com/tree-sitter-grammars/tree-sitter-yaml', }, maintainers = { '@amaanq' }, @@ -2684,10 +2686,10 @@ return { }, zsh = { install_info = { - revision = 'v0.52.1', + revision = 'bd344c23a7683e293d077c6648e88f209782fedb', url = 'https://github.com/georgeharker/tree-sitter-zsh', }, maintainers = { '@georgeharker' }, - tier = 1, + tier = 2, }, } diff --git a/plugin/filetypes.lua b/plugin/filetypes.lua index 7759c1f5c..f8fe0c287 100644 --- a/plugin/filetypes.lua +++ b/plugin/filetypes.lua @@ -2,7 +2,7 @@ local filetypes = { angular = { 'htmlangular' }, bash = { 'sh' }, bibtex = { 'bib' }, - c_sharp = { 'cs', 'csharp', 'c-sharp' }, + c_sharp = { 'cs', 'csharp' }, commonlisp = { 'lisp' }, cooklang = { 'cook' }, devicetree = { 'dts' }, diff --git a/runtime/queries/angular/highlights.scm b/runtime/queries/angular/highlights.scm index ad192329a..d248d2e4c 100644 --- a/runtime/queries/angular/highlights.scm +++ b/runtime/queries/angular/highlights.scm @@ -28,6 +28,12 @@ (binding_name (identifier) @keyword) +(class_binding + [ + (identifier) + (class_name) + ] @keyword) + (event_binding (binding_name (identifier) @keyword)) diff --git a/runtime/queries/bpftrace/highlights.scm b/runtime/queries/bpftrace/highlights.scm new file mode 100644 index 000000000..19e568515 --- /dev/null +++ b/runtime/queries/bpftrace/highlights.scm @@ -0,0 +1,229 @@ +; Comments +[ + (line_comment) + (block_comment) +] @comment @spell + +; String and numeric literals +(string_literal) @string + +(escape_sequence) @string.escape + +(integer_literal) @number + +(boolean_literal) @boolean + +; Variables +(identifier) @variable + +(args_keyword) @variable.builtin + +(argn_identifier) @variable.builtin + +(retval_identifier) @variable.builtin + +(scratch_variable) @variable + +(map_variable) @variable + +(script_parameter) @variable.parameter + +; Macro +(macro_definition + (identifier) @function.macro) + +; Probes +; fentry/fexit, kprobe/kretprobe, rawtracepoint +(probe + provider: (_) @type.builtin + module: (wildcard_identifier) @module + function: (wildcard_identifier) @property) + +(probe + provider: (_) @type.builtin + function: (wildcard_identifier) @property) + +; uprobe/uretprobe +(probe + provider: (uprobe_uretprobe_provider) @type.builtin + binary: (file_identifier) @string.special.path + function: (identifier) @property) + +; tracepoint +(probe + provider: (_) @type.builtin + subsys: (wildcard_identifier) @module + event: (wildcard_identifier) @property) + +; software/hardware +(probe + provider: (_) @type.builtin + event: (identifier_with_dash) @property + count: (integer_literal) @number) + +(probe + provider: (_) @type.builtin + event: (identifier_with_dash) @property) + +; bench/test +(probe + provider: (bench_test_provider) @type.builtin + function: (identifier) @property) + +; profile/interval +(probe + provider: (profile_interval_provider) @type.builtin + unit: (time_unit) @string.special + count: (integer_literal) @property) + +(probe + provider: (profile_interval_provider) @type.builtin + count: (integer_literal) @number) + +; iter +(probe + provider: (iter_provider) @type.builtin + object: (identifier) @module + pin: (file_identifier) @property) + +(probe + provider: (iter_provider) @type.builtin + object: (identifier) @module) + +; ustd +(probe + provider: (ustd_provider) @type.builtin + binary: (file_identifier) @string.special.path + namespace: (identifier) @variable + function: (identifier) @property) + +(probe + provider: (ustd_provider) @type.builtin + binary: (file_identifier) @string.special.path + function: (identifier) @property) + +; watchpoint/asyncwatchpoint +(probe + provider: (watchpoint_provider) @type.builtin + address: (integer_literal) @number + length: (integer_literal) @number + mode: (watchpoint_mode) @property) + +; Types +(type_specifier) @type + +(integer_type) @type.builtin + +[ + "BEGIN" + "begin" + "END" + "end" +] @type.builtin + +; Keywords +(hashbang) @keyword.directive + +(return_statement) @keyword.return + +[ + "config" + "let" + "macro" + "offsetof" + "sizeof" +] @keyword + +[ + "if" + "else" +] @keyword.conditional + +[ + "for" + "unroll" + "while" + (break_statement) + (continue_statement) +] @keyword.repeat + +"import" @keyword.import + +(field_expression + field: (identifier) @property) + +(call_expression + function: (identifier) @function.call) + +; Punctuations +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +[ + "," + ";" + ":" + "." +] @punctuation.delimiter + +; Operators +[ + ; Field access + "->" + ; Range + ".." + ; Assignment + "=" + "<<=" + ">>=" + "+=" + "-=" + "*=" + "/=" + "%=" + "&=" + "|=" + "^=" + ; Update + "--" + "++" + ; Arithmetic + "%" + "+" + "-" + "*" + "/" + ; Relational + "<=" + "<" + ">=" + ">" + "==" + "!=" + ; Bitwise + "&" + "^" + "|" + "~" + "<<" + ">>" + ; Logical + "&&" + "||" + "!" +] @operator + +(conditional_expression + [ + "?" + ":" + ] @keyword.conditional.ternary) + +(predicate + "/" @punctuation.delimiter) diff --git a/runtime/queries/bpftrace/injections.scm b/runtime/queries/bpftrace/injections.scm new file mode 100644 index 000000000..8907d9f84 --- /dev/null +++ b/runtime/queries/bpftrace/injections.scm @@ -0,0 +1,12 @@ +([ + (c_struct) + (c_preproc) + (c_preproc_block) +] @injection.content + (#set! injection.language "c")) + +([ + (line_comment) + (block_comment) +] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/c3/highlights.scm b/runtime/queries/c3/highlights.scm index 1f02496b8..f2aa46dea 100644 --- a/runtime/queries/c3/highlights.scm +++ b/runtime/queries/c3/highlights.scm @@ -106,6 +106,7 @@ "$if" "$include" "$is_const" + "$kindof" "$nameof" "$offsetof" "$qnameof" @@ -218,6 +219,8 @@ "&&&" "+++" "|||" + "???" + "+++=" ] @operator (range_expr @@ -232,6 +235,7 @@ (ternary_expr [ "?" + "???" ":" ] @keyword.conditional.ternary) @@ -268,8 +272,8 @@ (#any-of? @variable.builtin "alignof" "associated" "elements" "extnameof" "from_ordinal" "get" "inf" "is_eq" "is_ordered" "is_substruct" "len" "lookup" "lookup_field" "max" "membersof" "methodsof" "min" "nan" "inner" - "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "tagof" - "has_tagof" "values" "typeid"))) + "kindof" "names" "nameof" "params" "paramsof" "parentof" "qnameof" "returns" "sizeof" "set" + "tagof" "has_tagof" "values" "typeid"))) ; Label [ @@ -285,7 +289,7 @@ (path_ident (ident) @module)) -(import_declaration +(import_path (path_ident (ident) @module)) @@ -298,6 +302,9 @@ (call_inline_attributes (at_ident) @attribute) +(type_suffix + (at_ident) @attribute) + (asm_block_stmt (at_ident) @attribute) diff --git a/runtime/queries/c_sharp/highlights.scm b/runtime/queries/c_sharp/highlights.scm index 0c9489506..75aa3f847 100644 --- a/runtime/queries/c_sharp/highlights.scm +++ b/runtime/queries/c_sharp/highlights.scm @@ -327,6 +327,9 @@ (lambda_expression type: (identifier) @type) +(lambda_expression + (modifier) @keyword.modifier) + (as_expression right: (identifier) @type) diff --git a/runtime/queries/ecma/injections.scm b/runtime/queries/ecma/injections.scm index 669c75671..69afb6d41 100644 --- a/runtime/queries/ecma/injections.scm +++ b/runtime/queries/ecma/injections.scm @@ -59,10 +59,15 @@ (#set! injection.include-children) (#set! injection.language "groq")) +; gql`...` or gql(`...`) (call_expression function: (identifier) @_name (#eq? @_name "gql") - arguments: (template_string) @injection.content + arguments: [ + (arguments + (template_string) @injection.content) + (template_string) @injection.content + ] (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children) (#set! injection.language "graphql")) diff --git a/runtime/queries/ecma/locals.scm b/runtime/queries/ecma/locals.scm index adc58531d..97570e44a 100644 --- a/runtime/queries/ecma/locals.scm +++ b/runtime/queries/ecma/locals.scm @@ -25,6 +25,11 @@ name: (object_pattern (shorthand_property_identifier_pattern) @local.definition.var)) +(variable_declarator + (object_pattern + (pair_pattern + (identifier) @local.definition.var))) + (import_specifier (identifier) @local.definition.import) diff --git a/runtime/queries/editorconfig/highlights.scm b/runtime/queries/editorconfig/highlights.scm index feb0a524c..a1d686b36 100644 --- a/runtime/queries/editorconfig/highlights.scm +++ b/runtime/queries/editorconfig/highlights.scm @@ -1,14 +1,19 @@ (comment) @comment @spell -(section - (section_name) @string.special.path) +(property) @property -(character_choice - (character) @constant) +(string) @string -(character_range - start: (character) @constant - end: (character) @constant) +(header + (glob) @string.special.path) + +(character) @character + +(character_escape) @string.escape + +(wildcard) @character.special + +(integer) @number [ "[" @@ -20,36 +25,11 @@ [ "," ".." - (path_separator) + "/" + "-" ] @punctuation.delimiter [ - "-" "=" - (negation) + "!" ] @operator - -[ - (wildcard_characters) - (wildcard_any_characters) - (wildcard_single_character) -] @character.special - -(escaped_character) @string.escape - -(pair - key: (identifier) @property - value: (_) @string) - -(boolean) @boolean - -(integer) @number - -(unset) @constant.builtin - -[ - (spelling_language) - (indent_style) - (end_of_line) - (charset) -] @string.special diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm index 549bceda0..da5c52a32 100644 --- a/runtime/queries/fish/highlights.scm +++ b/runtime/queries/fish/highlights.scm @@ -112,15 +112,16 @@ (command name: (word) @function.call) -; derived from builtin -n (fish 3.2.2) +; derived from builtin -n (fish 4.3.3) (command name: [ (word) @function.builtin (#any-of? @function.builtin "." ":" "_" "abbr" "alias" "argparse" "bg" "bind" "block" "breakpoint" "builtin" "cd" "command" "commandline" "complete" "contains" "count" "disown" "echo" "emit" "eval" "exec" - "exit" "fg" "functions" "history" "isatty" "jobs" "math" "path" "printf" "pwd" "random" "read" - "realpath" "set" "set_color" "source" "status" "string" "test" "time" "type" "ulimit" "wait") + "exit" "fg" "fish_indent" "fish_key_reader" "functions" "history" "isatty" "jobs" "math" + "path" "printf" "pwd" "random" "read" "realpath" "set" "set_color" "source" "status" "string" + "test" "time" "type" "ulimit" "wait") ]) ; Functions @@ -163,15 +164,15 @@ ; Reference: https://fishshell.com/docs/current/language.html#special-variables ((variable_name) @variable.builtin (#any-of? @variable.builtin - "PATH" "CDPATH" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC" - "LC_TIME" "fish_color_normal" "fish_color_command" "fish_color_keyword" "fish_color_keyword" - "fish_color_redirection" "fish_color_end" "fish_color_error" "fish_color_param" - "fish_color_valid_path" "fish_color_option" "fish_color_comment" "fish_color_selection" - "fish_color_operator" "fish_color_escape" "fish_color_autosuggestion" "fish_color_cwd" - "fish_color_cwd_root" "fish_color_user" "fish_color_host" "fish_color_host_remote" - "fish_color_status" "fish_color_cancel" "fish_color_search_match" "fish_color_history_current" - "fish_pager_color_progress" "fish_pager_color_background" "fish_pager_color_prefix" - "fish_pager_color_completion" "fish_pager_color_description" + "PATH" "CDPATH" "LANG" "LANGUAGE" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" + "LC_NUMERIC" "LC_TIME" "fish_color_normal" "fish_color_command" "fish_color_keyword" + "fish_color_keyword" "fish_color_redirection" "fish_color_end" "fish_color_error" + "fish_color_param" "fish_color_valid_path" "fish_color_option" "fish_color_comment" + "fish_color_selection" "fish_color_operator" "fish_color_escape" "fish_color_autosuggestion" + "fish_color_cwd" "fish_color_cwd_root" "fish_color_user" "fish_color_host" + "fish_color_host_remote" "fish_color_status" "fish_color_cancel" "fish_color_search_match" + "fish_color_history_current" "fish_pager_color_progress" "fish_pager_color_background" + "fish_pager_color_prefix" "fish_pager_color_completion" "fish_pager_color_description" "fish_pager_color_selected_background" "fish_pager_color_selected_prefix" "fish_pager_color_selected_completion" "fish_pager_color_selected_description" "fish_pager_color_secondary_background" "fish_pager_color_secondary_prefix" @@ -183,8 +184,8 @@ "fish_cursor_visual" "fish_cursor_external" "fish_function_path" "fish_greeting" "fish_history" "fish_trace" "FISH_DEBUG" "FISH_DEBUG_OUTPUT" "fish_user_paths" "umask" "BROWSER" "_" "argv" "CMD_DURATION" "COLUMNS" "LINES" "fish_kill_signal" "fish_killring" "fish_read_limit" "fish_pid" - "history" "HOME" "hostname" "IFS" "last_pid" "PWD" "pipestatus" "SHLVL" "status" - "status_generation" "TERM" "USER" "EUID" "version" "FISH_VERSION")) + "fish_terminal_color_theme" "history" "HOME" "hostname" "IFS" "last_pid" "PWD" "pipestatus" + "SHLVL" "status" "status_generation" "TERM" "USER" "EUID" "version" "FISH_VERSION")) ; Nodes [ diff --git a/runtime/queries/glimmer/injections.scm b/runtime/queries/glimmer/injections.scm index 30b438682..9efa71f5e 100644 --- a/runtime/queries/glimmer/injections.scm +++ b/runtime/queries/glimmer/injections.scm @@ -3,19 +3,12 @@ (#set! injection.language "comment")) ; <style> tags -((element_node - (element_node_start - (tag_name) @_tag_name - (#eq? @_tag_name "style"))) @injection.content - (#offset! @injection.content 0 7 0 -8) - (#set! injection.language "css") - (#set! injection.include-children)) +((style_element + (raw_text) @injection.content) + (#set! injection.language "css")) ; <script> tags -((element_node - (element_node_start - (tag_name) @_tag_name - (#eq? @_tag_name "script"))) @injection.content - (#offset! @injection.content 0 8 0 -9) - (#set! injection.language "glimmer_javascript") +((script_element + (raw_text) @injection.content) + (#set! injection.language "javascript") (#set! injection.include-children)) diff --git a/runtime/queries/glimmer_typescript/indents.scm b/runtime/queries/glimmer_typescript/indents.scm index 237254d4c..ec026473f 100644 --- a/runtime/queries/glimmer_typescript/indents.scm +++ b/runtime/queries/glimmer_typescript/indents.scm @@ -1,3 +1,5 @@ +; inherits: typescript + (glimmer_opening_tag) @indent.begin (glimmer_closing_tag) @indent.end diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm index de0eaf0a1..d0fdc17f6 100644 --- a/runtime/queries/haskell/highlights.scm +++ b/runtime/queries/haskell/highlights.scm @@ -9,7 +9,8 @@ (_) @variable.parameter)) (expression/lambda - (_)+ @variable.parameter + patterns: (patterns + (_) @variable.parameter) "->") (decl/function @@ -226,7 +227,8 @@ (qualified ((module) @module (variable) @function.call)) - ]) + ] + operator: (operator)) ; infix operators applied to variables ((expression/variable) @variable @@ -245,7 +247,7 @@ (function (infix left_operand: [ - (variable) @variable + (variable) @variable.parameter (qualified ((module) @module (variable) @variable)) diff --git a/runtime/queries/html_tags/highlights.scm b/runtime/queries/html_tags/highlights.scm index 9eaf813be..94a338aa7 100644 --- a/runtime/queries/html_tags/highlights.scm +++ b/runtime/queries/html_tags/highlights.scm @@ -1,9 +1,11 @@ -(tag_name) @tag +(tag_name) @tag @nospell ; (erroneous_end_tag_name) @error ; we do not lint syntax errors (comment) @comment @spell -(attribute_name) @tag.attribute +(attribute_name) @tag.attribute @nospell + +(attribute_value) @nospell ((attribute (quoted_attribute_value) @string) diff --git a/runtime/queries/kos/highlights.scm b/runtime/queries/kos/highlights.scm index 0942b2b89..07757d2e3 100644 --- a/runtime/queries/kos/highlights.scm +++ b/runtime/queries/kos/highlights.scm @@ -4,8 +4,13 @@ (number) @number +(float_number) @number.float + (identifier) @variable +(parameter + parameter: (identifier) @variable.parameter) + (property_identifier) @property [ @@ -57,8 +62,9 @@ "=>" ] @keyword.function +"_" @character.special + [ - "_" (line) "assert" ;"async" @@ -96,6 +102,15 @@ "}" ] @punctuation.bracket +(string_literal_begin + "\\(" @punctuation.special) + +(string_literal_continuation + "\\(" @punctuation.special) + +(formatted_string + ")" @punctuation.special) + [ ";" ":" diff --git a/runtime/queries/kotlin/highlights.scm b/runtime/queries/kotlin/highlights.scm index 8eda6ef61..a45ab23d5 100644 --- a/runtime/queries/kotlin/highlights.scm +++ b/runtime/queries/kotlin/highlights.scm @@ -153,7 +153,7 @@ "charArrayOf" "emptyArray" "mapOf" "setOf" "listOf" "emptyMap" "emptySet" "emptyList" "mutableMapOf" "mutableSetOf" "mutableListOf" "print" "println" "error" "TODO" "run" "runCatching" "repeat" "lazy" "lazyOf" "enumValues" "enumValueOf" "assert" "check" - "checkNotNull" "require" "requireNotNull" "with" "suspend" "synchronized")) + "checkNotNull" "require" "requireNotNull" "with" "synchronized")) ; Literals [ @@ -343,12 +343,11 @@ "?:" "!!" "is" - "!is" "in" - "!in" "as" "as?" ".." + "..<" "->" ] @operator diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm index e76745f4f..8f371c9ed 100644 --- a/runtime/queries/lua/injections.scm +++ b/runtime/queries/lua/injections.scm @@ -34,10 +34,10 @@ (_) . (string - content: _ @_method) + content: (_) @_method) . (string - content: _ @injection.content))) + content: (_) @injection.content))) (#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify") (#eq? @_method "nvim_exec_lua") (#set! injection.language "lua")) diff --git a/runtime/queries/make/highlights.scm b/runtime/queries/make/highlights.scm index 8d182c026..b4ef14cb1 100644 --- a/runtime/queries/make/highlights.scm +++ b/runtime/queries/make/highlights.scm @@ -167,6 +167,7 @@ "eval" "file" "value" + "let" ] @function.builtin) "\\" @punctuation.special diff --git a/runtime/queries/nickel/highlights.scm b/runtime/queries/nickel/highlights.scm index c5ebfe166..2f563e9f8 100644 --- a/runtime/queries/nickel/highlights.scm +++ b/runtime/queries/nickel/highlights.scm @@ -1,5 +1,8 @@ (comment) @comment @spell +(annot_atom + doc: (static_string) @spell) + [ "forall" "in" @@ -7,6 +10,10 @@ "default" "doc" "rec" + "optional" + "priority" + "force" + "not_exported" ] @keyword "fun" @keyword.function @@ -23,20 +30,54 @@ (types) @type -"Array" @type.builtin +[ + "Array" + "Number" + "Dyn" + "Bool" + "String" +] @type.builtin ; BUILTIN Constants (bool) @boolean "null" @constant.builtin +(enum_tag) @constant + (num_literal) @number -(infix_op) @operator +[ + (infix_op) + "|>" + "=" + "&" + "&&" + "||" + "==" + "+" + "-" + "*" + "/" + "%" + "!" + "?" + "!=" + "<" + "<=" + ">" + ">=" + "@" + ".." + "=>" + "++" +] @operator + +"or" @keyword.operator (type_atom) @type -(enum_tag) @variable +(static_string) @string (chunk_literal_single) @string @@ -51,24 +92,60 @@ ")" "[|" "|]" + "[" + "]" ] @punctuation.bracket -(multstr_start) @punctuation.bracket - -(multstr_end) @punctuation.bracket +[ + "," + "." + ":" + ";" + "|" + "->" +] @punctuation.delimiter -(interpolation_start) @punctuation.bracket +(multstr_start) @string -(interpolation_end) @punctuation.bracket +(multstr_end) @string -(field_decl) @variable.member +[ + (interpolation_start) + (interpolation_end) +] @punctuation.special (builtin) @function.builtin +(builtin + "%" @function.builtin) + (fun_expr pats: (pattern_fun (ident) @variable.parameter)) +; application where the head terms is an identifier: function arg1 arg2 arg3 +(applicative + t1: (applicative + . + (record_operand + (atom + (ident))) @function)) + +; application where the head terms is a record field path: foo.bar.function arg1 arg2 arg3 (applicative t1: (applicative - (record_operand) @function)) + . + (record_operand + (record_operation_chain)) @function)) + +(str_chunks) @string + +(field_path_elem) @property + +(infix_expr + op: (infix_b_op_6) + t2: (infix_expr + (applicative + . + (record_operand + (record_operation_chain) @function)))) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index 718a9c1c5..c1593b91f 100644 --- a/runtime/queries/nix/injections.scm +++ b/runtime/queries/nix/injections.scm @@ -48,7 +48,8 @@ ((string_fragment) @injection.content (#set! injection.language "bash"))) ] - (#lua-match? @_path "^%a+Phase$")) + (#lua-match? @_path "^%a+Phase$") + (#set! injection.combined)) (binding attrpath: (attrpath @@ -61,7 +62,8 @@ ((string_fragment) @injection.content (#set! injection.language "bash"))) ] - (#lua-match? @_path "^pre%a+$")) + (#lua-match? @_path "^pre%a+$") + (#set! injection.combined)) (binding attrpath: (attrpath @@ -74,7 +76,8 @@ ((string_fragment) @injection.content (#set! injection.language "bash"))) ] - (#lua-match? @_path "^post%a+$")) + (#lua-match? @_path "^post%a+$") + (#set! injection.combined)) (binding attrpath: (attrpath @@ -87,7 +90,8 @@ ((string_fragment) @injection.content (#set! injection.language "bash"))) ] - (#lua-match? @_path "^script$")) + (#lua-match? @_path "^script$") + (#set! injection.combined)) (apply_expression function: (_) @_func diff --git a/runtime/queries/proto/folds.scm b/runtime/queries/proto/folds.scm index 76f688b7d..87fe6d304 100644 --- a/runtime/queries/proto/folds.scm +++ b/runtime/queries/proto/folds.scm @@ -2,6 +2,8 @@ (enum) (message) (service) + (oneof) + (rpc) ] @fold (import)+ @fold diff --git a/runtime/queries/proto/highlights.scm b/runtime/queries/proto/highlights.scm index 894686dd4..22df9002f 100644 --- a/runtime/queries/proto/highlights.scm +++ b/runtime/queries/proto/highlights.scm @@ -11,6 +11,9 @@ (field_option (identifier) @property) +(enum_value_option + (identifier) @property) + (block_lit (identifier) @property) @@ -21,13 +24,17 @@ "option" "reserved" "syntax" + "edition" "to" + "max" ] @keyword [ "enum" + "group" "service" "message" + "map" ] @keyword.type "rpc" @keyword.function @@ -35,9 +42,14 @@ "returns" @keyword.return [ + "export" + "local" "optional" "repeated" "required" + "stream" + "weak" + "public" ] @keyword.modifier [ @@ -65,6 +77,8 @@ "\"proto2\"" ] @string.special +(escape_sequence) @string.escape + (int_lit) @number (float_lit) @number.float @@ -97,4 +111,8 @@ ":" ] @punctuation.delimiter -"=" @operator +[ + "=" + "-" + "+" +] @operator diff --git a/runtime/queries/robot/highlights.scm b/runtime/queries/robot/highlights.scm index a9c545b8a..ab30906c7 100644 --- a/runtime/queries/robot/highlights.scm +++ b/runtime/queries/robot/highlights.scm @@ -10,7 +10,13 @@ (test_case_setting) ] @keyword -(variable_definition +(scalar_variable + (variable_name) @variable) + +(list_variable + (variable_name) @variable) + +(dictionary_variable (variable_name) @variable) (keyword_definition diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index de9d09684..2342dcfa3 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -476,9 +476,12 @@ [ (line_comment) (block_comment) +] @comment @spell + +[ (outer_doc_comment_marker) (inner_doc_comment_marker) -] @comment @spell +] @comment.documentation (line_comment (doc_comment)) @comment.documentation diff --git a/runtime/queries/rust/injections.scm b/runtime/queries/rust/injections.scm index 7bffd1fc9..b7d5b4bb6 100644 --- a/runtime/queries/rust/injections.scm +++ b/runtime/queries/rust/injections.scm @@ -5,7 +5,7 @@ (identifier) @_macro_name ] (token_tree) @injection.content - (#not-any-of? @_macro_name "slint" "html" "json") + (#not-any-of? @_macro_name "slint" "html" "json" "xml") (#set! injection.language "rust") (#set! injection.include-children)) @@ -16,7 +16,7 @@ (identifier) @injection.language ] (token_tree) @injection.content - (#any-of? @injection.language "slint" "html" "json") + (#any-of? @injection.language "slint" "html" "json" "xml") (#offset! @injection.content 0 1 0 -1) (#set! injection.include-children)) diff --git a/runtime/queries/supercollider/folds.scm b/runtime/queries/supercollider/folds.scm index 2f5f1043a..a62272b5c 100644 --- a/runtime/queries/supercollider/folds.scm +++ b/runtime/queries/supercollider/folds.scm @@ -2,5 +2,4 @@ (function_call) (code_block) (function_block) - (control_structure) ] @fold diff --git a/runtime/queries/supercollider/highlights.scm b/runtime/queries/supercollider/highlights.scm index c56bce69a..bef85ef45 100644 --- a/runtime/queries/supercollider/highlights.scm +++ b/runtime/queries/supercollider/highlights.scm @@ -1,6 +1,6 @@ ; highlights.scm ; See this for full list: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md -; comments +; Comments (line_comment) @comment @spell (block_comment) @comment @spell @@ -9,6 +9,12 @@ (argument name: (identifier) @variable.parameter) +"..." @variable.parameter ; variable argument + +; For function calls +(named_argument + name: (identifier) @variable.parameter) + ; Variables (local_var name: (identifier) @variable) @@ -18,31 +24,58 @@ (builtin_var) @constant.builtin -; (variable) @variable ; Functions (function_definition name: (variable) @function) -; For function calls -(named_argument - name: (identifier) @function.call) - ; Methods -(method_call - name: (method_name) @function.method.call) +(function_call + name: (_) @function.method.call) + +; Collections +(associative_item + (identifier) @property) ; Classes (class) @type +(parent_class) @type + +(instance_method_name) @function.method + +(class_method_name) @function.method + ; Literals +(bool) @boolean + (number) @number (float) @number.float (string) @string +(escape_sequence) @string.escape + (symbol) @string.special.symbol +; Conditionals +[ + "?" + "!?" + "??" +] @keyword.conditional + +((function_call + name: (_) @keyword.conditional) + (#any-of? @keyword.conditional "if" "while" "case" "switch" "try" "protect")) + +((function_call + name: (_) @keyword.repeat) + (#any-of? @keyword.repeat "for" "forBy")) + +; Duplication operator +"!" @keyword.repeat + ; Operators [ "&&" @@ -52,6 +85,8 @@ "^" "==" "!=" + "===" + "!==" "<" "<=" ">" @@ -64,6 +99,13 @@ "/" "%" "=" + "@" + "|@|" + "@@" + "@|@" + "++" + "+/+" + ".." ] @operator ; Keywords @@ -71,11 +113,13 @@ "arg" "classvar" "const" - ; "super" - ; "this" "var" ] @keyword +((local_var + name: (identifier) @variable.builtin) + (#any-of? @variable.builtin "this" "super")) + ; Brackets [ "(" @@ -92,12 +136,5 @@ ";" "." "," + ":" ] @punctuation.delimiter - -; control structure -(control_structure) @keyword.conditional - -(escape_sequence) @string.escape - -; SinOsc.ar()!2 -(duplicated_statement) @keyword.repeat diff --git a/runtime/queries/supercollider/indents.scm b/runtime/queries/supercollider/indents.scm index c0cffab3c..396721abf 100644 --- a/runtime/queries/supercollider/indents.scm +++ b/runtime/queries/supercollider/indents.scm @@ -12,21 +12,30 @@ (variable_definition) (variable_definition_sequence (variable_definition)) - (control_structure) (return_statement) ] @indent.begin [ (parameter_call_list - (argument_calls)) - "(" + (_)) ")" - "{" "}" - "[" "]" ] @indent.branch +; for auto-indent while typing +(ERROR + "{") @indent.begin + +(ERROR + "}") @indent.branch + +(ERROR + "[") @indent.begin + +(ERROR + "]") @indent.branch + [ (block_comment) (line_comment) diff --git a/runtime/queries/supercollider/locals.scm b/runtime/queries/supercollider/locals.scm index 066bbf9ab..b0a082131 100644 --- a/runtime/queries/supercollider/locals.scm +++ b/runtime/queries/supercollider/locals.scm @@ -3,7 +3,6 @@ (function_call) (code_block) (function_block) - (control_structure) ] @local.scope ; Definitions diff --git a/runtime/queries/textproto/highlights.scm b/runtime/queries/textproto/highlights.scm index 527af0398..f4d355ce2 100644 --- a/runtime/queries/textproto/highlights.scm +++ b/runtime/queries/textproto/highlights.scm @@ -6,6 +6,18 @@ (number) @number +"-" @operator + +[ + ":" + ";" + "," + "." + "/" +] @punctuation.delimiter + +(string_escape) @string.escape + ; For stuff like "inf" and "-inf". (scalar_value [ diff --git a/runtime/queries/typst/highlights.scm b/runtime/queries/typst/highlights.scm index a0dcc1b89..0ae538fe1 100644 --- a/runtime/queries/typst/highlights.scm +++ b/runtime/queries/typst/highlights.scm @@ -106,7 +106,17 @@ (emph) @markup.italic -(url) @markup.link.url +((url) @markup.link.url + (#set! @markup.link.url url @markup.link.url)) + +(call + item: (ident) @_link + (#eq? @_link "link") + (group + . + (string) @markup.link.url + (#offset! @markup.link.url 0 1 0 -1) + (#set! @markup.link.url url @markup.link.url))) ; code blocks (raw_span) @markup.raw diff --git a/runtime/queries/typst/indents.scm b/runtime/queries/typst/indents.scm index d43c586c1..424320fe4 100644 --- a/runtime/queries/typst/indents.scm +++ b/runtime/queries/typst/indents.scm @@ -3,10 +3,12 @@ (let) (show) (call) + (for) + (branch) ] @indent.begin [ "]" "}" ")" -] @indent.branch @indent.end +] @indent.end @indent.branch diff --git a/runtime/queries/usd/highlights.scm b/runtime/queries/usd/highlights.scm index d6c2a3668..98a7ff95c 100644 --- a/runtime/queries/usd/highlights.scm +++ b/runtime/queries/usd/highlights.scm @@ -52,12 +52,14 @@ "]" "{" "}" + "[]" ] @punctuation.bracket [ ":" ";" "." + "," ] @punctuation.delimiter "=" @operator diff --git a/runtime/queries/vento/highlights.scm b/runtime/queries/vento/highlights.scm index 9d35b2f66..ec31aae20 100644 --- a/runtime/queries/vento/highlights.scm +++ b/runtime/queries/vento/highlights.scm @@ -1,6 +1,26 @@ (comment) @comment @spell -(keyword) @keyword +[ + "if" + "/if" + "else" + "for" + "/for" + "layout" + "/layout" + "set" + "/set" + "import" + "export" + "/export" + "include" + "function" + "/function" + "fragment" + "/fragment" + "of" + "async" +] @keyword (tag [ diff --git a/runtime/queries/zsh/highlights.scm b/runtime/queries/zsh/highlights.scm index 75a37408b..20fac01ba 100644 --- a/runtime/queries/zsh/highlights.scm +++ b/runtime/queries/zsh/highlights.scm @@ -14,8 +14,8 @@ [ ";" ";;" - ";&" - ";;&" + (case_fallthrough) + (case_test_next) "&" ] @punctuation.delimiter diff --git a/scripts/check-parsers.lua b/scripts/check-parsers.lua index c2eefd7c9..9d39af482 100755 --- a/scripts/check-parsers.lua +++ b/scripts/check-parsers.lua @@ -1,5 +1,5 @@ #!/usr/bin/env -S nvim -l -vim.opt.runtimepath:append('.') +vim.o.rtp = vim.o.rtp .. ',.' local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 94d8951cb..4c9fc86b1 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -1,5 +1,5 @@ #!/usr/bin/env -S nvim -l -vim.opt.runtimepath:append('.') +vim.o.rtp = vim.o.rtp .. ',.' local query_types = require('nvim-treesitter.health').bundled_queries local configs = require('nvim-treesitter.parsers') diff --git a/scripts/install-parsers.lua b/scripts/install-parsers.lua index c97c6eecc..855c73cbd 100755 --- a/scripts/install-parsers.lua +++ b/scripts/install-parsers.lua |
