Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuaLS updates to follow style guide + better hl #748

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -161,7 +161,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 @@ -178,7 +178,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 @@ -362,7 +362,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 @@ -379,7 +379,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 @@ -425,7 +425,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
Loading