From cd876f8e53385c63b3b3048a0917dd58786e1467 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 7 Jan 2024 11:42:44 +0100 Subject: Refactor mason-lspconfig --- fnl/plugins/lsp/lspconfig.fnl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fnl/plugins/lsp') diff --git a/fnl/plugins/lsp/lspconfig.fnl b/fnl/plugins/lsp/lspconfig.fnl index 8cc5141..6e2ace4 100644 --- a/fnl/plugins/lsp/lspconfig.fnl +++ b/fnl/plugins/lsp/lspconfig.fnl @@ -19,20 +19,20 @@ (tset opts :capabilities (capabilities)) (config.setup opts)))) -(fn opts [] - (let [servers (require :plugins.lsp.servers)] - {:ensure_installed (vim.tbl_keys servers) - :automatic_installation true - :handlers [handlers]})) +(fn setup-mason-lspconfig [] + (let [mason-lspconfig (require :mason-lspconfig) + servers (require :plugins.lsp.servers)] + (mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers) + :automatic_installation true + :handlers [handlers]}))) (fn config [] (on-attach) (let [diagnostics (require :plugins.lsp.diagnostics) - ui (require :lspconfig.ui.windows) - mason-lspconfig (require :mason-lspconfig)] + ui (require :lspconfig.ui.windows)] (diagnostics.setup) (set ui.default_options.border :single) - (mason-lspconfig.setup (opts)))) + (setup-mason-lspconfig))) {1 :neovim/nvim-lspconfig :event :BufReadPost -- cgit v1.2.3-70-g09d2