From 6c3cbbc4d5300a6e934e881606436748cc3e72dd Mon Sep 17 00:00:00 2001 From: William Boman Date: Tue, 23 Aug 2022 13:20:29 +0200 Subject: fix: only consider servers that have been set up as available (#2066) * test: add failing test * fix(lspconfig): only consider servers that have been set up as available --- test/lspconfig_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/lspconfig_spec.lua') diff --git a/test/lspconfig_spec.lua b/test/lspconfig_spec.lua index 163bf887..8fc117c5 100644 --- a/test/lspconfig_spec.lua +++ b/test/lspconfig_spec.lua @@ -251,5 +251,19 @@ describe('lspconfig', function() } ) end) + + it("excludes indexed server configs that haven't been set up", function() + eq( + exec_lua [[ + local lspconfig = require("lspconfig") + local actual = nil + local _ = lspconfig.sumneko_lua + local _ = lspconfig.tsserver + lspconfig.rust_analyzer.setup {} + return lspconfig.available_servers() + ]], + { 'rust_analyzer' } + ) + end) end) end) -- cgit v1.2.3-70-g09d2