diff options
| author | dundargoc <gocdundar@gmail.com> | 2025-01-20 23:06:18 +0100 |
|---|---|---|
| committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2025-01-21 06:21:29 +0100 |
| commit | e118ce58dab72c17216292eef7df4cee3cf60885 (patch) | |
| tree | 53374dcbeacf1bda446f512c2829ac03fb21b2cf | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar.gz nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar.bz2 nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar.lz nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar.xz nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.tar.zst nvim-lspconfig-e118ce58dab72c17216292eef7df4cee3cf60885.zip | |
refactor!: make available_servers function private
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
| -rw-r--r-- | lua/lspconfig/health.lua | 2 | ||||
| -rw-r--r-- | lua/lspconfig/util.lua | 2 | ||||
| -rw-r--r-- | plugin/lspconfig.lua | 2 | ||||
| -rw-r--r-- | test/lspconfig_spec.lua | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lua/lspconfig/health.lua b/lua/lspconfig/health.lua index 64c584cf..c88d786d 100644 --- a/lua/lspconfig/health.lua +++ b/lua/lspconfig/health.lua @@ -224,7 +224,7 @@ local function check_lspconfig(bufnr) bufnr = (bufnr and bufnr ~= -1) and bufnr or nil health.start('LSP configs active in this session (globally)') - health.info('Configured servers: ' .. table.concat(util.available_servers(), ', ')) + health.info('Configured servers: ' .. table.concat(util._available_servers(), ', ')) local deprecated_servers = {} for server_name, deprecate in pairs(require('lspconfig').server_aliases()) do table.insert(deprecated_servers, ('%s -> %s'):format(server_name, deprecate.to)) diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 56013415..bfcbb0a6 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -223,7 +223,7 @@ function M.get_managed_clients() return clients end -function M.available_servers() +function M._available_servers() local servers = {} local configs = require 'lspconfig.configs' for server, config in pairs(configs) do diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua index 0283d847..fc60427d 100644 --- a/plugin/lspconfig.lua +++ b/plugin/lspconfig.lua @@ -14,7 +14,7 @@ end local lsp_complete_configured_servers = function(arg) return completion_sort(vim.tbl_filter(function(s) return s:sub(1, #arg) == arg - end, util.available_servers())) + end, util._available_servers())) end local lsp_get_active_clients = function(arg) diff --git a/test/lspconfig_spec.lua b/test/lspconfig_spec.lua index 52d33eac..39e5783a 100644 --- a/test/lspconfig_spec.lua +++ b/test/lspconfig_spec.lua @@ -144,7 +144,7 @@ describe('lspconfig', function() local _ = lspconfig.lua_ls local _ = lspconfig.tsserver lspconfig.rust_analyzer.setup {} - same({ 'rust_analyzer' }, require('lspconfig.util').available_servers()) + same({ 'rust_analyzer' }, require('lspconfig.util')._available_servers()) end) it('provides user_config to the on_setup hook', function() |
