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
|
|
|
|
|
|
|
|
return M
|