diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-05 02:52:05 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-05 02:52:05 +0100 |
commit | e3ef0791e7462c95c77ec9014d92ec97484789c8 (patch) | |
tree | 0094f9d2da11f34075187813f5c991e5ce4e037d /fnl/config/lsp/mason-lspconfig.fnl | |
parent | be463a40d7ec811a02732ba0a2f2c657b12bd73c (diff) |
Refactor lsp
Diffstat (limited to 'fnl/config/lsp/mason-lspconfig.fnl')
-rw-r--r-- | fnl/config/lsp/mason-lspconfig.fnl | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/fnl/config/lsp/mason-lspconfig.fnl b/fnl/config/lsp/mason-lspconfig.fnl index 8aeaff1..5180549 100644 --- a/fnl/config/lsp/mason-lspconfig.fnl +++ b/fnl/config/lsp/mason-lspconfig.fnl @@ -1,51 +1,8 @@ -;; TBD +;; Automatic installation and updating of some lsps. (module config.lsp.mason-lspconfig {autoload {util config.util}}) -(def- servers [:bashls - :clangd - :cssls - :dockerls - :hls - :html - :jsonls - :rust_analyzer - :sqls - :sumneko_lua - :taplo - :terraformls - :texlab - :tflint - :yamlls - :zk]) - -(defn- handler-opts [] - (let [handlers (require :config.lsp.handlers)] - {:on_attach handlers.on-attach :capabilities (handlers.capabilities)})) - -(defn- jsonls-opts [] - (let [jsonls-opts (require :config.lsp.settings.jsonls)] - (vim.tbl_deep_extend :force jsonls-opts (handler-opts)))) - -(defn- sumneko-lua-opts [] - (let [sumneko-lua (require :config.lsp.settings.sumneko-lua)] - (vim.tbl_deep_extend :force sumneko-lua.opts (handler-opts)))) - -(defn- rust-opts [] - (let [rust (require :config.lsp.settings.rust)] - (vim.tbl_deep_extend :force rust.opts (handler-opts)))) - -(defn- get-server-opts [server] - (match server - :jsonls (jsonls-opts) - :sumneko_lua (sumneko-lua-opts) - :rust_analyzer (rust-opts) - _ (handler-opts))) +(def- servers (require :config.lsp.servers)) (def- opts {:ensure_installed servers :automatic_installation true}) (util.setup :mason-lspconfig opts) - -(let [lspconfig (util.prequire :lspconfig)] - (each [_ server (ipairs servers)] - (let [server-config (. lspconfig server)] - (server-config.setup (get-server-opts server))))) |