diff --git a/lua/render/compiler.lua b/lua/render/compiler.lua index 78b2aec..7d2a1d4 100644 --- a/lua/render/compiler.lua +++ b/lua/render/compiler.lua @@ -114,14 +114,16 @@ function M.stop(bufnr) return end log.dbg('stopping process for buffer %d', bufnr) - proc.obj:kill('sigterm') + ---@type fun(self: table, signal: string|integer) + local kill = proc.obj.kill + kill(proc.obj, 'sigterm') local timer = vim.uv.new_timer() if timer then timer:start(5000, 0, function() timer:close() if active[bufnr] and active[bufnr].obj == proc.obj then - proc.obj:kill('sigkill') + kill(proc.obj, 'sigkill') active[bufnr] = nil end end) diff --git a/lua/render/diagnostic.lua b/lua/render/diagnostic.lua index 8e9658f..a526219 100644 --- a/lua/render/diagnostic.lua +++ b/lua/render/diagnostic.lua @@ -12,7 +12,7 @@ end ---@param bufnr integer ---@param name string ----@param error_parser fun(stderr: string, ctx: render.Context): vim.Diagnostic[] +---@param error_parser fun(stderr: string, ctx: render.Context): render.Diagnostic[] ---@param stderr string ---@param ctx render.Context function M.set(bufnr, name, error_parser, stderr, ctx) diff --git a/lua/render/init.lua b/lua/render/init.lua index a04192b..73f3057 100644 --- a/lua/render/init.lua +++ b/lua/render/init.lua @@ -4,7 +4,7 @@ ---@field cwd? string|fun(ctx: render.Context): string ---@field env? table ---@field output? string|fun(ctx: render.Context): string ----@field error_parser? fun(stderr: string, ctx: render.Context): vim.Diagnostic[] +---@field error_parser? fun(stderr: string, ctx: render.Context): render.Diagnostic[] ---@field clean? string[]|fun(ctx: render.Context): string[] ---@class render.Config @@ -18,8 +18,17 @@ ---@field root string ---@field ft string +---@class render.Diagnostic +---@field lnum integer +---@field col integer +---@field message string +---@field severity? integer +---@field end_lnum? integer +---@field end_col? integer +---@field source? string + ---@class render.Process ----@field obj vim.SystemObj +---@field obj table ---@field provider string ---@field output_file string