hinell / lsp-timeout.nvim

Start/stop LSP servers upon demand; keeps RAM usage low
Other
211 stars 6 forks source link

Option to exclude certain languages #14

Closed Zeioth closed 11 months ago

Zeioth commented 11 months ago

Summary

New option exclude = { 'markdown', ... }.

So the plugin doesn't trigger for said language.

Why

There are many scenarios where this is necessary. I'm gonna describe two.

scenario 1

Imagine you are editing a markdown file.

You don't have a markdown lsp server, but you have prettierd as formatter.

When lsp-timeout run :LspStop, this is gonna also stop prettierd.

But it won't be possible to restore it with a LspAttach autocmd like next, because there is not lsp server at all.

      vim.api.nvim_create_autocmd({ "LspAttach" }, {
        desc = "Ensure null-ls start its sources a lsp client starts",
        callback = function()
           pcall(function() require("null-ls").enable({}) end)
        end,
      })

scenario 2

Some LSP servers might just miss behave, and it would be a good idea to be able to ignore the language entirely.

hinell commented 11 months ago

Duplicate of #10

Ah, null-ls is involved again ... I'm looking into their code currently to figure out how it interferes with the lsp-config clients configs.