From 3b275bb7cafd7d77be5fd3cf8d46eaa3a7deddf3 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Wed, 5 Jan 2022 11:04:18 -0800 Subject: chore: remove healthcheck (#1636) Previously, lspconfig had a recommended healthcheck. This was mostly noise as its predominant use was to check if a server was installed. This check was not accurate as vim.fn.executable is extremely primitive and does not consider cmd_env (forwarded to uv_spawn) or language servers that are run via an interpreter. Furthermore, checking if a language server is executable will no longer be a useful signal once TCP support (which allows for connecting to already running or remote servers). Remove for now. --- lua/lspconfig/health.lua | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 lua/lspconfig/health.lua (limited to 'lua') diff --git a/lua/lspconfig/health.lua b/lua/lspconfig/health.lua deleted file mode 100644 index 1adbe9d2..00000000 --- a/lua/lspconfig/health.lua +++ /dev/null @@ -1,28 +0,0 @@ -local M = {} -function M.check() - local configs = require 'lspconfig.configs' - - if not configs or vim.tbl_count(configs) == 0 then - vim.fn['health#report_warn'] [[Can't find any config.]] - end - for _, top_level_config in pairs(configs) do - -- Only check configs that have a make_config function. - if not (top_level_config.make_config == nil) then - -- the folder needs to exist - local config = top_level_config.make_config '.' - - local status, cmd = pcall(vim.lsp._cmd_parts, config.cmd) - if not status then - vim.fn['health#report_error'](string.format('%s: config.cmd error, %s', config.name, cmd)) - else - if not (vim.fn.executable(cmd) == 1) then - vim.fn['health#report_error'](string.format('%s: The given command %q is not executable.', config.name, cmd)) - else - vim.fn['health#report_info'](string.format('%s: configuration checked.', config.name)) - end - end - end - end -end - -return M -- cgit v1.2.3-70-g09d2