Skip to content

LSP does not activate (ts_ls) using recommended Lazy setup. #614

@wladston

Description

@wladston

I lost a shameful number of hours trying to debug this, so I thought I'd leave the solution registered to help anyone who might have the same issue.

When I install the plugin with Lazy according to the recommended way according to the project's README, installing lua_ls and ts_ls:

return {
    'mason-org/mason-lspconfig.nvim',
    opts = {
        ensure_installed = { 'lua_ls',  'ts_ls' },
    },
    dependencies = {
        { 'mason-org/mason.nvim', opts = {} },
        'neovim/nvim-lspconfig',
    }
}

The Lua language server would be activated, but the Typescript language server would not. By switching to this setup:

return {
    { 'neovim/nvim-lspconfig' },
    { 'mason-org/mason.nvim', opts = {} },
    {
        'mason-org/mason-lspconfig.nvim',
        opts = {
            ensure_installed = { 'lua_ls', 'ts_ls' },
        },
    }
}

Then both Lua and Typescript language servers activate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions