Skip to content

Commit

Permalink
chore: LuaLS updates to follow style guide + better hl (#748)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Kongsgaard <daniel@Daniels-MBP.home>
  • Loading branch information
Danielkonge and Daniel Kongsgaard committed Oct 23, 2023
1 parent d51125e commit 2546441
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lua/ibl/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local get = function(name)
-- TODO [Lukas]: remove this when AstroNvim drops support for 0.8
if not vim.api.nvim_get_hl then
---@diagnostic disable-next-line
return (vim.fn.hlexists(name) == 1 and vim.api.nvim_get_hl_by_name(name, true)) or vim.empty_dict() --[[ @as table ]]
return (vim.fn.hlexists(name) == 1 and vim.api.nvim_get_hl_by_name(name, true)) or vim.empty_dict() --[[@as table]]
end

return vim.api.nvim_get_hl(0, { name = name })
Expand Down Expand Up @@ -52,7 +52,7 @@ M.setup = function()
local config = conf.get_config(-1)

for _, fn in
pairs(hooks.get(-1, hooks.type.HIGHLIGHT_SETUP) --[[ @as ibl.hooks.cb.highlight_setup[] ]])
pairs(hooks.get(-1, hooks.type.HIGHLIGHT_SETUP) --[=[@as ibl.hooks.cb.highlight_setup[]]=])
do
fn()
end
Expand Down
10 changes: 5 additions & 5 deletions lua/ibl/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ M.refresh = function(bufnr)
end

for _, fn in
pairs(hooks.get(bufnr, hooks.type.ACTIVE) --[[ @as ibl.hooks.cb.active[] ]])
pairs(hooks.get(bufnr, hooks.type.ACTIVE) --[=[@as ibl.hooks.cb.active[]]=])
do
if not fn(bufnr) then
clear_buffer(bufnr)
Expand All @@ -177,7 +177,7 @@ M.refresh = function(bufnr)

local scope_disabled = false
for _, fn in
pairs(hooks.get(bufnr, hooks.type.SCOPE_ACTIVE) --[[ @as ibl.hooks.cb.scope_active[] ]])
pairs(hooks.get(bufnr, hooks.type.SCOPE_ACTIVE) --[=[@as ibl.hooks.cb.scope_active[]]=])
do
if not fn(bufnr) then
scope_disabled = true
Expand Down Expand Up @@ -361,7 +361,7 @@ M.refresh = function(bufnr)
end

for _, fn in
pairs(hooks.get(bufnr, hooks.type.WHITESPACE) --[[ @as ibl.hooks.cb.whitespace[] ]])
pairs(hooks.get(bufnr, hooks.type.WHITESPACE) --[=[@as ibl.hooks.cb.whitespace[]]=])
do
whitespace_tbl = fn(buffer_state.tick, bufnr, row - 1, whitespace_tbl)
end
Expand All @@ -378,7 +378,7 @@ M.refresh = function(bufnr)
return indent.is_indent(w)
end, whitespace_tbl) + 1
for _, fn in
pairs(hooks.get(bufnr, hooks.type.SCOPE_HIGHLIGHT) --[[ @as ibl.hooks.cb.scope_highlight[] ]])
pairs(hooks.get(bufnr, hooks.type.SCOPE_HIGHLIGHT) --[=[@as ibl.hooks.cb.scope_highlight[]]=])
do
scope_index = fn(buffer_state.tick, bufnr, scope, scope_index)
end
Expand Down Expand Up @@ -424,7 +424,7 @@ M.refresh = function(bufnr)
end

for _, fn in
pairs(hooks.get(bufnr, hooks.type.VIRTUAL_TEXT) --[[ @as ibl.hooks.cb.virtual_text[] ]])
pairs(hooks.get(bufnr, hooks.type.VIRTUAL_TEXT) --[=[@as ibl.hooks.cb.virtual_text[]]=])
do
virt_text = fn(buffer_state.tick, bufnr, row - 1, virt_text)
end
Expand Down

0 comments on commit 2546441

Please sign in to comment.