Skip to content

Commit 72c537e

Browse files
committed
refactor!: rename setup_handlers to handlers
1 parent b207bd2 commit 72c537e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lua/astrolsp/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ return {
1212
diagnostics = {},
1313
flags = {},
1414
formatting = { format_on_save = { enabled = true }, disabled = {} },
15+
handlers = {},
1516
mappings = {},
1617
servers = {},
17-
setup_handlers = { function(server, opts) require("lspconfig")[server].setup(opts) end },
1818
on_attach = nil,
1919
}

lua/astrolsp/init.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,13 @@ function M.lsp_setup(server)
8686
end
8787
end
8888
local opts = M.lsp_opts(server)
89-
local setup_handler = M.config.setup_handlers[server]
90-
if setup_handler == nil then setup_handler = M.config.setup_handlers[1] end
91-
if setup_handler then setup_handler(server, opts) end
89+
local handler = M.config.handlers[server]
90+
if handler == nil then handler = M.config.handlers[1] end
91+
if handler then
92+
handler(server, opts)
93+
elseif handler == nil then
94+
require("lspconfig")[server].setup(opts)
95+
end
9296
end
9397

9498
local function add_buffer_autocmd(augroup, bufnr, autocmds)

0 commit comments

Comments
 (0)