2023-11-30 13:17:58 +00:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.get_active_lsp()
|
2024-03-05 03:10:57 +00:00
|
|
|
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
2023-11-30 13:17:58 +00:00
|
|
|
local clients = vim.lsp.get_active_clients()
|
|
|
|
if next(clients) == nil then
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
for _, client in ipairs(clients) do
|
|
|
|
local filetypes = client.config.filetypes
|
|
|
|
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
|
|
|
return string.format(" %s", client.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
|
|
|
|
function M.get_dap_status()
|
|
|
|
local status = require('dap').status()
|
|
|
|
if string.len(status) > 0 then
|
|
|
|
return string.format("🪳 %s", status)
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-01-26 00:47:12 +00:00
|
|
|
function M.get_autoexpand_status()
|
|
|
|
if require('luasnip').expand_auto_on then
|
|
|
|
return "🟢 auto"
|
|
|
|
else
|
|
|
|
return "🔴 auto"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-11-30 13:17:58 +00:00
|
|
|
return M
|