From 70d139ac2771fac9b072aaebe505f9ac77480b2a Mon Sep 17 00:00:00 2001 From: Luc Sinet Date: Fri, 13 Aug 2021 22:32:56 +0200 Subject: [Refactor/Bugfix] Improve null ls handler (#1277) --- lua/core/galaxyline.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lua/core/galaxyline.lua') diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua index ee0a317d..512dd78c 100644 --- a/lua/core/galaxyline.lua +++ b/lua/core/galaxyline.lua @@ -204,19 +204,23 @@ table.insert(gls.right, { local function get_attached_provider_name(msg) msg = msg or "LSP Inactive" + local buf_clients = vim.lsp.buf_get_clients() if next(buf_clients) == nil then return msg end - local buf_ft = vim.bo.filetype + local buf_client_names = {} - local null_ls_providers = require("lsp.null-ls").get_registered_providers_by_filetype(buf_ft) for _, client in pairs(buf_clients) do if client.name ~= "null-ls" then table.insert(buf_client_names, client.name) end end + + local null_ls = require "lsp.null-ls" + local null_ls_providers = null_ls.list_supported_provider_names(vim.bo.filetype) vim.list_extend(buf_client_names, null_ls_providers) + return table.concat(buf_client_names, ", ") end -- cgit v1.2.3