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:
kylo252 2021-08-06 16:27:19 +02:00 committed by GitHub
parent c8d1b95712
commit 47ebd70817
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 268 additions and 0 deletions

View file

@ -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)