clojure-lsp for neovim Mason is old. anyone on this list is involved with the process of updating it ?
The Mason Registry was updates a few days ago with the latest release of Clojure LSP, 2024.11.08-17.49.29 FYI. There is a renovate bot that should automatically update the Mason Registry when a new tool version is available. Unfortunately the https://github.com/mason-org/mason-registry/pull/7896 this time, but the maintainer updated the PR and merged it manually.
I installed clojure-lsp manually and updated the mason config,
clojure_lsp = {
cmd = { "/usr/bin/clojure-lsp" },
},I meant the lsp-config, that can accept the cmd option when calling setup
import({ "mason", "mason-lspconfig", "lspconfig", "cmp_nvim_lsp" }, function(modules)
-- ... existing code ...
masonLspConfig.setup_handlers({
-- ... existing handlers ...
})
-- Add clojure_lsp setup here, before the final end)
local lspconfig = modules.lspconfig
lspconfig.clojure_lsp.setup({
cmd = { "/usr/local/bin/clojure-lsp" },
filetypes = { "clojure", "edn" },
root_dir = lspconfig.util.root_pattern("project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git"),
capabilities = opts.capabilities,
on_attach = opts.on_attach
})
end)I assume mason uses the Clojure LSP version defined in the mason-registry configuration for clojure-lsp, i.e. https://github.com/mason-org/mason-registry/blob/main/packages/clojure-lsp/package.yaml If that is correct, I will create a PR to update to the latest release (unless someone beats me to it 🙂 )
Ah, there is already a https://github.com/mason-org/mason-registry/pull/7896.
For anyone using AstroNvim configuration, then mason can be configured to use an LSP server installed separately by including the following config in your lua/plugins/user.lua file (or directly in lua/plugins/astrolsp.lua file if using the AstroNvim template)
return {
-- INFO: prevent Mason loading Clojure & Lua LSP servers
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = vim.tbl_filter(function(s) return s ~= "lua_ls" end, opts.ensure_installed)
opts.ensure_installed = vim.tbl_filter(function(s) return s ~= "clojure_lsp" end, opts.ensure_installed)
end,
},
-- INFO: Use local Clojure & Lua LSP servers
return{
{
"AstroNvim/astrolsp",
---@type AstroLSPOpts
opts = {
-- Configuration table of features provided by AstroLSP
features = {
autoformat = true, -- enable or disable auto formatting on start
codelens = true, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- enable servers that you already have installed without mason
servers = {
"clojure_lsp",
},
},
},
}