diff --git a/runtime/lua/tohtml.lua b/runtime/lua/tohtml.lua index 4deef7cd60..61ea7346ad 100644 --- a/runtime/lua/tohtml.lua +++ b/runtime/lua/tohtml.lua @@ -744,8 +744,7 @@ local function styletable_statuscolumn(state) signcolumn = 'auto' end if signcolumn ~= 'no' then - local max = tonumber(signcolumn:match('^%w-:(%d)')) --[[@as integer?]] - or 1 + local max = tonumber(signcolumn:match('^%w-:(%d)')) --[[@as integer?]] or 1 if signcolumn:match('^auto') then --- @type table local signcount = {} @@ -772,8 +771,7 @@ local function styletable_statuscolumn(state) local foldcolumn = state.opt.foldcolumn if foldcolumn ~= '0' then if foldcolumn:match('^auto') then - local max = tonumber(foldcolumn:match('^%w-:(%d)')) --[[@as integer?]] - or 1 + local max = tonumber(foldcolumn:match('^%w-:(%d)')) --[[@as integer?]] or 1 local maxfold = 0 vim._with({ buf = state.bufnr }, function() for row = state.start, state.end_ do diff --git a/runtime/lua/vim/treesitter/query.lua b/runtime/lua/vim/treesitter/query.lua index cd217e6ab2..7fa954698d 100644 --- a/runtime/lua/vim/treesitter/query.lua +++ b/runtime/lua/vim/treesitter/query.lua @@ -653,14 +653,10 @@ local directive_handlers = { end metadata[capture_id].offset = { - pred[3] --[[@as integer]] - or 0, - pred[4] --[[@as integer]] - or 0, - pred[5] --[[@as integer]] - or 0, - pred[6] --[[@as integer]] - or 0, + pred[3] --[[@as integer]] or 0, + pred[4] --[[@as integer]] or 0, + pred[5] --[[@as integer]] or 0, + pred[6] --[[@as integer]] or 0, } end, -- Transform the content of the node diff --git a/src/gen/luacats_grammar.lua b/src/gen/luacats_grammar.lua index f382ec89e1..f013dae04d 100644 --- a/src/gen/luacats_grammar.lua +++ b/src/gen/luacats_grammar.lua @@ -160,8 +160,8 @@ local typedef = P({ fun = opt(Pf('async')) * Pf('fun') * paren(comma(v.fun_param)) * opt(Pf(':') * comma1(v.fun_ret)), generics = P(ty_ident) * Pf('<') * comma1(v.type) * Plf('>'), }) / function(match) - return vim.trim(match):gsub('^%((.*)%)$', '%1'):gsub('%?+', '?') - end + return vim.trim(match):gsub('^%((.*)%)$', '%1'):gsub('%?+', '?') +end local access = P('private') + P('protected') + P('package') local caccess = Cg(access, 'access')