From c438c87ed6ed85754853c45232a8019e3ed928ac Mon Sep 17 00:00:00 2001 From: Talon Date: Thu, 27 Jul 2023 09:20:26 -0600 Subject: [PATCH] how to require language servers --- fnl/lazy-setup.fnl | 29 +++++++++++++---------------- init.lua | 4 +--- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/fnl/lazy-setup.fnl b/fnl/lazy-setup.fnl index 0f19656..eeac02e 100644 --- a/fnl/lazy-setup.fnl +++ b/fnl/lazy-setup.fnl @@ -25,7 +25,7 @@ "williamboman/mason-lspconfig.nvim" {:url "https://github.com/j-hui/fidget.nvim" :tag "legacy" - :opts {}} ; NOTE: `opts = {}` is the same as calling `require("fidget").setup({})` + :opts {}} "folke/neodev.nvim"]} ])) @@ -37,13 +37,10 @@ mason (require :mason) mason-lspconfig (require :mason-lspconfig) servers - {:lua_ls { - :Lua { - :workspace { :checkThirdParty false } - :telemetry { :enable false }}} - ;:fennel_language_server {} - ;:bash_language_server {} - ;:jq {} + {:lua_ls {:Lua {:workspace {:checkThirdParty false} + :telemetry {:enable false}}} + :fennel_language_server {} + :bashls {} } on_attach (fn [_ bufnr] (let @@ -60,12 +57,12 @@ (mason.setup) (mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers)}) (mason-lspconfig.setup_handlers - [(fn [server_name] (let - [server (require server_name) - ] - (server.setup - {:capabilities (vim.lsp.protocol.make_client_capabilities) - :on_attach on_attach - :settings (. servers server_name) - :filetypes (or settings.filetypes []) }))) + ;; TODO require is looking in the wrong spot? + [(fn [server_name] (let [server (require server_name)] + (print server_name) + (server.setup + {:capabilities (vim.lsp.protocol.make_client_capabilities) + :on_attach on_attach + :settings (. servers server_name) + :filetypes (or settings.filetypes []) }))) ])) diff --git a/init.lua b/init.lua index 906b557..7fc5ca3 100644 --- a/init.lua +++ b/init.lua @@ -1,13 +1,11 @@ local hotpot_path = vim.fn.stdpath('data') .. '/lazy/hotpot.nvim' - -vim.opt.rtp:prepend(hotpot_path) - if vim.fn.empty(vim.fn.glob(hotpot_path)) > 0 then print("Could not find hotpot.nvim, cloning new copy to", hotpot_path) vim.fn.system({'git', 'clone', 'https://github.com/rktjmp/hotpot.nvim', hotpot_path}) vim.cmd("helptags " .. hotpot_path .. "/doc") end +vim.opt.rtp:prepend(hotpot_path) require("hotpot") require("init")