lsp

2024-12-05T11:50:39.611419Z

clojure-lsp for neovim Mason is old. anyone on this list is involved with the process of updating it ?

practicalli-johnny 2024-12-24T15:08:48.678339Z

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.

🙏 1
Zatura24 2024-12-05T13:32:11.233969Z

I installed clojure-lsp manually and updated the mason config,

Zatura24 2024-12-05T13:32:15.397529Z

clojure_lsp = {
        cmd = { "/usr/bin/clojure-lsp" },
    },

Zatura24 2024-12-05T13:33:47.573119Z

I meant the lsp-config, that can accept the cmd option when calling setup

🙏 2
2024-12-05T19:49:49.113409Z

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)

2024-12-05T19:49:56.482579Z

thank you @jannick.joosten

🙌 1
practicalli-johnny 2024-12-05T23:05:57.765029Z

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 🙂 )

🙏 2
practicalli-johnny 2024-12-05T23:07:59.734729Z

Ah, there is already a https://github.com/mason-org/mason-registry/pull/7896.

practicalli-johnny 2024-12-05T23:20:45.279119Z

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",
      },
    },
  },
}

🙏 2