Help lua_ls from sumneko_lua

I updated lspconfig and replace sumneko_lua to lua_ls but I am getting this
[lspconfig] Cannot access configuration for lua_ls. Ensure this server is listed in `server_configurations.md` or added as a custom server.

I have this config, using lazy.nvim as my plugin manager

    {
        "williamboman/mason-lspconfig.nvim",
        config = function()
            require("mason-lspconfig").setup({
                ensure_installed = {
                    "angularls",
                    "bashls",
                    "cssls",
                    "eslint",
                    "gopls",
                    "html",
                    "jsonls",
                    "lua_ls",
                    "rust_analyzer",
                    "svelte",
                    "tailwindcss",
                    "tsserver",
                    "yamlls",
                },
            })
        end,
    },

Any hint how should i fix this?

Thank you

That’s exactly how I do it. Are your mason packages the latest versions?

Grep your configs for sumneko_lua, anywhere you find that will need to be changed to lua_ls.

The problem was my lazy.nvim config, removing the defaults.version="*" config of lazy.nvim fix the issue, because it was installing the stable version of lspconfig that is not compitable with the latest mason-lspconfig.

3 Likes

Hey there,

Does someone knows how to fix this issue if I use packer.nvim as Plugin Manager instead of lazy.nvim? I got the same error.