diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-05-10 23:11:42 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-05-10 23:11:42 +0200 |
commit | 9304b87476b7b0ef64564f20e87e79499eacb0bd (patch) | |
tree | 4be2cb94a6f1693755426656fadd24d0b8d1e1cc | |
parent | f845a7b0588559750b1cb7eede1b3aecb450cdfe (diff) |
fix(lsp): use lspconfig for lsp server setup
-rw-r--r-- | fnl/config/lsp/init.fnl | 7 | ||||
-rw-r--r-- | fnl/config/lsp/lsp-installer.fnl | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/fnl/config/lsp/init.fnl b/fnl/config/lsp/init.fnl index 5ec20c1..6e7473d 100644 --- a/fnl/config/lsp/init.fnl +++ b/fnl/config/lsp/init.fnl @@ -1,8 +1,7 @@ ;; Loads the LSP functionality. (module config.lsp.init {autoload {util util}}) -(let [_ (util.load-plugin :lspconfig)] - (require :config.lsp.lsp-installer) - (let [handlers (require :config.lsp.handlers)] +(let [handlers (require :config.lsp.handlers)] (handlers.setup)) - (require :config.lsp.null-ls)) +(require :config.lsp.lsp-installer) +(require :config.lsp.null-ls) diff --git a/fnl/config/lsp/lsp-installer.fnl b/fnl/config/lsp/lsp-installer.fnl index af9a4e8..0b9ebe4 100644 --- a/fnl/config/lsp/lsp-installer.fnl +++ b/fnl/config/lsp/lsp-installer.fnl @@ -24,7 +24,9 @@ :sumneko_lua (sumneko-lua-opts) _ handler-opts)) -(let [lsp-installer (util.load-plugin :nvim-lsp-installer)] - (lsp-installer.on_server_ready (fn [server] - (let [opts (get-server-opts server)] - (server:setup opts))))) +(let [lsp-installer (util.load-plugin :nvim-lsp-installer) + lspconfig (util.load-plugin :lspconfig)] + (lsp-installer.setup) + (each [_ server (ipairs (lsp-installer.get_installed_servers))] + (let [server-config (. lspconfig server.name)] + (server-config.setup (get-server-opts server))))) |