mirror of https://github.com/folke/lazy.nvim.git
style: better uv annotations
This commit is contained in:
parent
ccd96bfa2e
commit
3867a81bb2
|
@ -2,7 +2,7 @@ local Config = require("lazy.core.config")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@type table<uv.uv_process_t, true>
|
---@type table<uv_process_t, true>
|
||||||
M.running = {}
|
M.running = {}
|
||||||
|
|
||||||
M.signals = {
|
M.signals = {
|
||||||
|
@ -75,10 +75,10 @@ function M.spawn(cmd, opts)
|
||||||
local stderr = assert(uv.new_pipe())
|
local stderr = assert(uv.new_pipe())
|
||||||
|
|
||||||
local output = ""
|
local output = ""
|
||||||
---@type uv.uv_process_t
|
---@type uv_process_t?
|
||||||
local handle = nil
|
local handle = nil
|
||||||
|
|
||||||
---@type uv.uv_timer_t
|
---@type uv_timer_t
|
||||||
local timeout
|
local timeout
|
||||||
local killed = false
|
local killed = false
|
||||||
if opts.timeout then
|
if opts.timeout then
|
||||||
|
@ -96,6 +96,7 @@ function M.spawn(cmd, opts)
|
||||||
cwd = opts.cwd,
|
cwd = opts.cwd,
|
||||||
env = env_flat,
|
env = env_flat,
|
||||||
}, function(exit_code, signal)
|
}, function(exit_code, signal)
|
||||||
|
---@cast handle uv_process_t
|
||||||
M.running[handle] = nil
|
M.running[handle] = nil
|
||||||
if timeout then
|
if timeout then
|
||||||
timeout:stop()
|
timeout:stop()
|
||||||
|
|
Loading…
Reference in New Issue