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.
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).
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
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.
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))
```
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.
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.
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.
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.
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.