From 385a9745fab510ec4429db83cc5c65745a0a37fb Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 12 Aug 2026 21:00:25 +0300 Subject: [PATCH] fix(picker.lspconfig): take into account when cmd is a function --- lua/snacks/picker/source/lsp/config.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/snacks/picker/source/lsp/config.lua b/lua/snacks/picker/source/lsp/config.lua index 81620e6d8..bf42f4bef 100644 --- a/lua/snacks/picker/source/lsp/config.lua +++ b/lua/snacks/picker/source/lsp/config.lua @@ -138,6 +138,17 @@ function M.find(opts, ctx) installed = bins[cmd[1]] ~= nil end cmd[1] = vim.fs.basename(cmd[1]) + elseif type(cmd) == "function" and item.enabled then + local ok, result = pcall(cmd) + ---@type any + local any = result + if ok and any and any.transport and any.transport.cmd and type(any.transport.cmd) == "table" then + if bins[any.transport.cmd[1]] then + cmd = any.transport.cmd + bin = bins[any.transport.cmd[1]] + installed = true + end + end end local want = (not opts.installed or installed) and (not opts.configured or item.enabled) if opts.attached == true and not item.attached then