From fb41274c6418634f59d45efa808b6a8a2d6887f2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 24 Oct 2024 09:56:32 -0700 Subject: fix(health): version fails for jdtls #3399 Problem: version fails for jdtls Solution: Try `-version` (one hyphen). Drop `-v`, it's probably not useful. Also drop `-h` because it is unlikely to work if `--help` didn't work. TODO: make a smarter guess about the actual "argv0" of `cmd`. --- lua/lspconfig/health.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/lspconfig/health.lua b/lua/lspconfig/health.lua index 74a35655..62b489c6 100644 --- a/lua/lspconfig/health.lua +++ b/lua/lspconfig/health.lua @@ -68,7 +68,7 @@ end local function try_fmt_version(prog) local all = nil --- Collected output from all attempts. local tried = '' --- Attempted commands. - for _, v_arg in ipairs { '--version', '-v', 'version', '--help', '-h' } do + for _, v_arg in ipairs { '--version', '-version', 'version', '--help' } do local cmd = { prog, v_arg } local out = try_get_cmd_output(cmd) all = out and ('%s\n%s'):format(all or '', out) or all -- cgit v1.2.3-70-g09d2