mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-28 22:08:12 +02:00
Add LunarVim info panel (Experimental) (#1241)
* feat: lunarvim info (Experimental) * Add missing providers info * Use nvim api directly to create the popup * width tweaks
This commit is contained in:
parent
c8d1b95712
commit
47ebd70817
5 changed files with 268 additions and 0 deletions
|
@ -64,6 +64,36 @@ function M.common_capabilities()
|
|||
return capabilities
|
||||
end
|
||||
|
||||
function M.get_ls_capabilities(client_id)
|
||||
local client
|
||||
if not client_id then
|
||||
local buf_clients = vim.lsp.buf_get_clients()
|
||||
for _, buf_client in ipairs(buf_clients) do
|
||||
if buf_client.name ~= "null-ls" then
|
||||
client_id = buf_client.id
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not client_id then
|
||||
error "Unable to determine client_id"
|
||||
end
|
||||
|
||||
client = vim.lsp.get_client_by_id(tonumber(client_id))
|
||||
|
||||
local enabled_caps = {}
|
||||
|
||||
for k, v in pairs(client.resolved_capabilities) do
|
||||
if v == true then
|
||||
-- print("got cap: ", vim.inspect(caps))
|
||||
table.insert(enabled_caps, k)
|
||||
-- vim.list_extend(enabled_caps, cap)
|
||||
end
|
||||
end
|
||||
|
||||
return enabled_caps
|
||||
end
|
||||
|
||||
function M.common_on_init(client, bufnr)
|
||||
if lvim.lsp.on_init_callback then
|
||||
lvim.lsp.on_init_callback(client, bufnr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue