aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-12-08 12:49:05 +0100
committerChristian Clason <c.clason@uni-graz.at>2026-04-01 14:59:25 +0200
commit125faa20a258692fe9e4f0577ac0e4be7d4bcab4 (patch)
tree3af4793811383210ffd42c12fe544332d1a9012f /lua
parentfeat!: drop support for Nvim 0.11 (diff)
downloadnvim-treesitter-feat/emmylua.tar
nvim-treesitter-feat/emmylua.tar.gz
nvim-treesitter-feat/emmylua.tar.bz2
nvim-treesitter-feat/emmylua.tar.lz
nvim-treesitter-feat/emmylua.tar.xz
nvim-treesitter-feat/emmylua.tar.zst
nvim-treesitter-feat/emmylua.zip
ci: migrate to emmylualsfeat/emmylua
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/async.lua31
-rw-r--r--lua/nvim-treesitter/indent.lua2
-rw-r--r--lua/nvim-treesitter/install.lua6
3 files changed, 26 insertions, 13 deletions
diff --git a/lua/nvim-treesitter/async.lua b/lua/nvim-treesitter/async.lua
index e78c0f964..a0a59e4b1 100644
--- a/lua/nvim-treesitter/async.lua
+++ b/lua/nvim-treesitter/async.lua
@@ -1,3 +1,4 @@
+---@meta nvim-treesitter.async vendored file, don't diagnose
local pcall = copcall or pcall
--- @param ... any
@@ -345,8 +346,9 @@ end
--- -- Since uv functions have sync versions. You can just do:
--- local stat = vim.fs_stat('foo.txt')
--- ```
---- @param func function
---- @param ... any
+--- @generic T, R
+--- @param func async fun(...: T...): R...
+--- @param ... T...
--- @return async.Task
function M.arun(func, ...)
local task = Task._new(func)
@@ -354,19 +356,27 @@ function M.arun(func, ...)
return task
end
---- @class async.TaskFun
---- @field package _fun fun(...: any): any
---- @operator call(...): any
+--- @alias async.TaskFun<T, R> fun(...: T...): async.Task
+
+--- @generic T, R
+--- @class async._TaskFun<T, R>
+--- @field package _fun async fun(...: T...): R...
+--- @operator call(...: T...): async.Task
local TaskFun = {}
TaskFun.__index = TaskFun
+--- @generic T, R
+--- @param self async._TaskFun<T, R>
+--- @param ... T...
+--- @return async.Task
function TaskFun:__call(...)
return M.arun(self._fun, ...)
end