Commit graph

5995 commits

Author SHA1 Message Date
Christian Clason
f525d9eb6b 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-04-06 13:17:33 +02:00
Christian Clason
9abfe42989 fix(ci): update to changed neovim release name 2025-04-06 13:17:33 +02:00
Christian Clason
92c4116fb9 fix(install): return error code in callback 2025-04-06 13:17:33 +02:00
Christian Clason
aa87954651 feat(install)!: bump minimum tree-sitter version to 0.24 2025-04-06 13:17:33 +02:00
Christian Clason
05a695e9be ci(tests): add optional workflow for generating grammars
run on PR by adding label `ci:generate` or manually
2025-04-06 13:17:33 +02:00
Christian Clason
dc23fe1de9 feat(install): allow specifying max jobs 2025-04-06 13:17:33 +02:00
Christian Clason
a58b9132a1 feat(config)!: remove auto_install
use https://github.com/lewis6991/ts-install.nvim instead
2025-04-06 13:17:33 +02:00
Christian Clason
deeb6a0f46 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-04-06 13:17:33 +02:00
Christian Clason
9e484d5ffd feat!: use tree-sitter build 2025-04-06 13:17:33 +02:00
Christian Clason
b96ca7212d 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-04-06 13:17:31 +02:00
Christian Clason
a8830720eb fix: vim.tbl_flatten is deprecated 2025-04-06 13:16:46 +02:00
Christian Clason
fe11b0b590 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-04-06 13:16:46 +02:00
nvim-treesitter-bot[bot]
d15e73f5f0 bot(readme): update 2025-04-06 13:16:46 +02:00
Christian Clason
14680dcf2d 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-04-06 13:16:46 +02:00
Lewis Russell
f8458f227a fix: do not use vim.iter (#6469) 2025-04-06 13:16:46 +02:00
Lewis Russell
aef1032d21 feat: improve logging of failed installs 2025-04-06 13:16:46 +02:00
Christian Clason
7544688027 feat(install)!: remove support for C++ scanners 2025-04-06 13:16:46 +02:00
Phạm Huy Hoàng
54dc7f89a5 doc: better clarification of highlights/injections 2025-04-06 13:16:46 +02:00
Phạm Huy Hoàng
88c9729abb fix(format): update scripts to support nightly (#6126)
No need for assert as the use is contained within the script only
2025-04-06 13:16:46 +02:00
Gregory Anders
a7fd268713 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-04-06 13:16:45 +02:00
Christian Clason
4141eb8e95 fix: better output for update-lockfile 2025-04-06 13:16:45 +02:00
Christian Clason
891916c639 feat: improve check-queries 2025-04-06 13:16:45 +02:00
Christian Clason
c929d69aa8 docs: update CONTRIBUTING.md 2025-04-06 13:16:45 +02:00
Lewis Russell
8dccea892f refactor: pull out predicate function 2025-04-06 13:16:45 +02:00
Lewis Russell
e5babe1336 fix: update vim.system types 2025-04-06 13:16:45 +02:00
Lewis Russell
623069bfa4 fix: remove downcase! directive use 2025-04-06 13:16:45 +02:00
Lewis Russell
b9e1cd1466 feat: allow a custom revision in install_info 2025-04-06 13:16:45 +02:00
Pham Huy Hoang
478f40063d fix!: indents now rely on treesitter highlight
- Apply suggestions from Lewis to only parse visible lines
- Fix failed tests
2025-04-06 13:16:45 +02:00
Christian Clason
aa3dc33893 docs(readme): document 'location' key 2025-04-06 13:16:45 +02:00
Pham Huy Hoang
a8dd18209a tests: remove set ft 2025-04-06 13:16:45 +02:00
Lewis Russell
f69876bfae fix: cleanup diagnostics 2025-04-06 13:16:45 +02:00
Lewis Russell
e353b43f46 fix: add stricter cc options (#5063) 2025-04-06 13:16:45 +02:00
Christian Clason
bae24a51d7 fix: remove upstreamed directives
`#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype`
2025-04-06 13:16:45 +02:00
TheLeoP
860aa734a3 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-04-06 13:16:45 +02:00
TheLeoP
6963ee8691 fix: check if config has install_info in filter 2025-04-06 13:16:45 +02:00
Lewis Russell
05c9300a57 fix: check queries in needs_update() 2025-04-06 13:16:45 +02:00
Lewis Russell
c9eff8ad7d fix: filter languages through parser.configs 2025-04-06 13:16:45 +02:00
Christian Clason
21239d7db5 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-04-06 13:16:45 +02:00
Christian Clason
654153e043 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-04-06 13:16:45 +02:00
Lewis Russell
80b3bb188d refactor: use vim.system (#4923) 2025-04-06 13:16:45 +02:00
Christian Clason
3677694dbe fix: expand tiers in ignore_install 2025-04-06 13:16:45 +02:00
Christian Clason
5a2fa8b92e feat: drop TSInstallInfo in favor of better checkhealth
also fixes the hole in install.compilers
2025-04-06 13:16:45 +02:00
Christian Clason
18fd625de8 refactor: use vim.uv 2025-04-06 13:16:45 +02:00
Christian Clason
58a6e91e40 fix: install dependencies 2025-04-06 13:16:45 +02:00
Christian Clason
8a122f5a0e ci: remove update-lockfile shell script 2025-04-06 13:16:45 +02:00
Lewis Russell
68aa1ac4f6 refactor: rewrite installation using jobs and async
Replace sync variants with callback support
2025-04-06 13:16:45 +02:00
Christian Clason
422ae43428 refactor: use vim.fs.joinpath 2025-04-06 13:16:45 +02:00
Christian Clason
ca26208f2b feat!: drop luarocks release 2025-04-06 13:16:45 +02:00
Christian Clason
d4246a2eeb feat(locals)!: refactor locals.lua into standalone
Co-authored-by: TheLeoP <eugenio2305@hotmail.com>
2025-04-06 13:16:45 +02:00
Christian Clason
1764f4270f feat!: drop modules, general refactor and cleanup 2025-04-06 13:16:45 +02:00