From 5c38490806ddc7c4610fd62c3731888ee30ae515 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 17 Jun 2026 05:26:18 -0600 Subject: [PATCH] fix(lsp): allow specifying bufnr + client_id filter when enabling capabilities #37690 Today there is a constraint that these arguments to the enable filter be mutually exclusive, but I do not know why such a constraint exists (it is perfectly reasonable to want to enable a capabilility for just one buffer and just one client). (cherry picked from commit ed267268b899fa194998a4dd5d0b814e3b5c7fc1) --- runtime/lua/vim/lsp/_capability.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/lua/vim/lsp/_capability.lua b/runtime/lua/vim/lsp/_capability.lua index f5c35f86c4..3272efa793 100644 --- a/runtime/lua/vim/lsp/_capability.lua +++ b/runtime/lua/vim/lsp/_capability.lua @@ -124,7 +124,6 @@ function M.enable(name, enable, filter) filter = filter or {} local bufnr = filter.bufnr and vim._resolve_bufnr(filter.bufnr) local client_id = filter.client_id - assert(not (bufnr and client_id), '`bufnr` and `client_id` are mutually exclusive.') local var = make_enable_var(name) local client = client_id and vim.lsp.get_client_by_id(client_id)