feat: display LSP source on statusline

This commit is contained in:
NotAShelf 2023-06-07 02:36:02 +03:00
commit 0c01fbc121
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
3 changed files with 25 additions and 3 deletions

View file

@ -183,6 +183,25 @@ in {
description = "active config for: | A | B | C (X) | Y | Z |";
default = ''
{
{
-- Lsp server name .
function()
local msg = 'No Active Lsp'
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end,
icon = ' ',
},
{
"diagnostics",
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
@ -227,7 +246,6 @@ in {
separator = {
left = '',
},
},
{
"location",