Commit graph

56 commits

Author SHA1 Message Date
Christian Clason
a796eb4fc1 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-03-05 10:00:39 +01:00
Christian Clason
303fabc2f7 feat!: use tree-sitter build 2025-03-05 10:00:39 +01:00
Christian Clason
961b7f6f77 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-03-05 10:00:39 +01:00
Christian Clason
6d3a9b6ebd 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-03-05 10:00:39 +01:00
TheLeoP
cc19eceb1b 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-03-05 10:00:39 +01:00
Lewis Russell
fcc9a8d110 refactor: use vim.system (#4923) 2025-03-05 10:00:39 +01:00
Christian Clason
37ae595d20 feat: drop TSInstallInfo in favor of better checkhealth
also fixes the hole in install.compilers
2025-03-05 10:00:39 +01:00
Christian Clason
ee1e991ae2 refactor: use vim.uv 2025-03-05 10:00:39 +01:00
Christian Clason
70910f335f fix: install dependencies 2025-03-05 10:00:38 +01:00
Lewis Russell
c9074b7e5f refactor: rewrite installation using jobs and async
Replace sync variants with callback support
2025-03-05 10:00:38 +01:00
Christian Clason
20c077f374 feat!: drop modules, general refactor and cleanup 2025-03-05 10:00:38 +01:00
Christian Clason
d740b0ad92 docs(readme): mark Nvim 0.10 as required 2024-10-25 08:48:16 +02:00
Christian Clason
59d4c14a1a feat!: bump minimum Nvim version to 0.9.2
required for empty injection fix
2024-01-15 13:02:20 +01:00
Christian Clason
2aa9e9b0e6 feat!: bump required Nvim version to 0.9.1 2023-08-12 17:34:15 +02:00
dundargoc
21f2fb188e fix(checkhealth): use non-deprecated versions if possible 2023-04-16 05:26:14 -07:00
Lewis Russell
90ead4ed58 fix: shim 0.9 deprecations 2023-03-24 16:05:38 +01:00
kylo252
1f087c91f5
fix(health): check required neovim version (#4330)
* fix(health): check required neovim version

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

* fixup(readme)!: always prefer latest neovim
2023-03-24 03:36:30 +01:00
dundargoc
87dd482e1a fix(health): align the list of parsers when doing checkhealth
Some parser names are too long for the given space, which shifts the
features so they aren't in line.
2022-12-21 13:08:15 +01:00
Stephan Seitz
5aacb06135 chore: print OS version on health report
Often we get issue report without knowing which version of Windows or
Linux or MacOS they are running.
2022-11-26 18:38:49 +01:00
Stephan Seitz
fbf453a432 chore: trim space in check-health
Fixes #3248
2022-08-03 18:45:37 +02:00
Christian Clason
b922b2c3db fix(health): update to upstream changes
The `health` module was moved to `vim.health` in https://github.com/neovim/neovim/pull/18720
2022-06-02 12:56:57 +02:00
Christian Clason
07eb437bb1 refactor!: update to Neovim 0.7 APIs
* set highlight groups via nvim_set_hl
* define autocommands via nvim_create_autocmd
* port plugin/nvim-treesitter.vim to Lua
* port healthcheck to Lua
2022-04-30 16:08:01 +02:00
Christian Clason
a189323454 chore: bump minimal Nvim version to 0.7 and check
Checks minimal version in `:checkhealth nvim-treesitter`

Also recommend nightlies
2022-04-16 11:13:32 +02:00
Stephan Seitz
7049a66b54 health: check which file caused an error 2022-01-29 23:45:32 +01:00
Christian Clason
bb319daf5f feat: specify abi version for generate on newer ts cli
Check tree-sitter CLI version and if > 0.20.3 and generating a parser
from grammar, use `--abi=vim.treesitter.language_version`.

Besides being able to opt-in to newer ABI benefits, this is a necessary
workaround for an upstream bug with 0.20.3, where `parser.h` is not
generated if the (optional) `--abi` flag is omitted.
2022-01-22 22:56:50 +01:00
Javier López
66f1873213 feat(healthcheck): support native lua healthchecks, and fixes
After neovim/neovim#15259 lua healthchecks are called directly and are
prefered over neovim autoload ones. The discover of Lua ones requires
the function to be named "check()".

Also the mentioned PR changed the design of healthchecks to not use
output capturing, therefore avoid printing and instead concatenate and
call the health functions.
2021-10-11 09:47:16 +02:00
Stephan Seitz
44d4d07dbf chore: print compiler version in healthcheck 2021-10-03 11:06:57 +02:00
Santos Gallegos
bd3363e01d Checkhealth: include injections
Fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1459
2021-07-05 12:34:47 +02:00
Santos Gallegos
be8f656087
Use stylua for autoformat code (#1480) 2021-07-04 21:12:17 +00:00
Stephan Seitz
ee2266993b Fix 1359: nil check for version in health-check 2021-06-04 07:46:11 +02:00
Stephan Seitz
bf0ae40cf4 fix(health): let CC check behave like in real installation
Fixes #1146
2021-04-07 13:00:42 +02:00
Stephan Seitz
052590ae55 healthcheck: raise error when ABI is too old 2021-04-02 06:05:56 +02:00
Stephan Seitz
c16a6c972b Check for node-js on :TSInstallFromGrammar
Ref: https://github.com/nvim-treesitter/nvim-treesitter/issues/1121#issuecomment-811755767
2021-04-01 21:10:47 +02:00
Stephan Seitz
edd942a962 Add tree-sitter ABI version to health check 2021-03-31 19:01:21 +02:00
Stephan Seitz
1375cc5c1f fix(checkhealth): display error messages of failed queries 2021-03-23 21:25:37 +01:00
bitcoder
b84dbcc66c use health#report_warn for treesitter version check 2021-03-22 12:40:43 +01:00
nbCloud91
5c00f8ede1 fix formatting issues caused by asterisk
Replace the asterisk used for "Multiple parsers found" by a plus sign. It prevents the asterisk from messing up the formatting of the rest of the `:checkhealth` buffer.
2021-03-18 07:09:31 +01:00
BonaBeavis
f652e1efed Use newline instead of space 2021-03-17 20:21:50 +01:00
BonaBeavis
2bbc1a2d59 Add newline before legend
Without this newline there is no syntax highlighting after the legend.
2021-03-17 20:21:50 +01:00
bitcoder
ec41db9511 update tips in healthcheck 2021-03-09 00:45:50 +01:00
bitcoder
7760f08658 add treesitter version in checkhealth 2021-03-09 00:45:50 +01:00
kiyan
9d57216c0d chore: remove useless code and indent files 2021-02-27 13:36:33 +01:00
kiyan
9e5fb44f84 health: add legend for x icon in query health 2021-02-22 23:32:11 +01:00
kiyan
dbe5441918 chore: rewrite healthcheck for compact output 2021-02-22 23:32:11 +01:00
Stephan Seitz
8c10b1a14d fix(checkhealth): use pcall to check for syntax errors in query files 2020-09-20 10:37:06 +02:00
Thomas Vigouroux
34160bb6f2 fix(health): only check installed parsers
This is to avoid awfully long checkhealths. And not installed parsers
can be infered from the fact that they are not listed.
2020-08-27 21:39:11 +02:00
Stephan Seitz
31d1f068fd checkhealth for all query groups 2020-07-15 16:28:48 +02:00
Stephan Seitz
5642507f6a Make luacheck happy 2020-07-05 19:21:06 +02:00
kiyan42
df17a48c85 refactor: parser list and lang->ft/ft->lang
- move parser list in `parsers.lua`
- most `ft` variable where changed to `lang`, `ft` is only used on
  autocmd binding, and lang is used for everything else. Functions have
  been defined to make the switch between `ft` and `lang`
2020-06-20 12:31:52 +02:00
Stephan Seitz
3b3a692e2c Remove postspaces and avoid one global 2020-05-22 17:07:28 +02:00