aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2025-05-16 15:44:26 +0100
committerChristian Clason <c.clason@uni-graz.at>2025-05-16 18:33:52 +0200
commit69371f0148bb96b41047f036a58e7e648e200140 (patch)
tree32915a193e2989297d25855b69bfc08f7f8615c8 /doc
parentrefactor(indent): use `node:byte_length() (diff)
downloadnvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar.gz
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar.bz2
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar.lz
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar.xz
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.tar.zst
nvim-treesitter-69371f0148bb96b41047f036a58e7e648e200140.zip
feat(install)!: migrate to latest async.nvim impl (#7856)
Provides significantly simpler blocking installation and update.
Diffstat (limited to 'doc')
-rw-r--r--doc/nvim-treesitter.txt29
1 files changed, 9 insertions, 20 deletions
diff --git a/doc/nvim-treesitter.txt b/doc/nvim-treesitter.txt
index c810023f7..b57687961 100644
--- a/doc/nvim-treesitter.txt
+++ b/doc/nvim-treesitter.txt
@@ -102,7 +102,7 @@ setup({opts}) *nvim-treesitter.setup()*
directory to install parsers and queries to. Note: will be
appended to |runtimepath|.
-install({languages}, {opts}, {callback}) *nvim-treesitter.install()*
+install({languages} [, {opts}]) *nvim-treesitter.install()*
Download, compile, and install the specified treesitter parsers and copy
the corresponding queries to a directory on |runtimepath|, enabling their
@@ -110,13 +110,9 @@ install({languages}, {opts}, {callback}) *nvim-treesitter.install()*
Note: This operation is performed asynchronously by default. For
synchronous operation (e.g., in a bootstrapping script), you need to
- provide a suitable {callback}: >lua
- local done = nil
- require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' },
- function(success)
- done = success
- end)
- vim.wait(3000000, function() return done ~= nil end)
+ `wait()` for it: >lua
+ require('nvim-treesitter').install({ 'rust', 'javascript', 'zig' })
+ :wait(300000) -- max. 5 minutes
<
Parameters: ~
• {languages} `(string[]|string)` (List of) languages or tiers (`stable`,
@@ -129,7 +125,6 @@ install({languages}, {opts}, {callback}) *nvim-treesitter.install()*
compiling.
• {max_jobs} (`integer?`) limit parallel tasks (useful in
combination with {generate} on memory-limited systems).
- • {callback} `(function?`) Callback for synchronous execution.
uninstall({languages}) *nvim-treesitter.uninstall()*
@@ -139,25 +134,19 @@ uninstall({languages}) *nvim-treesitter.uninstall()
• {languages} `(string[]|string)` (List of) languages or tiers (`stable`,
`unstable`) to update.
-update({languages}, {callback}) *nvim-treesitter.update()*
+update([{languages}]) *nvim-treesitter.update()*
Update the parsers and queries if older than the revision specified in the
manifest.
Note: This operation is performed asynchronously by default. For
synchronous operation (e.g., in a bootstrapping script), you need to
- provide a suitable {callback}: >lua
- local done = nil
- require('nvim-treesitter').update(),
- function(success)
- done = success
- end)
- vim.wait(3000000, function() return done ~= nil end)
+ `wait()` for it: >lua
+ require('nvim-treesitter').update():wait(300000) -- max. 5 minutes
<
Parameters: ~
- • {languages} `(string[]|string)` (List of) languages or tiers to
- uninstall.
- • {callback} `(function?`) Callback for synchronous execution.
+ • {languages} `(string[]|string)?` (List of) languages or tiers to update
+ (default: all installed).
indentexpr() *nvim-treesitter.indentexpr()*