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()`).
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).
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>
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.
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.
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.
`: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.
* 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
]=]
```