aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorluca-sartore-prorob <59091319+lucaSartore@users.noreply.github.com>2025-04-30 13:44:25 +0200
committerGitHub <noreply@github.com>2025-04-30 04:44:25 -0700
commit5eb30c9d70f0bef087cacc1f93543c2cf02366b1 (patch)
treef5ece9d580cc719e3685b01422623633fafa417f /lua
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar.gz
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar.bz2
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar.lz
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar.xz
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.tar.zst
nvim-lspconfig-5eb30c9d70f0bef087cacc1f93543c2cf02366b1.zip
perf: execute sanitize_cmd only on Windows to speed up WSL #3808
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/configs.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua
index b32b8001..344b648e 100644
--- a/lua/lspconfig/configs.lua
+++ b/lua/lspconfig/configs.lua
@@ -24,8 +24,13 @@ local configs = {}
--- @field root_dir? string|fun(filename: string, bufnr: number)
--- @field commands? table<string, lspconfig.Config.command>
+--- For Windows: calls exepath() to ensure .cmd/.bat (if appropriate) on commands. https://github.com/neovim/nvim-lspconfig/issues/3704
--- @param cmd any
local function sanitize_cmd(cmd)
+ -- exepath() is slow, so avoid it on non-Windows.
+ if vim.fn.has('win32') == 0 then
+ return
+ end
if cmd and type(cmd) == 'table' and not vim.tbl_isempty(cmd) then
local original = cmd[1]
cmd[1] = vim.fn.exepath(cmd[1])