From 8c7bc612866701671e26106fc78146d803f350bc Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Mar 2026 16:28:37 -0500 Subject: [PATCH] fix(compiler): format is_longrunning and annotate is_reload field Problem: stylua required is_longrunning to be on one line; lua-ls warned about undefined field is_reload on preview.Process. Solution: inline the boolean expression and add is_reload? to the preview.Process annotation. --- lua/preview/compiler.lua | 3 +-- lua/preview/init.lua | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/preview/compiler.lua b/lua/preview/compiler.lua index 08cbbb4..e19cbf0 100644 --- a/lua/preview/compiler.lua +++ b/lua/preview/compiler.lua @@ -316,8 +316,7 @@ end ---@param provider preview.ProviderConfig ---@param ctx_builder fun(bufnr: integer): preview.Context function M.toggle(bufnr, name, provider, ctx_builder) - local is_longrunning = type(provider.reload) == 'table' - or type(provider.reload) == 'function' + local is_longrunning = type(provider.reload) == 'table' or type(provider.reload) == 'function' if is_longrunning then if active[bufnr] then diff --git a/lua/preview/init.lua b/lua/preview/init.lua index 1e5614e..7a380ba 100644 --- a/lua/preview/init.lua +++ b/lua/preview/init.lua @@ -35,6 +35,7 @@ ---@field obj table ---@field provider string ---@field output_file string +---@field is_reload? boolean ---@class preview ---@field setup fun(opts?: table)