test: typing for helpers.meths

This commit is contained in:
Lewis Russell
2024-01-12 12:44:54 +00:00
parent 284e0ad26d
commit c30f2e3182
141 changed files with 3342 additions and 3137 deletions

View File

@@ -631,6 +631,9 @@ module.uimeths = module.create_callindex(ui)
local function create_api(request, call)
local m = {}
function m.nvim(method, ...)
if vim.startswith(method, 'nvim_') then
return request(method, ...)
end
return request('nvim_' .. method, ...)
end
@@ -700,6 +703,9 @@ module.describe_lua_and_rpc = function(describe)
end
end
--- add for typing. The for loop after will overwrite this
module.meths = vim.api
for name, fn in pairs(module.rpc.api) do
module[name] = fn
end
@@ -862,11 +868,11 @@ function module.skip_fragile(pending_fn, cond)
end
function module.exec(code)
module.meths.exec2(code, {})
module.meths.nvim_exec2(code, {})
end
function module.exec_capture(code)
return module.meths.exec2(code, { output = true }).output
return module.meths.nvim_exec2(code, { output = true }).output
end
--- @param code string