diff options
author | kylo252 <[email protected]> | 2021-07-31 15:04:22 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-31 13:04:22 +0000 |
commit | 8157f50d1308f42f3db1c7f69c226eb2e5c0b796 (patch) | |
tree | 86632f6bd85ab6400fa657e6e6dc41c751c7dc3c /lua/core/galaxyline.lua | |
parent | f36082da0dccf4cfc50dd3fec271b7a5cd41aaea (diff) |
feat: get null-ls registered providers by filetype (#1186)
Diffstat (limited to 'lua/core/galaxyline.lua')
-rw-r--r-- | lua/core/galaxyline.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lua/core/galaxyline.lua b/lua/core/galaxyline.lua index 63cffcf9..b2325b19 100644 --- a/lua/core/galaxyline.lua +++ b/lua/core/galaxyline.lua @@ -203,25 +203,19 @@ table.insert(gls.right, { local function get_attached_provider_name(msg) msg = msg or "LSP Inactive" local buf_clients = vim.lsp.buf_get_clients() + local utils = require "utils" 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").requested_providers + 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 - for _, provider in pairs(null_ls_providers) do - if vim.tbl_contains(provider.filetypes, buf_ft) then - if not vim.tbl_contains(buf_client_names, provider.name) then - table.insert(buf_client_names, provider.name) - end - end - end - else + if client.name ~= "null-ls" then table.insert(buf_client_names, client.name) end end + utils.list_extend_unique(buf_client_names, null_ls_providers) return table.concat(buf_client_names, ", ") end |