aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_meta.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2026-08-25 17:37:27 +0100
committerLewis Russell <me@lewisr.dev>2026-09-03 19:17:25 +0100
commitce8a897f985b2cfd1194f6c03fe5388f9bc6d6bf (patch)
tree81a85d8e22dc906aea69e0265f2e035f800a6c9c /runtime/lua/vim/_meta.lua
parentda4355ab8f68c4e0290134e691ab7b9dedc2a5df (diff)
downloadrneovim-ce8a897f985b2cfd1194f6c03fe5388f9bc6d6bf.tar.gz
rneovim-ce8a897f985b2cfd1194f6c03fe5388f9bc6d6bf.tar.bz2
rneovim-ce8a897f985b2cfd1194f6c03fe5388f9bc6d6bf.zip
feat(lua): add vim.async
Problem: Nvim has many Lua APIs that start callback-driven work: timers, jobs, libuv handles, and other event-loop tasks. Callers that need to sequence or cancel that work have to build their own coroutine wrappers, task bookkeeping, and cleanup rules. This makes async control flow hard to share, test, and document. Solution: Add `vim.async`, a structured-concurrency module vendored from async.nvim. It provides task handles, await/pawait helpers, sleep/timeout helpers, completion-order iteration, and semaphores on top of Nvim's event loop. The API follows the same broad model as Trio: async work has an owner, tasks are awaited explicitly, and cancellation is cooperative. Include generated vimdoc with an introductory overview and examples, a news entry, and functional tests for the new module. AI-assisted
Diffstat (limited to 'runtime/lua/vim/_meta.lua')
-rw-r--r--runtime/lua/vim/_meta.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 18dbe49c85..e285cd5a12 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -66,6 +66,8 @@ vim.uv = ...
vim.F = require('vim.F')
vim._watch = require('vim._watch')
+---@diagnostic disable-next-line: no-unknown
+vim.async = require('vim.async')
vim.diagnostic = require('vim.diagnostic')
vim.filetype = require('vim.filetype')
vim.fs = require('vim.fs')