Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lsp): add ability to skip lsp setup for a server #582

Merged
merged 2 commits into from Jun 2, 2022
Merged

Conversation

mehalter
Copy link
Member

@mehalter mehalter commented Jun 2, 2022

Some users may want to use plugins for setting up language servers such as https://github.com/p00f/clangd_extensions.nvim or https://github.com/jose-elias-alvarez/typescript.nvim which requires you to not call the require("lspconfig")[server_name].setup call. This adds a nice user configuration for telling AstroNvim to not worry about setting up a server even if it is available.

Here is an example of setting up typescript.nvim with the new setup:

return {
  lsp = {
    skip_setup = { "tsserver" },
  },
  plugins = {
    init = {
      {
        "jose-elias-alvarez/typescript.nvim",
        after = "nvim-lsp-installer",
        config = function()
          require("typescript").setup {
            server = {
              capabilities = astronvim.lsp.capabilities,
              on_attach = astronvim.lsp.on_attach,
            },
          }
        end,
      },
    },
    ["nvim-lsp-installer"] = {
      ensure_installed = { "tsserver" },
    },
  },
}

@mehalter mehalter added the enhancement New feature or request label Jun 2, 2022
@mehalter mehalter requested a review from kabinspace June 2, 2022 13:09
@mehalter mehalter self-assigned this Jun 2, 2022
@mehalter mehalter mentioned this pull request Jun 2, 2022
@mehalter mehalter merged commit ab2ca4f into main Jun 2, 2022
@mehalter mehalter deleted the lsp_skip_setup branch June 2, 2022 13:27
@mehalter mehalter mentioned this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants