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"
{: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 []) })))
]))

View file

@ -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")