how to require language servers

This commit is contained in:
Talon 2023-07-27 09:20:26 -06:00
parent 288735707b
commit c438c87ed6
2 changed files with 14 additions and 19 deletions

View file

@ -25,7 +25,7 @@
"williamboman/mason-lspconfig.nvim" "williamboman/mason-lspconfig.nvim"
{:url "https://github.com/j-hui/fidget.nvim" {:url "https://github.com/j-hui/fidget.nvim"
:tag "legacy" :tag "legacy"
:opts {}} ; NOTE: `opts = {}` is the same as calling `require("fidget").setup({})` :opts {}}
"folke/neodev.nvim"]} "folke/neodev.nvim"]}
])) ]))
@ -37,13 +37,10 @@
mason (require :mason) mason (require :mason)
mason-lspconfig (require :mason-lspconfig) mason-lspconfig (require :mason-lspconfig)
servers servers
{:lua_ls { {:lua_ls {:Lua {:workspace {:checkThirdParty false}
:Lua {
:workspace { :checkThirdParty false }
:telemetry {:enable false}}} :telemetry {:enable false}}}
;:fennel_language_server {} :fennel_language_server {}
;:bash_language_server {} :bashls {}
;:jq {}
} }
on_attach (fn [_ bufnr] on_attach (fn [_ bufnr]
(let (let
@ -60,9 +57,9 @@
(mason.setup) (mason.setup)
(mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers)}) (mason-lspconfig.setup {:ensure_installed (vim.tbl_keys servers)})
(mason-lspconfig.setup_handlers (mason-lspconfig.setup_handlers
[(fn [server_name] (let ;; TODO require is looking in the wrong spot?
[server (require server_name) [(fn [server_name] (let [server (require server_name)]
] (print server_name)
(server.setup (server.setup
{:capabilities (vim.lsp.protocol.make_client_capabilities) {:capabilities (vim.lsp.protocol.make_client_capabilities)
:on_attach on_attach :on_attach on_attach

View file

@ -1,13 +1,11 @@
local hotpot_path = vim.fn.stdpath('data') .. '/lazy/hotpot.nvim' 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 if vim.fn.empty(vim.fn.glob(hotpot_path)) > 0 then
print("Could not find hotpot.nvim, cloning new copy to", hotpot_path) print("Could not find hotpot.nvim, cloning new copy to", hotpot_path)
vim.fn.system({'git', 'clone', vim.fn.system({'git', 'clone',
'https://github.com/rktjmp/hotpot.nvim', hotpot_path}) 'https://github.com/rktjmp/hotpot.nvim', hotpot_path})
vim.cmd("helptags " .. hotpot_path .. "/doc") vim.cmd("helptags " .. hotpot_path .. "/doc")
end end
vim.opt.rtp:prepend(hotpot_path)
require("hotpot") require("hotpot")
require("init") require("init")